1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610 |
- if(!dojo._hasResource["dojo.back"]){
- dojo._hasResource["dojo.back"] = true;
- dojo.provide("dojo.back");
- dojo.getObject("back", true, dojo);
- (function(){
- var back = dojo.back,
-
- getHash= back.getHash= function(){
- var h = window.location.hash;
- if(h.charAt(0) == "#"){ h = h.substring(1); }
- return dojo.isMozilla ? h : decodeURIComponent(h);
- },
-
- setHash= back.setHash= function(h){
- if(!h){ h = ""; }
- window.location.hash = encodeURIComponent(h);
- historyCounter = history.length;
- };
- var initialHref = (typeof(window) !== "undefined") ? window.location.href : "";
- var initialHash = (typeof(window) !== "undefined") ? getHash() : "";
- var initialState = null;
- var locationTimer = null;
- var bookmarkAnchor = null;
- var historyIframe = null;
- var forwardStack = [];
- var historyStack = [];
- var moveForward = false;
- var changingUrl = false;
- var historyCounter;
- function handleBackButton(){
-
-
- var current = historyStack.pop();
- if(!current){ return; }
- var last = historyStack[historyStack.length-1];
- if(!last && historyStack.length == 0){
- last = initialState;
- }
- if(last){
- if(last.kwArgs["back"]){
- last.kwArgs["back"]();
- }else if(last.kwArgs["backButton"]){
- last.kwArgs["backButton"]();
- }else if(last.kwArgs["handle"]){
- last.kwArgs.handle("back");
- }
- }
- forwardStack.push(current);
- }
- back.goBack = handleBackButton;
- function handleForwardButton(){
-
- var last = forwardStack.pop();
- if(!last){ return; }
- if(last.kwArgs["forward"]){
- last.kwArgs.forward();
- }else if(last.kwArgs["forwardButton"]){
- last.kwArgs.forwardButton();
- }else if(last.kwArgs["handle"]){
- last.kwArgs.handle("forward");
- }
- historyStack.push(last);
- }
- back.goForward = handleForwardButton;
- function createState(url, args, hash){
-
- return {"url": url, "kwArgs": args, "urlHash": hash};
- }
- function getUrlQuery(url){
-
- var segments = url.split("?");
- if(segments.length < 2){
- return null;
- }
- else{
- return segments[1];
- }
- }
-
- function loadIframeHistory(){
-
- var url = (dojo.config["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html")) + "?" + (new Date()).getTime();
- moveForward = true;
- if(historyIframe){
- dojo.isWebKit ? historyIframe.location = url : window.frames[historyIframe.name].location = url;
- }else{
-
- }
- return url;
- }
- function checkLocation(){
- if(!changingUrl){
- var hsl = historyStack.length;
-
- var hash = getHash();
- if((hash === initialHash||window.location.href == initialHref)&&(hsl == 1)){
-
-
-
- handleBackButton();
- return;
- }
-
-
-
- if(forwardStack.length > 0){
- if(forwardStack[forwardStack.length-1].urlHash === hash){
- handleForwardButton();
- return;
- }
- }
-
-
- if((hsl >= 2)&&(historyStack[hsl-2])){
- if(historyStack[hsl-2].urlHash === hash){
- handleBackButton();
- return;
- }
- }
- }
- };
-
- back.init = function(){
-
-
-
-
-
-
- if(dojo.byId("dj_history")){ return; }
- var src = dojo.config["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html");
- if (dojo._postLoad) {
- console.error("dojo.back.init() must be called before the DOM has loaded. "
- + "If using xdomain loading or djConfig.debugAtAllCosts, include dojo.back "
- + "in a build layer.");
- } else {
- document.write('<iframe style="border:0;width:1px;height:1px;position:absolute;visibility:hidden;bottom:0;right:0;" name="dj_history" id="dj_history" src="' + src + '"></iframe>');
- }
- };
- back.setInitialState = function(/*Object*/args){
-
-
-
-
-
-
-
-
- initialState = createState(initialHref, args, initialHash);
- };
-
-
-
-
-
-
- back.addToHistory = function(/*dojo.__backArgs*/ args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- forwardStack = [];
- var hash = null;
- var url = null;
- if(!historyIframe){
- if(dojo.config["useXDomain"] && !dojo.config["dojoIframeHistoryUrl"]){
- console.warn("dojo.back: When using cross-domain Dojo builds,"
- + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
- + " to the path on your domain to iframe_history.html");
- }
- historyIframe = window.frames["dj_history"];
- }
- if(!bookmarkAnchor){
- bookmarkAnchor = dojo.create("a", {style: {display: "none"}}, dojo.body());
- }
- if(args["changeUrl"]){
- hash = ""+ ((args["changeUrl"]!==true) ? args["changeUrl"] : (new Date()).getTime());
-
-
-
-
-
-
-
-
- if(historyStack.length == 0 && initialState.urlHash == hash){
- initialState = createState(url, args, hash);
- return;
- }else if(historyStack.length > 0 && historyStack[historyStack.length - 1].urlHash == hash){
- historyStack[historyStack.length - 1] = createState(url, args, hash);
- return;
- }
- changingUrl = true;
- setTimeout(function() {
- setHash(hash);
- changingUrl = false;
- }, 1);
- bookmarkAnchor.href = hash;
-
- if(dojo.isIE){
- url = loadIframeHistory();
- var oldCB = args["back"]||args["backButton"]||args["handle"];
-
-
-
- var tcb = function(handleName){
- if(getHash() != ""){
- setTimeout(function() { setHash(hash); }, 1);
- }
-
- oldCB.apply(this, [handleName]);
- };
-
-
- if(args["back"]){
- args.back = tcb;
- }else if(args["backButton"]){
- args.backButton = tcb;
- }else if(args["handle"]){
- args.handle = tcb;
- }
-
- var oldFW = args["forward"]||args["forwardButton"]||args["handle"];
-
-
-
-
- var tfw = function(handleName){
- if(getHash() != ""){
- setHash(hash);
- }
- if(oldFW){
-
- oldFW.apply(this, [handleName]);
- }
- };
-
- if(args["forward"]){
- args.forward = tfw;
- }else if(args["forwardButton"]){
- args.forwardButton = tfw;
- }else if(args["handle"]){
- args.handle = tfw;
- }
- }else if(!dojo.isIE){
-
- if(!locationTimer){
- locationTimer = setInterval(checkLocation, 200);
- }
-
- }
- }else{
- url = loadIframeHistory();
- }
- historyStack.push(createState(url, args, hash));
- };
- back._iframeLoaded = function(evt, ifrLoc){
-
-
- var query = getUrlQuery(ifrLoc.href);
- if(query == null){
-
-
- if(historyStack.length == 1){
- handleBackButton();
- }
- return;
- }
- if(moveForward){
-
- moveForward = false;
- return;
- }
-
-
-
- if(historyStack.length >= 2 && query == getUrlQuery(historyStack[historyStack.length-2].url)){
- handleBackButton();
- }else if(forwardStack.length > 0 && query == getUrlQuery(forwardStack[forwardStack.length-1].url)){
- handleForwardButton();
- }
- };
- })();
- }
- if(!dojo._hasResource["dojo.regexp"]){
- dojo._hasResource["dojo.regexp"] = true;
- dojo.provide("dojo.regexp");
- dojo.getObject("regexp", true, dojo);
- dojo.regexp.escapeString = function(/*String*/str, /*String?*/except){
-
-
-
-
- return str.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, function(ch){
- if(except && except.indexOf(ch) != -1){
- return ch;
- }
- return "\\" + ch;
- });
- };
- dojo.regexp.buildGroupRE = function(/*Object|Array*/arr, /*Function*/re, /*Boolean?*/nonCapture){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!(arr instanceof Array)){
- return re(arr);
- }
-
- var b = [];
- for(var i = 0; i < arr.length; i++){
-
- b.push(re(arr[i]));
- }
-
- return dojo.regexp.group(b.join("|"), nonCapture);
- };
- dojo.regexp.group = function(/*String*/expression, /*Boolean?*/nonCapture){
-
-
-
-
-
- return "(" + (nonCapture ? "?:":"") + expression + ")";
- };
- }
- if(!dojo._hasResource["dojo.cookie"]){
- dojo._hasResource["dojo.cookie"] = true;
- dojo.provide("dojo.cookie");
- dojo.cookie = function(/*String*/name, /*String?*/value, /*dojo.__cookieProps?*/props){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var c = document.cookie;
- if(arguments.length == 1){
- var matches = c.match(new RegExp("(?:^|; )" + dojo.regexp.escapeString(name) + "=([^;]*)"));
- return matches ? decodeURIComponent(matches[1]) : undefined;
- }else{
- props = props || {};
- var exp = props.expires;
- if(typeof exp == "number"){
- var d = new Date();
- d.setTime(d.getTime() + exp*24*60*60*1000);
- exp = props.expires = d;
- }
- if(exp && exp.toUTCString){ props.expires = exp.toUTCString(); }
- value = encodeURIComponent(value);
- var updatedCookie = name + "=" + value, propName;
- for(propName in props){
- updatedCookie += "; " + propName;
- var propValue = props[propName];
- if(propValue !== true){ updatedCookie += "=" + propValue; }
- }
- document.cookie = updatedCookie;
- }
- };
- dojo.cookie.isSupported = function(){
-
-
-
-
-
- if(!("cookieEnabled" in navigator)){
- this("__djCookieTest__", "CookiesAllowed");
- navigator.cookieEnabled = this("__djCookieTest__") == "CookiesAllowed";
- if(navigator.cookieEnabled){
- this("__djCookieTest__", "", {expires: -1});
- }
- }
- return navigator.cookieEnabled;
- };
- }
- if(!dojo._hasResource["dojo.date"]){
- dojo._hasResource["dojo.date"] = true;
- dojo.provide("dojo.date");
- dojo.getObject("date", true, dojo);
- dojo.date.getDaysInMonth = function(/*Date*/dateObject){
-
-
- var month = dateObject.getMonth();
- var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- if(month == 1 && dojo.date.isLeapYear(dateObject)){ return 29; }
- return days[month];
- };
- dojo.date.isLeapYear = function(/*Date*/dateObject){
-
-
-
-
-
-
-
-
- var year = dateObject.getFullYear();
- return !(year%400) || (!(year%4) && !!(year%100));
- };
- dojo.date.getTimezoneName = function(/*Date*/dateObject){
-
-
-
-
-
-
-
-
-
- var str = dateObject.toString();
- var tz = '';
- var match;
-
- var pos = str.indexOf('(');
- if(pos > -1){
- tz = str.substring(++pos, str.indexOf(')'));
- }else{
-
-
-
-
- var pat = /([A-Z\/]+) \d{4}$/;
- if((match = str.match(pat))){
- tz = match[1];
- }else{
-
-
- str = dateObject.toLocaleString();
-
-
- pat = / ([A-Z\/]+)$/;
- if((match = str.match(pat))){
- tz = match[1];
- }
- }
- }
-
- return (tz == 'AM' || tz == 'PM') ? '' : tz;
- };
- dojo.date.compare = function(/*Date*/date1, /*Date?*/date2, /*String?*/portion){
-
-
-
-
-
-
-
-
-
-
-
-
-
- date1 = new Date(+date1);
- date2 = new Date(+(date2 || new Date()));
- if(portion == "date"){
-
- date1.setHours(0, 0, 0, 0);
- date2.setHours(0, 0, 0, 0);
- }else if(portion == "time"){
-
- date1.setFullYear(0, 0, 0);
- date2.setFullYear(0, 0, 0);
- }
-
- if(date1 > date2){ return 1; }
- if(date1 < date2){ return -1; }
- return 0;
- };
- dojo.date.add = function(/*Date*/date, /*String*/interval, /*int*/amount){
-
-
-
-
-
-
-
-
-
-
- var sum = new Date(+date);
- var fixOvershoot = false;
- var property = "Date";
- switch(interval){
- case "day":
- break;
- case "weekday":
-
-
-
-
-
- var days, weeks;
- var mod = amount % 5;
- if(!mod){
- days = (amount > 0) ? 5 : -5;
- weeks = (amount > 0) ? ((amount-5)/5) : ((amount+5)/5);
- }else{
- days = mod;
- weeks = parseInt(amount/5);
- }
-
- var strt = date.getDay();
-
-
- var adj = 0;
- if(strt == 6 && amount > 0){
- adj = 1;
- }else if(strt == 0 && amount < 0){
-
-
- adj = -1;
- }
-
- var trgt = strt + days;
-
- if(trgt == 0 || trgt == 6){
- adj = (amount > 0) ? 2 : -2;
- }
-
-
- amount = (7 * weeks) + days + adj;
- break;
- case "year":
- property = "FullYear";
-
- fixOvershoot = true;
- break;
- case "week":
- amount *= 7;
- break;
- case "quarter":
-
- amount *= 3;
-
- case "month":
-
- fixOvershoot = true;
- property = "Month";
- break;
- default:
- property = "UTC"+interval.charAt(0).toUpperCase() + interval.substring(1) + "s";
- }
- if(property){
- sum["set"+property](sum["get"+property]()+amount);
- }
- if(fixOvershoot && (sum.getDate() < date.getDate())){
- sum.setDate(0);
- }
- return sum;
- };
- dojo.date.difference = function(/*Date*/date1, /*Date?*/date2, /*String?*/interval){
-
-
-
-
-
-
-
-
-
-
-
-
-
- date2 = date2 || new Date();
- interval = interval || "day";
- var yearDiff = date2.getFullYear() - date1.getFullYear();
- var delta = 1;
- switch(interval){
- case "quarter":
- var m1 = date1.getMonth();
- var m2 = date2.getMonth();
-
- var q1 = Math.floor(m1/3) + 1;
- var q2 = Math.floor(m2/3) + 1;
-
- q2 += (yearDiff * 4);
- delta = q2 - q1;
- break;
- case "weekday":
- var days = Math.round(dojo.date.difference(date1, date2, "day"));
- var weeks = parseInt(dojo.date.difference(date1, date2, "week"));
- var mod = days % 7;
-
- if(mod == 0){
- days = weeks*5;
- }else{
-
- var adj = 0;
- var aDay = date1.getDay();
- var bDay = date2.getDay();
- weeks = parseInt(days/7);
- mod = days % 7;
-
-
- var dtMark = new Date(date1);
- dtMark.setDate(dtMark.getDate()+(weeks*7));
- var dayMark = dtMark.getDay();
-
- if(days > 0){
- switch(true){
-
- case aDay == 6:
- adj = -1;
- break;
-
- case aDay == 0:
- adj = 0;
- break;
-
- case bDay == 6:
- adj = -1;
- break;
-
- case bDay == 0:
- adj = -2;
- break;
-
- case (dayMark + mod) > 5:
- adj = -2;
- }
- }else if(days < 0){
- switch(true){
-
- case aDay == 6:
- adj = 0;
- break;
-
- case aDay == 0:
- adj = 1;
- break;
-
- case bDay == 6:
- adj = 2;
- break;
-
- case bDay == 0:
- adj = 1;
- break;
-
- case (dayMark + mod) < 0:
- adj = 2;
- }
- }
- days += adj;
- days -= (weeks*2);
- }
- delta = days;
- break;
- case "year":
- delta = yearDiff;
- break;
- case "month":
- delta = (date2.getMonth() - date1.getMonth()) + (yearDiff * 12);
- break;
- case "week":
-
-
- delta = parseInt(dojo.date.difference(date1, date2, "day")/7);
- break;
- case "day":
- delta /= 24;
-
- case "hour":
- delta /= 60;
-
- case "minute":
- delta /= 60;
-
- case "second":
- delta /= 1000;
-
- case "millisecond":
- delta *= date2.getTime() - date1.getTime();
- }
-
- return Math.round(delta);
- };
- }
- if(!dojo._hasResource["dojo.i18n"]){
- dojo._hasResource["dojo.i18n"] = true;
- dojo.provide("dojo.i18n");
- dojo.getObject("i18n", true, dojo);
- dojo.i18n.getLocalization = dojo.i18n.getLocalization || function(/*String*/packageName, /*String*/bundleName, /*String?*/locale){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- locale = dojo.i18n.normalizeLocale(locale);
-
- var elements = locale.split('-');
- var module = [packageName,"nls",bundleName].join('.');
- var bundle = dojo._loadedModules[module];
- if(bundle){
- var localization;
- for(var i = elements.length; i > 0; i--){
- var loc = elements.slice(0, i).join('_');
- if(bundle[loc]){
- localization = bundle[loc];
- break;
- }
- }
- if(!localization){
- localization = bundle.ROOT;
- }
-
- if(localization){
- var clazz = function(){};
- clazz.prototype = localization;
- return new clazz();
- }
- }
- throw new Error("Bundle not found: " + bundleName + " in " + packageName+" , locale=" + locale);
- };
- dojo.i18n.normalizeLocale = function(/*String?*/locale){
-
-
-
-
-
-
-
- var result = locale ? locale.toLowerCase() : dojo.locale;
- if(result == "root"){
- result = "ROOT";
- }
- return result;
- };
- dojo.i18n._requireLocalization = function(/*String*/moduleName, /*String*/bundleName, /*String?*/locale, /*String?*/availableFlatLocales){
-
-
-
-
-
- var targetLocale = dojo.i18n.normalizeLocale(locale);
- var bundlePackage = [moduleName, "nls", bundleName].join(".");
-
-
-
-
-
-
-
-
-
-
-
- var bestLocale = "";
- if(availableFlatLocales){
- var flatLocales = availableFlatLocales.split(",");
- for(var i = 0; i < flatLocales.length; i++){
-
-
-
- if(targetLocale["indexOf"](flatLocales[i]) == 0){
- if(flatLocales[i].length > bestLocale.length){
- bestLocale = flatLocales[i];
- }
- }
- }
- if(!bestLocale){
- bestLocale = "ROOT";
- }
- }
-
- var tempLocale = availableFlatLocales ? bestLocale : targetLocale;
- var bundle = dojo._loadedModules[bundlePackage];
- var localizedBundle = null;
- if(bundle){
- if(dojo.config.localizationComplete && bundle._built){return;}
- var jsLoc = tempLocale.replace(/-/g, '_');
- var translationPackage = bundlePackage+"."+jsLoc;
- localizedBundle = dojo._loadedModules[translationPackage];
- }
- if(!localizedBundle){
- bundle = dojo["provide"](bundlePackage);
- var syms = dojo._getModuleSymbols(moduleName);
- var modpath = syms.concat("nls").join("/");
- var parent;
- dojo.i18n._searchLocalePath(tempLocale, availableFlatLocales, function(loc){
- var jsLoc = loc.replace(/-/g, '_');
- var translationPackage = bundlePackage + "." + jsLoc;
- var loaded = false;
- if(!dojo._loadedModules[translationPackage]){
-
- dojo["provide"](translationPackage);
- var module = [modpath];
- if(loc != "ROOT"){module.push(loc);}
- module.push(bundleName);
- var filespec = module.join("/") + '.js';
- loaded = dojo._loadPath(filespec, null, function(hash){
- hash = hash.root || hash;
-
- var clazz = function(){};
- clazz.prototype = parent;
- bundle[jsLoc] = new clazz();
- for(var j in hash){ bundle[jsLoc][j] = hash[j]; }
- });
- }else{
- loaded = true;
- }
- if(loaded && bundle[jsLoc]){
- parent = bundle[jsLoc];
- }else{
- bundle[jsLoc] = parent;
- }
- if(availableFlatLocales){
-
-
- return true;
- }
- });
- }
-
-
- if(availableFlatLocales && targetLocale != bestLocale){
- bundle[targetLocale.replace(/-/g, '_')] = bundle[bestLocale.replace(/-/g, '_')];
- }
- };
- (function(){
-
-
-
-
-
-
- var extra = dojo.config.extraLocale;
- if(extra){
- if(!extra instanceof Array){
- extra = [extra];
- }
- var req = dojo.i18n._requireLocalization;
- dojo.i18n._requireLocalization = function(m, b, locale, availableFlatLocales){
- req(m,b,locale, availableFlatLocales);
- if(locale){return;}
- for(var i=0; i<extra.length; i++){
- req(m,b,extra[i], availableFlatLocales);
- }
- };
- }
- })();
- dojo.i18n._searchLocalePath = function(/*String*/locale, /*Boolean*/down, /*Function*/searchFunc){
-
-
-
-
-
- locale = dojo.i18n.normalizeLocale(locale);
- var elements = locale.split('-');
- var searchlist = [];
- for(var i = elements.length; i > 0; i--){
- searchlist.push(elements.slice(0, i).join('-'));
- }
- searchlist.push(false);
- if(down){searchlist.reverse();}
- for(var j = searchlist.length - 1; j >= 0; j--){
- var loc = searchlist[j] || "ROOT";
- var stop = searchFunc(loc);
- if(stop){ break; }
- }
- };
- dojo.i18n._preloadLocalizations = function(/*String*/bundlePrefix, /*Array*/localesGenerated){
-
-
-
- function preload(locale){
- locale = dojo.i18n.normalizeLocale(locale);
- dojo.i18n._searchLocalePath(locale, true, function(loc){
- for(var i=0; i<localesGenerated.length;i++){
- if(localesGenerated[i] == loc){
- dojo["require"](bundlePrefix+"_"+loc);
- return true;
- }
- }
- return false;
- });
- }
- preload();
- var extra = dojo.config.extraLocale||[];
- for(var i=0; i<extra.length; i++){
- preload(extra[i]);
- }
- };
- }
- if(!dojo._hasResource["dojo.cldr.supplemental"]){
- dojo._hasResource["dojo.cldr.supplemental"] = true;
- dojo.provide("dojo.cldr.supplemental");
- dojo.getObject("cldr.supplemental", true, dojo);
- dojo.cldr.supplemental.getFirstDayOfWeek = function(/*String?*/locale){
-
- var firstDay = {
- mv:5,
- ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,
- ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,
- ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,
- il:0,'in':0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,
- mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,
- vi:0,zw:0
- };
- var country = dojo.cldr.supplemental._region(locale);
- var dow = firstDay[country];
- return (dow === undefined) ? 1 : dow;
- };
- dojo.cldr.supplemental._region = function(/*String?*/locale){
- locale = dojo.i18n.normalizeLocale(locale);
- var tags = locale.split('-');
- var region = tags[1];
- if(!region){
-
-
- region = {de:"de", en:"us", es:"es", fi:"fi", fr:"fr", he:"il", hu:"hu", it:"it",
- ja:"jp", ko:"kr", nl:"nl", pt:"br", sv:"se", zh:"cn"}[tags[0]];
- }else if(region.length == 4){
-
-
- region = tags[2];
- }
- return region;
- };
- dojo.cldr.supplemental.getWeekend = function(/*String?*/locale){
-
- var weekendStart = {
- 'in':0,
- af:4,dz:4,ir:4,om:4,sa:4,ye:4,
- ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5
- };
- var weekendEnd = {
- af:5,dz:5,ir:5,om:5,sa:5,ye:5,
- ae:6,bh:5,eg:6,il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6
- };
- var country = dojo.cldr.supplemental._region(locale);
- var start = weekendStart[country];
- var end = weekendEnd[country];
- if(start === undefined){start=6;}
- if(end === undefined){end=0;}
- return {start:start, end:end};
- };
- }
- if(!dojo._hasResource["dojo.string"]){
- dojo._hasResource["dojo.string"] = true;
- dojo.provide("dojo.string");
- dojo.getObject("string", true, dojo);
- dojo.string.rep = function(/*String*/str, /*Integer*/num){
-
-
-
-
-
-
-
- if(num <= 0 || !str){ return ""; }
-
- var buf = [];
- for(;;){
- if(num & 1){
- buf.push(str);
- }
- if(!(num >>= 1)){ break; }
- str += str;
- }
- return buf.join("");
- };
- dojo.string.pad = function(/*String*/text, /*Integer*/size, /*String?*/ch, /*Boolean?*/end){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!ch){
- ch = '0';
- }
- var out = String(text),
- pad = dojo.string.rep(ch, Math.ceil((size - out.length) / ch.length));
- return end ? out + pad : pad + out;
- };
- dojo.string.substitute = function( /*String*/ template,
- /*Object|Array*/map,
- /*Function?*/ transform,
- /*Object?*/ thisObject){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- thisObject = thisObject || dojo.global;
- transform = transform ?
- dojo.hitch(thisObject, transform) : function(v){ return v; };
- return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,
- function(match, key, format){
- var value = dojo.getObject(key, false, map);
- if(format){
- value = dojo.getObject(format, false, thisObject).call(thisObject, value, key);
- }
- return transform(value, key).toString();
- });
- };
- dojo.string.trim = String.prototype.trim ?
- dojo.trim :
- function(str){
- str = str.replace(/^\s+/, '');
- for(var i = str.length - 1; i >= 0; i--){
- if(/\S/.test(str.charAt(i))){
- str = str.substring(0, i + 1);
- break;
- }
- }
- return str;
- };
- }
- if(!dojo._hasResource["dojo.date.locale"]){
- dojo._hasResource["dojo.date.locale"] = true;
- dojo.provide("dojo.date.locale");
- dojo.getObject("date.locale", true, dojo);
- (function(){
-
- function formatPattern(dateObject, bundle, options, pattern){
- return pattern.replace(/([a-z])\1*/ig, function(match){
- var s, pad,
- c = match.charAt(0),
- l = match.length,
- widthList = ["abbr", "wide", "narrow"];
- switch(c){
- case 'G':
- s = bundle[(l < 4) ? "eraAbbr" : "eraNames"][dateObject.getFullYear() < 0 ? 0 : 1];
- break;
- case 'y':
- s = dateObject.getFullYear();
- switch(l){
- case 1:
- break;
- case 2:
- if(!options.fullYear){
- s = String(s); s = s.substr(s.length - 2);
- break;
- }
-
- default:
- pad = true;
- }
- break;
- case 'Q':
- case 'q':
- s = Math.ceil((dateObject.getMonth()+1)/3);
- pad = true;
- break;
- case 'M':
- var m = dateObject.getMonth();
- if(l<3){
- s = m+1; pad = true;
- }else{
- var propM = ["months", "format", widthList[l-3]].join("-");
- s = bundle[propM][m];
- }
- break;
- case 'w':
- var firstDay = 0;
- s = dojo.date.locale._getWeekOfYear(dateObject, firstDay); pad = true;
- break;
- case 'd':
- s = dateObject.getDate(); pad = true;
- break;
- case 'D':
- s = dojo.date.locale._getDayOfYear(dateObject); pad = true;
- break;
- case 'E':
- var d = dateObject.getDay();
- if(l<3){
- s = d+1; pad = true;
- }else{
- var propD = ["days", "format", widthList[l-3]].join("-");
- s = bundle[propD][d];
- }
- break;
- case 'a':
- var timePeriod = (dateObject.getHours() < 12) ? 'am' : 'pm';
- s = options[timePeriod] || bundle['dayPeriods-format-wide-' + timePeriod];
- break;
- case 'h':
- case 'H':
- case 'K':
- case 'k':
- var h = dateObject.getHours();
-
- switch (c){
- case 'h':
- s = (h % 12) || 12;
- break;
- case 'H':
- s = h;
- break;
- case 'K':
- s = (h % 12);
- break;
- case 'k':
- s = h || 24;
- break;
- }
- pad = true;
- break;
- case 'm':
- s = dateObject.getMinutes(); pad = true;
- break;
- case 's':
- s = dateObject.getSeconds(); pad = true;
- break;
- case 'S':
- s = Math.round(dateObject.getMilliseconds() * Math.pow(10, l-3)); pad = true;
- break;
- case 'v':
- case 'z':
-
- s = dojo.date.locale._getZone(dateObject, true, options);
- if(s){break;}
- l=4;
-
- case 'Z':
- var offset = dojo.date.locale._getZone(dateObject, false, options);
- var tz = [
- (offset<=0 ? "+" : "-"),
- dojo.string.pad(Math.floor(Math.abs(offset)/60), 2),
- dojo.string.pad(Math.abs(offset)% 60, 2)
- ];
- if(l==4){
- tz.splice(0, 0, "GMT");
- tz.splice(3, 0, ":");
- }
- s = tz.join("");
- break;
- default:
- throw new Error("dojo.date.locale.format: invalid pattern char: "+pattern);
- }
- if(pad){ s = dojo.string.pad(s, l); }
- return s;
- });
- }
- dojo.date.locale._getZone = function(/*Date*/dateObject, /*boolean*/getName, /*dojo.date.locale.__FormatOptions?*/options){
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(getName){
- return dojo.date.getTimezoneName(dateObject);
- }else{
- return dateObject.getTimezoneOffset();
- }
- };
- dojo.date.locale.format = function(/*Date*/dateObject, /*dojo.date.locale.__FormatOptions?*/options){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- options = options || {};
- var locale = dojo.i18n.normalizeLocale(options.locale),
- formatLength = options.formatLength || 'short',
- bundle = dojo.date.locale._getGregorianBundle(locale),
- str = [],
- sauce = dojo.hitch(this, formatPattern, dateObject, bundle, options);
- if(options.selector == "year"){
- return _processPattern(bundle["dateFormatItem-yyyy"] || "yyyy", sauce);
- }
- var pattern;
- if(options.selector != "date"){
- pattern = options.timePattern || bundle["timeFormat-"+formatLength];
- if(pattern){str.push(_processPattern(pattern, sauce));}
- }
- if(options.selector != "time"){
- pattern = options.datePattern || bundle["dateFormat-"+formatLength];
- if(pattern){str.push(_processPattern(pattern, sauce));}
- }
- return str.length == 1 ? str[0] : bundle["dateTimeFormat-"+formatLength].replace(/\{(\d+)\}/g,
- function(match, key){ return str[key]; });
- };
- dojo.date.locale.regexp = function(/*dojo.date.locale.__FormatOptions?*/options){
-
-
- return dojo.date.locale._parseInfo(options).regexp;
- };
- dojo.date.locale._parseInfo = function(/*dojo.date.locale.__FormatOptions?*/options){
- options = options || {};
- var locale = dojo.i18n.normalizeLocale(options.locale),
- bundle = dojo.date.locale._getGregorianBundle(locale),
- formatLength = options.formatLength || 'short',
- datePattern = options.datePattern || bundle["dateFormat-" + formatLength],
- timePattern = options.timePattern || bundle["timeFormat-" + formatLength],
- pattern;
- if(options.selector == 'date'){
- pattern = datePattern;
- }else if(options.selector == 'time'){
- pattern = timePattern;
- }else{
- pattern = bundle["dateTimeFormat-"+formatLength].replace(/\{(\d+)\}/g,
- function(match, key){ return [timePattern, datePattern][key]; });
- }
- var tokens = [],
- re = _processPattern(pattern, dojo.hitch(this, _buildDateTimeRE, tokens, bundle, options));
- return {regexp: re, tokens: tokens, bundle: bundle};
- };
- dojo.date.locale.parse = function(/*String*/value, /*dojo.date.locale.__FormatOptions?*/options){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var controlChars = /[\u200E\u200F\u202A\u202E]/g,
- info = dojo.date.locale._parseInfo(options),
- tokens = info.tokens, bundle = info.bundle,
- re = new RegExp("^" + info.regexp.replace(controlChars, "") + "$",
- info.strict ? "" : "i"),
- match = re.exec(value && value.replace(controlChars, ""));
- if(!match){ return null; }
- var widthList = ['abbr', 'wide', 'narrow'],
- result = [1970,0,1,0,0,0,0],
- amPm = "",
- valid = dojo.every(match, function(v, i){
- if(!i){return true;}
- var token=tokens[i-1];
- var l=token.length;
- switch(token.charAt(0)){
- case 'y':
- if(l != 2 && options.strict){
-
- result[0] = v;
- }else{
- if(v<100){
- v = Number(v);
-
-
- var year = '' + new Date().getFullYear(),
- century = year.substring(0, 2) * 100,
- cutoff = Math.min(Number(year.substring(2, 4)) + 20, 99),
- num = (v < cutoff) ? century + v : century - 100 + v;
- result[0] = num;
- }else{
-
- if(options.strict){
- return false;
- }
-
-
- result[0] = v;
- }
- }
- break;
- case 'M':
- if(l>2){
- var months = bundle['months-format-' + widthList[l-3]].concat();
- if(!options.strict){
-
-
- v = v.replace(".","").toLowerCase();
- months = dojo.map(months, function(s){ return s.replace(".","").toLowerCase(); } );
- }
- v = dojo.indexOf(months, v);
- if(v == -1){
- return false;
- }
- }else{
- v--;
- }
- result[1] = v;
- break;
- case 'E':
- case 'e':
- var days = bundle['days-format-' + widthList[l-3]].concat();
- if(!options.strict){
-
- v = v.toLowerCase();
- days = dojo.map(days, function(d){return d.toLowerCase();});
- }
- v = dojo.indexOf(days, v);
- if(v == -1){
- return false;
- }
-
-
-
-
- break;
- case 'D':
- result[1] = 0;
-
- case 'd':
- result[2] = v;
- break;
- case 'a':
- var am = options.am || bundle['dayPeriods-format-wide-am'],
- pm = options.pm || bundle['dayPeriods-format-wide-pm'];
- if(!options.strict){
- var period = /\./g;
- v = v.replace(period,'').toLowerCase();
- am = am.replace(period,'').toLowerCase();
- pm = pm.replace(period,'').toLowerCase();
- }
- if(options.strict && v != am && v != pm){
- return false;
- }
-
- amPm = (v == pm) ? 'p' : (v == am) ? 'a' : '';
- break;
- case 'K':
- if(v == 24){ v = 0; }
-
- case 'h':
- case 'H':
- case 'k':
-
- if(v > 23){
- return false;
- }
-
-
- result[3] = v;
- break;
- case 'm':
- result[4] = v;
- break;
- case 's':
- result[5] = v;
- break;
- case 'S':
- result[6] = v;
- }
- return true;
- });
- var hours = +result[3];
- if(amPm === 'p' && hours < 12){
- result[3] = hours + 12;
- }else if(amPm === 'a' && hours == 12){
- result[3] = 0;
- }
-
-
- var dateObject = new Date(result[0], result[1], result[2], result[3], result[4], result[5], result[6]);
- if(options.strict){
- dateObject.setFullYear(result[0]);
- }
-
-
- var allTokens = tokens.join(""),
- dateToken = allTokens.indexOf('d') != -1,
- monthToken = allTokens.indexOf('M') != -1;
- if(!valid ||
- (monthToken && dateObject.getMonth() > result[1]) ||
- (dateToken && dateObject.getDate() > result[2])){
- return null;
- }
-
-
-
- if((monthToken && dateObject.getMonth() < result[1]) ||
- (dateToken && dateObject.getDate() < result[2])){
- dateObject = dojo.date.add(dateObject, "hour", 1);
- }
- return dateObject;
- };
- function _processPattern(pattern, applyPattern, applyLiteral, applyAll){
-
-
- var identity = function(x){return x;};
- applyPattern = applyPattern || identity;
- applyLiteral = applyLiteral || identity;
- applyAll = applyAll || identity;
-
-
- var chunks = pattern.match(/(''|[^'])+/g),
- literal = pattern.charAt(0) == "'";
- dojo.forEach(chunks, function(chunk, i){
- if(!chunk){
- chunks[i]='';
- }else{
- chunks[i]=(literal ? applyLiteral : applyPattern)(chunk.replace(/''/g, "'"));
- literal = !literal;
- }
- });
- return applyAll(chunks.join(''));
- }
- function _buildDateTimeRE(tokens, bundle, options, pattern){
- pattern = dojo.regexp.escapeString(pattern);
- if(!options.strict){ pattern = pattern.replace(" a", " ?a"); }
- return pattern.replace(/([a-z])\1*/ig, function(match){
-
- var s,
- c = match.charAt(0),
- l = match.length,
- p2 = '', p3 = '';
- if(options.strict){
- if(l > 1){ p2 = '0' + '{'+(l-1)+'}'; }
- if(l > 2){ p3 = '0' + '{'+(l-2)+'}'; }
- }else{
- p2 = '0?'; p3 = '0{0,2}';
- }
- switch(c){
- case 'y':
- s = '\\d{2,4}';
- break;
- case 'M':
- s = (l>2) ? '\\S+?' : '1[0-2]|'+p2+'[1-9]';
- break;
- case 'D':
- s = '[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|'+p3+'[1-9][0-9]|'+p2+'[1-9]';
- break;
- case 'd':
- s = '3[01]|[12]\\d|'+p2+'[1-9]';
- break;
- case 'w':
- s = '[1-4][0-9]|5[0-3]|'+p2+'[1-9]';
- break;
- case 'E':
- s = '\\S+';
- break;
- case 'h':
- s = '1[0-2]|'+p2+'[1-9]';
- break;
- case 'k':
- s = '1[01]|'+p2+'\\d';
- break;
- case 'H':
- s = '1\\d|2[0-3]|'+p2+'\\d';
- break;
- case 'K':
- s = '1\\d|2[0-4]|'+p2+'[1-9]';
- break;
- case 'm':
- case 's':
- s = '[0-5]\\d';
- break;
- case 'S':
- s = '\\d{'+l+'}';
- break;
- case 'a':
- var am = options.am || bundle['dayPeriods-format-wide-am'],
- pm = options.pm || bundle['dayPeriods-format-wide-pm'];
- s = am + '|' + pm;
- if(!options.strict){
- if(am != am.toLowerCase()){ s += '|' + am.toLowerCase(); }
- if(pm != pm.toLowerCase()){ s += '|' + pm.toLowerCase(); }
- if(s.indexOf('.') != -1){ s += '|' + s.replace(/\./g, ""); }
- }
- s = s.replace(/\./g, "\\.");
- break;
- default:
-
-
-
- s = ".*";
- }
- if(tokens){ tokens.push(match); }
- return "(" + s + ")";
- }).replace(/[\xa0 ]/g, "[\\s\\xa0]");
- }
- })();
- (function(){
- var _customFormats = [];
- dojo.date.locale.addCustomFormats = function(/*String*/packageName, /*String*/bundleName){
-
-
-
-
-
-
-
-
-
-
- _customFormats.push({pkg:packageName,name:bundleName});
- };
- dojo.date.locale._getGregorianBundle = function(/*String*/locale){
- var gregorian = {};
- dojo.forEach(_customFormats, function(desc){
- var bundle = dojo.i18n.getLocalization(desc.pkg, desc.name, locale);
- gregorian = dojo.mixin(gregorian, bundle);
- }, this);
- return gregorian;
- };
- })();
- dojo.date.locale.addCustomFormats("dojo.cldr","gregorian");
- dojo.date.locale.getNames = function(/*String*/item, /*String*/type, /*String?*/context, /*String?*/locale){
-
-
-
-
-
-
-
-
-
-
-
- var label,
- lookup = dojo.date.locale._getGregorianBundle(locale),
- props = [item, context, type];
- if(context == 'standAlone'){
- var key = props.join('-');
- label = lookup[key];
-
- if(label[0] == 1){ label = undefined; }
- }
- props[1] = 'format';
-
- return (label || lookup[props.join('-')]).concat();
- };
- dojo.date.locale.isWeekend = function(/*Date?*/dateObject, /*String?*/locale){
-
-
- var weekend = dojo.cldr.supplemental.getWeekend(locale),
- day = (dateObject || new Date()).getDay();
- if(weekend.end < weekend.start){
- weekend.end += 7;
- if(day < weekend.start){ day += 7; }
- }
- return day >= weekend.start && day <= weekend.end;
- };
- dojo.date.locale._getDayOfYear = function(/*Date*/dateObject){
-
- return dojo.date.difference(new Date(dateObject.getFullYear(), 0, 1, dateObject.getHours()), dateObject) + 1;
- };
- dojo.date.locale._getWeekOfYear = function(/*Date*/dateObject, /*Number*/firstDayOfWeek){
- if(arguments.length == 1){ firstDayOfWeek = 0; }
- var firstDayOfYear = new Date(dateObject.getFullYear(), 0, 1).getDay(),
- adj = (firstDayOfYear - firstDayOfWeek + 7) % 7,
- week = Math.floor((dojo.date.locale._getDayOfYear(dateObject) + adj - 1) / 7);
-
- if(firstDayOfYear == firstDayOfWeek){ week++; }
- return week;
- };
- }
- if(!dojo._hasResource["dojo.dnd.common"]){
- dojo._hasResource["dojo.dnd.common"] = true;
- dojo.provide("dojo.dnd.common");
- dojo.getObject("dnd", true, dojo);
- dojo.dnd.getCopyKeyState = dojo.isCopyKey;
- dojo.dnd._uniqueId = 0;
- dojo.dnd.getUniqueId = function(){
-
-
- var id;
- do{
- id = dojo._scopeName + "Unique" + (++dojo.dnd._uniqueId);
- }while(dojo.byId(id));
- return id;
- };
- dojo.dnd._empty = {};
- dojo.dnd.isFormElement = function(/*Event*/ e){
-
-
- var t = e.target;
- if(t.nodeType == 3 ){
- t = t.parentNode;
- }
- return " button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0;
- };
- }
- if(!dojo._hasResource["dojo.window"]){
- dojo._hasResource["dojo.window"] = true;
- dojo.provide("dojo.window");
- dojo.getObject("window", true, dojo);
- dojo.window.getBox = function(){
-
-
- var scrollRoot = (dojo.doc.compatMode == 'BackCompat') ? dojo.body() : dojo.doc.documentElement;
-
- var scroll = dojo._docScroll();
- return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y };
- };
- dojo.window.get = function(doc){
-
-
-
-
-
-
- if(dojo.isIE && window !== document.parentWindow){
-
- doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
-
-
- var win = doc._parentWindow;
- doc._parentWindow = null;
- return win;
- }
- return doc.parentWindow || doc.defaultView;
- };
- dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
-
-
-
-
-
-
-
- node = dojo.byId(node);
- var body, doc = node.ownerDocument || dojo.doc;
-
- if(!("rtl_adjust_position_for_verticalScrollBar" in dojo.window)){
- body = dojo.body();
- var scrollable = dojo.create('div', {
- style: {overflow:'scroll', overflowX:'visible', direction:'rtl', visibility:'hidden', position:'absolute', left:'0', top:'0', width:'64px', height:'64px'}
- }, body, "last"),
- div = dojo.create('div', {
- style: {overflow:'hidden', direction:'ltr'}
- }, scrollable, "last");
- dojo.window.rtl_adjust_position_for_verticalScrollBar = dojo.position(div).x != 0;
- scrollable.removeChild(div);
- body.removeChild(scrollable);
- }
- if(!("position_fixed_support" in dojo.window)){
-
- body = dojo.body();
- var outer = dojo.create('span', {
- style: {visibility:'hidden', position:'fixed', left:'1px', top:'1px'}
- }, body, "last"),
- inner = dojo.create('span', {
- style: {position:'fixed', left:'0', top:'0'}
- }, outer, "last");
- dojo.window.position_fixed_support = dojo.position(inner).x != dojo.position(outer).x;
- outer.removeChild(inner);
- body.removeChild(outer);
- }
- try{
- body = doc.body || doc.getElementsByTagName("body")[0];
- var html = doc.documentElement || body.parentNode,
- isIE = dojo.isIE,
- isWK = dojo.isWebKit;
-
- if(node == body || node == html){ return; }
- if(!(dojo.isMozilla || isIE || isWK || dojo.isOpera) && ("scrollIntoView" in node)){
- node.scrollIntoView(false);
- return;
- }
- var backCompat = doc.compatMode == 'BackCompat',
- rootWidth = Math.min(body.clientWidth || html.clientWidth, html.clientWidth || body.clientWidth),
- rootHeight = Math.min(body.clientHeight || html.clientHeight, html.clientHeight || body.clientHeight),
- scrollRoot = (isWK || backCompat) ? body : html,
- nodePos = pos || dojo.position(node),
- el = node.parentNode,
- isFixed = function(el){
- return (isIE <= 6 || (isIE == 7 && backCompat))
- ? false
- : (dojo.window.position_fixed_support && (dojo.style(el, 'position').toLowerCase() == "fixed"));
- };
- if(isFixed(node)){ return; }
- while(el){
- if(el == body){ el = scrollRoot; }
- var elPos = dojo.position(el),
- fixedPos = isFixed(el),
- rtl = dojo.getComputedStyle(el).direction.toLowerCase() == "rtl";
-
- if(el == scrollRoot){
- elPos.w = rootWidth; elPos.h = rootHeight;
- if(scrollRoot == html && isIE && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; }
- if(elPos.x < 0 || !isIE || isIE >= 9){ elPos.x = 0; }
- if(elPos.y < 0 || !isIE || isIE >= 9){ elPos.y = 0; }
- }else{
- var pb = dojo._getPadBorderExtents(el);
- elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
- var clientSize = el.clientWidth,
- scrollBarSize = elPos.w - clientSize;
- if(clientSize > 0 && scrollBarSize > 0){
- if(rtl && dojo.window.rtl_adjust_position_for_verticalScrollBar){
- elPos.x += scrollBarSize;
- }
- elPos.w = clientSize;
- }
- clientSize = el.clientHeight;
- scrollBarSize = elPos.h - clientSize;
- if(clientSize > 0 && scrollBarSize > 0){
- elPos.h = clientSize;
- }
- }
- if(fixedPos){
- if(elPos.y < 0){
- elPos.h += elPos.y; elPos.y = 0;
- }
- if(elPos.x < 0){
- elPos.w += elPos.x; elPos.x = 0;
- }
- if(elPos.y + elPos.h > rootHeight){
- elPos.h = rootHeight - elPos.y;
- }
- if(elPos.x + elPos.w > rootWidth){
- elPos.w = rootWidth - elPos.x;
- }
- }
-
- var l = nodePos.x - elPos.x,
- t = nodePos.y - elPos.y,
- r = l + nodePos.w - elPos.w,
- bot = t + nodePos.h - elPos.h;
- var s, old;
- if(r * l > 0 && (!!el.scrollLeft || el == scrollRoot || el.scrollWidth > el.offsetHeight)){
- s = Math[l < 0? "max" : "min"](l, r);
- if(rtl && ((isIE == 8 && !backCompat) || isIE >= 9)){ s = -s; }
- old = el.scrollLeft;
- el.scrollLeft += s;
- s = el.scrollLeft - old;
- nodePos.x -= s;
- }
- if(bot * t > 0 && (!!el.scrollTop || el == scrollRoot || el.scrollHeight > el.offsetHeight)){
- s = Math.ceil(Math[t < 0? "max" : "min"](t, bot));
- old = el.scrollTop;
- el.scrollTop += s;
- s = el.scrollTop - old;
- nodePos.y -= s;
- }
- el = (el != scrollRoot) && !fixedPos && el.parentNode;
- }
- }catch(error){
- console.error('scrollIntoView: ' + error);
- node.scrollIntoView(false);
- }
- };
- }
- if(!dojo._hasResource["dojo.dnd.autoscroll"]){
- dojo._hasResource["dojo.dnd.autoscroll"] = true;
- dojo.provide("dojo.dnd.autoscroll");
- dojo.getObject("dnd", true, dojo);
- dojo.dnd.getViewport = dojo.window.getBox;
- dojo.dnd.V_TRIGGER_AUTOSCROLL = 32;
- dojo.dnd.H_TRIGGER_AUTOSCROLL = 32;
- dojo.dnd.V_AUTOSCROLL_VALUE = 16;
- dojo.dnd.H_AUTOSCROLL_VALUE = 16;
- dojo.dnd.autoScroll = function(e){
-
-
-
-
-
-
- var v = dojo.window.getBox(), dx = 0, dy = 0;
- if(e.clientX < dojo.dnd.H_TRIGGER_AUTOSCROLL){
- dx = -dojo.dnd.H_AUTOSCROLL_VALUE;
- }else if(e.clientX > v.w - dojo.dnd.H_TRIGGER_AUTOSCROLL){
- dx = dojo.dnd.H_AUTOSCROLL_VALUE;
- }
- if(e.clientY < dojo.dnd.V_TRIGGER_AUTOSCROLL){
- dy = -dojo.dnd.V_AUTOSCROLL_VALUE;
- }else if(e.clientY > v.h - dojo.dnd.V_TRIGGER_AUTOSCROLL){
- dy = dojo.dnd.V_AUTOSCROLL_VALUE;
- }
- window.scrollBy(dx, dy);
- };
- dojo.dnd._validNodes = {"div": 1, "p": 1, "td": 1};
- dojo.dnd._validOverflow = {"auto": 1, "scroll": 1};
- dojo.dnd.autoScrollNodes = function(e){
-
-
-
-
-
-
- for(var n = e.target; n;){
- if(n.nodeType == 1 && (n.tagName.toLowerCase() in dojo.dnd._validNodes)){
- var s = dojo.getComputedStyle(n);
- if(s.overflow.toLowerCase() in dojo.dnd._validOverflow){
- var b = dojo._getContentBox(n, s), t = dojo.position(n, true);
-
- var w = Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL, b.w / 2),
- h = Math.min(dojo.dnd.V_TRIGGER_AUTOSCROLL, b.h / 2),
- rx = e.pageX - t.x, ry = e.pageY - t.y, dx = 0, dy = 0;
- if(dojo.isWebKit || dojo.isOpera){
-
-
-
- rx += dojo.body().scrollLeft;
- ry += dojo.body().scrollTop;
- }
- if(rx > 0 && rx < b.w){
- if(rx < w){
- dx = -w;
- }else if(rx > b.w - w){
- dx = w;
- }
- }
-
- if(ry > 0 && ry < b.h){
- if(ry < h){
- dy = -h;
- }else if(ry > b.h - h){
- dy = h;
- }
- }
- var oldLeft = n.scrollLeft, oldTop = n.scrollTop;
- n.scrollLeft = n.scrollLeft + dx;
- n.scrollTop = n.scrollTop + dy;
- if(oldLeft != n.scrollLeft || oldTop != n.scrollTop){ return; }
- }
- }
- try{
- n = n.parentNode;
- }catch(x){
- n = null;
- }
- }
- dojo.dnd.autoScroll(e);
- };
- }
- if(!dojo._hasResource["dojo.dnd.Avatar"]){
- dojo._hasResource["dojo.dnd.Avatar"] = true;
- dojo.provide("dojo.dnd.Avatar");
- dojo.declare("dojo.dnd.Avatar", null, {
-
-
-
-
- constructor: function(manager){
- this.manager = manager;
- this.construct();
- },
-
- construct: function(){
-
-
-
- this.isA11y = dojo.hasClass(dojo.body(),"dijit_a11y");
- var a = dojo.create("table", {
- "class": "dojoDndAvatar",
- style: {
- position: "absolute",
- zIndex: "1999",
- margin: "0px"
- }
- }),
- source = this.manager.source, node,
- b = dojo.create("tbody", null, a),
- tr = dojo.create("tr", null, b),
- td = dojo.create("td", null, tr),
- icon = this.isA11y ? dojo.create("span", {
- id : "a11yIcon",
- innerHTML : this.manager.copy ? '+' : "<"
- }, td) : null,
- span = dojo.create("span", {
- innerHTML: source.generateText ? this._generateText() : ""
- }, td),
- k = Math.min(5, this.manager.nodes.length), i = 0;
-
- dojo.attr(tr, {
- "class": "dojoDndAvatarHeader",
- style: {opacity: 0.9}
- });
- for(; i < k; ++i){
- if(source.creator){
-
- node = source._normalizedCreator(source.getItem(this.manager.nodes[i].id).data, "avatar").node;
- }else{
-
- node = this.manager.nodes[i].cloneNode(true);
- if(node.tagName.toLowerCase() == "tr"){
-
- var table = dojo.create("table"),
- tbody = dojo.create("tbody", null, table);
- tbody.appendChild(node);
- node = table;
- }
- }
- node.id = "";
- tr = dojo.create("tr", null, b);
- td = dojo.create("td", null, tr);
- td.appendChild(node);
- dojo.attr(tr, {
- "class": "dojoDndAvatarItem",
- style: {opacity: (9 - i) / 10}
- });
- }
- this.node = a;
- },
- destroy: function(){
-
-
- dojo.destroy(this.node);
- this.node = false;
- },
- update: function(){
-
-
- dojo[(this.manager.canDropFlag ? "add" : "remove") + "Class"](this.node, "dojoDndAvatarCanDrop");
- if (this.isA11y){
- var icon = dojo.byId("a11yIcon");
- var text = '+';
- if (this.manager.canDropFlag && !this.manager.copy) {
- text = '< ';
- }else if (!this.manager.canDropFlag && !this.manager.copy) {
- text = "o";
- }else if(!this.manager.canDropFlag){
- text = 'x';
- }
- icon.innerHTML=text;
- }
-
- dojo.query(("tr.dojoDndAvatarHeader td span" +(this.isA11y ? " span" : "")), this.node).forEach(
- function(node){
- node.innerHTML = this._generateText();
- }, this);
- },
- _generateText: function(){
-
- return this.manager.nodes.length.toString();
- }
- });
- }
- if(!dojo._hasResource["dojo.dnd.Manager"]){
- dojo._hasResource["dojo.dnd.Manager"] = true;
- dojo.provide("dojo.dnd.Manager");
- dojo.declare("dojo.dnd.Manager", null, {
-
-
- constructor: function(){
- this.avatar = null;
- this.source = null;
- this.nodes = [];
- this.copy = true;
- this.target = null;
- this.canDropFlag = false;
- this.events = [];
- },
-
- OFFSET_X: 16,
- OFFSET_Y: 16,
-
-
- overSource: function(source){
-
-
-
-
- if(this.avatar){
- this.target = (source && source.targetState != "Disabled") ? source : null;
- this.canDropFlag = Boolean(this.target);
- this.avatar.update();
- }
- dojo.publish("/dnd/source/over", [source]);
- },
- outSource: function(source){
-
-
-
-
- if(this.avatar){
- if(this.target == source){
- this.target = null;
- this.canDropFlag = false;
- this.avatar.update();
- dojo.publish("/dnd/source/over", [null]);
- }
- }else{
- dojo.publish("/dnd/source/over", [null]);
- }
- },
- startDrag: function(source, nodes, copy){
-
-
-
-
-
-
-
-
- this.source = source;
- this.nodes = nodes;
- this.copy = Boolean(copy);
- this.avatar = this.makeAvatar();
- dojo.body().appendChild(this.avatar.node);
- dojo.publish("/dnd/start", [source, nodes, this.copy]);
- this.events = [
- dojo.connect(dojo.doc, "onmousemove", this, "onMouseMove"),
- dojo.connect(dojo.doc, "onmouseup", this, "onMouseUp"),
- dojo.connect(dojo.doc, "onkeydown", this, "onKeyDown"),
- dojo.connect(dojo.doc, "onkeyup", this, "onKeyUp"),
-
- dojo.connect(dojo.doc, "ondragstart", dojo.stopEvent),
- dojo.connect(dojo.body(), "onselectstart", dojo.stopEvent)
- ];
- var c = "dojoDnd" + (copy ? "Copy" : "Move");
- dojo.addClass(dojo.body(), c);
- },
- canDrop: function(flag){
-
-
- var canDropFlag = Boolean(this.target && flag);
- if(this.canDropFlag != canDropFlag){
- this.canDropFlag = canDropFlag;
- this.avatar.update();
- }
- },
- stopDrag: function(){
-
-
- dojo.removeClass(dojo.body(), ["dojoDndCopy", "dojoDndMove"]);
- dojo.forEach(this.events, dojo.disconnect);
- this.events = [];
- this.avatar.destroy();
- this.avatar = null;
- this.source = this.target = null;
- this.nodes = [];
- },
- makeAvatar: function(){
-
-
- return new dojo.dnd.Avatar(this);
- },
- updateAvatar: function(){
-
-
- this.avatar.update();
- },
-
-
- onMouseMove: function(e){
-
-
-
-
- var a = this.avatar;
- if(a){
- dojo.dnd.autoScrollNodes(e);
-
- var s = a.node.style;
- s.left = (e.pageX + this.OFFSET_X) + "px";
- s.top = (e.pageY + this.OFFSET_Y) + "px";
- var copy = Boolean(this.source.copyState(dojo.isCopyKey(e)));
- if(this.copy != copy){
- this._setCopyStatus(copy);
- }
- }
- },
- onMouseUp: function(e){
-
-
-
-
- if(this.avatar){
- if(this.target && this.canDropFlag){
- var copy = Boolean(this.source.copyState(dojo.isCopyKey(e))),
- params = [this.source, this.nodes, copy, this.target, e];
- dojo.publish("/dnd/drop/before", params);
- dojo.publish("/dnd/drop", params);
- }else{
- dojo.publish("/dnd/cancel");
- }
- this.stopDrag();
- }
- },
-
-
- onKeyDown: function(e){
-
-
-
-
-
- if(this.avatar){
- switch(e.keyCode){
- case dojo.keys.CTRL:
- var copy = Boolean(this.source.copyState(true));
- if(this.copy != copy){
- this._setCopyStatus(copy);
- }
- break;
- case dojo.keys.ESCAPE:
- dojo.publish("/dnd/cancel");
- this.stopDrag();
- break;
- }
- }
- },
- onKeyUp: function(e){
-
-
-
-
- if(this.avatar && e.keyCode == dojo.keys.CTRL){
- var copy = Boolean(this.source.copyState(false));
- if(this.copy != copy){
- this._setCopyStatus(copy);
- }
- }
- },
-
-
- _setCopyStatus: function(copy){
-
-
-
-
- this.copy = copy;
- this.source._markDndStatus(this.copy);
- this.updateAvatar();
- dojo.replaceClass(dojo.body(),
- "dojoDnd" + (this.copy ? "Copy" : "Move"),
- "dojoDnd" + (this.copy ? "Move" : "Copy"));
- }
- });
- dojo.dnd._manager = null;
- dojo.dnd.manager = function(){
-
-
- if(!dojo.dnd._manager){
- dojo.dnd._manager = new dojo.dnd.Manager();
- }
- return dojo.dnd._manager;
- };
- }
- if(!dojo._hasResource["dojo.dnd.Mover"]){
- dojo._hasResource["dojo.dnd.Mover"] = true;
- dojo.provide("dojo.dnd.Mover");
- dojo.declare("dojo.dnd.Mover", null, {
- constructor: function(node, e, host){
-
-
-
-
-
-
-
-
-
-
-
- this.node = dojo.byId(node);
- var pos = e.touches ? e.touches[0] : e;
- this.marginBox = {l: pos.pageX, t: pos.pageY};
- this.mouseButton = e.button;
- var h = (this.host = host), d = node.ownerDocument;
- this.events = [
-
-
- dojo.connect(d, "onmousemove", this, "onFirstMove"),
- dojo.connect(d, "ontouchmove", this, "onFirstMove"),
-
- dojo.connect(d, "onmousemove", this, "onMouseMove"),
- dojo.connect(d, "ontouchmove", this, "onMouseMove"),
-
- dojo.connect(d, "onmouseup", this, "onMouseUp"),
- dojo.connect(d, "ontouchend", this, "onMouseUp"),
-
- dojo.connect(d, "ondragstart", dojo.stopEvent),
- dojo.connect(d.body, "onselectstart", dojo.stopEvent)
- ];
-
- if(h && h.onMoveStart){
- h.onMoveStart(this);
- }
- },
-
- onMouseMove: function(e){
-
-
-
-
- dojo.dnd.autoScroll(e);
- var m = this.marginBox,
- pos = e.touches ? e.touches[0] : e;
- this.host.onMove(this, {l: m.l + pos.pageX, t: m.t + pos.pageY}, e);
- dojo.stopEvent(e);
- },
- onMouseUp: function(e){
- if(dojo.isWebKit && dojo.isMac && this.mouseButton == 2 ?
- e.button == 0 : this.mouseButton == e.button){
- this.destroy();
- }
- dojo.stopEvent(e);
- },
-
- onFirstMove: function(e){
-
-
-
- var s = this.node.style, l, t, h = this.host;
- switch(s.position){
- case "relative":
- case "absolute":
-
- l = Math.round(parseFloat(s.left)) || 0;
- t = Math.round(parseFloat(s.top)) || 0;
- break;
- default:
- s.position = "absolute";
- var m = dojo.marginBox(this.node);
-
-
-
-
-
-
-
-
- var b = dojo.doc.body;
- var bs = dojo.getComputedStyle(b);
- var bm = dojo._getMarginBox(b, bs);
- var bc = dojo._getContentBox(b, bs);
- l = m.l - (bc.l - bm.l);
- t = m.t - (bc.t - bm.t);
- break;
- }
- this.marginBox.l = l - this.marginBox.l;
- this.marginBox.t = t - this.marginBox.t;
- if(h && h.onFirstMove){
- h.onFirstMove(this, e);
- }
-
-
- dojo.disconnect(this.events.shift());
- dojo.disconnect(this.events.shift());
- },
- destroy: function(){
-
-
- dojo.forEach(this.events, dojo.disconnect);
-
- var h = this.host;
- if(h && h.onMoveStop){
- h.onMoveStop(this);
- }
-
- this.events = this.node = this.host = null;
- }
- });
- }
- if(!dojo._hasResource["dojo.dnd.Moveable"]){
- dojo._hasResource["dojo.dnd.Moveable"] = true;
- dojo.provide("dojo.dnd.Moveable");
- dojo.declare("dojo.dnd.Moveable", null, {
-
- handle: "",
- delay: 0,
- skip: false,
-
- constructor: function(node, params){
-
-
-
-
-
-
- this.node = dojo.byId(node);
- if(!params){ params = {}; }
- this.handle = params.handle ? dojo.byId(params.handle) : null;
- if(!this.handle){ this.handle = this.node; }
- this.delay = params.delay > 0 ? params.delay : 0;
- this.skip = params.skip;
- this.mover = params.mover ? params.mover : dojo.dnd.Mover;
- this.events = [
- dojo.connect(this.handle, "onmousedown", this, "onMouseDown"),
- dojo.connect(this.handle, "ontouchstart", this, "onMouseDown"),
-
- dojo.connect(this.handle, "ondragstart", this, "onSelectStart"),
- dojo.connect(this.handle, "onselectstart", this, "onSelectStart")
- ];
- },
-
- markupFactory: function(params, node){
- return new dojo.dnd.Moveable(node, params);
- },
-
- destroy: function(){
-
-
- dojo.forEach(this.events, dojo.disconnect);
- this.events = this.node = this.handle = null;
- },
-
-
- onMouseDown: function(e){
-
-
-
-
- if(this.skip && dojo.dnd.isFormElement(e)){ return; }
- if(this.delay){
- this.events.push(
- dojo.connect(this.handle, "onmousemove", this, "onMouseMove"),
- dojo.connect(this.handle, "ontouchmove", this, "onMouseMove"),
- dojo.connect(this.handle, "onmouseup", this, "onMouseUp"),
- dojo.connect(this.handle, "ontouchend", this, "onMouseUp")
- );
- var pos = e.touches ? e.touches[0] : e;
- this._lastX = pos.pageX;
- this._lastY = pos.pageY;
- }else{
- this.onDragDetected(e);
- }
- dojo.stopEvent(e);
- },
- onMouseMove: function(e){
-
-
-
-
- var pos = e.touches ? e.touches[0] : e;
- if(Math.abs(pos.pageX - this._lastX) > this.delay || Math.abs(pos.pageY - this._lastY) > this.delay){
- this.onMouseUp(e);
- this.onDragDetected(e);
- }
- dojo.stopEvent(e);
- },
- onMouseUp: function(e){
-
-
-
-
- for(var i = 0; i < 2; ++i){
- dojo.disconnect(this.events.pop());
- }
- dojo.stopEvent(e);
- },
- onSelectStart: function(e){
-
-
-
-
- if(!this.skip || !dojo.dnd.isFormElement(e)){
- dojo.stopEvent(e);
- }
- },
-
-
- onDragDetected: function(/* Event */ e){
-
-
-
- new this.mover(this.node, e, this);
- },
- onMoveStart: function(/* dojo.dnd.Mover */ mover){
-
-
- dojo.publish("/dnd/move/start", [mover]);
- dojo.addClass(dojo.body(), "dojoMove");
- dojo.addClass(this.node, "dojoMoveItem");
- },
- onMoveStop: function(/* dojo.dnd.Mover */ mover){
-
-
- dojo.publish("/dnd/move/stop", [mover]);
- dojo.removeClass(dojo.body(), "dojoMove");
- dojo.removeClass(this.node, "dojoMoveItem");
- },
- onFirstMove: function(/* dojo.dnd.Mover */ mover, /* Event */ e){
-
-
-
-
-
- },
- onMove: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop, /* Event */ e){
-
-
-
- this.onMoving(mover, leftTop);
- var s = mover.node.style;
- s.left = leftTop.l + "px";
- s.top = leftTop.t + "px";
- this.onMoved(mover, leftTop);
- },
- onMoving: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
-
-
-
-
- },
- onMoved: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
-
-
-
-
- }
- });
- }
- if(!dojo._hasResource["dojo.dnd.move"]){
- dojo._hasResource["dojo.dnd.move"] = true;
- dojo.provide("dojo.dnd.move");
- dojo.declare("dojo.dnd.move.constrainedMoveable", dojo.dnd.Moveable, {
-
- constraints: function(){},
- within: false,
-
-
- markupFactory: function(params, node){
- return new dojo.dnd.move.constrainedMoveable(node, params);
- },
- constructor: function(node, params){
-
-
-
-
-
-
-
- if(!params){ params = {}; }
- this.constraints = params.constraints;
- this.within = params.within;
- },
- onFirstMove: function(/* dojo.dnd.Mover */ mover){
-
-
-
- var c = this.constraintBox = this.constraints.call(this, mover);
- c.r = c.l + c.w;
- c.b = c.t + c.h;
- if(this.within){
- var mb = dojo._getMarginSize(mover.node);
- c.r -= mb.w;
- c.b -= mb.h;
- }
- },
- onMove: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
-
-
-
- var c = this.constraintBox, s = mover.node.style;
- this.onMoving(mover, leftTop);
- leftTop.l = leftTop.l < c.l ? c.l : c.r < leftTop.l ? c.r : leftTop.l;
- leftTop.t = leftTop.t < c.t ? c.t : c.b < leftTop.t ? c.b : leftTop.t;
- s.left = leftTop.l + "px";
- s.top = leftTop.t + "px";
- this.onMoved(mover, leftTop);
- }
- });
- dojo.declare("dojo.dnd.move.boxConstrainedMoveable", dojo.dnd.move.constrainedMoveable, {
-
-
- box: {},
-
-
- markupFactory: function(params, node){
- return new dojo.dnd.move.boxConstrainedMoveable(node, params);
- },
- constructor: function(node, params){
-
-
-
-
-
-
- var box = params && params.box;
- this.constraints = function(){ return box; };
- }
- });
- dojo.declare("dojo.dnd.move.parentConstrainedMoveable", dojo.dnd.move.constrainedMoveable, {
-
-
- area: "content",
-
- markupFactory: function(params, node){
- return new dojo.dnd.move.parentConstrainedMoveable(node, params);
- },
- constructor: function(node, params){
-
-
-
-
-
-
- var area = params && params.area;
- this.constraints = function(){
- var n = this.node.parentNode,
- s = dojo.getComputedStyle(n),
- mb = dojo._getMarginBox(n, s);
- if(area == "margin"){
- return mb;
- }
- var t = dojo._getMarginExtents(n, s);
- mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
- if(area == "border"){
- return mb;
- }
- t = dojo._getBorderExtents(n, s);
- mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
- if(area == "padding"){
- return mb;
- }
- t = dojo._getPadExtents(n, s);
- mb.l += t.l, mb.t += t.t, mb.w -= t.w, mb.h -= t.h;
- return mb;
- };
- }
- });
- dojo.dnd.constrainedMover = dojo.dnd.move.constrainedMover;
- dojo.dnd.boxConstrainedMover = dojo.dnd.move.boxConstrainedMover;
- dojo.dnd.parentConstrainedMover = dojo.dnd.move.parentConstrainedMover;
- }
- if(!dojo._hasResource["dojo.date.stamp"]){
- dojo._hasResource["dojo.date.stamp"] = true;
- dojo.provide("dojo.date.stamp");
- dojo.getObject("date.stamp", true, dojo);
- dojo.date.stamp.fromISOString = function(/*String*/formattedString, /*Number?*/defaultTime){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!dojo.date.stamp._isoRegExp){
- dojo.date.stamp._isoRegExp =
- /^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;
- }
- var match = dojo.date.stamp._isoRegExp.exec(formattedString),
- result = null;
- if(match){
- match.shift();
- if(match[1]){match[1]--;}
- if(match[6]){match[6] *= 1000;}
- if(defaultTime){
-
- defaultTime = new Date(defaultTime);
- dojo.forEach(dojo.map(["FullYear", "Month", "Date", "Hours", "Minutes", "Seconds", "Milliseconds"], function(prop){
- return defaultTime["get" + prop]();
- }), function(value, index){
- match[index] = match[index] || value;
- });
- }
- result = new Date(match[0]||1970, match[1]||0, match[2]||1, match[3]||0, match[4]||0, match[5]||0, match[6]||0);
- if(match[0] < 100){
- result.setFullYear(match[0] || 1970);
- }
- var offset = 0,
- zoneSign = match[7] && match[7].charAt(0);
- if(zoneSign != 'Z'){
- offset = ((match[8] || 0) * 60) + (Number(match[9]) || 0);
- if(zoneSign != '-'){ offset *= -1; }
- }
- if(zoneSign){
- offset -= result.getTimezoneOffset();
- }
- if(offset){
- result.setTime(result.getTime() + offset * 60000);
- }
- }
- return result;
- };
- dojo.date.stamp.toISOString = function(/*Date*/dateObject, /*dojo.date.stamp.__Options?*/options){
-
-
-
-
-
-
-
-
-
-
- var _ = function(n){ return (n < 10) ? "0" + n : n; };
- options = options || {};
- var formattedDate = [],
- getter = options.zulu ? "getUTC" : "get",
- date = "";
- if(options.selector != "time"){
- var year = dateObject[getter+"FullYear"]();
- date = ["0000".substr((year+"").length)+year, _(dateObject[getter+"Month"]()+1), _(dateObject[getter+"Date"]())].join('-');
- }
- formattedDate.push(date);
- if(options.selector != "date"){
- var time = [_(dateObject[getter+"Hours"]()), _(dateObject[getter+"Minutes"]()), _(dateObject[getter+"Seconds"]())].join(':');
- var millis = dateObject[getter+"Milliseconds"]();
- if(options.milliseconds){
- time += "."+ (millis < 100 ? "0" : "") + _(millis);
- }
- if(options.zulu){
- time += "Z";
- }else if(options.selector != "time"){
- var timezoneOffset = dateObject.getTimezoneOffset();
- var absOffset = Math.abs(timezoneOffset);
- time += (timezoneOffset > 0 ? "-" : "+") +
- _(Math.floor(absOffset/60)) + ":" + _(absOffset%60);
- }
- formattedDate.push(time);
- }
- return formattedDate.join('T');
- };
- }
- if(!dojo._hasResource["dojo.parser"]){
- dojo._hasResource["dojo.parser"] = true;
- dojo.provide("dojo.parser");
- new Date("X");
- dojo.parser = new function(){
-
-
- var d = dojo;
- function val2type(/*Object*/ value){
-
-
- if(d.isString(value)){ return "string"; }
- if(typeof value == "number"){ return "number"; }
- if(typeof value == "boolean"){ return "boolean"; }
- if(d.isFunction(value)){ return "function"; }
- if(d.isArray(value)){ return "array"; }
- if(value instanceof Date) { return "date"; }
- if(value instanceof d._Url){ return "url"; }
- return "object";
- }
- function str2obj(/*String*/ value, /*String*/ type){
-
-
- switch(type){
- case "string":
- return value;
- case "number":
- return value.length ? Number(value) : NaN;
- case "boolean":
-
- return typeof value == "boolean" ? value : !(value.toLowerCase()=="false");
- case "function":
- if(d.isFunction(value)){
-
-
-
- value=value.toString();
- value=d.trim(value.substring(value.indexOf('{')+1, value.length-1));
- }
- try{
- if(value === "" || value.search(/[^\w\.]+/i) != -1){
-
- return new Function(value);
- }else{
-
-
- return d.getObject(value, false) || new Function(value);
- }
- }catch(e){ return new Function(); }
- case "array":
- return value ? value.split(/\s*,\s*/) : [];
- case "date":
- switch(value){
- case "": return new Date("");
- case "now": return new Date();
- default: return d.date.stamp.fromISOString(value);
- }
- case "url":
- return d.baseUrl + value;
- default:
- return d.fromJson(value);
- }
- }
- var dummyClass = {}, instanceClasses = {
-
-
- };
-
-
-
-
- d.connect(d, "extend", function(){
- instanceClasses = {};
- });
- function getProtoInfo(cls, params){
-
-
-
-
- for(var name in cls){
- if(name.charAt(0)=="_"){ continue; }
- if(name in dummyClass){ continue; }
- params[name] = val2type(cls[name]);
- }
- return params;
- }
- function getClassInfo(/*String*/ className, /*Boolean*/ skipParamsLookup){
-
-
-
-
-
-
-
-
-
-
-
- var c = instanceClasses[className];
- if(!c){
-
- var cls = d.getObject(className), params = null;
- if(!cls){ return null; }
- if(!skipParamsLookup){
- params = getProtoInfo(cls.prototype, {})
- }
- c = { cls: cls, params: params };
-
- }else if(!skipParamsLookup && !c.params){
-
-
-
-
- c.params = getProtoInfo(c.cls.prototype, {});
- }
-
- return c;
- }
- this._functionFromScript = function(script, attrData){
-
-
-
-
-
-
-
-
- var preamble = "";
- var suffix = "";
- var argsStr = (script.getAttribute(attrData + "args") || script.getAttribute("args"));
- if(argsStr){
- d.forEach(argsStr.split(/\s*,\s*/), function(part, idx){
- preamble += "var "+part+" = arguments["+idx+"]; ";
- });
- }
- var withStr = script.getAttribute("with");
- if(withStr && withStr.length){
- d.forEach(withStr.split(/\s*,\s*/), function(part){
- preamble += "with("+part+"){";
- suffix += "}";
- });
- }
- return new Function(preamble+script.innerHTML+suffix);
- };
- this.instantiate = function(/* Array */nodes, /* Object? */mixin, /* Object? */args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var thelist = [],
- mixin = mixin||{};
- args = args||{};
-
- var attrName = (args.scope || d._scopeName) + "Type",
- attrData = "data-" + (args.scope || d._scopeName) + "-";
- d.forEach(nodes, function(obj){
- if(!obj){ return; }
-
- var node, type, clsInfo, clazz, scripts, fastpath;
- if(obj.node){
-
- node = obj.node;
- type = obj.type;
- fastpath = obj.fastpath;
- clsInfo = obj.clsInfo || (type && getClassInfo(type, fastpath));
- clazz = clsInfo && clsInfo.cls;
- scripts = obj.scripts;
- }else{
-
- node = obj;
- type = attrName in mixin ? mixin[attrName] : node.getAttribute(attrName);
- clsInfo = type && getClassInfo(type);
- clazz = clsInfo && clsInfo.cls;
- scripts = (clazz && (clazz._noScript || clazz.prototype._noScript) ? [] :
- d.query("> script[type^='dojo/']", node));
- }
- if(!clsInfo){
- throw new Error("Could not load class '" + type);
- }
-
-
-
- var params = {};
-
- if(args.defaults){
-
- d._mixin(params, args.defaults);
- }
- if(obj.inherited){
-
- d._mixin(params, obj.inherited);
- }
-
-
- if(fastpath){
- var extra = node.getAttribute(attrData + "props");
- if(extra && extra.length){
- try{
- extra = d.fromJson.call(args.propsThis, "{" + extra + "}");
- d._mixin(params, extra);
- }catch(e){
-
- throw new Error(e.toString() + " in data-dojo-props='" + extra + "'");
- }
- }
-
-
- var attachPoint = node.getAttribute(attrData + "attach-point");
- if(attachPoint){
- params.dojoAttachPoint = attachPoint;
- }
- var attachEvent = node.getAttribute(attrData + "attach-event");
- if(attachEvent){
- params.dojoAttachEvent = attachEvent;
- }
- dojo.mixin(params, mixin);
- }else{
-
-
-
- var attributes = node.attributes;
-
- for(var name in clsInfo.params){
- var item = name in mixin ? { value:mixin[name], specified:true } : attributes.getNamedItem(name);
- if(!item || (!item.specified && (!dojo.isIE || name.toLowerCase()!="value"))){ continue; }
- var value = item.value;
-
- switch(name){
- case "class":
- value = "className" in mixin ? mixin.className : node.className;
- break;
- case "style":
- value = "style" in mixin ? mixin.style : (node.style && node.style.cssText);
- }
- var _type = clsInfo.params[name];
- if(typeof value == "string"){
- params[name] = str2obj(value, _type);
- }else{
- params[name] = value;
- }
- }
- }
-
-
-
-
-
-
- var connects = [],
- calls = [];
- d.forEach(scripts, function(script){
- node.removeChild(script);
-
- var event = (script.getAttribute(attrData + "event") || script.getAttribute("event")),
- type = script.getAttribute("type"),
- nf = d.parser._functionFromScript(script, attrData);
- if(event){
- if(type == "dojo/connect"){
- connects.push({event: event, func: nf});
- }else{
- params[event] = nf;
- }
- }else{
- calls.push(nf);
- }
- });
- var markupFactory = clazz.markupFactory || clazz.prototype && clazz.prototype.markupFactory;
-
- var instance = markupFactory ? markupFactory(params, node, clazz) : new clazz(params, node);
- thelist.push(instance);
-
-
- var jsname = (node.getAttribute(attrData + "id") || node.getAttribute("jsId"));
- if(jsname){
- d.setObject(jsname, instance);
- }
-
- d.forEach(connects, function(connect){
- d.connect(instance, connect.event, null, connect.func);
- });
- d.forEach(calls, function(func){
- func.call(instance);
- });
- });
-
-
-
- if(!mixin._started){
-
-
-
-
-
- d.forEach(thelist, function(instance){
- if( !args.noStart && instance &&
- dojo.isFunction(instance.startup) &&
- !instance._started &&
- (!instance.getParent || !instance.getParent())
- ){
- instance.startup();
- }
- });
- }
- return thelist;
- };
- this.parse = function(rootNode, args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var root;
- if(!args && rootNode && rootNode.rootNode){
- args = rootNode;
- root = args.rootNode;
- }else{
- root = rootNode;
- }
- root = root ? dojo.byId(root) : dojo.body();
- args = args || {};
- var attrName = (args.scope || d._scopeName) + "Type",
- attrData = "data-" + (args.scope || d._scopeName) + "-";
- function scan(parent, list){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var inherited = dojo.clone(parent.inherited);
- dojo.forEach(["dir", "lang"], function(name){
-
- var val = parent.node.getAttribute(name);
- if(val){
- inherited[name] = val;
- }
- });
-
- var scripts = parent.clsInfo && !parent.clsInfo.cls.prototype._noScript ? parent.scripts : null;
-
- var recurse = (!parent.clsInfo || !parent.clsInfo.cls.prototype.stopParser) || (args && args.template);
-
- for(var child = parent.node.firstChild; child; child = child.nextSibling){
- if(child.nodeType == 1){
-
- var type, html5 = recurse && child.getAttribute(attrData + "type");
- if(html5){
- type = html5;
- }else{
-
- type = recurse && child.getAttribute(attrName);
- }
-
- var fastpath = html5 == type;
- if(type){
-
- var params = {
- "type": type,
- fastpath: fastpath,
- clsInfo: getClassInfo(type, fastpath),
- node: child,
- scripts: [],
- inherited: inherited
- };
- list.push(params);
-
-
- scan(params, list);
- }else if(scripts && child.nodeName.toLowerCase() == "script"){
-
- type = child.getAttribute("type");
- if (type && /^dojo\/\w/i.test(type)) {
- scripts.push(child);
- }
- }else if(recurse){
-
- scan({
- node: child,
- inherited: inherited
- }, list);
- }
- }
- }
- }
-
- var inherited = {};
- if(args && args.inherited){
- for(var key in args.inherited){
- if(args.inherited[key]){ inherited[key] = args.inherited[key]; }
- }
- }
-
- var list = [];
- scan({
- node: root,
- inherited: inherited
- }, list);
-
- var mixin = args && args.template ? {template: true} : null;
- return this.instantiate(list, mixin, args);
- };
- }();
- (function(){
- var parseRunner = function(){
- if(dojo.config.parseOnLoad){
- dojo.parser.parse();
- }
- };
-
- if(dojo.getObject("dijit.wai.onload") === dojo._loaders[0]){
- dojo._loaders.splice(1, 0, parseRunner);
- }else{
- dojo._loaders.unshift(parseRunner);
- }
- })();
- }
- if(!dojo._hasResource["dojo.dnd.Container"]){
- dojo._hasResource["dojo.dnd.Container"] = true;
- dojo.provide("dojo.dnd.Container");
- dojo.declare("dojo.dnd.Container", null, {
-
-
-
-
-
- skipForm: false,
-
-
-
- constructor: function(node, params){
-
-
-
-
-
-
- this.node = dojo.byId(node);
- if(!params){ params = {}; }
- this.creator = params.creator || null;
- this.skipForm = params.skipForm;
- this.parent = params.dropParent && dojo.byId(params.dropParent);
-
-
- this.map = {};
- this.current = null;
-
- this.containerState = "";
- dojo.addClass(this.node, "dojoDndContainer");
-
-
- if(!(params && params._skipStartup)){
- this.startup();
- }
-
- this.events = [
- dojo.connect(this.node, "onmouseover", this, "onMouseOver"),
- dojo.connect(this.node, "onmouseout", this, "onMouseOut"),
-
- dojo.connect(this.node, "ondragstart", this, "onSelectStart"),
- dojo.connect(this.node, "onselectstart", this, "onSelectStart")
- ];
- },
-
-
- creator: function(){
-
-
- },
-
-
- getItem: function(/*String*/ key){
-
-
- return this.map[key];
- },
- setItem: function(/*String*/ key, /*dojo.dnd.Item*/ data){
-
-
- this.map[key] = data;
- },
- delItem: function(/*String*/ key){
-
-
- delete this.map[key];
- },
- forInItems: function(/*Function*/ f, /*Object?*/ o){
-
-
-
- o = o || dojo.global;
- var m = this.map, e = dojo.dnd._empty;
- for(var i in m){
- if(i in e){ continue; }
- f.call(o, m[i], i, this);
- }
- return o;
- },
- clearItems: function(){
-
-
- this.map = {};
- },
-
-
- getAllNodes: function(){
-
-
- return dojo.query("> .dojoDndItem", this.parent);
- },
- sync: function(){
-
-
- var map = {};
- this.getAllNodes().forEach(function(node){
- if(node.id){
- var item = this.getItem(node.id);
- if(item){
- map[node.id] = item;
- return;
- }
- }else{
- node.id = dojo.dnd.getUniqueId();
- }
- var type = node.getAttribute("dndType"),
- data = node.getAttribute("dndData");
- map[node.id] = {
- data: data || node.innerHTML,
- type: type ? type.split(/\s*,\s*/) : ["text"]
- };
- }, this);
- this.map = map;
- return this;
- },
- insertNodes: function(data, before, anchor){
-
-
-
-
-
-
-
-
- if(!this.parent.firstChild){
- anchor = null;
- }else if(before){
- if(!anchor){
- anchor = this.parent.firstChild;
- }
- }else{
- if(anchor){
- anchor = anchor.nextSibling;
- }
- }
- if(anchor){
- for(var i = 0; i < data.length; ++i){
- var t = this._normalizedCreator(data[i]);
- this.setItem(t.node.id, {data: t.data, type: t.type});
- this.parent.insertBefore(t.node, anchor);
- }
- }else{
- for(var i = 0; i < data.length; ++i){
- var t = this._normalizedCreator(data[i]);
- this.setItem(t.node.id, {data: t.data, type: t.type});
- this.parent.appendChild(t.node);
- }
- }
- return this;
- },
- destroy: function(){
-
-
- dojo.forEach(this.events, dojo.disconnect);
- this.clearItems();
- this.node = this.parent = this.current = null;
- },
-
- markupFactory: function(params, node){
- params._skipStartup = true;
- return new dojo.dnd.Container(node, params);
- },
- startup: function(){
-
-
-
-
- if(!this.parent){
-
- this.parent = this.node;
- if(this.parent.tagName.toLowerCase() == "table"){
- var c = this.parent.getElementsByTagName("tbody");
- if(c && c.length){ this.parent = c[0]; }
- }
- }
- this.defaultCreator = dojo.dnd._defaultCreator(this.parent);
-
- this.sync();
- },
-
- onMouseOver: function(e){
-
-
-
-
- var n = e.relatedTarget;
- while(n){
- if(n == this.node){ break; }
- try{
- n = n.parentNode;
- }catch(x){
- n = null;
- }
- }
- if(!n){
- this._changeState("Container", "Over");
- this.onOverEvent();
- }
- n = this._getChildByEvent(e);
- if(this.current == n){ return; }
- if(this.current){ this._removeItemClass(this.current, "Over"); }
- if(n){ this._addItemClass(n, "Over"); }
- this.current = n;
- },
- onMouseOut: function(e){
-
-
-
-
- for(var n = e.relatedTarget; n;){
- if(n == this.node){ return; }
- try{
- n = n.parentNode;
- }catch(x){
- n = null;
- }
- }
- if(this.current){
- this._removeItemClass(this.current, "Over");
- this.current = null;
- }
- this._changeState("Container", "");
- this.onOutEvent();
- },
- onSelectStart: function(e){
-
-
-
-
- if(!this.skipForm || !dojo.dnd.isFormElement(e)){
- dojo.stopEvent(e);
- }
- },
-
-
- onOverEvent: function(){
-
-
- },
- onOutEvent: function(){
-
-
- },
- _changeState: function(type, newState){
-
-
-
-
-
-
- var prefix = "dojoDnd" + type;
- var state = type.toLowerCase() + "State";
-
- dojo.replaceClass(this.node, prefix + newState, prefix + this[state]);
- this[state] = newState;
- },
- _addItemClass: function(node, type){
-
-
-
-
-
-
- dojo.addClass(node, "dojoDndItem" + type);
- },
- _removeItemClass: function(node, type){
-
-
-
-
-
-
- dojo.removeClass(node, "dojoDndItem" + type);
- },
- _getChildByEvent: function(e){
-
-
-
-
- var node = e.target;
- if(node){
- for(var parent = node.parentNode; parent; node = parent, parent = node.parentNode){
- if(parent == this.parent && dojo.hasClass(node, "dojoDndItem")){ return node; }
- }
- }
- return null;
- },
- _normalizedCreator: function(/*dojo.dnd.Item*/ item, /*String*/ hint){
-
-
- var t = (this.creator || this.defaultCreator).call(this, item, hint);
- if(!dojo.isArray(t.type)){ t.type = ["text"]; }
- if(!t.node.id){ t.node.id = dojo.dnd.getUniqueId(); }
- dojo.addClass(t.node, "dojoDndItem");
- return t;
- }
- });
- dojo.dnd._createNode = function(tag){
-
-
-
-
-
- if(!tag){ return dojo.dnd._createSpan; }
- return function(text){
- return dojo.create(tag, {innerHTML: text});
- };
- };
- dojo.dnd._createTrTd = function(text){
-
-
-
-
- var tr = dojo.create("tr");
- dojo.create("td", {innerHTML: text}, tr);
- return tr;
- };
- dojo.dnd._createSpan = function(text){
-
-
-
-
- return dojo.create("span", {innerHTML: text});
- };
- dojo.dnd._defaultCreatorNodes = {ul: "li", ol: "li", div: "div", p: "div"};
- dojo.dnd._defaultCreator = function(node){
-
-
-
-
- var tag = node.tagName.toLowerCase();
- var c = tag == "tbody" || tag == "thead" ? dojo.dnd._createTrTd :
- dojo.dnd._createNode(dojo.dnd._defaultCreatorNodes[tag]);
- return function(item, hint){
- var isObj = item && dojo.isObject(item), data, type, n;
- if(isObj && item.tagName && item.nodeType && item.getAttribute){
-
- data = item.getAttribute("dndData") || item.innerHTML;
- type = item.getAttribute("dndType");
- type = type ? type.split(/\s*,\s*/) : ["text"];
- n = item;
- }else{
-
- data = (isObj && item.data) ? item.data : item;
- type = (isObj && item.type) ? item.type : ["text"];
- n = (hint == "avatar" ? dojo.dnd._createSpan : c)(String(data));
- }
- if(!n.id){
- n.id = dojo.dnd.getUniqueId();
- }
- return {node: n, data: data, type: type};
- };
- };
- }
- if(!dojo._hasResource["dojo.dnd.Selector"]){
- dojo._hasResource["dojo.dnd.Selector"] = true;
- dojo.provide("dojo.dnd.Selector");
- dojo.declare("dojo.dnd.Selector", dojo.dnd.Container, {
-
-
-
-
- constructor: function(node, params){
-
-
-
-
-
-
- if(!params){ params = {}; }
- this.singular = params.singular;
- this.autoSync = params.autoSync;
-
- this.selection = {};
- this.anchor = null;
- this.simpleSelection = false;
-
- this.events.push(
- dojo.connect(this.node, "onmousedown", this, "onMouseDown"),
- dojo.connect(this.node, "onmouseup", this, "onMouseUp"));
- },
-
-
- singular: false,
-
-
- getSelectedNodes: function(){
-
-
- var t = new dojo.NodeList();
- var e = dojo.dnd._empty;
- for(var i in this.selection){
- if(i in e){ continue; }
- t.push(dojo.byId(i));
- }
- return t;
- },
- selectNone: function(){
-
-
- return this._removeSelection()._removeAnchor();
- },
- selectAll: function(){
-
-
- this.forInItems(function(data, id){
- this._addItemClass(dojo.byId(id), "Selected");
- this.selection[id] = 1;
- }, this);
- return this._removeAnchor();
- },
- deleteSelectedNodes: function(){
-
-
- var e = dojo.dnd._empty;
- for(var i in this.selection){
- if(i in e){ continue; }
- var n = dojo.byId(i);
- this.delItem(i);
- dojo.destroy(n);
- }
- this.anchor = null;
- this.selection = {};
- return this;
- },
- forInSelectedItems: function(/*Function*/ f, /*Object?*/ o){
-
-
-
- o = o || dojo.global;
- var s = this.selection, e = dojo.dnd._empty;
- for(var i in s){
- if(i in e){ continue; }
- f.call(o, this.getItem(i), i, this);
- }
- },
- sync: function(){
-
-
-
- dojo.dnd.Selector.superclass.sync.call(this);
-
-
- if(this.anchor){
- if(!this.getItem(this.anchor.id)){
- this.anchor = null;
- }
- }
-
-
- var t = [], e = dojo.dnd._empty;
- for(var i in this.selection){
- if(i in e){ continue; }
- if(!this.getItem(i)){
- t.push(i);
- }
- }
- dojo.forEach(t, function(i){
- delete this.selection[i];
- }, this);
-
- return this;
- },
- insertNodes: function(addSelected, data, before, anchor){
-
-
-
-
-
-
-
-
-
-
- var oldCreator = this._normalizedCreator;
- this._normalizedCreator = function(item, hint){
- var t = oldCreator.call(this, item, hint);
- if(addSelected){
- if(!this.anchor){
- this.anchor = t.node;
- this._removeItemClass(t.node, "Selected");
- this._addItemClass(this.anchor, "Anchor");
- }else if(this.anchor != t.node){
- this._removeItemClass(t.node, "Anchor");
- this._addItemClass(t.node, "Selected");
- }
- this.selection[t.node.id] = 1;
- }else{
- this._removeItemClass(t.node, "Selected");
- this._removeItemClass(t.node, "Anchor");
- }
- return t;
- };
- dojo.dnd.Selector.superclass.insertNodes.call(this, data, before, anchor);
- this._normalizedCreator = oldCreator;
- return this;
- },
- destroy: function(){
-
-
- dojo.dnd.Selector.superclass.destroy.call(this);
- this.selection = this.anchor = null;
- },
-
- markupFactory: function(params, node){
- params._skipStartup = true;
- return new dojo.dnd.Selector(node, params);
- },
-
- onMouseDown: function(e){
-
-
-
-
- if(this.autoSync){ this.sync(); }
- if(!this.current){ return; }
- if(!this.singular && !dojo.isCopyKey(e) && !e.shiftKey && (this.current.id in this.selection)){
- this.simpleSelection = true;
- if(e.button === dojo.mouseButtons.LEFT){
-
-
- dojo.stopEvent(e);
- }
- return;
- }
- if(!this.singular && e.shiftKey){
- if(!dojo.isCopyKey(e)){
- this._removeSelection();
- }
- var c = this.getAllNodes();
- if(c.length){
- if(!this.anchor){
- this.anchor = c[0];
- this._addItemClass(this.anchor, "Anchor");
- }
- this.selection[this.anchor.id] = 1;
- if(this.anchor != this.current){
- var i = 0;
- for(; i < c.length; ++i){
- var node = c[i];
- if(node == this.anchor || node == this.current){ break; }
- }
- for(++i; i < c.length; ++i){
- var node = c[i];
- if(node == this.anchor || node == this.current){ break; }
- this._addItemClass(node, "Selected");
- this.selection[node.id] = 1;
- }
- this._addItemClass(this.current, "Selected");
- this.selection[this.current.id] = 1;
- }
- }
- }else{
- if(this.singular){
- if(this.anchor == this.current){
- if(dojo.isCopyKey(e)){
- this.selectNone();
- }
- }else{
- this.selectNone();
- this.anchor = this.current;
- this._addItemClass(this.anchor, "Anchor");
- this.selection[this.current.id] = 1;
- }
- }else{
- if(dojo.isCopyKey(e)){
- if(this.anchor == this.current){
- delete this.selection[this.anchor.id];
- this._removeAnchor();
- }else{
- if(this.current.id in this.selection){
- this._removeItemClass(this.current, "Selected");
- delete this.selection[this.current.id];
- }else{
- if(this.anchor){
- this._removeItemClass(this.anchor, "Anchor");
- this._addItemClass(this.anchor, "Selected");
- }
- this.anchor = this.current;
- this._addItemClass(this.current, "Anchor");
- this.selection[this.current.id] = 1;
- }
- }
- }else{
- if(!(this.current.id in this.selection)){
- this.selectNone();
- this.anchor = this.current;
- this._addItemClass(this.current, "Anchor");
- this.selection[this.current.id] = 1;
- }
- }
- }
- }
- dojo.stopEvent(e);
- },
- onMouseUp: function(e){
-
-
-
-
- if(!this.simpleSelection){ return; }
- this.simpleSelection = false;
- this.selectNone();
- if(this.current){
- this.anchor = this.current;
- this._addItemClass(this.anchor, "Anchor");
- this.selection[this.current.id] = 1;
- }
- },
- onMouseMove: function(e){
-
-
-
-
- this.simpleSelection = false;
- },
-
-
- onOverEvent: function(){
-
-
- this.onmousemoveEvent = dojo.connect(this.node, "onmousemove", this, "onMouseMove");
- },
- onOutEvent: function(){
-
-
- dojo.disconnect(this.onmousemoveEvent);
- delete this.onmousemoveEvent;
- },
- _removeSelection: function(){
-
-
- var e = dojo.dnd._empty;
- for(var i in this.selection){
- if(i in e){ continue; }
- var node = dojo.byId(i);
- if(node){ this._removeItemClass(node, "Selected"); }
- }
- this.selection = {};
- return this;
- },
- _removeAnchor: function(){
- if(this.anchor){
- this._removeItemClass(this.anchor, "Anchor");
- this.anchor = null;
- }
- return this;
- }
- });
- }
- if(!dojo._hasResource["dojo.dnd.Source"]){
- dojo._hasResource["dojo.dnd.Source"] = true;
- dojo.provide("dojo.dnd.Source");
- dojo.declare("dojo.dnd.Source", dojo.dnd.Selector, {
-
-
-
-
- isSource: true,
- horizontal: false,
- copyOnly: false,
- selfCopy: false,
- selfAccept: true,
- skipForm: false,
- withHandles: false,
- autoSync: false,
- delay: 0,
- accept: ["text"],
- generateText: true,
-
- constructor: function(/*DOMNode|String*/node, /*dojo.dnd.__SourceArgs?*/params){
-
-
-
-
-
-
-
- dojo.mixin(this, dojo.mixin({}, params));
- var type = this.accept;
- if(type.length){
- this.accept = {};
- for(var i = 0; i < type.length; ++i){
- this.accept[type[i]] = 1;
- }
- }
-
- this.isDragging = false;
- this.mouseDown = false;
- this.targetAnchor = null;
- this.targetBox = null;
- this.before = true;
- this._lastX = 0;
- this._lastY = 0;
-
- this.sourceState = "";
- if(this.isSource){
- dojo.addClass(this.node, "dojoDndSource");
- }
- this.targetState = "";
- if(this.accept){
- dojo.addClass(this.node, "dojoDndTarget");
- }
- if(this.horizontal){
- dojo.addClass(this.node, "dojoDndHorizontal");
- }
-
- this.topics = [
- dojo.subscribe("/dnd/source/over", this, "onDndSourceOver"),
- dojo.subscribe("/dnd/start", this, "onDndStart"),
- dojo.subscribe("/dnd/drop", this, "onDndDrop"),
- dojo.subscribe("/dnd/cancel", this, "onDndCancel")
- ];
- },
-
-
- checkAcceptance: function(source, nodes){
-
-
-
-
-
-
- if(this == source){
- return !this.copyOnly || this.selfAccept;
- }
- for(var i = 0; i < nodes.length; ++i){
- var type = source.getItem(nodes[i].id).type;
-
- var flag = false;
- for(var j = 0; j < type.length; ++j){
- if(type[j] in this.accept){
- flag = true;
- break;
- }
- }
- if(!flag){
- return false;
- }
- }
- return true;
- },
- copyState: function(keyPressed, self){
-
-
-
-
-
-
-
-
- if(keyPressed){ return true; }
- if(arguments.length < 2){
- self = this == dojo.dnd.manager().target;
- }
- if(self){
- if(this.copyOnly){
- return this.selfCopy;
- }
- }else{
- return this.copyOnly;
- }
- return false;
- },
- destroy: function(){
-
-
- dojo.dnd.Source.superclass.destroy.call(this);
- dojo.forEach(this.topics, dojo.unsubscribe);
- this.targetAnchor = null;
- },
-
- markupFactory: function(params, node){
- params._skipStartup = true;
- return new dojo.dnd.Source(node, params);
- },
-
- onMouseMove: function(e){
-
-
-
-
- if(this.isDragging && this.targetState == "Disabled"){ return; }
- dojo.dnd.Source.superclass.onMouseMove.call(this, e);
- var m = dojo.dnd.manager();
- if(!this.isDragging){
- if(this.mouseDown && this.isSource &&
- (Math.abs(e.pageX - this._lastX) > this.delay || Math.abs(e.pageY - this._lastY) > this.delay)){
- var nodes = this.getSelectedNodes();
- if(nodes.length){
- m.startDrag(this, nodes, this.copyState(dojo.isCopyKey(e), true));
- }
- }
- }
- if(this.isDragging){
-
- var before = false;
- if(this.current){
- if(!this.targetBox || this.targetAnchor != this.current){
- this.targetBox = dojo.position(this.current, true);
- }
- if(this.horizontal){
- before = (e.pageX - this.targetBox.x) < (this.targetBox.w / 2);
- }else{
- before = (e.pageY - this.targetBox.y) < (this.targetBox.h / 2);
- }
- }
- if(this.current != this.targetAnchor || before != this.before){
- this._markTargetAnchor(before);
- m.canDrop(!this.current || m.source != this || !(this.current.id in this.selection));
- }
- }
- },
- onMouseDown: function(e){
-
-
-
-
- if(!this.mouseDown && this._legalMouseDown(e) && (!this.skipForm || !dojo.dnd.isFormElement(e))){
- this.mouseDown = true;
- this._lastX = e.pageX;
- this._lastY = e.pageY;
- dojo.dnd.Source.superclass.onMouseDown.call(this, e);
- }
- },
- onMouseUp: function(e){
-
-
-
-
- if(this.mouseDown){
- this.mouseDown = false;
- dojo.dnd.Source.superclass.onMouseUp.call(this, e);
- }
- },
-
-
- onDndSourceOver: function(source){
-
-
-
-
- if(this != source){
- this.mouseDown = false;
- if(this.targetAnchor){
- this._unmarkTargetAnchor();
- }
- }else if(this.isDragging){
- var m = dojo.dnd.manager();
- m.canDrop(this.targetState != "Disabled" && (!this.current || m.source != this || !(this.current.id in this.selection)));
- }
- },
- onDndStart: function(source, nodes, copy){
-
-
-
-
-
-
-
-
- if(this.autoSync){ this.sync(); }
- if(this.isSource){
- this._changeState("Source", this == source ? (copy ? "Copied" : "Moved") : "");
- }
- var accepted = this.accept && this.checkAcceptance(source, nodes);
- this._changeState("Target", accepted ? "" : "Disabled");
- if(this == source){
- dojo.dnd.manager().overSource(this);
- }
- this.isDragging = true;
- },
- onDndDrop: function(source, nodes, copy, target){
-
-
-
-
-
-
-
-
-
-
- if(this == target){
-
- this.onDrop(source, nodes, copy);
- }
- this.onDndCancel();
- },
- onDndCancel: function(){
-
-
- if(this.targetAnchor){
- this._unmarkTargetAnchor();
- this.targetAnchor = null;
- }
- this.before = true;
- this.isDragging = false;
- this.mouseDown = false;
- this._changeState("Source", "");
- this._changeState("Target", "");
- },
-
-
- onDrop: function(source, nodes, copy){
-
-
-
-
-
-
-
-
-
- if(this != source){
- this.onDropExternal(source, nodes, copy);
- }else{
- this.onDropInternal(nodes, copy);
- }
- },
- onDropExternal: function(source, nodes, copy){
-
-
-
-
-
-
-
-
-
-
- var oldCreator = this._normalizedCreator;
-
- if(this.creator){
-
- this._normalizedCreator = function(node, hint){
- return oldCreator.call(this, source.getItem(node.id).data, hint);
- };
- }else{
-
- if(copy){
-
- this._normalizedCreator = function(node, hint){
- var t = source.getItem(node.id);
- var n = node.cloneNode(true);
- n.id = dojo.dnd.getUniqueId();
- return {node: n, data: t.data, type: t.type};
- };
- }else{
-
- this._normalizedCreator = function(node, hint){
- var t = source.getItem(node.id);
- source.delItem(node.id);
- return {node: node, data: t.data, type: t.type};
- };
- }
- }
- this.selectNone();
- if(!copy && !this.creator){
- source.selectNone();
- }
- this.insertNodes(true, nodes, this.before, this.current);
- if(!copy && this.creator){
- source.deleteSelectedNodes();
- }
- this._normalizedCreator = oldCreator;
- },
- onDropInternal: function(nodes, copy){
-
-
-
-
-
-
-
-
- var oldCreator = this._normalizedCreator;
-
- if(this.current && this.current.id in this.selection){
-
- return;
- }
- if(copy){
- if(this.creator){
-
- this._normalizedCreator = function(node, hint){
- return oldCreator.call(this, this.getItem(node.id).data, hint);
- };
- }else{
-
- this._normalizedCreator = function(node, hint){
- var t = this.getItem(node.id);
- var n = node.cloneNode(true);
- n.id = dojo.dnd.getUniqueId();
- return {node: n, data: t.data, type: t.type};
- };
- }
- }else{
-
- if(!this.current){
-
- return;
- }
- this._normalizedCreator = function(node, hint){
- var t = this.getItem(node.id);
- return {node: node, data: t.data, type: t.type};
- };
- }
- this._removeSelection();
- this.insertNodes(true, nodes, this.before, this.current);
- this._normalizedCreator = oldCreator;
- },
- onDraggingOver: function(){
-
-
-
- },
- onDraggingOut: function(){
-
-
-
- },
-
-
- onOverEvent: function(){
-
-
- dojo.dnd.Source.superclass.onOverEvent.call(this);
- dojo.dnd.manager().overSource(this);
- if(this.isDragging && this.targetState != "Disabled"){
- this.onDraggingOver();
- }
- },
- onOutEvent: function(){
-
-
- dojo.dnd.Source.superclass.onOutEvent.call(this);
- dojo.dnd.manager().outSource(this);
- if(this.isDragging && this.targetState != "Disabled"){
- this.onDraggingOut();
- }
- },
- _markTargetAnchor: function(before){
-
-
-
-
- if(this.current == this.targetAnchor && this.before == before){ return; }
- if(this.targetAnchor){
- this._removeItemClass(this.targetAnchor, this.before ? "Before" : "After");
- }
- this.targetAnchor = this.current;
- this.targetBox = null;
- this.before = before;
- if(this.targetAnchor){
- this._addItemClass(this.targetAnchor, this.before ? "Before" : "After");
- }
- },
- _unmarkTargetAnchor: function(){
-
-
- if(!this.targetAnchor){ return; }
- this._removeItemClass(this.targetAnchor, this.before ? "Before" : "After");
- this.targetAnchor = null;
- this.targetBox = null;
- this.before = true;
- },
- _markDndStatus: function(copy){
-
-
- this._changeState("Source", copy ? "Copied" : "Moved");
- },
- _legalMouseDown: function(e){
-
-
-
-
-
-
- if(!dojo.mouseButtons.isLeft(e)){ return false; }
-
- if(!this.withHandles){ return true; }
-
-
- for(var node = e.target; node && node !== this.node; node = node.parentNode){
- if(dojo.hasClass(node, "dojoDndHandle")){ return true; }
- if(dojo.hasClass(node, "dojoDndItem") || dojo.hasClass(node, "dojoDndIgnore")){ break; }
- }
- return false;
- }
- });
- dojo.declare("dojo.dnd.Target", dojo.dnd.Source, {
-
-
- constructor: function(node, params){
-
-
- this.isSource = false;
- dojo.removeClass(this.node, "dojoDndSource");
- },
-
- markupFactory: function(params, node){
- params._skipStartup = true;
- return new dojo.dnd.Target(node, params);
- }
- });
- dojo.declare("dojo.dnd.AutoSource", dojo.dnd.Source, {
-
-
-
- constructor: function(node, params){
-
-
- this.autoSync = true;
- },
-
- markupFactory: function(params, node){
- params._skipStartup = true;
- return new dojo.dnd.AutoSource(node, params);
- }
- });
- }
- if(!dojo._hasResource["dojo.fx.Toggler"]){
- dojo._hasResource["dojo.fx.Toggler"] = true;
- dojo.provide("dojo.fx.Toggler");
- dojo.declare("dojo.fx.Toggler", null, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- node: null,
-
-
- showFunc: dojo.fadeIn,
-
-
- hideFunc: dojo.fadeOut,
-
-
- showDuration: 200,
-
-
- hideDuration: 200,
-
-
-
-
-
-
-
- constructor: function(args){
- var _t = this;
- dojo.mixin(_t, args);
- _t.node = args.node;
- _t._showArgs = dojo.mixin({}, args);
- _t._showArgs.node = _t.node;
- _t._showArgs.duration = _t.showDuration;
- _t.showAnim = _t.showFunc(_t._showArgs);
- _t._hideArgs = dojo.mixin({}, args);
- _t._hideArgs.node = _t.node;
- _t._hideArgs.duration = _t.hideDuration;
- _t.hideAnim = _t.hideFunc(_t._hideArgs);
- dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
- dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
- },
- show: function(delay){
-
-
-
- return this.showAnim.play(delay || 0);
- },
- hide: function(delay){
-
-
-
- return this.hideAnim.play(delay || 0);
- }
- });
- }
- if(!dojo._hasResource["dojo.fx"]){
- dojo._hasResource["dojo.fx"] = true;
- dojo.provide("dojo.fx");
- (function(){
-
- var d = dojo,
- _baseObj = {
- _fire: function(evt, args){
- if(this[evt]){
- this[evt].apply(this, args||[]);
- }
- return this;
- }
- };
- var _chain = function(animations){
- this._index = -1;
- this._animations = animations||[];
- this._current = this._onAnimateCtx = this._onEndCtx = null;
- this.duration = 0;
- d.forEach(this._animations, function(a){
- this.duration += a.duration;
- if(a.delay){ this.duration += a.delay; }
- }, this);
- };
- d.extend(_chain, {
- _onAnimate: function(){
- this._fire("onAnimate", arguments);
- },
- _onEnd: function(){
- d.disconnect(this._onAnimateCtx);
- d.disconnect(this._onEndCtx);
- this._onAnimateCtx = this._onEndCtx = null;
- if(this._index + 1 == this._animations.length){
- this._fire("onEnd");
- }else{
-
- this._current = this._animations[++this._index];
- this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
- this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
- this._current.play(0, true);
- }
- },
- play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
- if(!this._current){ this._current = this._animations[this._index = 0]; }
- if(!gotoStart && this._current.status() == "playing"){ return this; }
- var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
- this._fire("beforeBegin");
- }),
- onBegin = d.connect(this._current, "onBegin", this, function(arg){
- this._fire("onBegin", arguments);
- }),
- onPlay = d.connect(this._current, "onPlay", this, function(arg){
- this._fire("onPlay", arguments);
- d.disconnect(beforeBegin);
- d.disconnect(onBegin);
- d.disconnect(onPlay);
- });
- if(this._onAnimateCtx){
- d.disconnect(this._onAnimateCtx);
- }
- this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
- if(this._onEndCtx){
- d.disconnect(this._onEndCtx);
- }
- this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
- this._current.play.apply(this._current, arguments);
- return this;
- },
- pause: function(){
- if(this._current){
- var e = d.connect(this._current, "onPause", this, function(arg){
- this._fire("onPause", arguments);
- d.disconnect(e);
- });
- this._current.pause();
- }
- return this;
- },
- gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
- this.pause();
- var offset = this.duration * percent;
- this._current = null;
- d.some(this._animations, function(a){
- if(a.duration <= offset){
- this._current = a;
- return true;
- }
- offset -= a.duration;
- return false;
- });
- if(this._current){
- this._current.gotoPercent(offset / this._current.duration, andPlay);
- }
- return this;
- },
- stop: function(/*boolean?*/ gotoEnd){
- if(this._current){
- if(gotoEnd){
- for(; this._index + 1 < this._animations.length; ++this._index){
- this._animations[this._index].stop(true);
- }
- this._current = this._animations[this._index];
- }
- var e = d.connect(this._current, "onStop", this, function(arg){
- this._fire("onStop", arguments);
- d.disconnect(e);
- });
- this._current.stop();
- }
- return this;
- },
- status: function(){
- return this._current ? this._current.status() : "stopped";
- },
- destroy: function(){
- if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
- if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
- }
- });
- d.extend(_chain, _baseObj);
- dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return new _chain(animations)
- };
- var _combine = function(animations){
- this._animations = animations||[];
- this._connects = [];
- this._finished = 0;
- this.duration = 0;
- d.forEach(animations, function(a){
- var duration = a.duration;
- if(a.delay){ duration += a.delay; }
- if(this.duration < duration){ this.duration = duration; }
- this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
- }, this);
-
- this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
- var self = this;
- d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
- function(evt){
- self._connects.push(d.connect(self._pseudoAnimation, evt,
- function(){ self._fire(evt, arguments); }
- ));
- }
- );
- };
- d.extend(_combine, {
- _doAction: function(action, args){
- d.forEach(this._animations, function(a){
- a[action].apply(a, args);
- });
- return this;
- },
- _onEnd: function(){
- if(++this._finished > this._animations.length){
- this._fire("onEnd");
- }
- },
- _call: function(action, args){
- var t = this._pseudoAnimation;
- t[action].apply(t, args);
- },
- play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
- this._finished = 0;
- this._doAction("play", arguments);
- this._call("play", arguments);
- return this;
- },
- pause: function(){
- this._doAction("pause", arguments);
- this._call("pause", arguments);
- return this;
- },
- gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
- var ms = this.duration * percent;
- d.forEach(this._animations, function(a){
- a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
- });
- this._call("gotoPercent", arguments);
- return this;
- },
- stop: function(/*boolean?*/ gotoEnd){
- this._doAction("stop", arguments);
- this._call("stop", arguments);
- return this;
- },
- status: function(){
- return this._pseudoAnimation.status();
- },
- destroy: function(){
- d.forEach(this._connects, dojo.disconnect);
- }
- });
- d.extend(_combine, _baseObj);
- dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return new _combine(animations);
- };
- dojo.fx.wipeIn = function(/*Object*/ args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var node = args.node = d.byId(args.node), s = node.style, o;
- var anim = d.animateProperty(d.mixin({
- properties: {
- height: {
-
- start: function(){
-
-
- o = s.overflow;
- s.overflow = "hidden";
- if(s.visibility == "hidden" || s.display == "none"){
- s.height = "1px";
- s.display = "";
- s.visibility = "";
- return 1;
- }else{
- var height = d.style(node, "height");
- return Math.max(height, 1);
- }
- },
- end: function(){
- return node.scrollHeight;
- }
- }
- }
- }, args));
- d.connect(anim, "onEnd", function(){
- s.height = "auto";
- s.overflow = o;
- });
- return anim;
- };
- dojo.fx.wipeOut = function(/*Object*/ args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var node = args.node = d.byId(args.node), s = node.style, o;
-
- var anim = d.animateProperty(d.mixin({
- properties: {
- height: {
- end: 1
- }
- }
- }, args));
- d.connect(anim, "beforeBegin", function(){
- o = s.overflow;
- s.overflow = "hidden";
- s.display = "";
- });
- d.connect(anim, "onEnd", function(){
- s.overflow = o;
- s.height = "auto";
- s.display = "none";
- });
- return anim;
- };
- dojo.fx.slideTo = function(/*Object*/ args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var node = args.node = d.byId(args.node),
- top = null, left = null;
- var init = (function(n){
- return function(){
- var cs = d.getComputedStyle(n);
- var pos = cs.position;
- top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
- left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
- if(pos != 'absolute' && pos != 'relative'){
- var ret = d.position(n, true);
- top = ret.y;
- left = ret.x;
- n.style.position="absolute";
- n.style.top=top+"px";
- n.style.left=left+"px";
- }
- };
- })(node);
- init();
- var anim = d.animateProperty(d.mixin({
- properties: {
- top: args.top || 0,
- left: args.left || 0
- }
- }, args));
- d.connect(anim, "beforeBegin", anim, init);
- return anim;
- };
- })();
- }
- if(!dojo._hasResource["dojo.fx.easing"]){
- dojo._hasResource["dojo.fx.easing"] = true;
- dojo.provide("dojo.fx.easing");
- dojo.getObject("fx.easing", true, dojo);
- dojo.fx.easing = {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- linear: function(/* Decimal? */n){
-
- return n;
- },
- quadIn: function(/* Decimal? */n){
- return Math.pow(n, 2);
- },
- quadOut: function(/* Decimal? */n){
- return n * (n - 2) * -1;
- },
- quadInOut: function(/* Decimal? */n){
- n = n * 2;
- if(n < 1){ return Math.pow(n, 2) / 2; }
- return -1 * ((--n) * (n - 2) - 1) / 2;
- },
- cubicIn: function(/* Decimal? */n){
- return Math.pow(n, 3);
- },
- cubicOut: function(/* Decimal? */n){
- return Math.pow(n - 1, 3) + 1;
- },
- cubicInOut: function(/* Decimal? */n){
- n = n * 2;
- if(n < 1){ return Math.pow(n, 3) / 2; }
- n -= 2;
- return (Math.pow(n, 3) + 2) / 2;
- },
- quartIn: function(/* Decimal? */n){
- return Math.pow(n, 4);
- },
- quartOut: function(/* Decimal? */n){
- return -1 * (Math.pow(n - 1, 4) - 1);
- },
- quartInOut: function(/* Decimal? */n){
- n = n * 2;
- if(n < 1){ return Math.pow(n, 4) / 2; }
- n -= 2;
- return -1 / 2 * (Math.pow(n, 4) - 2);
- },
- quintIn: function(/* Decimal? */n){
- return Math.pow(n, 5);
- },
- quintOut: function(/* Decimal? */n){
- return Math.pow(n - 1, 5) + 1;
- },
- quintInOut: function(/* Decimal? */n){
- n = n * 2;
- if(n < 1){ return Math.pow(n, 5) / 2; };
- n -= 2;
- return (Math.pow(n, 5) + 2) / 2;
- },
- sineIn: function(/* Decimal? */n){
- return -1 * Math.cos(n * (Math.PI / 2)) + 1;
- },
- sineOut: function(/* Decimal? */n){
- return Math.sin(n * (Math.PI / 2));
- },
- sineInOut: function(/* Decimal? */n){
- return -1 * (Math.cos(Math.PI * n) - 1) / 2;
- },
- expoIn: function(/* Decimal? */n){
- return (n == 0) ? 0 : Math.pow(2, 10 * (n - 1));
- },
- expoOut: function(/* Decimal? */n){
- return (n == 1) ? 1 : (-1 * Math.pow(2, -10 * n) + 1);
- },
- expoInOut: function(/* Decimal? */n){
- if(n == 0){ return 0; }
- if(n == 1){ return 1; }
- n = n * 2;
- if(n < 1){ return Math.pow(2, 10 * (n - 1)) / 2; }
- --n;
- return (-1 * Math.pow(2, -10 * n) + 2) / 2;
- },
- circIn: function(/* Decimal? */n){
- return -1 * (Math.sqrt(1 - Math.pow(n, 2)) - 1);
- },
- circOut: function(/* Decimal? */n){
- n = n - 1;
- return Math.sqrt(1 - Math.pow(n, 2));
- },
- circInOut: function(/* Decimal? */n){
- n = n * 2;
- if(n < 1){ return -1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) - 1); }
- n -= 2;
- return 1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) + 1);
- },
- backIn: function(/* Decimal? */n){
-
-
-
-
-
-
- var s = 1.70158;
- return Math.pow(n, 2) * ((s + 1) * n - s);
- },
- backOut: function(/* Decimal? */n){
-
-
-
-
-
-
-
-
-
- n = n - 1;
- var s = 1.70158;
- return Math.pow(n, 2) * ((s + 1) * n + s) + 1;
- },
- backInOut: function(/* Decimal? */n){
-
-
-
-
-
-
-
- var s = 1.70158 * 1.525;
- n = n * 2;
- if(n < 1){ return (Math.pow(n, 2) * ((s + 1) * n - s)) / 2; }
- n-=2;
- return (Math.pow(n, 2) * ((s + 1) * n + s) + 2) / 2;
- },
- elasticIn: function(/* Decimal? */n){
-
-
-
-
-
-
-
-
- if(n == 0 || n == 1){ return n; }
- var p = .3;
- var s = p / 4;
- n = n - 1;
- return -1 * Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p);
- },
- elasticOut: function(/* Decimal? */n){
-
-
-
-
-
-
-
-
-
-
- if(n==0 || n == 1){ return n; }
- var p = .3;
- var s = p / 4;
- return Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p) + 1;
- },
- elasticInOut: function(/* Decimal? */n){
-
-
-
-
-
-
-
-
-
-
- if(n == 0) return 0;
- n = n * 2;
- if(n == 2) return 1;
- var p = .3 * 1.5;
- var s = p / 4;
- if(n < 1){
- n -= 1;
- return -.5 * (Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p));
- }
- n -= 1;
- return .5 * (Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p)) + 1;
- },
- bounceIn: function(/* Decimal? */n){
-
-
- return (1 - dojo.fx.easing.bounceOut(1 - n));
- },
- bounceOut: function(/* Decimal? */n){
-
-
- var s = 7.5625;
- var p = 2.75;
- var l;
- if(n < (1 / p)){
- l = s * Math.pow(n, 2);
- }else if(n < (2 / p)){
- n -= (1.5 / p);
- l = s * Math.pow(n, 2) + .75;
- }else if(n < (2.5 / p)){
- n -= (2.25 / p);
- l = s * Math.pow(n, 2) + .9375;
- }else{
- n -= (2.625 / p);
- l = s * Math.pow(n, 2) + .984375;
- }
- return l;
- },
- bounceInOut: function(/* Decimal? */n){
-
-
- if(n < 0.5){ return dojo.fx.easing.bounceIn(n * 2) / 2; }
- return (dojo.fx.easing.bounceOut(n * 2 - 1) / 2) + 0.5;
- }
- };
- }
- if(!dojo._hasResource["dojo.io.iframe"]){
- dojo._hasResource["dojo.io.iframe"] = true;
- dojo.provide("dojo.io.iframe");
- dojo.getObject("io", true, dojo);
- dojo.io.iframe = {
-
-
-
- create: function(/*String*/fname, /*String*/onloadstr, /*String?*/uri){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(window[fname]){ return window[fname]; }
- if(window.frames[fname]){ return window.frames[fname]; }
- var cframe = null;
- var turi = uri;
- if(!turi){
- if(dojo.config["useXDomain"] && !dojo.config["dojoBlankHtmlUrl"]){
- console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds,"
- + " please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"
- + " to the path on your domain to blank.html");
- }
- turi = (dojo.config["dojoBlankHtmlUrl"]||dojo.moduleUrl("dojo", "resources/blank.html"));
- }
- var cframe = dojo.place(
- '<iframe id="'+fname+'" name="'+fname+'" src="'+turi+'" onload="'+onloadstr+
- '" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',
- dojo.body());
- window[fname] = cframe;
- return cframe;
- },
- setSrc: function(/*DOMNode*/iframe, /*String*/src, /*Boolean*/replace){
-
-
-
-
- try{
- if(!replace){
- if(dojo.isWebKit){
- iframe.location = src;
- }else{
- frames[iframe.name].location = src;
- }
- }else{
-
- var idoc;
- if(dojo.isIE || dojo.isWebKit){
- idoc = iframe.contentWindow.document;
- }else{
- idoc = iframe.contentWindow;
- }
-
-
-
-
-
- if(!idoc){
- iframe.location = src;
- return;
- }else{
- idoc.location.replace(src);
- }
- }
- }catch(e){
- console.log("dojo.io.iframe.setSrc: ", e);
- }
- },
- doc: function(/*DOMNode*/iframeNode){
-
- var doc = iframeNode.contentDocument ||
- (
- (
- (iframeNode.name) && (iframeNode.document) &&
- (dojo.doc.getElementsByTagName("iframe")[iframeNode.name].contentWindow) &&
- (dojo.doc.getElementsByTagName("iframe")[iframeNode.name].contentWindow.document)
- )
- ) ||
- (
- (iframeNode.name)&&(dojo.doc.frames[iframeNode.name])&&
- (dojo.doc.frames[iframeNode.name].document)
- ) || null;
- return doc;
- },
- send: function(/*dojo.io.iframe.__ioArgs*/args){
-
-
-
-
- if(!this["_frame"]){
- this._frame = this.create(this._iframeName, dojo._scopeName + ".io.iframe._iframeOnload();");
- }
-
- var dfd = dojo._ioSetArgs(
- args,
- function(/*Deferred*/dfd){
-
- dfd.canceled = true;
- dfd.ioArgs._callNext();
- },
- function(/*Deferred*/dfd){
-
- var value = null;
- try{
- var ioArgs = dfd.ioArgs;
- var dii = dojo.io.iframe;
- var ifd = dii.doc(dii._frame);
- var handleAs = ioArgs.handleAs;
-
- value = ifd;
- if(handleAs != "html"){
- if(handleAs == "xml"){
-
-
- if(dojo.isIE < 9 || (dojo.isIE && dojo.isQuirks)){
- dojo.query("a", dii._frame.contentWindow.document.documentElement).orphan();
- var xmlText=(dii._frame.contentWindow.document).documentElement.innerText;
- xmlText=xmlText.replace(/>\s+</g, "><");
- xmlText=dojo.trim(xmlText);
-
-
- var fauxXhr = { responseText: xmlText };
- value = dojo._contentHandlers["xml"](fauxXhr);
- }
- }else{
- value = ifd.getElementsByTagName("textarea")[0].value;
- if(handleAs == "json"){
- value = dojo.fromJson(value);
- }else if(handleAs == "javascript"){
- value = dojo.eval(value);
- }
- }
- }
- }catch(e){
- value = e;
- }finally{
- ioArgs._callNext();
- }
- return value;
- },
- function(/*Error*/error, /*Deferred*/dfd){
-
- dfd.ioArgs._hasError = true;
- dfd.ioArgs._callNext();
- return error;
- }
- );
-
-
- dfd.ioArgs._callNext = function(){
- if(!this["_calledNext"]){
- this._calledNext = true;
- dojo.io.iframe._currentDfd = null;
- dojo.io.iframe._fireNextRequest();
- }
- };
- this._dfdQueue.push(dfd);
- this._fireNextRequest();
-
-
- dojo._ioWatch(
- dfd,
- function(/*Deferred*/dfd){
-
- return !dfd.ioArgs["_hasError"];
- },
- function(dfd){
-
- return (!!dfd.ioArgs["_finished"]);
- },
- function(dfd){
-
- if(dfd.ioArgs._finished){
- dfd.callback(dfd);
- }else{
- dfd.errback(new Error("Invalid dojo.io.iframe request state"));
- }
- }
- );
- return dfd;
- },
- _currentDfd: null,
- _dfdQueue: [],
- _iframeName: dojo._scopeName + "IoIframe",
- _fireNextRequest: function(){
-
- try{
- if((this._currentDfd)||(this._dfdQueue.length == 0)){ return; }
-
- do{
- var dfd = this._currentDfd = this._dfdQueue.shift();
- } while(dfd && dfd.canceled && this._dfdQueue.length);
-
- if(!dfd || dfd.canceled){
- this._currentDfd = null;
- return;
- }
- var ioArgs = dfd.ioArgs;
- var args = ioArgs.args;
- ioArgs._contentToClean = [];
- var fn = dojo.byId(args["form"]);
- var content = args["content"] || {};
- if(fn){
- if(content){
-
-
- var pHandler = function(name, value) {
- dojo.create("input", {type: "hidden", name: name, value: value}, fn);
- ioArgs._contentToClean.push(name);
- };
- for(var x in content){
- var val = content[x];
- if(dojo.isArray(val) && val.length > 1){
- var i;
- for (i = 0; i < val.length; i++) {
- pHandler(x,val[i]);
- }
- }else{
- if(!fn[x]){
- pHandler(x,val);
- }else{
- fn[x].value = val;
- }
- }
- }
- }
-
-
- var actnNode = fn.getAttributeNode("action");
- var mthdNode = fn.getAttributeNode("method");
- var trgtNode = fn.getAttributeNode("target");
- if(args["url"]){
- ioArgs._originalAction = actnNode ? actnNode.value : null;
- if(actnNode){
- actnNode.value = args.url;
- }else{
- fn.setAttribute("action",args.url);
- }
- }
- if(!mthdNode || !mthdNode.value){
- if(mthdNode){
- mthdNode.value= (args["method"]) ? args["method"] : "post";
- }else{
- fn.setAttribute("method", (args["method"]) ? args["method"] : "post");
- }
- }
- ioArgs._originalTarget = trgtNode ? trgtNode.value: null;
- if(trgtNode){
- trgtNode.value = this._iframeName;
- }else{
- fn.setAttribute("target", this._iframeName);
- }
- fn.target = this._iframeName;
- dojo._ioNotifyStart(dfd);
- fn.submit();
- }else{
-
-
- var tmpUrl = args.url + (args.url.indexOf("?") > -1 ? "&" : "?") + ioArgs.query;
- dojo._ioNotifyStart(dfd);
- this.setSrc(this._frame, tmpUrl, true);
- }
- }catch(e){
- dfd.errback(e);
- }
- },
- _iframeOnload: function(){
- var dfd = this._currentDfd;
- if(!dfd){
- this._fireNextRequest();
- return;
- }
- var ioArgs = dfd.ioArgs;
- var args = ioArgs.args;
- var fNode = dojo.byId(args.form);
-
- if(fNode){
-
- var toClean = ioArgs._contentToClean;
- for(var i = 0; i < toClean.length; i++) {
- var key = toClean[i];
-
-
-
- for(var j = 0; j < fNode.childNodes.length; j++){
- var chNode = fNode.childNodes[j];
- if(chNode.name == key){
- dojo.destroy(chNode);
- break;
- }
- }
- }
-
- if(ioArgs["_originalAction"]){
- fNode.setAttribute("action", ioArgs._originalAction);
- }
- if(ioArgs["_originalTarget"]){
- fNode.setAttribute("target", ioArgs._originalTarget);
- fNode.target = ioArgs._originalTarget;
- }
- }
- ioArgs._finished = true;
- }
- };
- }
- if(!dojo._hasResource["dojo.number"]){
- dojo._hasResource["dojo.number"] = true;
- dojo.provide("dojo.number");
- dojo.getObject("number", true, dojo);
- dojo.number.format = function(/*Number*/value, /*dojo.number.__FormatOptions?*/options){
-
-
-
-
-
-
-
-
-
-
- options = dojo.mixin({}, options || {});
- var locale = dojo.i18n.normalizeLocale(options.locale),
- bundle = dojo.i18n.getLocalization("dojo.cldr", "number", locale);
- options.customs = bundle;
- var pattern = options.pattern || bundle[(options.type || "decimal") + "Format"];
- if(isNaN(value) || Math.abs(value) == Infinity){ return null; }
- return dojo.number._applyPattern(value, pattern, options);
- };
- dojo.number._numberPatternRE = /[#0,]*[#0](?:\.0*#*)?/;
- dojo.number._applyPattern = function(/*Number*/value, /*String*/pattern, /*dojo.number.__FormatOptions?*/options){
-
-
-
-
-
-
-
-
-
-
-
-
-
- options = options || {};
- var group = options.customs.group,
- decimal = options.customs.decimal,
- patternList = pattern.split(';'),
- positivePattern = patternList[0];
- pattern = patternList[(value < 0) ? 1 : 0] || ("-" + positivePattern);
-
- if(pattern.indexOf('%') != -1){
- value *= 100;
- }else if(pattern.indexOf('\u2030') != -1){
- value *= 1000;
- }else if(pattern.indexOf('\u00a4') != -1){
- group = options.customs.currencyGroup || group;
- decimal = options.customs.currencyDecimal || decimal;
- pattern = pattern.replace(/\u00a4{1,3}/, function(match){
- var prop = ["symbol", "currency", "displayName"][match.length-1];
- return options[prop] || options.currency || "";
- });
- }else if(pattern.indexOf('E') != -1){
- throw new Error("exponential notation not supported");
- }
-
-
- var numberPatternRE = dojo.number._numberPatternRE;
- var numberPattern = positivePattern.match(numberPatternRE);
- if(!numberPattern){
- throw new Error("unable to find a number expression in pattern: "+pattern);
- }
- if(options.fractional === false){ options.places = 0; }
- return pattern.replace(numberPatternRE,
- dojo.number._formatAbsolute(value, numberPattern[0], {decimal: decimal, group: group, places: options.places, round: options.round}));
- };
- dojo.number.round = function(/*Number*/value, /*Number?*/places, /*Number?*/increment){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var factor = 10 / (increment || 10);
- return (factor * +value).toFixed(places) / factor;
- };
- if((0.9).toFixed() == 0){
-
-
- (function(){
- var round = dojo.number.round;
- dojo.number.round = function(v, p, m){
- var d = Math.pow(10, -p || 0), a = Math.abs(v);
- if(!v || a >= d || a * Math.pow(10, p + 1) < 5){
- d = 0;
- }
- return round(v, p, m) + (v > 0 ? d : -d);
- };
- })();
- }
- dojo.number._formatAbsolute = function(/*Number*/value, /*String*/pattern, /*dojo.number.__FormatAbsoluteOptions?*/options){
-
-
-
-
-
-
-
- options = options || {};
- if(options.places === true){options.places=0;}
- if(options.places === Infinity){options.places=6;}
- var patternParts = pattern.split("."),
- comma = typeof options.places == "string" && options.places.indexOf(","),
- maxPlaces = options.places;
- if(comma){
- maxPlaces = options.places.substring(comma + 1);
- }else if(!(maxPlaces >= 0)){
- maxPlaces = (patternParts[1] || []).length;
- }
- if(!(options.round < 0)){
- value = dojo.number.round(value, maxPlaces, options.round);
- }
- var valueParts = String(Math.abs(value)).split("."),
- fractional = valueParts[1] || "";
- if(patternParts[1] || options.places){
- if(comma){
- options.places = options.places.substring(0, comma);
- }
-
- var pad = options.places !== undefined ? options.places : (patternParts[1] && patternParts[1].lastIndexOf("0") + 1);
- if(pad > fractional.length){
- valueParts[1] = dojo.string.pad(fractional, pad, '0', true);
- }
-
- if(maxPlaces < fractional.length){
- valueParts[1] = fractional.substr(0, maxPlaces);
- }
- }else{
- if(valueParts[1]){ valueParts.pop(); }
- }
-
- var patternDigits = patternParts[0].replace(',', '');
- pad = patternDigits.indexOf("0");
- if(pad != -1){
- pad = patternDigits.length - pad;
- if(pad > valueParts[0].length){
- valueParts[0] = dojo.string.pad(valueParts[0], pad);
- }
-
- if(patternDigits.indexOf("#") == -1){
- valueParts[0] = valueParts[0].substr(valueParts[0].length - pad);
- }
- }
-
- var index = patternParts[0].lastIndexOf(','),
- groupSize, groupSize2;
- if(index != -1){
- groupSize = patternParts[0].length - index - 1;
- var remainder = patternParts[0].substr(0, index);
- index = remainder.lastIndexOf(',');
- if(index != -1){
- groupSize2 = remainder.length - index - 1;
- }
- }
- var pieces = [];
- for(var whole = valueParts[0]; whole;){
- var off = whole.length - groupSize;
- pieces.push((off > 0) ? whole.substr(off) : whole);
- whole = (off > 0) ? whole.slice(0, off) : "";
- if(groupSize2){
- groupSize = groupSize2;
- delete groupSize2;
- }
- }
- valueParts[0] = pieces.reverse().join(options.group || ",");
- return valueParts.join(options.decimal || ".");
- };
- dojo.number.regexp = function(/*dojo.number.__RegexpOptions?*/options){
-
-
-
-
-
- return dojo.number._parseInfo(options).regexp;
- };
- dojo.number._parseInfo = function(/*Object?*/options){
- options = options || {};
- var locale = dojo.i18n.normalizeLocale(options.locale),
- bundle = dojo.i18n.getLocalization("dojo.cldr", "number", locale),
- pattern = options.pattern || bundle[(options.type || "decimal") + "Format"],
- group = bundle.group,
- decimal = bundle.decimal,
- factor = 1;
- if(pattern.indexOf('%') != -1){
- factor /= 100;
- }else if(pattern.indexOf('\u2030') != -1){
- factor /= 1000;
- }else{
- var isCurrency = pattern.indexOf('\u00a4') != -1;
- if(isCurrency){
- group = bundle.currencyGroup || group;
- decimal = bundle.currencyDecimal || decimal;
- }
- }
-
- var patternList = pattern.split(';');
- if(patternList.length == 1){
- patternList.push("-" + patternList[0]);
- }
- var re = dojo.regexp.buildGroupRE(patternList, function(pattern){
- pattern = "(?:"+dojo.regexp.escapeString(pattern, '.')+")";
- return pattern.replace(dojo.number._numberPatternRE, function(format){
- var flags = {
- signed: false,
- separator: options.strict ? group : [group,""],
- fractional: options.fractional,
- decimal: decimal,
- exponent: false
- },
- parts = format.split('.'),
- places = options.places;
-
-
- if(parts.length == 1 && factor != 1){
- parts[1] = "###";
- }
- if(parts.length == 1 || places === 0){
- flags.fractional = false;
- }else{
- if(places === undefined){ places = options.pattern ? parts[1].lastIndexOf('0') + 1 : Infinity; }
- if(places && options.fractional == undefined){flags.fractional = true;}
- if(!options.places && (places < parts[1].length)){ places += "," + parts[1].length; }
- flags.places = places;
- }
- var groups = parts[0].split(',');
- if(groups.length > 1){
- flags.groupSize = groups.pop().length;
- if(groups.length > 1){
- flags.groupSize2 = groups.pop().length;
- }
- }
- return "("+dojo.number._realNumberRegexp(flags)+")";
- });
- }, true);
- if(isCurrency){
-
- re = re.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g, function(match, before, target, after){
- var prop = ["symbol", "currency", "displayName"][target.length-1],
- symbol = dojo.regexp.escapeString(options[prop] || options.currency || "");
- before = before ? "[\\s\\xa0]" : "";
- after = after ? "[\\s\\xa0]" : "";
- if(!options.strict){
- if(before){before += "*";}
- if(after){after += "*";}
- return "(?:"+before+symbol+after+")?";
- }
- return before+symbol+after;
- });
- }
-
- return {regexp: re.replace(/[\xa0 ]/g, "[\\s\\xa0]"), group: group, decimal: decimal, factor: factor};
- };
- dojo.number.parse = function(/*String*/expression, /*dojo.number.__ParseOptions?*/options){
-
-
-
-
-
-
-
-
-
-
-
- var info = dojo.number._parseInfo(options),
- results = (new RegExp("^"+info.regexp+"$")).exec(expression);
- if(!results){
- return NaN;
- }
- var absoluteMatch = results[1];
- if(!results[1]){
- if(!results[2]){
- return NaN;
- }
-
- absoluteMatch =results[2];
- info.factor *= -1;
- }
-
-
- absoluteMatch = absoluteMatch.
- replace(new RegExp("["+info.group + "\\s\\xa0"+"]", "g"), "").
- replace(info.decimal, ".");
-
- return absoluteMatch * info.factor;
- };
- dojo.number._realNumberRegexp = function(/*dojo.number.__RealNumberRegexpFlags?*/flags){
-
-
-
-
- flags = flags || {};
-
- if(!("places" in flags)){ flags.places = Infinity; }
- if(typeof flags.decimal != "string"){ flags.decimal = "."; }
- if(!("fractional" in flags) || /^0/.test(flags.places)){ flags.fractional = [true, false]; }
- if(!("exponent" in flags)){ flags.exponent = [true, false]; }
- if(!("eSigned" in flags)){ flags.eSigned = [true, false]; }
- var integerRE = dojo.number._integerRegexp(flags),
- decimalRE = dojo.regexp.buildGroupRE(flags.fractional,
- function(q){
- var re = "";
- if(q && (flags.places!==0)){
- re = "\\" + flags.decimal;
- if(flags.places == Infinity){
- re = "(?:" + re + "\\d+)?";
- }else{
- re += "\\d{" + flags.places + "}";
- }
- }
- return re;
- },
- true
- );
- var exponentRE = dojo.regexp.buildGroupRE(flags.exponent,
- function(q){
- if(q){ return "([eE]" + dojo.number._integerRegexp({ signed: flags.eSigned}) + ")"; }
- return "";
- }
- );
- var realRE = integerRE + decimalRE;
-
- if(decimalRE){realRE = "(?:(?:"+ realRE + ")|(?:" + decimalRE + "))";}
- return realRE + exponentRE;
- };
- dojo.number._integerRegexp = function(/*dojo.number.__IntegerRegexpFlags?*/flags){
-
-
-
- flags = flags || {};
- if(!("signed" in flags)){ flags.signed = [true, false]; }
- if(!("separator" in flags)){
- flags.separator = "";
- }else if(!("groupSize" in flags)){
- flags.groupSize = 3;
- }
- var signRE = dojo.regexp.buildGroupRE(flags.signed,
- function(q){ return q ? "[-+]" : ""; },
- true
- );
- var numberRE = dojo.regexp.buildGroupRE(flags.separator,
- function(sep){
- if(!sep){
- return "(?:\\d+)";
- }
- sep = dojo.regexp.escapeString(sep);
- if(sep == " "){ sep = "\\s"; }
- else if(sep == "\xa0"){ sep = "\\s\\xa0"; }
- var grp = flags.groupSize, grp2 = flags.groupSize2;
-
- if(grp2){
- var grp2RE = "(?:0|[1-9]\\d{0," + (grp2-1) + "}(?:[" + sep + "]\\d{" + grp2 + "})*[" + sep + "]\\d{" + grp + "})";
- return ((grp-grp2) > 0) ? "(?:" + grp2RE + "|(?:0|[1-9]\\d{0," + (grp-1) + "}))" : grp2RE;
- }
- return "(?:0|[1-9]\\d{0," + (grp-1) + "}(?:[" + sep + "]\\d{" + grp + "})*)";
- },
- true
- );
- return signRE + numberRE;
- };
- }
- if(!dojo._hasResource["dojo.AdapterRegistry"]){
- dojo._hasResource["dojo.AdapterRegistry"] = true;
- dojo.provide("dojo.AdapterRegistry");
- dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.pairs = [];
- this.returnWrappers = returnWrappers || false;
- };
- dojo.extend(dojo.AdapterRegistry, {
- register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
- },
- match: function(/* ... */){
-
-
-
-
-
- for(var i = 0; i < this.pairs.length; i++){
- var pair = this.pairs[i];
- if(pair[1].apply(this, arguments)){
- if((pair[3])||(this.returnWrappers)){
- return pair[2];
- }else{
- return pair[2].apply(this, arguments);
- }
- }
- }
- throw new Error("No match found");
- },
- unregister: function(name){
-
-
-
-
- for(var i = 0; i < this.pairs.length; i++){
- var pair = this.pairs[i];
- if(pair[0] == name){
- this.pairs.splice(i, 1);
- return true;
- }
- }
- return false;
- }
- });
- }
- if(!dojo._hasResource["dijit._base.place"]){
- dojo._hasResource["dijit._base.place"] = true;
- dojo.provide("dijit._base.place");
- dijit.getViewport = function(){
-
-
- return dojo.window.getBox();
- };
- dijit.placeOnScreen = function(
- /* DomNode */ node,
- /* dijit.__Position */ pos,
- /* String[] */ corners,
- /* dijit.__Position? */ padding){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var choices = dojo.map(corners, function(corner){
- var c = { corner: corner, pos: {x:pos.x,y:pos.y} };
- if(padding){
- c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x;
- c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y;
- }
- return c;
- });
- return dijit._place(node, choices);
- }
- dijit._place = function(/*DomNode*/ node, choices, layoutNode, /*Object*/ aroundNodeCoords){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var view = dojo.window.getBox();
-
-
-
- if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){
- dojo.body().appendChild(node);
- }
- var best = null;
- dojo.some(choices, function(choice){
- var corner = choice.corner;
- var pos = choice.pos;
- var overflow = 0;
-
- var spaceAvailable = {
- w: corner.charAt(1) == 'L' ? (view.l + view.w) - pos.x : pos.x - view.l,
- h: corner.charAt(1) == 'T' ? (view.t + view.h) - pos.y : pos.y - view.t
- };
-
-
-
- if(layoutNode){
- var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords);
- overflow = typeof res == "undefined" ? 0 : res;
- }
-
- var style = node.style;
- var oldDisplay = style.display;
- var oldVis = style.visibility;
- style.visibility = "hidden";
- style.display = "";
- var mb = dojo.marginBox(node);
- style.display = oldDisplay;
- style.visibility = oldVis;
-
-
- var startX = Math.max(view.l, corner.charAt(1) == 'L' ? pos.x : (pos.x - mb.w)),
- startY = Math.max(view.t, corner.charAt(0) == 'T' ? pos.y : (pos.y - mb.h)),
- endX = Math.min(view.l + view.w, corner.charAt(1) == 'L' ? (startX + mb.w) : pos.x),
- endY = Math.min(view.t + view.h, corner.charAt(0) == 'T' ? (startY + mb.h) : pos.y),
- width = endX - startX,
- height = endY - startY;
- overflow += (mb.w - width) + (mb.h - height);
- if(best == null || overflow < best.overflow){
- best = {
- corner: corner,
- aroundCorner: choice.aroundCorner,
- x: startX,
- y: startY,
- w: width,
- h: height,
- overflow: overflow,
- spaceAvailable: spaceAvailable
- };
- }
-
- return !overflow;
- });
-
-
- if(best.overflow && layoutNode){
- layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);
- }
-
-
-
-
-
-
-
- var l = dojo._isBodyLtr(),
- s = node.style;
- s.top = best.y + "px";
- s[l ? "left" : "right"] = (l ? best.x : view.w - best.x - best.w) + "px";
- s[l ? "right" : "left"] = "auto";
- return best;
- }
- dijit.placeOnScreenAroundNode = function(
- /* DomNode */ node,
- /* DomNode */ aroundNode,
- /* Object */ aroundCorners,
- /* Function? */ layoutNode){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- aroundNode = dojo.byId(aroundNode);
- var aroundNodePos = dojo.position(aroundNode, true);
-
- return dijit._placeOnScreenAroundRect(node,
- aroundNodePos.x, aroundNodePos.y, aroundNodePos.w, aroundNodePos.h,
- aroundCorners, layoutNode);
- };
- dijit.placeOnScreenAroundRectangle = function(
- /* DomNode */ node,
- /* dijit.__Rectangle */ aroundRect,
- /* Object */ aroundCorners,
- /* Function */ layoutNode){
-
-
-
-
- return dijit._placeOnScreenAroundRect(node,
- aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height,
- aroundCorners, layoutNode);
- };
- dijit._placeOnScreenAroundRect = function(
- /* DomNode */ node,
- /* Number */ x,
- /* Number */ y,
- /* Number */ width,
- /* Number */ height,
- /* Object */ aroundCorners,
- /* Function */ layoutNode){
-
-
-
-
-
- var choices = [];
- for(var nodeCorner in aroundCorners){
- choices.push( {
- aroundCorner: nodeCorner,
- corner: aroundCorners[nodeCorner],
- pos: {
- x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width),
- y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height)
- }
- });
- }
- return dijit._place(node, choices, layoutNode, {w: width, h: height});
- };
- dijit.placementRegistry= new dojo.AdapterRegistry();
- dijit.placementRegistry.register("node",
- function(n, x){
- return typeof x == "object" &&
- typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
- },
- dijit.placeOnScreenAroundNode);
- dijit.placementRegistry.register("rect",
- function(n, x){
- return typeof x == "object" &&
- "x" in x && "y" in x && "width" in x && "height" in x;
- },
- dijit.placeOnScreenAroundRectangle);
- dijit.placeOnScreenAroundElement = function(
- /* DomNode */ node,
- /* Object */ aroundElement,
- /* Object */ aroundCorners,
- /* Function */ layoutNode){
-
-
-
- return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
- };
- dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var align = {};
- dojo.forEach(position, function(pos){
- switch(pos){
- case "after":
- align[leftToRight ? "BR" : "BL"] = leftToRight ? "BL" : "BR";
- break;
- case "before":
- align[leftToRight ? "BL" : "BR"] = leftToRight ? "BR" : "BL";
- break;
- case "below-alt":
- leftToRight = !leftToRight;
-
- case "below":
-
- align[leftToRight ? "BL" : "BR"] = leftToRight ? "TL" : "TR";
- align[leftToRight ? "BR" : "BL"] = leftToRight ? "TR" : "TL";
- break;
- case "above-alt":
- leftToRight = !leftToRight;
-
- case "above":
- default:
-
- align[leftToRight ? "TL" : "TR"] = leftToRight ? "BL" : "BR";
- align[leftToRight ? "TR" : "TL"] = leftToRight ? "BR" : "BL";
- break;
- }
- });
- return align;
- };
- }
- if(!dojo._hasResource["dijit._Container"]){
- dojo._hasResource["dijit._Container"] = true;
- dojo.provide("dijit._Container");
- dojo.declare("dijit._Container",
- null,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- isContainer: true,
- buildRendering: function(){
- this.inherited(arguments);
- if(!this.containerNode){
-
- this.containerNode = this.domNode;
- }
- },
- addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
-
-
-
-
-
- var refNode = this.containerNode;
- if(insertIndex && typeof insertIndex == "number"){
- var children = this.getChildren();
- if(children && children.length >= insertIndex){
- refNode = children[insertIndex-1].domNode;
- insertIndex = "after";
- }
- }
- dojo.place(widget.domNode, refNode, insertIndex);
-
-
-
-
- if(this._started && !widget._started){
- widget.startup();
- }
- },
- removeChild: function(/*Widget or int*/ widget){
-
-
-
-
- if(typeof widget == "number"){
- widget = this.getChildren()[widget];
- }
- if(widget){
- var node = widget.domNode;
- if(node && node.parentNode){
- node.parentNode.removeChild(node);
- }
- }
- },
- hasChildren: function(){
-
-
- return this.getChildren().length > 0;
- },
- destroyDescendants: function(/*Boolean*/ preserveDom){
-
-
-
- dojo.forEach(this.getChildren(), function(child){ child.destroyRecursive(preserveDom); });
- },
- _getSiblingOfChild: function(/*dijit._Widget*/ child, /*int*/ dir){
-
-
-
-
-
-
-
- var node = child.domNode,
- which = (dir>0 ? "nextSibling" : "previousSibling");
- do{
- node = node[which];
- }while(node && (node.nodeType != 1 || !dijit.byNode(node)));
- return node && dijit.byNode(node);
- },
- getIndexOfChild: function(/*dijit._Widget*/ child){
-
-
- return dojo.indexOf(this.getChildren(), child);
- },
- startup: function(){
-
-
-
-
-
-
-
-
-
-
- if(this._started){ return; }
-
- dojo.forEach(this.getChildren(), function(child){ child.startup(); });
- this.inherited(arguments);
- }
- }
- );
- }
- if(!dojo._hasResource["dijit._base.manager"]){
- dojo._hasResource["dijit._base.manager"] = true;
- dojo.provide("dijit._base.manager");
- dojo.declare("dijit.WidgetSet", null, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- constructor: function(){
- this._hash = {};
- this.length = 0;
- },
- add: function(/*dijit._Widget*/ widget){
-
-
-
-
-
- if(this._hash[widget.id]){
- throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
- }
- this._hash[widget.id] = widget;
- this.length++;
- },
- remove: function(/*String*/ id){
-
-
-
- if(this._hash[id]){
- delete this._hash[id];
- this.length--;
- }
- },
- forEach: function(/*Function*/ func, /* Object? */thisObj){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- thisObj = thisObj || dojo.global;
- var i = 0, id;
- for(id in this._hash){
- func.call(thisObj, this._hash[id], i++, this._hash);
- }
- return this;
- },
- filter: function(/*Function*/ filter, /* Object? */thisObj){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- thisObj = thisObj || dojo.global;
- var res = new dijit.WidgetSet(), i = 0, id;
- for(id in this._hash){
- var w = this._hash[id];
- if(filter.call(thisObj, w, i++, this._hash)){
- res.add(w);
- }
- }
- return res;
- },
- byId: function(/*String*/ id){
-
-
-
-
-
-
-
-
- return this._hash[id];
- },
- byClass: function(/*String*/ cls){
-
-
-
-
-
-
-
-
-
- var res = new dijit.WidgetSet(), id, widget;
- for(id in this._hash){
- widget = this._hash[id];
- if(widget.declaredClass == cls){
- res.add(widget);
- }
- }
- return res;
- },
- toArray: function(){
-
-
-
-
-
-
- var ar = [];
- for(var id in this._hash){
- ar.push(this._hash[id]);
- }
- return ar;
- },
- map: function(/* Function */func, /* Object? */thisObj){
-
-
-
-
-
-
-
- return dojo.map(this.toArray(), func, thisObj);
- },
- every: function(func, thisObj){
-
-
-
-
-
-
-
-
-
- thisObj = thisObj || dojo.global;
- var x = 0, i;
- for(i in this._hash){
- if(!func.call(thisObj, this._hash[i], x++, this._hash)){
- return false;
- }
- }
- return true;
- },
- some: function(func, thisObj){
-
-
-
-
-
-
-
-
-
- thisObj = thisObj || dojo.global;
- var x = 0, i;
- for(i in this._hash){
- if(func.call(thisObj, this._hash[i], x++, this._hash)){
- return true;
- }
- }
- return false;
- }
- });
- (function(){
-
- dijit.registry = new dijit.WidgetSet();
- var hash = dijit.registry._hash,
- attr = dojo.attr,
- hasAttr = dojo.hasAttr,
- style = dojo.style;
- dijit.byId = function(/*String|dijit._Widget*/ id){
-
-
- return typeof id == "string" ? hash[id] : id;
- };
- var _widgetTypeCtr = {};
- dijit.getUniqueId = function(/*String*/widgetType){
-
-
-
- var id;
- do{
- id = widgetType + "_" +
- (widgetType in _widgetTypeCtr ?
- ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
- }while(hash[id]);
- return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id;
- };
-
- dijit.findWidgets = function(/*DomNode*/ root){
-
-
-
-
- var outAry = [];
-
- function getChildrenHelper(root){
- for(var node = root.firstChild; node; node = node.nextSibling){
- if(node.nodeType == 1){
- var widgetId = node.getAttribute("widgetId");
- if(widgetId){
- var widget = hash[widgetId];
- if(widget){
- outAry.push(widget);
- }
- }else{
- getChildrenHelper(node);
- }
- }
- }
- }
-
- getChildrenHelper(root);
- return outAry;
- };
-
- dijit._destroyAll = function(){
-
-
-
-
- dijit._curFocus = null;
- dijit._prevFocus = null;
- dijit._activeStack = [];
-
-
- dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
-
-
- if(!widget._destroyed){
- if(widget.destroyRecursive){
- widget.destroyRecursive();
- }else if(widget.destroy){
- widget.destroy();
- }
- }
- });
- };
-
- if(dojo.isIE){
-
-
- dojo.addOnWindowUnload(function(){
- dijit._destroyAll();
- });
- }
-
- dijit.byNode = function(/*DOMNode*/ node){
-
-
- return hash[node.getAttribute("widgetId")];
- };
-
- dijit.getEnclosingWidget = function(/*DOMNode*/ node){
-
-
-
- while(node){
- var id = node.getAttribute && node.getAttribute("widgetId");
- if(id){
- return hash[id];
- }
- node = node.parentNode;
- }
- return null;
- };
- var shown = (dijit._isElementShown = function(/*Element*/ elem){
- var s = style(elem);
- return (s.visibility != "hidden")
- && (s.visibility != "collapsed")
- && (s.display != "none")
- && (attr(elem, "type") != "hidden");
- });
-
- dijit.hasDefaultTabStop = function(/*Element*/ elem){
-
-
-
-
- switch(elem.nodeName.toLowerCase()){
- case "a":
-
- return hasAttr(elem, "href");
- case "area":
- case "button":
- case "input":
- case "object":
- case "select":
- case "textarea":
-
- return true;
- case "iframe":
-
- var body;
- try{
-
- var contentDocument = elem.contentDocument;
- if("designMode" in contentDocument && contentDocument.designMode == "on"){
- return true;
- }
- body = contentDocument.body;
- }catch(e1){
-
-
-
- try{
- body = elem.contentWindow.document.body;
- }catch(e2){
- return false;
- }
- }
- return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
- default:
- return elem.contentEditable == 'true';
- }
- };
-
- var isTabNavigable = (dijit.isTabNavigable = function(/*Element*/ elem){
-
-
-
-
- if(attr(elem, "disabled")){
- return false;
- }else if(hasAttr(elem, "tabIndex")){
-
- return attr(elem, "tabIndex") >= 0;
- }else{
-
- return dijit.hasDefaultTabStop(elem);
- }
- });
- dijit._getTabNavigable = function(/*DOMNode*/ root){
-
-
-
-
-
-
-
-
-
-
-
-
-
- var first, last, lowest, lowestTabindex, highest, highestTabindex, radioSelected = {};
- function radioName(node) {
-
- return node && node.tagName.toLowerCase() == "input" &&
- node.type && node.type.toLowerCase() == "radio" &&
- node.name && node.name.toLowerCase();
- }
- var walkTree = function(/*DOMNode*/parent){
- dojo.query("> *", parent).forEach(function(child){
-
-
- if((dojo.isIE <= 9 && child.scopeName !== "HTML") || !shown(child)){
- return;
- }
- if(isTabNavigable(child)){
- var tabindex = attr(child, "tabIndex");
- if(!hasAttr(child, "tabIndex") || tabindex == 0){
- if(!first){ first = child; }
- last = child;
- }else if(tabindex > 0){
- if(!lowest || tabindex < lowestTabindex){
- lowestTabindex = tabindex;
- lowest = child;
- }
- if(!highest || tabindex >= highestTabindex){
- highestTabindex = tabindex;
- highest = child;
- }
- }
- var rn = radioName(child);
- if(dojo.attr(child, "checked") && rn) {
- radioSelected[rn] = child;
- }
- }
- if(child.nodeName.toUpperCase() != 'SELECT'){
- walkTree(child);
- }
- });
- };
- if(shown(root)){ walkTree(root) }
- function rs(node) {
-
- return radioSelected[radioName(node)] || node;
- }
- return { first: rs(first), last: rs(last), lowest: rs(lowest), highest: rs(highest) };
- }
- dijit.getFirstInTabbingOrder = function(/*String|DOMNode*/ root){
-
-
-
- var elems = dijit._getTabNavigable(dojo.byId(root));
- return elems.lowest ? elems.lowest : elems.first;
- };
-
- dijit.getLastInTabbingOrder = function(/*String|DOMNode*/ root){
-
-
-
- var elems = dijit._getTabNavigable(dojo.byId(root));
- return elems.last ? elems.last : elems.highest;
- };
-
-
-
- dijit.defaultDuration = dojo.config["defaultDuration"] || 200;
- })();
- }
- if(!dojo._hasResource["dojo.Stateful"]){
- dojo._hasResource["dojo.Stateful"] = true;
- dojo.provide("dojo.Stateful");
- dojo.declare("dojo.Stateful", null, {
-
-
-
-
-
-
-
-
-
- postscript: function(mixin){
- if(mixin){
- dojo.mixin(this, mixin);
- }
- },
-
- get: function(/*String*/name){
-
-
-
-
-
-
-
-
-
-
-
-
-
- return this[name];
- },
- set: function(/*String*/name, /*Object*/value){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(typeof name === "object"){
- for(var x in name){
- this.set(x, name[x]);
- }
- return this;
- }
- var oldValue = this[name];
- this[name] = value;
- if(this._watchCallbacks){
- this._watchCallbacks(name, oldValue, value);
- }
- return this;
- },
- watch: function(/*String?*/name, /*Function*/callback){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var callbacks = this._watchCallbacks;
- if(!callbacks){
- var self = this;
- callbacks = this._watchCallbacks = function(name, oldValue, value, ignoreCatchall){
- var notify = function(propertyCallbacks){
- if(propertyCallbacks){
- propertyCallbacks = propertyCallbacks.slice();
- for(var i = 0, l = propertyCallbacks.length; i < l; i++){
- try{
- propertyCallbacks[i].call(self, name, oldValue, value);
- }catch(e){
- console.error(e);
- }
- }
- }
- };
- notify(callbacks['_' + name]);
- if(!ignoreCatchall){
- notify(callbacks["*"]);
- }
- };
- }
- if(!callback && typeof name === "function"){
- callback = name;
- name = "*";
- }else{
-
- name = '_' + name;
- }
- var propertyCallbacks = callbacks[name];
- if(typeof propertyCallbacks !== "object"){
- propertyCallbacks = callbacks[name] = [];
- }
- propertyCallbacks.push(callback);
- return {
- unwatch: function(){
- propertyCallbacks.splice(dojo.indexOf(propertyCallbacks, callback), 1);
- }
- };
- }
-
- });
- }
- if(!dojo._hasResource["dijit._WidgetBase"]){
- dojo._hasResource["dijit._WidgetBase"] = true;
- dojo.provide("dijit._WidgetBase");
- (function(){
- function isEqual(a, b){
-
-
-
-
- return a === b || ( a !== a && b !== b);
- }
- dojo.declare("dijit._WidgetBase", dojo.Stateful, {
-
-
-
-
-
-
-
-
- id: "",
-
-
-
-
-
- lang: "",
-
-
-
-
- dir: "",
-
-
- "class": "",
-
-
- style: "",
-
-
-
-
-
-
-
-
- title: "",
-
-
-
- tooltip: "",
-
-
-
- baseClass: "",
-
-
- srcNodeRef: null,
-
-
-
-
-
- domNode: null,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- containerNode: null,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""},
-
-
-
- _blankGif: (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")).toString(),
-
- postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
-
-
-
-
- this.create(params, srcNodeRef);
- },
- create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.srcNodeRef = dojo.byId(srcNodeRef);
-
-
- this._connects = [];
-
-
- this._subscribes = [];
-
- if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; }
- if(params){
- this.params = params;
- dojo._mixin(this, params);
- }
- this.postMixInProperties();
-
-
-
- if(!this.id){
- this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
- }
- dijit.registry.add(this);
- this.buildRendering();
- if(this.domNode){
-
-
- this._applyAttributes();
-
-
-
-
- var source = this.srcNodeRef;
- if(source && source.parentNode && this.domNode !== source){
- source.parentNode.replaceChild(this.domNode, source);
- }
- }
- if(this.domNode){
-
-
- this.domNode.setAttribute("widgetId", this.id);
- }
- this.postCreate();
-
- if(this.srcNodeRef && !this.srcNodeRef.parentNode){
- delete this.srcNodeRef;
- }
- this._created = true;
- },
- _applyAttributes: function(){
-
-
-
-
-
-
-
-
-
-
-
-
-
- var condAttrApply = function(attr, scope){
- if((scope.params && attr in scope.params) || scope[attr]){
- scope.set(attr, scope[attr]);
- }
- };
-
- for(var attr in this.attributeMap){
- condAttrApply(attr, this);
- }
-
- dojo.forEach(this._getSetterAttributes(), function(a){
- if(!(a in this.attributeMap)){
- condAttrApply(a, this);
- }
- }, this);
- },
- _getSetterAttributes: function(){
-
-
- var ctor = this.constructor;
- if(!ctor._setterAttrs){
- var r = (ctor._setterAttrs = []),
- attrs,
- proto = ctor.prototype;
- for(var fxName in proto){
- if(dojo.isFunction(proto[fxName]) && (attrs = fxName.match(/^_set([a-zA-Z]*)Attr$/)) && attrs[1]){
- r.push(attrs[1].charAt(0).toLowerCase() + attrs[1].substr(1));
- }
- }
- }
- return ctor._setterAttrs;
- },
- postMixInProperties: function(){
-
-
-
-
-
-
-
- },
- buildRendering: function(){
-
-
-
-
-
-
-
- if(!this.domNode){
-
- this.domNode = this.srcNodeRef || dojo.create('div');
- }
-
-
-
- if(this.baseClass){
- var classes = this.baseClass.split(" ");
- if(!this.isLeftToRight()){
- classes = classes.concat( dojo.map(classes, function(name){ return name+"Rtl"; }));
- }
- dojo.addClass(this.domNode, classes);
- }
- },
- postCreate: function(){
-
-
-
-
-
-
-
-
- },
- startup: function(){
-
-
-
-
-
-
-
- this._started = true;
- },
-
- destroyRecursive: function(/*Boolean?*/ preserveDom){
-
-
-
-
-
-
-
-
-
-
- this._beingDestroyed = true;
- this.destroyDescendants(preserveDom);
- this.destroy(preserveDom);
- },
- destroy: function(/*Boolean*/ preserveDom){
-
-
-
-
-
-
- this._beingDestroyed = true;
- this.uninitialize();
- var d = dojo,
- dfe = d.forEach,
- dun = d.unsubscribe;
- dfe(this._connects, function(array){
- dfe(array, d.disconnect);
- });
- dfe(this._subscribes, function(handle){
- dun(handle);
- });
-
- dfe(this._supportingWidgets || [], function(w){
- if(w.destroyRecursive){
- w.destroyRecursive();
- }else if(w.destroy){
- w.destroy();
- }
- });
- this.destroyRendering(preserveDom);
- dijit.registry.remove(this.id);
- this._destroyed = true;
- },
- destroyRendering: function(/*Boolean?*/ preserveDom){
-
-
-
-
-
-
-
-
- if(this.bgIframe){
- this.bgIframe.destroy(preserveDom);
- delete this.bgIframe;
- }
- if(this.domNode){
- if(preserveDom){
- dojo.removeAttr(this.domNode, "widgetId");
- }else{
- dojo.destroy(this.domNode);
- }
- delete this.domNode;
- }
- if(this.srcNodeRef){
- if(!preserveDom){
- dojo.destroy(this.srcNodeRef);
- }
- delete this.srcNodeRef;
- }
- },
- destroyDescendants: function(/*Boolean?*/ preserveDom){
-
-
-
-
-
-
-
-
- dojo.forEach(this.getChildren(), function(widget){
- if(widget.destroyRecursive){
- widget.destroyRecursive(preserveDom);
- }
- });
- },
- uninitialize: function(){
-
-
-
-
-
- return false;
- },
-
- _setClassAttr: function(/*String*/ value){
-
-
-
-
- var mapNode = this[this.attributeMap["class"] || 'domNode'];
- dojo.replaceClass(mapNode, value, this["class"]);
- this._set("class", value);
- },
- _setStyleAttr: function(/*String||Object*/ value){
-
-
-
-
-
-
-
-
-
- var mapNode = this[this.attributeMap.style || 'domNode'];
-
-
- if(dojo.isObject(value)){
- dojo.style(mapNode, value);
- }else{
- if(mapNode.style.cssText){
- mapNode.style.cssText += "; " + value;
- }else{
- mapNode.style.cssText = value;
- }
- }
- this._set("style", value);
- },
- _attrToDom: function(/*String*/ attr, /*String*/ value){
-
-
-
-
-
-
-
-
- var commands = this.attributeMap[attr];
- dojo.forEach(dojo.isArray(commands) ? commands : [commands], function(command){
-
- var mapNode = this[command.node || command || "domNode"];
- var type = command.type || "attribute";
- switch(type){
- case "attribute":
- if(dojo.isFunction(value)){
- value = dojo.hitch(this, value);
- }
-
-
-
- var attrName = command.attribute ? command.attribute :
- (/^on[A-Z][a-zA-Z]*$/.test(attr) ? attr.toLowerCase() : attr);
- dojo.attr(mapNode, attrName, value);
- break;
- case "innerText":
- mapNode.innerHTML = "";
- mapNode.appendChild(dojo.doc.createTextNode(value));
- break;
- case "innerHTML":
- mapNode.innerHTML = value;
- break;
- case "class":
- dojo.replaceClass(mapNode, value, this[attr]);
- break;
- }
- }, this);
- },
- get: function(name){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var names = this._getAttrNames(name);
- return this[names.g] ? this[names.g]() : this[name];
- },
-
- set: function(name, value){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(typeof name === "object"){
- for(var x in name){
- this.set(x, name[x]);
- }
- return this;
- }
- var names = this._getAttrNames(name);
- if(this[names.s]){
-
- var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
- }else{
-
- if(name in this.attributeMap){
- this._attrToDom(name, value);
- }
- this._set(name, value);
- }
- return result || this;
- },
-
- _attrPairNames: {},
- _getAttrNames: function(name){
-
-
-
-
-
- var apn = this._attrPairNames;
- if(apn[name]){ return apn[name]; }
- var uc = name.charAt(0).toUpperCase() + name.substr(1);
- return (apn[name] = {
- n: name+"Node",
- s: "_set"+uc+"Attr",
- g: "_get"+uc+"Attr"
- });
- },
- _set: function(/*String*/ name, /*anything*/ value){
-
-
-
- var oldValue = this[name];
- this[name] = value;
- if(this._watchCallbacks && this._created && !isEqual(value, oldValue)){
- this._watchCallbacks(name, oldValue, value);
- }
- },
- toString: function(){
-
-
-
-
-
-
- return '[Widget ' + this.declaredClass + ', ' + (this.id || 'NO ID') + ']';
- },
- getDescendants: function(){
-
-
-
-
- return this.containerNode ? dojo.query('[widgetId]', this.containerNode).map(dijit.byNode) : [];
- },
- getChildren: function(){
-
-
-
- return this.containerNode ? dijit.findWidgets(this.containerNode) : [];
- },
- connect: function(
- /*Object|null*/ obj,
- /*String|Function*/ event,
- /*String|Function*/ method){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var handles = [dojo._connect(obj, event, this, method)];
- this._connects.push(handles);
- return handles;
- },
- disconnect: function(/* _Widget.Handle */ handles){
-
-
-
-
-
- for(var i=0; i<this._connects.length; i++){
- if(this._connects[i] == handles){
- dojo.forEach(handles, dojo.disconnect);
- this._connects.splice(i, 1);
- return;
- }
- }
- },
- subscribe: function(
- /*String*/ topic,
- /*String|Function*/ method){
-
-
-
-
-
-
-
-
-
-
-
-
-
- var handle = dojo.subscribe(topic, this, method);
-
- this._subscribes.push(handle);
- return handle;
- },
- unsubscribe: function(/*Object*/ handle){
-
-
-
- for(var i=0; i<this._subscribes.length; i++){
- if(this._subscribes[i] == handle){
- dojo.unsubscribe(handle);
- this._subscribes.splice(i, 1);
- return;
- }
- }
- },
- isLeftToRight: function(){
-
-
-
-
- return this.dir ? (this.dir == "ltr") : dojo._isBodyLtr();
- },
- placeAt: function(/* String|DomNode|_Widget */reference, /* String?|Int? */position){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(reference.declaredClass && reference.addChild){
- reference.addChild(this, position);
- }else{
- dojo.place(this.domNode, reference, position);
- }
- return this;
- },
- defer: function(fcn, delay){
-
-
-
-
-
-
-
-
- var timer = setTimeout(dojo.hitch(this,
- function(){
- timer = null;
- if(!this._destroyed){
- dojo.hitch(this, fcn)();
- }
- }),
- delay || 0
- );
- return {
- remove: function(){
- if(timer){
- clearTimeout(timer);
- timer = null;
- }
- return null;
- }
- };
- }
- });
- })();
- }
- if(!dojo._hasResource["dijit._base.focus"]){
- dojo._hasResource["dijit._base.focus"] = true;
- dojo.provide("dijit._base.focus");
- dojo.mixin(dijit, {
-
-
- _curFocus: null,
-
-
- _prevFocus: null,
- isCollapsed: function(){
-
-
- return dijit.getBookmark().isCollapsed;
- },
- getBookmark: function(){
-
-
- var bm, rg, tg, sel = dojo.doc.selection, cf = dijit._curFocus;
- if(dojo.global.getSelection){
-
- sel = dojo.global.getSelection();
- if(sel){
- if(sel.isCollapsed){
- tg = cf? cf.tagName : "";
- if(tg){
-
- tg = tg.toLowerCase();
- if(tg == "textarea" ||
- (tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
- sel = {
- start: cf.selectionStart,
- end: cf.selectionEnd,
- node: cf,
- pRange: true
- };
- return {isCollapsed: (sel.end <= sel.start), mark: sel};
- }
- }
- bm = {isCollapsed:true};
- if(sel.rangeCount){
- bm.mark = sel.getRangeAt(0).cloneRange();
- }
- }else{
- rg = sel.getRangeAt(0);
- bm = {isCollapsed: false, mark: rg.cloneRange()};
- }
- }
- }else if(sel){
-
-
-
- tg = cf ? cf.tagName : "";
- tg = tg.toLowerCase();
- if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
- if(sel.type && sel.type.toLowerCase() == "none"){
- return {
- isCollapsed: true,
- mark: null
- }
- }else{
- rg = sel.createRange();
- return {
- isCollapsed: rg.text && rg.text.length?false:true,
- mark: {
- range: rg,
- pRange: true
- }
- };
- }
- }
- bm = {};
-
- try{
-
-
- rg = sel.createRange();
- bm.isCollapsed = !(sel.type == 'Text' ? rg.htmlText.length : rg.length);
- }catch(e){
- bm.isCollapsed = true;
- return bm;
- }
- if(sel.type.toUpperCase() == 'CONTROL'){
- if(rg.length){
- bm.mark=[];
- var i=0,len=rg.length;
- while(i<len){
- bm.mark.push(rg.item(i++));
- }
- }else{
- bm.isCollapsed = true;
- bm.mark = null;
- }
- }else{
- bm.mark = rg.getBookmark();
- }
- }else{
- console.warn("No idea how to store the current selection for this browser!");
- }
- return bm;
- },
- moveToBookmark: function(/*Object*/bookmark){
-
-
-
-
- var _doc = dojo.doc,
- mark = bookmark.mark;
- if(mark){
- if(dojo.global.getSelection){
-
- var sel = dojo.global.getSelection();
- if(sel && sel.removeAllRanges){
- if(mark.pRange){
- var r = mark;
- var n = r.node;
- n.selectionStart = r.start;
- n.selectionEnd = r.end;
- }else{
- sel.removeAllRanges();
- sel.addRange(mark);
- }
- }else{
- console.warn("No idea how to restore selection for this browser!");
- }
- }else if(_doc.selection && mark){
-
- var rg;
- if(mark.pRange){
- rg = mark.range;
- }else if(dojo.isArray(mark)){
- rg = _doc.body.createControlRange();
-
-
- dojo.forEach(mark, function(n){
- rg.addElement(n);
- });
- }else{
- rg = _doc.body.createTextRange();
- rg.moveToBookmark(mark);
- }
- rg.select();
- }
- }
- },
- getFocus: function(/*Widget?*/ menu, /*Window?*/ openedForWindow){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var node = !dijit._curFocus || (menu && dojo.isDescendant(dijit._curFocus, menu.domNode)) ? dijit._prevFocus : dijit._curFocus;
- return {
- node: node,
- bookmark: (node == dijit._curFocus) && dojo.withGlobal(openedForWindow || dojo.global, dijit.getBookmark),
- openedForWindow: openedForWindow
- };
- },
- focus: function(/*Object || DomNode */ handle){
-
-
-
-
-
- if(!handle){ return; }
- var node = "node" in handle ? handle.node : handle,
- bookmark = handle.bookmark,
- openedForWindow = handle.openedForWindow,
- collapsed = bookmark ? bookmark.isCollapsed : false;
-
-
-
- if(node){
- var focusNode = (node.tagName.toLowerCase() == "iframe") ? node.contentWindow : node;
- if(focusNode && focusNode.focus){
- try{
-
-
- focusNode.focus();
- }catch(e){}
- }
- dijit._onFocusNode(node);
- }
-
-
-
-
- if(bookmark && dojo.withGlobal(openedForWindow || dojo.global, dijit.isCollapsed) && !collapsed){
- if(openedForWindow){
- openedForWindow.focus();
- }
- try{
- dojo.withGlobal(openedForWindow || dojo.global, dijit.moveToBookmark, null, [bookmark]);
- }catch(e2){
-
- }
- }
- },
-
-
- _activeStack: [],
- registerIframe: function(/*DomNode*/ iframe){
-
-
-
-
-
-
-
-
- return dijit.registerWin(iframe.contentWindow, iframe);
- },
- unregisterIframe: function(/*Object*/ handle){
-
-
-
-
-
- dijit.unregisterWin(handle);
- },
- registerWin: function(/*Window?*/targetWindow, /*DomNode?*/ effectiveNode){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var mousedownListener = function(evt){
- dijit._justMouseDowned = true;
- setTimeout(function(){ dijit._justMouseDowned = false; }, 0);
-
-
-
- if(dojo.isIE && evt && evt.srcElement && evt.srcElement.parentNode == null){
- return;
- }
- dijit._onTouchNode(effectiveNode || evt.target || evt.srcElement, "mouse");
- };
-
-
-
-
-
-
-
- var doc = dojo.isIE ? targetWindow.document.documentElement : targetWindow.document;
- if(doc){
- if(dojo.isIE){
- targetWindow.document.body.attachEvent('onmousedown', mousedownListener);
- var activateListener = function(evt){
-
-
- if(evt.srcElement.tagName.toLowerCase() != "#document" &&
- dijit.isTabNavigable(evt.srcElement)){
- dijit._onFocusNode(effectiveNode || evt.srcElement);
- }else{
- dijit._onTouchNode(effectiveNode || evt.srcElement);
- }
- };
- doc.attachEvent('onactivate', activateListener);
- var deactivateListener = function(evt){
- dijit._onBlurNode(effectiveNode || evt.srcElement);
- };
- doc.attachEvent('ondeactivate', deactivateListener);
- return function(){
- targetWindow.document.detachEvent('onmousedown', mousedownListener);
- doc.detachEvent('onactivate', activateListener);
- doc.detachEvent('ondeactivate', deactivateListener);
- doc = null;
- };
- }else if(doc.body){
- doc.body.addEventListener('mousedown', mousedownListener, true);
- var focusListener = function(evt){
- dijit._onFocusNode(effectiveNode || evt.target);
- };
- doc.addEventListener('focus', focusListener, true);
- var blurListener = function(evt){
- dijit._onBlurNode(effectiveNode || evt.target);
- };
- doc.addEventListener('blur', blurListener, true);
- return function(){
- doc.body.removeEventListener('mousedown', mousedownListener, true);
- doc.removeEventListener('focus', focusListener, true);
- doc.removeEventListener('blur', blurListener, true);
- doc = null;
- };
- }
- }
- },
- unregisterWin: function(/*Handle*/ handle){
-
-
-
-
-
- handle && handle();
- },
- _onBlurNode: function(/*DomNode*/ node){
-
-
-
-
-
- dijit._prevFocus = dijit._curFocus;
- dijit._curFocus = null;
- if(dijit._justMouseDowned){
-
-
- return;
- }
-
- if(dijit._clearActiveWidgetsTimer){
- clearTimeout(dijit._clearActiveWidgetsTimer);
- }
- dijit._clearActiveWidgetsTimer = setTimeout(function(){
- delete dijit._clearActiveWidgetsTimer;
- dijit._setStack([]);
- dijit._prevFocus = null;
- }, 100);
- },
- _onTouchNode: function(/*DomNode*/ node, /*String*/ by){
-
-
-
-
-
-
-
- if(dijit._clearActiveWidgetsTimer){
- clearTimeout(dijit._clearActiveWidgetsTimer);
- delete dijit._clearActiveWidgetsTimer;
- }
-
- var newStack=[];
- try{
- while(node){
- var popupParent = dojo.attr(node, "dijitPopupParent");
- if(popupParent){
- node=dijit.byId(popupParent).domNode;
- }else if(node.tagName && node.tagName.toLowerCase() == "body"){
-
- if(node === dojo.body()){
-
- break;
- }
-
-
- node=dojo.window.get(node.ownerDocument).frameElement;
- }else{
-
-
-
- var id = node.getAttribute && node.getAttribute("widgetId"),
- widget = id && dijit.byId(id);
- if(widget && !(by == "mouse" && widget.get("disabled"))){
- newStack.unshift(id);
- }
- node=node.parentNode;
- }
- }
- }catch(e){ }
- dijit._setStack(newStack, by);
- },
- _onFocusNode: function(/*DomNode*/ node){
-
-
- if(!node){
- return;
- }
- if(node.nodeType == 9){
-
-
-
- return;
- }
- dijit._onTouchNode(node);
- if(node == dijit._curFocus){ return; }
- if(dijit._curFocus){
- dijit._prevFocus = dijit._curFocus;
- }
- dijit._curFocus = node;
- dojo.publish("focusNode", [node]);
- },
- _setStack: function(/*String[]*/ newStack, /*String*/ by){
-
-
-
-
-
-
- var oldStack = dijit._activeStack;
- dijit._activeStack = newStack;
-
- for(var nCommon=0; nCommon<Math.min(oldStack.length, newStack.length); nCommon++){
- if(oldStack[nCommon] != newStack[nCommon]){
- break;
- }
- }
- var widget;
-
- for(var i=oldStack.length-1; i>=nCommon; i--){
- widget = dijit.byId(oldStack[i]);
- if(widget){
- widget._focused = false;
- widget.set("focused", false);
- widget._hasBeenBlurred = true;
- if(widget._onBlur){
- widget._onBlur(by);
- }
- dojo.publish("widgetBlur", [widget, by]);
- }
- }
-
- for(i=nCommon; i<newStack.length; i++){
- widget = dijit.byId(newStack[i]);
- if(widget){
- widget._focused = true;
- widget.set("focused", true);
- if(widget._onFocus){
- widget._onFocus(by);
- }
- dojo.publish("widgetFocus", [widget, by]);
- }
- }
- }
- });
- dojo.addOnLoad(function(){
- var handle = dijit.registerWin(window);
- if(dojo.isIE){
- dojo.addOnWindowUnload(function(){
- dijit.unregisterWin(handle);
- handle = null;
- })
- }
- });
- }
- if(!dojo._hasResource["dijit._base.window"]){
- dojo._hasResource["dijit._base.window"] = true;
- dojo.provide("dijit._base.window");
- dijit.getDocumentWindow = function(doc){
- return dojo.window.get(doc);
- };
- }
- if(!dojo._hasResource["dijit._base.popup"]){
- dojo._hasResource["dijit._base.popup"] = true;
- dojo.provide("dijit._base.popup");
- dijit.popup = {
-
-
-
-
-
- _stack: [],
-
-
-
-
- _beginZIndex: 1000,
- _idGen: 1,
- _createWrapper: function(/*Widget || DomNode*/ widget){
-
-
-
-
- var node = widget.domNode || widget,
- wrapper = widget.declaredClass ? widget._popupWrapper :
- node.parentNode && dojo.hasClass(node.parentNode, "dijitPopup") ? node.parentNode : null;
- if(!wrapper){
-
-
-
- wrapper = dojo.create("div",{
- "class":"dijitPopup",
- style:{ display: "none"},
- role: "presentation"
- }, dojo.body());
- wrapper.appendChild(node);
- var s = node.style;
- s.display = "";
- s.visibility = "";
- s.position = "";
- s.top = "0px";
- if(widget.declaredClass){
- widget._popupWrapper = wrapper;
- dojo.connect(widget, "destroy", function(){
- dojo.destroy(wrapper);
- delete widget._popupWrapper;
- });
- }
- }
-
- return wrapper;
- },
- moveOffScreen: function(/*Widget || DomNode*/ widget){
-
-
-
-
-
-
- var wrapper = this._createWrapper(widget);
- dojo.style(wrapper, {
- visibility: "hidden",
- top: "-9999px",
- display: ""
- });
- },
- hide: function(/*dijit._Widget*/ widget){
-
-
-
-
-
-
-
-
-
- var wrapper = this._createWrapper(widget);
- dojo.style(wrapper, "display", "none");
- },
-
- getTopPopup: function(){
-
-
-
- var stack = this._stack;
- for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
-
- }
- return stack[pi];
- },
- open: function(/*dijit.popup.__OpenArgs*/ args){
-
-
-
-
-
-
-
-
-
-
-
-
-
- var stack = this._stack,
- widget = args.popup,
- orient = args.orient || (
- (args.parent ? args.parent.isLeftToRight() : dojo._isBodyLtr()) ?
- {'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} :
- {'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}
- ),
- around = args.around,
- id = (args.around && args.around.id) ? (args.around.id+"_dropdown") : ("popup_"+this._idGen++);
-
-
-
- while(stack.length && (!args.parent || !dojo.isDescendant(args.parent.domNode, stack[stack.length-1].widget.domNode))){
- dijit.popup.close(stack[stack.length-1].widget);
- }
-
- var wrapper = this._createWrapper(widget);
- dojo.attr(wrapper, {
- id: id,
- style: {
- zIndex: this._beginZIndex + stack.length
- },
- "class": "dijitPopup " + (widget.baseClass || widget["class"] || "").split(" ")[0] +"Popup",
- dijitPopupParent: args.parent ? args.parent.id : ""
- });
- if(dojo.isIE || dojo.isMoz){
- if(!widget.bgIframe){
-
- widget.bgIframe = new dijit.BackgroundIframe(wrapper);
- }
- }
-
- var best = around ?
- dijit.placeOnScreenAroundElement(wrapper, around, orient, widget.orient ? dojo.hitch(widget, "orient") : null) :
- dijit.placeOnScreen(wrapper, args, orient == 'R' ? ['TR','BR','TL','BL'] : ['TL','BL','TR','BR'], args.padding);
- wrapper.style.display = "";
- wrapper.style.visibility = "visible";
- widget.domNode.style.visibility = "visible";
- var handlers = [];
-
-
- handlers.push(dojo.connect(wrapper, "onkeypress", this, function(evt){
- if(evt.charOrCode == dojo.keys.ESCAPE && args.onCancel){
- dojo.stopEvent(evt);
- args.onCancel();
- }else if(evt.charOrCode === dojo.keys.TAB){
- dojo.stopEvent(evt);
- var topPopup = this.getTopPopup();
- if(topPopup && topPopup.onCancel){
- topPopup.onCancel();
- }
- }
- }));
-
-
- if(widget.onCancel){
- handlers.push(dojo.connect(widget, "onCancel", args.onCancel));
- }
- handlers.push(dojo.connect(widget, widget.onExecute ? "onExecute" : "onChange", this, function(){
- var topPopup = this.getTopPopup();
- if(topPopup && topPopup.onExecute){
- topPopup.onExecute();
- }
- }));
- stack.push({
- widget: widget,
- parent: args.parent,
- onExecute: args.onExecute,
- onCancel: args.onCancel,
- onClose: args.onClose,
- handlers: handlers
- });
- if(widget.onOpen){
-
- widget.onOpen(best);
- }
- return best;
- },
- close: function(/*dijit._Widget?*/ popup){
-
-
-
- var stack = this._stack;
-
-
-
-
-
- while((popup && dojo.some(stack, function(elem){return elem.widget == popup;})) ||
- (!popup && stack.length)){
- var top = stack.pop(),
- widget = top.widget,
- onClose = top.onClose;
- if(widget.onClose){
-
- widget.onClose();
- }
- dojo.forEach(top.handlers, dojo.disconnect);
-
- if(widget && widget.domNode){
- this.hide(widget);
- }
-
- if(onClose){
- onClose();
- }
- }
- }
- };
- dijit._frames = new function(){
-
-
- var queue = [];
- this.pop = function(){
- var iframe;
- if(queue.length){
- iframe = queue.pop();
- iframe.style.display="";
- }else{
- if(dojo.isIE < 9){
- var burl = dojo.config["dojoBlankHtmlUrl"] || (dojo.moduleUrl("dojo", "resources/blank.html")+"") || "javascript:\"\"";
- var html="<iframe src='" + burl + "'"
- + " style='position: absolute; left: 0px; top: 0px;"
- + "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
- iframe = dojo.doc.createElement(html);
- }else{
- iframe = dojo.create("iframe");
- iframe.src = 'javascript:""';
- iframe.className = "dijitBackgroundIframe";
- dojo.style(iframe, "opacity", 0.1);
- }
- iframe.tabIndex = -1;
- dijit.setWaiRole(iframe,"presentation");
- }
- return iframe;
- };
- this.push = function(iframe){
- iframe.style.display="none";
- queue.push(iframe);
- }
- }();
- dijit.BackgroundIframe = function(/*DomNode*/ node){
-
-
-
-
-
-
-
- if(!node.id){ throw new Error("no id"); }
- if(dojo.isIE || dojo.isMoz){
- var iframe = (this.iframe = dijit._frames.pop());
- node.appendChild(iframe);
- if(dojo.isIE<7 || dojo.isQuirks){
- this.resize(node);
- this._conn = dojo.connect(node, 'onresize', this, function(){
- this.resize(node);
- });
- }else{
- dojo.style(iframe, {
- width: '100%',
- height: '100%'
- });
- }
- }
- };
- dojo.extend(dijit.BackgroundIframe, {
- resize: function(node){
-
-
-
- if(this.iframe){
- dojo.style(this.iframe, {
- width: node.offsetWidth + 'px',
- height: node.offsetHeight + 'px'
- });
- }
- },
- destroy: function(){
-
-
- if(this._conn){
- dojo.disconnect(this._conn);
- this._conn = null;
- }
- if(this.iframe){
- dijit._frames.push(this.iframe);
- delete this.iframe;
- }
- }
- });
- }
- if(!dojo._hasResource["dijit._base.scroll"]){
- dojo._hasResource["dijit._base.scroll"] = true;
- dojo.provide("dijit._base.scroll");
- dijit.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
-
-
-
-
- dojo.window.scrollIntoView(node, pos);
- };
- }
- if(!dojo._hasResource["dojo.uacss"]){
- dojo._hasResource["dojo.uacss"] = true;
- dojo.provide("dojo.uacss");
- (function(){
-
-
-
-
-
-
-
-
-
- var d = dojo,
- html = d.doc.documentElement,
- ie = d.isIE,
- opera = d.isOpera,
- maj = Math.floor,
- ff = d.isFF,
- boxModel = d.boxModel.replace(/-/,''),
- classes = {
- dj_quirks: d.isQuirks,
-
- dj_opera: opera,
- dj_khtml: d.isKhtml,
- dj_webkit: d.isWebKit,
- dj_safari: d.isSafari,
- dj_chrome: d.isChrome,
- dj_gecko: d.isMozilla
- };
- if(ie){
- classes["dj_ie"] = true;
- classes["dj_ie" + maj(ie)] = true;
- classes["dj_iequirks"] = d.isQuirks;
- }
- if(ff){
- classes["dj_ff" + maj(ff)] = true;
- }
- classes["dj_" + boxModel] = true;
-
- var classStr = "";
- for(var clz in classes){
- if(classes[clz]){
- classStr += clz + " ";
- }
- }
- html.className = d.trim(html.className + " " + classStr);
-
-
-
- dojo._loaders.unshift(function(){
- if(!dojo._isBodyLtr()){
- var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
- html.className = d.trim(html.className + " " + rtlClassStr);
- }
- });
- })();
- }
- if(!dojo._hasResource["dijit._base.sniff"]){
- dojo._hasResource["dijit._base.sniff"] = true;
- dojo.provide("dijit._base.sniff");
- }
- if(!dojo._hasResource["dijit._base.typematic"]){
- dojo._hasResource["dijit._base.typematic"] = true;
- dojo.provide("dijit._base.typematic");
- dijit.typematic = {
-
-
-
-
-
- _fireEventAndReload: function(){
- this._timer = null;
- this._callback(++this._count, this._node, this._evt);
-
-
-
- this._currentTimeout = Math.max(
- this._currentTimeout < 0 ? this._initialDelay :
- (this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
- this._minDelay);
- this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
- },
- trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(obj != this._obj){
- this.stop();
- this._initialDelay = initialDelay || 500;
- this._subsequentDelay = subsequentDelay || 0.90;
- this._minDelay = minDelay || 10;
- this._obj = obj;
- this._evt = evt;
- this._node = node;
- this._currentTimeout = -1;
- this._count = -1;
- this._callback = dojo.hitch(_this, callback);
- this._fireEventAndReload();
- this._evt = dojo.mixin({faux: true}, evt);
- }
- },
- stop: function(){
-
-
- if(this._timer){
- clearTimeout(this._timer);
- this._timer = null;
- }
- if(this._obj){
- this._callback(-1, this._node, this._evt);
- this._obj = null;
- }
- },
- addKeyListener: function(/*DOMNode*/ node, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(keyObject.keyCode){
- keyObject.charOrCode = keyObject.keyCode;
- dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
- }else if(keyObject.charCode){
- keyObject.charOrCode = String.fromCharCode(keyObject.charCode);
- dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
- }
- return [
- dojo.connect(node, "onkeypress", this, function(evt){
- if(evt.charOrCode == keyObject.charOrCode &&
- (keyObject.ctrlKey === undefined || keyObject.ctrlKey == evt.ctrlKey) &&
- (keyObject.altKey === undefined || keyObject.altKey == evt.altKey) &&
- (keyObject.metaKey === undefined || keyObject.metaKey == (evt.metaKey || false)) &&
- (keyObject.shiftKey === undefined || keyObject.shiftKey == evt.shiftKey)){
- dojo.stopEvent(evt);
- dijit.typematic.trigger(evt, _this, node, callback, keyObject, subsequentDelay, initialDelay, minDelay);
- }else if(dijit.typematic._obj == keyObject){
- dijit.typematic.stop();
- }
- }),
- dojo.connect(node, "onkeyup", this, function(evt){
- if(dijit.typematic._obj == keyObject){
- dijit.typematic.stop();
- }
- })
- ];
- },
- addMouseListener: function(/*DOMNode*/ node, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
-
-
-
-
-
- var dc = dojo.connect;
- return [
- dc(node, "mousedown", this, function(evt){
- dojo.stopEvent(evt);
- dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
- }),
- dc(node, "mouseup", this, function(evt){
- dojo.stopEvent(evt);
- dijit.typematic.stop();
- }),
- dc(node, "mouseout", this, function(evt){
- dojo.stopEvent(evt);
- dijit.typematic.stop();
- }),
- dc(node, "mousemove", this, function(evt){
- evt.preventDefault();
- }),
- dc(node, "dblclick", this, function(evt){
- dojo.stopEvent(evt);
- if(dojo.isIE < 9){
- dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
- setTimeout(dojo.hitch(this, dijit.typematic.stop), 50);
- }
- })
- ];
- },
- addListener: function(/*Node*/ mouseNode, /*Node*/ keyNode, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
-
-
-
-
-
-
-
-
-
-
- return this.addKeyListener(keyNode, keyObject, _this, callback, subsequentDelay, initialDelay, minDelay).concat(
- this.addMouseListener(mouseNode, _this, callback, subsequentDelay, initialDelay, minDelay));
- }
- };
- }
- if(!dojo._hasResource["dijit._base.wai"]){
- dojo._hasResource["dijit._base.wai"] = true;
- dojo.provide("dijit._base.wai");
- dijit.wai = {
- onload: function(){
-
-
-
-
-
-
-
- var div = dojo.create("div",{
- id: "a11yTestNode",
- style:{
- cssText:'border: 1px solid;'
- + 'border-color:red green;'
- + 'position: absolute;'
- + 'height: 5px;'
- + 'top: -999px;'
- + 'background-image: url("' + (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")) + '");'
- }
- }, dojo.body());
-
- var cs = dojo.getComputedStyle(div);
- if(cs){
- var bkImg = cs.backgroundImage;
- var needsA11y = (cs.borderTopColor == cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
- dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y");
- if(dojo.isIE){
- div.outerHTML = "";
- }else{
- dojo.body().removeChild(div);
- }
- }
- }
- };
- if(dojo.isIE || dojo.isMoz){
- dojo._loaders.unshift(dijit.wai.onload);
- }
- dojo.mixin(dijit, {
- hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
-
-
-
-
-
-
- var waiRole = this.getWaiRole(elem);
- return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
- },
- getWaiRole: function(/*Element*/ elem){
-
-
-
-
-
- return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
- },
- setWaiRole: function(/*Element*/ elem, /*String*/ role){
-
-
-
-
- dojo.attr(elem, "role", role);
- },
- removeWaiRole: function(/*Element*/ elem, /*String*/ role){
-
-
-
- var roleValue = dojo.attr(elem, "role");
- if(!roleValue){ return; }
- if(role){
- var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
- dojo.attr(elem, "role", t);
- }else{
- elem.removeAttribute("role");
- }
- },
- hasWaiState: function(/*Element*/ elem, /*String*/ state){
-
-
-
-
-
-
-
- return elem.hasAttribute ? elem.hasAttribute("aria-"+state) : !!elem.getAttribute("aria-"+state);
- },
- getWaiState: function(/*Element*/ elem, /*String*/ state){
-
-
-
-
-
-
-
- return elem.getAttribute("aria-"+state) || "";
- },
- setWaiState: function(/*Element*/ elem, /*String*/ state, /*String*/ value){
-
-
-
-
- elem.setAttribute("aria-"+state, value);
- },
- removeWaiState: function(/*Element*/ elem, /*String*/ state){
-
-
-
-
- elem.removeAttribute("aria-"+state);
- }
- });
- }
- if(!dojo._hasResource["dijit._base"]){
- dojo._hasResource["dijit._base"] = true;
- dojo.provide("dijit._base");
- }
- if(!dojo._hasResource["dijit._Widget"]){
- dojo._hasResource["dijit._Widget"] = true;
- dojo.provide("dijit._Widget");
- dojo.connect(dojo, "_connect",
- function(/*dijit._Widget*/ widget, /*String*/ event){
- if(widget && dojo.isFunction(widget._onConnect)){
- widget._onConnect(event);
- }
- });
- dijit._connectOnUseEventHandler = function(/*Event*/ event){};
- dijit._lastKeyDownNode = null;
- if(dojo.isIE){
- (function(){
- var keydownCallback = function(evt){
- dijit._lastKeyDownNode = evt.srcElement;
- };
- dojo.doc.attachEvent('onkeydown', keydownCallback);
- dojo.addOnWindowUnload(function(){
- dojo.doc.detachEvent('onkeydown', keydownCallback);
- });
- })();
- }else{
- dojo.doc.addEventListener('keydown', function(evt){
- dijit._lastKeyDownNode = evt.target;
- }, true);
- }
- (function(){
- dojo.declare("dijit._Widget", dijit._WidgetBase, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _deferredConnects: {
- onClick: "",
- onDblClick: "",
- onKeyDown: "",
- onKeyPress: "",
- onKeyUp: "",
- onMouseMove: "",
- onMouseDown: "",
- onMouseOut: "",
- onMouseOver: "",
- onMouseLeave: "",
- onMouseEnter: "",
- onMouseUp: ""
- },
- onClick: dijit._connectOnUseEventHandler,
-
- onDblClick: dijit._connectOnUseEventHandler,
-
- onKeyDown: dijit._connectOnUseEventHandler,
-
- onKeyPress: dijit._connectOnUseEventHandler,
-
- onKeyUp: dijit._connectOnUseEventHandler,
-
- onMouseDown: dijit._connectOnUseEventHandler,
-
- onMouseMove: dijit._connectOnUseEventHandler,
-
- onMouseOut: dijit._connectOnUseEventHandler,
-
- onMouseOver: dijit._connectOnUseEventHandler,
-
- onMouseLeave: dijit._connectOnUseEventHandler,
-
- onMouseEnter: dijit._connectOnUseEventHandler,
-
- onMouseUp: dijit._connectOnUseEventHandler,
-
- create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
-
-
-
-
- this._deferredConnects = dojo.clone(this._deferredConnects);
- for(var attr in this.attributeMap){
- delete this._deferredConnects[attr];
- }
- for(attr in this._deferredConnects){
- if(this[attr] !== dijit._connectOnUseEventHandler){
- delete this._deferredConnects[attr];
- }
- }
- this.inherited(arguments);
- if(this.domNode){
-
-
-
- for(attr in this.params){
- this._onConnect(attr);
- }
- }
- },
- _onConnect: function(/*String*/ event){
-
-
-
-
-
-
-
-
- if(event in this._deferredConnects){
- var mapNode = this[this._deferredConnects[event] || 'domNode'];
- this.connect(mapNode, event.toLowerCase(), event);
- delete this._deferredConnects[event];
- }
- },
-
-
-
-
-
- focused: false,
- isFocusable: function(){
-
-
-
- return this.focus && (dojo.style(this.domNode, "display") != "none");
- },
- onFocus: function(){
-
-
-
-
-
-
- },
- onBlur: function(){
-
-
-
-
-
-
-
- },
- _onFocus: function(e){
-
-
-
-
-
- this.onFocus();
- },
- _onBlur: function(){
-
-
-
-
-
- this.onBlur();
- },
-
- setAttribute: function(/*String*/ attr, /*anything*/ value){
-
-
-
-
- dojo.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.", "", "2.0");
- this.set(attr, value);
- },
- attr: function(/*String|Object*/name, /*Object?*/value){
-
-
-
-
-
-
-
-
-
-
-
-
- if(dojo.config.isDebug){
- var alreadyCalledHash = arguments.callee._ach || (arguments.callee._ach = {}),
- caller = (arguments.callee.caller || "unknown caller").toString();
- if(!alreadyCalledHash[caller]){
- dojo.deprecated(this.declaredClass + "::attr() is deprecated. Use get() or set() instead, called from " +
- caller, "", "2.0");
- alreadyCalledHash[caller] = true;
- }
- }
- var args = arguments.length;
- if(args >= 2 || typeof name === "object"){
- return this.set.apply(this, arguments);
- }else{
- return this.get(name);
- }
- },
-
-
-
-
-
- nodesWithKeyClick: ["input", "button"],
- connect: function(
- /*Object|null*/ obj,
- /*String|Function*/ event,
- /*String|Function*/ method){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var d = dojo,
- dc = d._connect,
- handles = this.inherited(arguments, [obj, event == "ondijitclick" ? "onclick" : event, method]);
- if(event == "ondijitclick"){
-
-
-
- if(d.indexOf(this.nodesWithKeyClick, obj.nodeName.toLowerCase()) == -1){
- var m = d.hitch(this, method);
- handles.push(
- dc(obj, "onkeydown", this, function(e){
-
- if((e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
- !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
-
- dijit._lastKeyDownNode = e.target;
-
-
-
-
- if(!("openDropDown" in this && obj == this._buttonNode)){
- e.preventDefault();
- }
- }
- }),
- dc(obj, "onkeyup", this, function(e){
-
- if( (e.keyCode == d.keys.ENTER || e.keyCode == d.keys.SPACE) &&
- e.target == dijit._lastKeyDownNode &&
- !e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey){
-
- dijit._lastKeyDownNode = null;
- return m(e);
- }
- })
- );
- }
- }
- return handles;
- },
-
- _onShow: function(){
-
-
-
- this.onShow();
- },
- onShow: function(){
-
-
-
-
-
-
-
-
- },
- onHide: function(){
-
-
-
-
-
-
-
-
- },
- onClose: function(){
-
-
-
-
-
-
-
-
-
- return true;
- }
- });
- })();
- }
- if(!dojo._hasResource["dojo.cache"]){
- dojo._hasResource["dojo.cache"] = true;
- dojo.provide("dojo.cache");
- var cache = {};
- dojo.cache = function(/*String||Object*/module, /*String*/url, /*String||Object?*/value){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(typeof module == "string"){
- var pathObj = dojo.moduleUrl(module, url);
- }else{
- pathObj = module;
- value = url;
- }
- var key = pathObj.toString();
- var val = value;
- if(value != undefined && !dojo.isString(value)){
- val = ("value" in value ? value.value : undefined);
- }
- var sanitize = value && value.sanitize ? true : false;
- if(typeof val == "string"){
-
- val = cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
- }else if(val === null){
-
- delete cache[key];
- }else{
-
-
- if(!(key in cache)){
- val = dojo._getText(key);
- cache[key] = sanitize ? dojo.cache._sanitize(val) : val;
- }
- val = cache[key];
- }
- return val;
- };
- dojo.cache._sanitize = function(/*String*/val){
-
-
-
-
-
-
- if(val){
- val = val.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
- var matches = val.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
- if(matches){
- val = matches[1];
- }
- }else{
- val = "";
- }
- return val;
- };
- }
- if(!dojo._hasResource["dijit._Templated"]){
- dojo._hasResource["dijit._Templated"] = true;
- dojo.provide("dijit._Templated");
- dojo.declare("dijit._Templated",
- null,
- {
-
-
-
-
-
-
-
-
-
- templateString: null,
-
-
-
- templatePath: null,
-
-
-
- widgetsInTemplate: false,
-
-
-
-
- _skipNodeCache: false,
-
-
-
-
-
-
-
- _earlyTemplatedStartup: false,
- constructor: function(){
- this._attachPoints = [];
- this._attachEvents = [];
- },
- _stringRepl: function(tmpl){
-
-
-
-
- var className = this.declaredClass, _this = this;
-
-
- return dojo.string.substitute(tmpl, this, function(value, key){
- if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
- if(typeof value == "undefined"){ throw new Error(className+" template:"+key); }
- if(value == null){ return ""; }
-
-
- return key.charAt(0) == "!" ? value :
-
-
- value.toString().replace(/"/g,""");
- }, this);
- },
- buildRendering: function(){
-
-
-
-
-
-
-
- var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache);
- var node;
- if(dojo.isString(cached)){
- node = dojo._toDom(this._stringRepl(cached));
- if(node.nodeType != 1){
-
- throw new Error("Invalid template: " + cached);
- }
- }else{
-
- node = cached.cloneNode(true);
- }
- this.domNode = node;
-
-
- this.inherited(arguments);
-
-
- this._attachTemplateNodes(node);
- if(this.widgetsInTemplate){
-
- var cw = (this._startupWidgets = dojo.parser.parse(node, {
- noStart: !this._earlyTemplatedStartup,
- template: true,
- inherited: {dir: this.dir, lang: this.lang},
- propsThis: this,
- scope: "dojo"
- }));
- this._supportingWidgets = dijit.findWidgets(node);
- this._attachTemplateNodes(cw, function(n,p){
- return n[p];
- });
- }
- this._fillContent(this.srcNodeRef);
- },
- _fillContent: function(/*DomNode*/ source){
-
-
-
-
-
- var dest = this.containerNode;
- if(source && dest){
- while(source.hasChildNodes()){
- dest.appendChild(source.firstChild);
- }
- }
- },
- _attachTemplateNodes: function(rootNode, getAttrFunc){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- getAttrFunc = getAttrFunc || function(n,p){ return n.getAttribute(p); };
- var nodes = dojo.isArray(rootNode) ? rootNode : (rootNode.all || rootNode.getElementsByTagName("*"));
- var x = dojo.isArray(rootNode) ? 0 : -1;
- for(; x<nodes.length; x++){
- var baseNode = (x == -1) ? rootNode : nodes[x];
- if(this.widgetsInTemplate && (getAttrFunc(baseNode, "dojoType") || getAttrFunc(baseNode, "data-dojo-type"))){
- continue;
- }
-
- var attachPoint = getAttrFunc(baseNode, "dojoAttachPoint") || getAttrFunc(baseNode, "data-dojo-attach-point");
- if(attachPoint){
- var point, points = attachPoint.split(/\s*,\s*/);
- while((point = points.shift())){
- if(dojo.isArray(this[point])){
- this[point].push(baseNode);
- }else{
- this[point]=baseNode;
- }
- this._attachPoints.push(point);
- }
- }
-
- var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent") || getAttrFunc(baseNode, "data-dojo-attach-event");;
- if(attachEvent){
-
-
- var event, events = attachEvent.split(/\s*,\s*/);
- var trim = dojo.trim;
- while((event = events.shift())){
- if(event){
- var thisFunc = null;
- if(event.indexOf(":") != -1){
-
- var funcNameArr = event.split(":");
- event = trim(funcNameArr[0]);
- thisFunc = trim(funcNameArr[1]);
- }else{
- event = trim(event);
- }
- if(!thisFunc){
- thisFunc = event;
- }
- this._attachEvents.push(this.connect(baseNode, event, thisFunc));
- }
- }
- }
-
-
- var role = getAttrFunc(baseNode, "waiRole");
- if(role){
- dijit.setWaiRole(baseNode, role);
- }
- var values = getAttrFunc(baseNode, "waiState");
- if(values){
- dojo.forEach(values.split(/\s*,\s*/), function(stateValue){
- if(stateValue.indexOf('-') != -1){
- var pair = stateValue.split('-');
- dijit.setWaiState(baseNode, pair[0], pair[1]);
- }
- });
- }
- }
- },
- startup: function(){
- dojo.forEach(this._startupWidgets, function(w){
- if(w && !w._started && w.startup){
- w.startup();
- }
- });
- this.inherited(arguments);
- },
- destroyRendering: function(){
-
- dojo.forEach(this._attachPoints, function(point){
- delete this[point];
- }, this);
- this._attachPoints = [];
-
- dojo.forEach(this._attachEvents, this.disconnect, this);
- this._attachEvents = [];
-
- this.inherited(arguments);
- }
- }
- );
- dijit._Templated._templateCache = {};
- dijit._Templated.getCachedTemplate = function(templatePath, templateString, alwaysUseString){
-
-
-
-
-
-
-
-
-
-
-
-
- var tmplts = dijit._Templated._templateCache;
- var key = templateString || templatePath;
- var cached = tmplts[key];
- if(cached){
- try{
-
- if(!cached.ownerDocument || cached.ownerDocument == dojo.doc){
-
- return cached;
- }
- }catch(e){ }
- dojo.destroy(cached);
- }
-
- if(!templateString){
- templateString = dojo.cache(templatePath, {sanitize: true});
- }
- templateString = dojo.string.trim(templateString);
- if(alwaysUseString || templateString.match(/\$\{([^\}]+)\}/g)){
-
- return (tmplts[key] = templateString);
- }else{
-
- var node = dojo._toDom(templateString);
- if(node.nodeType != 1){
- throw new Error("Invalid template: " + templateString);
- }
- return (tmplts[key] = node);
- }
- };
- if(dojo.isIE){
- dojo.addOnWindowUnload(function(){
- var cache = dijit._Templated._templateCache;
- for(var key in cache){
- var value = cache[key];
- if(typeof value == "object"){
- dojo.destroy(value);
- }
- delete cache[key];
- }
- });
- }
- dojo.extend(dijit._Widget,{
- dojoAttachEvent: "",
- dojoAttachPoint: "",
- waiRole: "",
- waiState:""
- });
- }
- if(!dojo._hasResource["dijit._CssStateMixin"]){
- dojo._hasResource["dijit._CssStateMixin"] = true;
- dojo.provide("dijit._CssStateMixin");
- dojo.declare("dijit._CssStateMixin", [], {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- cssStateNodes: {},
-
-
- hovering: false,
-
-
-
- active: false,
- _applyAttributes: function(){
-
-
-
- this.inherited(arguments);
-
- dojo.forEach(["onmouseenter", "onmouseleave", "onmousedown"], function(e){
- this.connect(this.domNode, e, "_cssMouseEvent");
- }, this);
-
-
- dojo.forEach(["disabled", "readOnly", "checked", "selected", "focused", "state", "hovering", "active"], function(attr){
- this.watch(attr, dojo.hitch(this, "_setStateClass"));
- }, this);
-
- for(var ap in this.cssStateNodes){
- this._trackMouseState(this[ap], this.cssStateNodes[ap]);
- }
-
-
- this._setStateClass();
- },
- _cssMouseEvent: function(/*Event*/ event){
-
-
-
- if(!this.disabled){
- switch(event.type){
- case "mouseenter":
- case "mouseover":
- this._set("hovering", true);
- this._set("active", this._mouseDown);
- break;
- case "mouseleave":
- case "mouseout":
- this._set("hovering", false);
- this._set("active", false);
- break;
- case "mousedown" :
- this._set("active", true);
- this._mouseDown = true;
-
-
-
- var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
- this._mouseDown = false;
- this._set("active", false);
- this.disconnect(mouseUpConnector);
- });
- break;
- }
- }
- },
- _setStateClass: function(){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var newStateClasses = this.baseClass.split(" ");
- function multiply(modifier){
- newStateClasses = newStateClasses.concat(dojo.map(newStateClasses, function(c){ return c+modifier; }), "dijit"+modifier);
- }
- if(!this.isLeftToRight()){
-
- multiply("Rtl");
- }
- if(this.checked){
- multiply("Checked");
- }
- if(this.state){
- multiply(this.state);
- }
- if(this.selected){
- multiply("Selected");
- }
- if(this.disabled){
- multiply("Disabled");
- }else if(this.readOnly){
- multiply("ReadOnly");
- }else{
- if(this.active){
- multiply("Active");
- }else if(this.hovering){
- multiply("Hover");
- }
- }
- if(this._focused){
- multiply("Focused");
- }
-
-
- var tn = this.stateNode || this.domNode,
- classHash = {};
- dojo.forEach(tn.className.split(" "), function(c){ classHash[c] = true; });
- if("_stateClasses" in this){
- dojo.forEach(this._stateClasses, function(c){ delete classHash[c]; });
- }
- dojo.forEach(newStateClasses, function(c){ classHash[c] = true; });
- var newClasses = [];
- for(var c in classHash){
- newClasses.push(c);
- }
- tn.className = newClasses.join(" ");
- this._stateClasses = newStateClasses;
- },
- _trackMouseState: function(/*DomNode*/ node, /*String*/ clazz){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var hovering=false, active=false, focused=false;
- var self = this,
- cn = dojo.hitch(this, "connect", node);
- function setClass(){
- var disabled = ("disabled" in self && self.disabled) || ("readonly" in self && self.readonly);
- dojo.toggleClass(node, clazz+"Hover", hovering && !active && !disabled);
- dojo.toggleClass(node, clazz+"Active", active && !disabled);
- dojo.toggleClass(node, clazz+"Focused", focused && !disabled);
- }
-
- cn("onmouseenter", function(){
- hovering = true;
- setClass();
- });
- cn("onmouseleave", function(){
- hovering = false;
- active = false;
- setClass();
- });
- cn("onmousedown", function(){
- active = true;
- setClass();
- });
- cn("onmouseup", function(){
- active = false;
- setClass();
- });
-
- cn("onfocus", function(){
- focused = true;
- setClass();
- });
- cn("onblur", function(){
- focused = false;
- setClass();
- });
-
-
- this.watch("disabled", setClass);
- this.watch("readOnly", setClass);
- }
- });
- }
- if(!dojo._hasResource["dijit.form._FormWidget"]){
- dojo._hasResource["dijit.form._FormWidget"] = true;
- dojo.provide("dijit.form._FormWidget");
- dojo.declare("dijit.form._FormWidget", [dijit._Widget, dijit._Templated, dijit._CssStateMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
- name: "",
-
-
- alt: "",
-
-
- value: "",
-
-
- type: "text",
-
-
- tabIndex: "0",
-
-
-
- disabled: false,
-
-
- intermediateChanges: false,
-
-
- scrollOnFocus: true,
-
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- value: "focusNode",
- id: "focusNode",
- tabIndex: "focusNode",
- alt: "focusNode",
- title: "focusNode"
- }),
- postMixInProperties: function(){
-
-
-
-
- this.nameAttrSetting = this.name ? ('name="' + this.name.replace(/'/g, """) + '"') : '';
- this.inherited(arguments);
- },
- postCreate: function(){
- this.inherited(arguments);
- this.connect(this.domNode, "onmousedown", "_onMouseDown");
- },
- _setDisabledAttr: function(/*Boolean*/ value){
- this._set("disabled", value);
- dojo.attr(this.focusNode, 'disabled', value);
- if(this.valueNode){
- dojo.attr(this.valueNode, 'disabled', value);
- }
- dijit.setWaiState(this.focusNode, "disabled", value);
- if(value){
-
-
- this._set("hovering", false);
- this._set("active", false);
-
- var attachPointNames = "tabIndex" in this.attributeMap ? this.attributeMap.tabIndex : "focusNode";
- dojo.forEach(dojo.isArray(attachPointNames) ? attachPointNames : [attachPointNames], function(attachPointName){
- var node = this[attachPointName];
-
- if(dojo.isWebKit || dijit.hasDefaultTabStop(node)){
- node.setAttribute('tabIndex', "-1");
- }else{
- node.removeAttribute('tabIndex');
- }
- }, this);
- }else{
- if(this.tabIndex != ""){
- this.focusNode.setAttribute('tabIndex', this.tabIndex);
- }
- }
- },
- setDisabled: function(/*Boolean*/ disabled){
-
-
- dojo.deprecated("setDisabled("+disabled+") is deprecated. Use set('disabled',"+disabled+") instead.", "", "2.0");
- this.set('disabled', disabled);
- },
- _onFocus: function(e){
- if(this.scrollOnFocus){
- dojo.window.scrollIntoView(this.domNode);
- }
- this.inherited(arguments);
- },
- isFocusable: function(){
-
-
-
-
- return !this.disabled && this.focusNode && (dojo.style(this.domNode, "display") != "none");
- },
- focus: function(){
-
-
- if(!this.disabled){
- dijit.focus(this.focusNode);
- }
- },
- compare: function(/*anything*/ val1, /*anything*/ val2){
-
-
-
-
- if(typeof val1 == "number" && typeof val2 == "number"){
- return (isNaN(val1) && isNaN(val2)) ? 0 : val1 - val2;
- }else if(val1 > val2){
- return 1;
- }else if(val1 < val2){
- return -1;
- }else{
- return 0;
- }
- },
- onChange: function(newValue){
-
-
-
-
- },
-
-
-
-
- _onChangeActive: false,
- _handleOnChange: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){
-
-
-
-
-
-
-
-
-
-
- if(this._lastValueReported == undefined && (priorityChange === null || !this._onChangeActive)){
-
-
- this._resetValue = this._lastValueReported = newValue;
- }
- this._pendingOnChange = this._pendingOnChange
- || (typeof newValue != typeof this._lastValueReported)
- || (this.compare(newValue, this._lastValueReported) != 0);
- if((this.intermediateChanges || priorityChange || priorityChange === undefined) && this._pendingOnChange){
- this._lastValueReported = newValue;
- this._pendingOnChange = false;
- if(this._onChangeActive){
- if(this._onChangeHandle){
- clearTimeout(this._onChangeHandle);
- }
-
-
- this._onChangeHandle = setTimeout(dojo.hitch(this,
- function(){
- this._onChangeHandle = null;
- this.onChange(newValue);
- }), 0);
- }
- }
- },
- create: function(){
-
- this.inherited(arguments);
- this._onChangeActive = true;
- },
- destroy: function(){
- if(this._onChangeHandle){
- clearTimeout(this._onChangeHandle);
- this.onChange(this._lastValueReported);
- }
- this.inherited(arguments);
- },
- setValue: function(/*String*/ value){
-
-
- dojo.deprecated("dijit.form._FormWidget:setValue("+value+") is deprecated. Use set('value',"+value+") instead.", "", "2.0");
- this.set('value', value);
- },
- getValue: function(){
-
-
- dojo.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.", "", "2.0");
- return this.get('value');
- },
-
- _onMouseDown: function(e){
-
-
-
-
- if(!e.ctrlKey && dojo.mouseButtons.isLeft(e) && this.isFocusable()){
-
-
- var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
- if (this.isFocusable()) {
- this.focus();
- }
- this.disconnect(mouseUpConnector);
- });
- }
- }
- });
- dojo.declare("dijit.form._FormValueWidget", dijit.form._FormWidget,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- readOnly: false,
- attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
- value: "",
- readOnly: "focusNode"
- }),
- _setReadOnlyAttr: function(/*Boolean*/ value){
- dojo.attr(this.focusNode, 'readOnly', value);
- dijit.setWaiState(this.focusNode, "readonly", value);
- this._set("readOnly", value);
- },
- postCreate: function(){
- this.inherited(arguments);
- if(dojo.isIE < 9 || (dojo.isIE && dojo.isQuirks)){
- this.connect(this.focusNode || this.domNode, "onkeydown", this._onKeyDown);
- }
-
-
- if(this._resetValue === undefined){
- this._lastValueReported = this._resetValue = this.value;
- }
- },
- _setValueAttr: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){
-
-
-
-
-
-
- this._handleOnChange(newValue, priorityChange);
- },
- _handleOnChange: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){
-
-
-
- this._set("value", newValue);
- this.inherited(arguments);
- },
- undo: function(){
-
-
- this._setValueAttr(this._lastValueReported, false);
- },
- reset: function(){
-
-
- this._hasBeenBlurred = false;
- this._setValueAttr(this._resetValue, true);
- },
- _onKeyDown: function(e){
- if(e.keyCode == dojo.keys.ESCAPE && !(e.ctrlKey || e.altKey || e.metaKey)){
- var te;
- if(dojo.isIE){
- e.preventDefault();
- te = document.createEventObject();
- te.keyCode = dojo.keys.ESCAPE;
- te.shiftKey = e.shiftKey;
- e.srcElement.fireEvent('onkeypress', te);
- }
- }
- },
- _layoutHackIE7: function(){
-
-
- if(dojo.isIE == 7){
- var domNode = this.domNode;
- var parent = domNode.parentNode;
- var pingNode = domNode.firstChild || domNode;
- var origFilter = pingNode.style.filter;
- var _this = this;
- while(parent && parent.clientHeight == 0){
- (function ping(){
- var disconnectHandle = _this.connect(parent, "onscroll",
- function(e){
- _this.disconnect(disconnectHandle);
- pingNode.style.filter = (new Date()).getMilliseconds();
- setTimeout(function(){ pingNode.style.filter = origFilter }, 0);
- }
- );
- })();
- parent = parent.parentNode;
- }
- }
- }
- });
- }
- if(!dojo._hasResource["dijit._HasDropDown"]){
- dojo._hasResource["dijit._HasDropDown"] = true;
- dojo.provide("dijit._HasDropDown");
- dojo.declare("dijit._HasDropDown",
- null,
- {
-
-
-
-
-
-
- _buttonNode: null,
-
-
-
-
-
- _arrowWrapperNode: null,
-
-
-
-
- _popupStateNode: null,
-
-
-
-
- _aroundNode: null,
-
-
-
- dropDown: null,
-
-
-
-
- autoWidth: true,
-
-
-
- forceWidth: false,
-
-
-
-
- maxHeight: 0,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dropDownPosition: ["below","above"],
-
-
-
- _stopClickEvents: true,
- _onDropDownMouseDown: function(/*Event*/ e){
-
-
- if(this.disabled || this.readOnly){ return; }
-
-
-
-
- e.preventDefault();
- this._docHandler = this.connect(dojo.doc, "onmouseup", "_onDropDownMouseUp");
- this.toggleDropDown();
- },
- _onDropDownMouseUp: function(/*Event?*/ e){
-
-
-
-
-
-
-
-
-
-
-
- if(e && this._docHandler){
- this.disconnect(this._docHandler);
- }
- var dropDown = this.dropDown, overMenu = false;
- if(e && this._opened){
-
-
-
-
- var c = dojo.position(this._buttonNode, true);
- if(!(e.pageX >= c.x && e.pageX <= c.x + c.w) ||
- !(e.pageY >= c.y && e.pageY <= c.y + c.h)){
- var t = e.target;
- while(t && !overMenu){
- if(dojo.hasClass(t, "dijitPopup")){
- overMenu = true;
- }else{
- t = t.parentNode;
- }
- }
- if(overMenu){
- t = e.target;
- if(dropDown.onItemClick){
- var menuItem;
- while(t && !(menuItem = dijit.byNode(t))){
- t = t.parentNode;
- }
- if(menuItem && menuItem.onClick && menuItem.getParent){
- menuItem.getParent().onItemClick(menuItem, e);
- }
- }
- return;
- }
- }
- }
- if(this._opened && dropDown.focus && dropDown.autoFocus !== false){
-
-
- window.setTimeout(dojo.hitch(dropDown, "focus"), 1);
- }
- },
- _onDropDownClick: function(/*Event*/ e){
-
- if(this._stopClickEvents){
- dojo.stopEvent(e);
- }
- },
- buildRendering: function(){
- this.inherited(arguments);
- this._buttonNode = this._buttonNode || this.focusNode || this.domNode;
- this._popupStateNode = this._popupStateNode || this.focusNode || this._buttonNode;
-
-
- var defaultPos = {
- "after" : this.isLeftToRight() ? "Right" : "Left",
- "before" : this.isLeftToRight() ? "Left" : "Right",
- "above" : "Up",
- "below" : "Down",
- "left" : "Left",
- "right" : "Right"
- }[this.dropDownPosition[0]] || this.dropDownPosition[0] || "Down";
- dojo.addClass(this._arrowWrapperNode || this._buttonNode, "dijit" + defaultPos + "ArrowButton");
- },
- postCreate: function(){
-
-
- this.inherited(arguments);
- this.connect(this._buttonNode, "onmousedown", "_onDropDownMouseDown");
- this.connect(this._buttonNode, "onclick", "_onDropDownClick");
- this.connect(this.focusNode, "onkeypress", "_onKey");
- this.connect(this.focusNode, "onkeyup", "_onKeyUp");
- },
- destroy: function(){
- if(this.dropDown){
-
-
- if(!this.dropDown._destroyed){
- this.dropDown.destroyRecursive();
- }
- delete this.dropDown;
- }
- this.inherited(arguments);
- },
- _onKey: function(/*Event*/ e){
-
-
- if(this.disabled || this.readOnly){ return; }
- var d = this.dropDown, target = e.target;
- if(d && this._opened && d.handleKey){
- if(d.handleKey(e) === false){
-
- dojo.stopEvent(e);
- return;
- }
- }
- if(d && this._opened && e.charOrCode == dojo.keys.ESCAPE){
- this.closeDropDown();
- dojo.stopEvent(e);
- }else if(!this._opened &&
- (e.charOrCode == dojo.keys.DOWN_ARROW ||
- ( (e.charOrCode == dojo.keys.ENTER || e.charOrCode == " ") &&
-
- ((target.tagName || "").toLowerCase() !== 'input' ||
- (target.type && target.type.toLowerCase() !== 'text'))))){
-
-
-
- this._toggleOnKeyUp = true;
- dojo.stopEvent(e);
- }
- },
- _onKeyUp: function(){
- if(this._toggleOnKeyUp){
- delete this._toggleOnKeyUp;
- this.toggleDropDown();
- var d = this.dropDown;
- if(d && d.focus){
- setTimeout(dojo.hitch(d, "focus"), 1);
- }
- }
- },
- _onBlur: function(){
-
-
-
-
-
-
- var focusMe = dijit._curFocus && this.dropDown && dojo.isDescendant(dijit._curFocus, this.dropDown.domNode);
- this.closeDropDown(focusMe);
- this.inherited(arguments);
- },
- isLoaded: function(){
-
-
-
-
-
- return true;
- },
- loadDropDown: function(/* Function */ loadCallback){
-
-
-
-
-
-
- loadCallback();
- },
- toggleDropDown: function(){
-
-
-
-
-
-
- if(this.disabled || this.readOnly){ return; }
- if(!this._opened){
-
- if(!this.isLoaded()){
- this.loadDropDown(dojo.hitch(this, "openDropDown"));
- return;
- }else{
- this.openDropDown();
- }
- }else{
- this.closeDropDown();
- }
- },
- openDropDown: function(){
-
-
-
-
-
-
-
- var dropDown = this.dropDown,
- ddNode = dropDown.domNode,
- aroundNode = this._aroundNode || this.domNode,
- self = this;
-
-
-
- if(!this._preparedNode){
- this._preparedNode = true;
-
- if(ddNode.style.width){
- this._explicitDDWidth = true;
- }
- if(ddNode.style.height){
- this._explicitDDHeight = true;
- }
- }
-
- if(this.maxHeight || this.forceWidth || this.autoWidth){
- var myStyle = {
- display: "",
- visibility: "hidden"
- };
- if(!this._explicitDDWidth){
- myStyle.width = "";
- }
- if(!this._explicitDDHeight){
- myStyle.height = "";
- }
- dojo.style(ddNode, myStyle);
-
-
- var maxHeight = this.maxHeight;
- if(maxHeight == -1){
-
-
- var viewport = dojo.window.getBox(),
- position = dojo.position(aroundNode, false);
- maxHeight = Math.floor(Math.max(position.y, viewport.h - (position.y + position.h)));
- }
-
-
- if(dropDown.startup && !dropDown._started){
- dropDown.startup();
- }
- dijit.popup.moveOffScreen(dropDown);
-
- var mb = dojo._getMarginSize(ddNode);
- var overHeight = (maxHeight && mb.h > maxHeight);
- dojo.style(ddNode, {
- overflowX: "hidden",
- overflowY: overHeight ? "auto" : "hidden"
- });
- if(overHeight){
- mb.h = maxHeight;
- if("w" in mb){
- mb.w += 16;
- }
- }else{
- delete mb.h;
- }
-
- if(this.forceWidth){
- mb.w = aroundNode.offsetWidth;
- }else if(this.autoWidth){
- mb.w = Math.max(mb.w, aroundNode.offsetWidth);
- }else{
- delete mb.w;
- }
-
-
- if(dojo.isFunction(dropDown.resize)){
- dropDown.resize(mb);
- }else{
- dojo.marginBox(ddNode, mb);
- }
- }
- var retVal = dijit.popup.open({
- parent: this,
- popup: dropDown,
- around: aroundNode,
- orient: dijit.getPopupAroundAlignment((this.dropDownPosition && this.dropDownPosition.length) ? this.dropDownPosition : ["below"],this.isLeftToRight()),
- onExecute: function(){
- self.closeDropDown(true);
- },
- onCancel: function(){
- self.closeDropDown(true);
- },
- onClose: function(){
- dojo.attr(self._popupStateNode, "popupActive", false);
- dojo.removeClass(self._popupStateNode, "dijitHasDropDownOpen");
- self._opened = false;
- }
- });
- dojo.attr(this._popupStateNode, "popupActive", "true");
- dojo.addClass(self._popupStateNode, "dijitHasDropDownOpen");
- this._opened=true;
-
- return retVal;
- },
- closeDropDown: function(/*Boolean*/ focus){
-
-
-
-
-
-
- if(this._opened){
- if(focus){ this.focus(); }
- dijit.popup.close(this.dropDown);
- this._opened = false;
- }
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.form.Button"]){
- dojo._hasResource["dijit.form.Button"] = true;
- dojo.provide("dijit.form.Button");
- dojo.declare("dijit.form.Button",
- dijit.form._FormWidget,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- label: "",
-
-
-
-
-
-
-
-
- showLabel: true,
-
-
- iconClass: "",
-
-
- type: "button",
- baseClass: "dijitButton",
- templateString: dojo.cache("dijit.form", "templates/Button.html", "<span class=\"dijit dijitReset dijitInline\"\n\t><span class=\"dijitReset dijitInline dijitButtonNode\"\n\t\tdojoAttachEvent=\"ondijitclick:_onButtonClick\"\n\t\t><span class=\"dijitReset dijitStretch dijitButtonContents\"\n\t\t\tdojoAttachPoint=\"titleNode,focusNode\"\n\t\t\trole=\"button\" aria-labelledby=\"${id}_label\"\n\t\t\t><span class=\"dijitReset dijitInline dijitIcon\" dojoAttachPoint=\"iconNode\"></span\n\t\t\t><span class=\"dijitReset dijitToggleButtonIconChar\">●</span\n\t\t\t><span class=\"dijitReset dijitInline dijitButtonText\"\n\t\t\t\tid=\"${id}_label\"\n\t\t\t\tdojoAttachPoint=\"containerNode\"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type=\"${type}\" value=\"${value}\" class=\"dijitOffScreen\" tabIndex=\"-1\"\n\t\tdojoAttachPoint=\"valueNode\"\n/></span>\n"),
- attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
- value: "valueNode"
- }),
- _onClick: function(/*Event*/ e){
-
-
- if(this.disabled){
- return false;
- }
- this._clicked();
- return this.onClick(e);
- },
- _onButtonClick: function(/*Event*/ e){
-
-
- if(this._onClick(e) === false){
- e.preventDefault();
- }else if(this.type == "submit" && !(this.valueNode||this.focusNode).form){
- for(var node=this.domNode; node.parentNode; node=node.parentNode){
- var widget=dijit.byNode(node);
- if(widget && typeof widget._onSubmit == "function"){
- widget._onSubmit(e);
- break;
- }
- }
- }else if(this.valueNode){
- this.valueNode.click();
- e.preventDefault();
- }
- },
- buildRendering: function(){
- this.inherited(arguments);
- dojo.setSelectable(this.focusNode, false);
- },
- _fillContent: function(/*DomNode*/ source){
-
-
-
-
- if(source && (!this.params || !("label" in this.params))){
- this.set('label', source.innerHTML);
- }
- },
- _setShowLabelAttr: function(val){
- if(this.containerNode){
- dojo.toggleClass(this.containerNode, "dijitDisplayNone", !val);
- }
- this._set("showLabel", val);
- },
- onClick: function(/*Event*/ e){
-
-
-
-
-
- return true;
- },
- _clicked: function(/*Event*/ e){
-
-
- },
- setLabel: function(/*String*/ content){
-
-
- dojo.deprecated("dijit.form.Button.setLabel() is deprecated. Use set('label', ...) instead.", "", "2.0");
- this.set("label", content);
- },
- _setLabelAttr: function(/*String*/ content){
-
-
-
-
- this._set("label", content);
- this.containerNode.innerHTML = content;
- if(this.showLabel == false && !this.params.title){
- this.titleNode.title = dojo.trim(this.containerNode.innerText || this.containerNode.textContent || '');
- }
- },
- _setIconClassAttr: function(/*String*/ val){
-
-
- var oldVal = this.iconClass || "dijitNoIcon",
- newVal = val || "dijitNoIcon";
- dojo.replaceClass(this.iconNode, newVal, oldVal);
- this._set("iconClass", val);
- }
- });
- dojo.declare("dijit.form.DropDownButton", [dijit.form.Button, dijit._Container, dijit._HasDropDown], {
-
-
-
-
-
-
-
-
-
-
-
-
- baseClass : "dijitDropDownButton",
- templateString: dojo.cache("dijit.form", "templates/DropDownButton.html", "<span class=\"dijit dijitReset dijitInline\"\n\t><span class='dijitReset dijitInline dijitButtonNode'\n\t\tdojoAttachEvent=\"ondijitclick:_onButtonClick\" dojoAttachPoint=\"_buttonNode\"\n\t\t><span class=\"dijitReset dijitStretch dijitButtonContents\"\n\t\t\tdojoAttachPoint=\"focusNode,titleNode,_arrowWrapperNode\"\n\t\t\trole=\"button\" aria-haspopup=\"true\" aria-labelledby=\"${id}_label\"\n\t\t\t><span class=\"dijitReset dijitInline dijitIcon\"\n\t\t\t\tdojoAttachPoint=\"iconNode\"\n\t\t\t></span\n\t\t\t><span class=\"dijitReset dijitInline dijitButtonText\"\n\t\t\t\tdojoAttachPoint=\"containerNode,_popupStateNode\"\n\t\t\t\tid=\"${id}_label\"\n\t\t\t></span\n\t\t\t><span class=\"dijitReset dijitInline dijitArrowButtonInner\"></span\n\t\t\t><span class=\"dijitReset dijitInline dijitArrowButtonChar\">▼</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type=\"${type}\" value=\"${value}\" class=\"dijitOffScreen\" tabIndex=\"-1\"\n\t\tdojoAttachPoint=\"valueNode\"\n/></span>\n"),
- _fillContent: function(){
-
-
-
-
-
- if(this.srcNodeRef){
-
-
- var nodes = dojo.query("*", this.srcNodeRef);
- dijit.form.DropDownButton.superclass._fillContent.call(this, nodes[0]);
-
- this.dropDownContainer = this.srcNodeRef;
- }
- },
- startup: function(){
- if(this._started){ return; }
-
-
- if(!this.dropDown && this.dropDownContainer){
- var dropDownNode = dojo.query("[widgetId]", this.dropDownContainer)[0];
- this.dropDown = dijit.byNode(dropDownNode);
- delete this.dropDownContainer;
- }
- if(this.dropDown){
- dijit.popup.hide(this.dropDown);
- }
- this.inherited(arguments);
- },
- isLoaded: function(){
-
-
- var dropDown = this.dropDown;
- return (!!dropDown && (!dropDown.href || dropDown.isLoaded));
- },
- loadDropDown: function(){
-
- var dropDown = this.dropDown;
- if(!dropDown){ return; }
- if(!this.isLoaded()){
- var handler = dojo.connect(dropDown, "onLoad", this, function(){
- dojo.disconnect(handler);
- this.openDropDown();
- });
- dropDown.refresh();
- }else{
- this.openDropDown();
- }
- },
- isFocusable: function(){
-
-
- return this.inherited(arguments) && !this._mouseDown;
- }
- });
- dojo.declare("dijit.form.ComboButton", dijit.form.DropDownButton, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- templateString: dojo.cache("dijit.form", "templates/ComboButton.html", "<table class=\"dijit dijitReset dijitInline dijitLeft\"\n\tcellspacing='0' cellpadding='0' role=\"presentation\"\n\t><tbody role=\"presentation\"><tr role=\"presentation\"\n\t\t><td class=\"dijitReset dijitStretch dijitButtonNode\" dojoAttachPoint=\"buttonNode\" dojoAttachEvent=\"ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress\"\n\t\t><div id=\"${id}_button\" class=\"dijitReset dijitButtonContents\"\n\t\t\tdojoAttachPoint=\"titleNode\"\n\t\t\trole=\"button\" aria-labelledby=\"${id}_label\"\n\t\t\t><div class=\"dijitReset dijitInline dijitIcon\" dojoAttachPoint=\"iconNode\" role=\"presentation\"></div\n\t\t\t><div class=\"dijitReset dijitInline dijitButtonText\" id=\"${id}_label\" dojoAttachPoint=\"containerNode\" role=\"presentation\"></div\n\t\t></div\n\t\t></td\n\t\t><td id=\"${id}_arrow\" class='dijitReset dijitRight dijitButtonNode dijitArrowButton'\n\t\t\tdojoAttachPoint=\"_popupStateNode,focusNode,_buttonNode\"\n\t\t\tdojoAttachEvent=\"onkeypress:_onArrowKeyPress\"\n\t\t\ttitle=\"${optionsTitle}\"\n\t\t\trole=\"button\" aria-haspopup=\"true\"\n\t\t\t><div class=\"dijitReset dijitArrowButtonInner\" role=\"presentation\"></div\n\t\t\t><div class=\"dijitReset dijitArrowButtonChar\" role=\"presentation\">▼</div\n\t\t></td\n\t\t><td style=\"display:none !important;\"\n\t\t\t><input ${!nameAttrSetting} type=\"${type}\" value=\"${value}\" dojoAttachPoint=\"valueNode\"\n\t\t/></td></tr></tbody\n></table>\n"),
- attributeMap: dojo.mixin(dojo.clone(dijit.form.Button.prototype.attributeMap), {
- id: "",
- tabIndex: ["focusNode", "titleNode"],
- title: "titleNode"
- }),
-
-
- optionsTitle: "",
- baseClass: "dijitComboButton",
-
-
- cssStateNodes: {
- "buttonNode": "dijitButtonNode",
- "titleNode": "dijitButtonContents",
- "_popupStateNode": "dijitDownArrowButton"
- },
- _focusedNode: null,
- _onButtonKeyPress: function(/*Event*/ evt){
-
-
- if(evt.charOrCode == dojo.keys[this.isLeftToRight() ? "RIGHT_ARROW" : "LEFT_ARROW"]){
- dijit.focus(this._popupStateNode);
- dojo.stopEvent(evt);
- }
- },
- _onArrowKeyPress: function(/*Event*/ evt){
-
-
- if(evt.charOrCode == dojo.keys[this.isLeftToRight() ? "LEFT_ARROW" : "RIGHT_ARROW"]){
- dijit.focus(this.titleNode);
- dojo.stopEvent(evt);
- }
- },
-
- focus: function(/*String*/ position){
-
-
-
-
-
- if(!this.disabled){
- dijit.focus(position == "start" ? this.titleNode : this._popupStateNode);
- }
- }
- });
- dojo.declare("dijit.form.ToggleButton", dijit.form.Button, {
-
-
-
- baseClass: "dijitToggleButton",
-
-
-
-
-
- checked: false,
- attributeMap: dojo.mixin(dojo.clone(dijit.form.Button.prototype.attributeMap), {
- checked:"focusNode"
- }),
- _clicked: function(/*Event*/ evt){
- this.set('checked', !this.checked);
- },
- _setCheckedAttr: function(/*Boolean*/ value, /*Boolean?*/ priorityChange){
- this._set("checked", value);
- dojo.attr(this.focusNode || this.domNode, "checked", value);
- dijit.setWaiState(this.focusNode || this.domNode, "pressed", value);
- this._handleOnChange(value, priorityChange);
- },
- setChecked: function(/*Boolean*/ checked){
-
-
- dojo.deprecated("setChecked("+checked+") is deprecated. Use set('checked',"+checked+") instead.", "", "2.0");
- this.set('checked', checked);
- },
- reset: function(){
-
-
- this._hasBeenBlurred = false;
-
- this.set('checked', this.params.checked || false);
- }
- });
- }
- if(!dojo._hasResource["dijit._editor._Plugin"]){
- dojo._hasResource["dijit._editor._Plugin"] = true;
- dojo.provide("dijit._editor._Plugin");
- dojo.declare("dijit._editor._Plugin", null, {
-
-
-
- constructor: function(/*Object?*/args, /*DomNode?*/node){
- this.params = args || {};
- dojo.mixin(this, this.params);
- this._connects=[];
- this._attrPairNames = {};
- },
-
-
- editor: null,
-
-
- iconClassPrefix: "dijitEditorIcon",
-
-
-
-
- button: null,
-
-
-
- command: "",
-
-
- useDefaultCommand: true,
-
-
-
-
- buttonClass: dijit.form.Button,
-
-
-
- disabled: false,
- getLabel: function(/*String*/key){
-
-
-
-
- return this.editor.commands[key];
- },
- _initButton: function(){
-
-
-
-
-
- if(this.command.length){
- var label = this.getLabel(this.command),
- editor = this.editor,
- className = this.iconClassPrefix+" "+this.iconClassPrefix + this.command.charAt(0).toUpperCase() + this.command.substr(1);
- if(!this.button){
- var props = dojo.mixin({
- label: label,
- dir: editor.dir,
- lang: editor.lang,
- showLabel: false,
- iconClass: className,
- dropDown: this.dropDown,
- tabIndex: "-1"
- }, this.params || {});
- this.button = new this.buttonClass(props);
- }
- }
- if(this.get("disabled") && this.button){
- this.button.set("disabled", this.get("disabled"));
- }
- },
- destroy: function(){
-
-
- dojo.forEach(this._connects, dojo.disconnect);
- if(this.dropDown){
- this.dropDown.destroyRecursive();
- }
- },
- connect: function(o, f, tf){
-
-
-
-
-
- this._connects.push(dojo.connect(o, f, this, tf));
- },
- updateState: function(){
-
-
-
-
-
-
-
-
-
-
-
- var e = this.editor,
- c = this.command,
- checked, enabled;
- if(!e || !e.isLoaded || !c.length){ return; }
- var disabled = this.get("disabled");
- if(this.button){
- try{
- enabled = !disabled && e.queryCommandEnabled(c);
- if(this.enabled !== enabled){
- this.enabled = enabled;
- this.button.set('disabled', !enabled);
- }
- if(typeof this.button.checked == 'boolean'){
- checked = e.queryCommandState(c);
- if(this.checked !== checked){
- this.checked = checked;
- this.button.set('checked', e.queryCommandState(c));
- }
- }
- }catch(e){
- console.log(e);
- }
- }
- },
- setEditor: function(/*dijit.Editor*/ editor){
-
-
-
-
- this.editor = editor;
-
- this._initButton();
-
- if(this.button && this.useDefaultCommand){
- if(this.editor.queryCommandAvailable(this.command)){
- this.connect(this.button, "onClick",
- dojo.hitch(this.editor, "execCommand", this.command, this.commandArg)
- );
- }else{
-
- this.button.domNode.style.display = "none";
- }
- }
- this.connect(this.editor, "onNormalizedDisplayChanged", "updateState");
- },
- setToolbar: function(/*dijit.Toolbar*/ toolbar){
-
-
-
-
- if(this.button){
- toolbar.addChild(this.button);
- }
-
- },
-
- set: function(/* attribute */ name, /* anything */ value){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(typeof name === "object"){
- for(var x in name){
- this.set(x, name[x]);
- }
- return this;
- }
- var names = this._getAttrNames(name);
- if(this[names.s]){
-
- var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
- }else{
- this._set(name, value);
- }
- return result || this;
- },
- get: function(name){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var names = this._getAttrNames(name);
- return this[names.g] ? this[names.g]() : this[name];
- },
- _setDisabledAttr: function(disabled){
-
-
-
- this.disabled = disabled;
- this.updateState();
- },
-
- _getAttrNames: function(name){
-
-
-
-
-
- var apn = this._attrPairNames;
- if(apn[name]){ return apn[name]; }
- var uc = name.charAt(0).toUpperCase() + name.substr(1);
- return (apn[name] = {
- s: "_set"+uc+"Attr",
- g: "_get"+uc+"Attr"
- });
- },
-
- _set: function(/*String*/ name, /*anything*/ value){
-
-
- var oldValue = this[name];
- this[name] = value;
- }
- });
- }
- if(!dojo._hasResource["dijit._editor.range"]){
- dojo._hasResource["dijit._editor.range"] = true;
- dojo.provide("dijit._editor.range");
- dijit.range={};
- dijit.range.getIndex=function(/*DomNode*/node, /*DomNode*/parent){
- var ret=[], retR=[];
- var stop = parent;
- var onode = node;
- var pnode, n;
- while(node != stop){
- var i = 0;
- pnode = node.parentNode;
- while((n=pnode.childNodes[i++])){
- if(n === node){
- --i;
- break;
- }
- }
-
-
-
- ret.unshift(i);
- retR.unshift(i-pnode.childNodes.length);
- node = pnode;
- }
-
-
-
- if(ret.length > 0 && onode.nodeType == 3){
- n = onode.previousSibling;
- while(n && n.nodeType == 3){
- ret[ret.length-1]--;
- n = n.previousSibling;
- }
- n = onode.nextSibling;
- while(n && n.nodeType == 3){
- retR[retR.length-1]++;
- n = n.nextSibling;
- }
- }
- return {o: ret, r:retR};
- }
- dijit.range.getNode = function(/*Array*/index, /*DomNode*/parent){
- if(!dojo.isArray(index) || index.length == 0){
- return parent;
- }
- var node = parent;
- dojo.every(index, function(i){
- if(i >= 0 && i < node.childNodes.length){
- node = node.childNodes[i];
- }else{
- node = null;
-
- return false;
- }
- return true;
- });
- return node;
- }
- dijit.range.getCommonAncestor = function(n1,n2,root){
- root = root||n1.ownerDocument.body;
- var getAncestors = function(n){
- var as=[];
- while(n){
- as.unshift(n);
- if(n !== root){
- n = n.parentNode;
- }else{
- break;
- }
- }
- return as;
- };
- var n1as = getAncestors(n1);
- var n2as = getAncestors(n2);
- var m = Math.min(n1as.length,n2as.length);
- var com = n1as[0];
- for(var i=1;i<m;i++){
- if(n1as[i] === n2as[i]){
- com = n1as[i]
- }else{
- break;
- }
- }
- return com;
- }
- dijit.range.getAncestor = function(/*DomNode*/node, /*RegEx?*/regex, /*DomNode?*/root){
- root = root || node.ownerDocument.body;
- while(node && node !== root){
- var name = node.nodeName.toUpperCase() ;
- if(regex.test(name)){
- return node;
- }
- node = node.parentNode;
- }
- return null;
- }
- dijit.range.BlockTagNames = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DT|DE)$/;
- dijit.range.getBlockAncestor = function(/*DomNode*/node, /*RegEx?*/regex, /*DomNode?*/root){
- root = root || node.ownerDocument.body;
- regex = regex || dijit.range.BlockTagNames;
- var block=null, blockContainer;
- while(node && node !== root){
- var name = node.nodeName.toUpperCase() ;
- if(!block && regex.test(name)){
- block = node;
- }
- if(!blockContainer && (/^(?:BODY|TD|TH|CAPTION)$/).test(name)){
- blockContainer = node;
- }
- node = node.parentNode;
- }
- return {blockNode:block, blockContainer:blockContainer || node.ownerDocument.body};
- }
- dijit.range.atBeginningOfContainer = function(/*DomNode*/container, /*DomNode*/node, /*Int*/offset){
- var atBeginning = false;
- var offsetAtBeginning = (offset == 0);
- if(!offsetAtBeginning && node.nodeType == 3){
- if(/^[\s\xA0]+$/.test(node.nodeValue.substr(0,offset))){
- offsetAtBeginning = true;
- }
- }
- if(offsetAtBeginning){
- var cnode = node;
- atBeginning = true;
- while(cnode && cnode !== container){
- if(cnode.previousSibling){
- atBeginning = false;
- break;
- }
- cnode = cnode.parentNode;
- }
- }
- return atBeginning;
- }
- dijit.range.atEndOfContainer = function(/*DomNode*/container, /*DomNode*/node, /*Int*/offset){
- var atEnd = false;
- var offsetAtEnd = (offset == (node.length || node.childNodes.length));
- if(!offsetAtEnd && node.nodeType == 3){
- if(/^[\s\xA0]+$/.test(node.nodeValue.substr(offset))){
- offsetAtEnd = true;
- }
- }
- if(offsetAtEnd){
- var cnode = node;
- atEnd = true;
- while(cnode && cnode !== container){
- if(cnode.nextSibling){
- atEnd = false;
- break;
- }
- cnode = cnode.parentNode;
- }
- }
- return atEnd;
- }
- dijit.range.adjacentNoneTextNode=function(startnode, next){
- var node = startnode;
- var len = (0-startnode.length) || 0;
- var prop = next?'nextSibling':'previousSibling';
- while(node){
- if(node.nodeType!=3){
- break;
- }
- len += node.length
- node = node[prop];
- }
- return [node,len];
- }
- dijit.range._w3c = Boolean(window['getSelection']);
- dijit.range.create = function(/*Window?*/win){
- if(dijit.range._w3c){
- return (win || dojo.global).document.createRange();
- }else{
- return new dijit.range.W3CRange;
- }
- }
- dijit.range.getSelection = function(/*Window*/win, /*Boolean?*/ignoreUpdate){
- if(dijit.range._w3c){
- return win.getSelection();
- }else{
- var s = new dijit.range.ie.selection(win);
- if(!ignoreUpdate){
- s._getCurrentSelection();
- }
- return s;
- }
- }
- if(!dijit.range._w3c){
- dijit.range.ie={
- cachedSelection: {},
- selection: function(win){
- this._ranges = [];
- this.addRange = function(r, /*boolean*/internal){
- this._ranges.push(r);
- if(!internal){
- r._select();
- }
- this.rangeCount = this._ranges.length;
- };
- this.removeAllRanges = function(){
-
- this._ranges = [];
- this.rangeCount = 0;
- };
- var _initCurrentRange = function(){
- var r = win.document.selection.createRange();
- var type=win.document.selection.type.toUpperCase();
- if(type == "CONTROL"){
-
- return new dijit.range.W3CRange(dijit.range.ie.decomposeControlRange(r));
- }else{
- return new dijit.range.W3CRange(dijit.range.ie.decomposeTextRange(r));
- }
- };
- this.getRangeAt = function(i){
- return this._ranges[i];
- };
- this._getCurrentSelection = function(){
- this.removeAllRanges();
- var r=_initCurrentRange();
- if(r){
- this.addRange(r, true);
- }
- };
- },
- decomposeControlRange: function(range){
- var firstnode = range.item(0), lastnode = range.item(range.length-1);
- var startContainer = firstnode.parentNode, endContainer = lastnode.parentNode;
- var startOffset = dijit.range.getIndex(firstnode, startContainer).o;
- var endOffset = dijit.range.getIndex(lastnode, endContainer).o+1;
- return [startContainer, startOffset,endContainer, endOffset];
- },
- getEndPoint: function(range, end){
- var atmrange = range.duplicate();
- atmrange.collapse(!end);
- var cmpstr = 'EndTo' + (end?'End':'Start');
- var parentNode = atmrange.parentElement();
- var startnode, startOffset, lastNode;
- if(parentNode.childNodes.length>0){
- dojo.every(parentNode.childNodes, function(node,i){
- var calOffset;
- if(node.nodeType != 3){
- atmrange.moveToElementText(node);
- if(atmrange.compareEndPoints(cmpstr,range) > 0){
-
- if(lastNode && lastNode.nodeType == 3){
-
- startnode = lastNode;
- calOffset = true;
- }else{
- startnode = parentNode;
- startOffset = i;
- return false;
- }
- }else{
- if(i == parentNode.childNodes.length-1){
- startnode = parentNode;
- startOffset = parentNode.childNodes.length;
- return false;
- }
- }
- }else{
- if(i == parentNode.childNodes.length-1){
- startnode = node;
- calOffset = true;
- }
- }
-
- if(calOffset && startnode){
- var prevnode = dijit.range.adjacentNoneTextNode(startnode)[0];
- if(prevnode){
- startnode = prevnode.nextSibling;
- }else{
- startnode = parentNode.firstChild;
- }
- var prevnodeobj = dijit.range.adjacentNoneTextNode(startnode);
- prevnode = prevnodeobj[0];
- var lenoffset = prevnodeobj[1];
- if(prevnode){
- atmrange.moveToElementText(prevnode);
- atmrange.collapse(false);
- }else{
- atmrange.moveToElementText(parentNode);
- }
- atmrange.setEndPoint(cmpstr, range);
- startOffset = atmrange.text.length-lenoffset;
- return false;
- }
-
- lastNode = node;
- return true;
- });
- }else{
- startnode = parentNode;
- startOffset = 0;
- }
-
-
-
- if(!end && startnode.nodeType == 1 && startOffset == startnode.childNodes.length){
- var nextnode=startnode.nextSibling;
- if(nextnode && nextnode.nodeType == 3){
- startnode = nextnode;
- startOffset = 0;
- }
- }
- return [startnode, startOffset];
- },
- setEndPoint: function(range, container, offset){
-
- var atmrange = range.duplicate(), node, len;
- if(container.nodeType!=3){
- if(offset > 0){
- node = container.childNodes[offset-1];
- if(node){
- if(node.nodeType == 3){
- container = node;
- offset = node.length;
-
- }else{
- if(node.nextSibling && node.nextSibling.nodeType == 3){
- container=node.nextSibling;
- offset=0;
-
- }else{
- atmrange.moveToElementText(node.nextSibling?node:container);
- var parent = node.parentNode;
- var tempNode = parent.insertBefore(node.ownerDocument.createTextNode(' '), node.nextSibling);
- atmrange.collapse(false);
- parent.removeChild(tempNode);
- }
- }
- }
- }else{
- atmrange.moveToElementText(container);
- atmrange.collapse(true);
- }
- }
- if(container.nodeType == 3){
- var prevnodeobj = dijit.range.adjacentNoneTextNode(container);
- var prevnode = prevnodeobj[0];
- len = prevnodeobj[1];
- if(prevnode){
- atmrange.moveToElementText(prevnode);
- atmrange.collapse(false);
-
-
- if(prevnode.contentEditable!='inherit'){
- len++;
- }
- }else{
- atmrange.moveToElementText(container.parentNode);
- atmrange.collapse(true);
- }
- offset += len;
- if(offset>0){
- if(atmrange.move('character',offset) != offset){
- console.error('Error when moving!');
- }
- }
- }
- return atmrange;
- },
- decomposeTextRange: function(range){
- var tmpary = dijit.range.ie.getEndPoint(range);
- var startContainer = tmpary[0], startOffset = tmpary[1];
- var endContainer = tmpary[0], endOffset = tmpary[1];
- if(range.htmlText.length){
- if(range.htmlText == range.text){
- endOffset = startOffset+range.text.length;
- }else{
- tmpary = dijit.range.ie.getEndPoint(range,true);
- endContainer = tmpary[0], endOffset = tmpary[1];
- }
- }
- return [startContainer, startOffset, endContainer, endOffset];
- },
- setRange: function(range, startContainer,
- startOffset, endContainer, endOffset, collapsed){
- var start=dijit.range.ie.setEndPoint(range, startContainer, startOffset);
- range.setEndPoint('StartToStart',start);
- if(!collapsed){
- var end=dijit.range.ie.setEndPoint(range, endContainer, endOffset);
- }
- range.setEndPoint('EndToEnd',end || start);
- return range;
- }
- }
- dojo.declare("dijit.range.W3CRange",null, {
- constructor: function(){
- if(arguments.length>0){
- this.setStart(arguments[0][0],arguments[0][1]);
- this.setEnd(arguments[0][2],arguments[0][3]);
- }else{
- this.commonAncestorContainer = null;
- this.startContainer = null;
- this.startOffset = 0;
- this.endContainer = null;
- this.endOffset = 0;
- this.collapsed = true;
- }
- },
- _updateInternal: function(){
- if(this.startContainer !== this.endContainer){
- this.commonAncestorContainer = dijit.range.getCommonAncestor(this.startContainer, this.endContainer);
- }else{
- this.commonAncestorContainer = this.startContainer;
- }
- this.collapsed = (this.startContainer === this.endContainer) && (this.startOffset == this.endOffset);
- },
- setStart: function(node, offset){
- offset=parseInt(offset);
- if(this.startContainer === node && this.startOffset == offset){
- return;
- }
- delete this._cachedBookmark;
- this.startContainer = node;
- this.startOffset = offset;
- if(!this.endContainer){
- this.setEnd(node, offset);
- }else{
- this._updateInternal();
- }
- },
- setEnd: function(node, offset){
- offset=parseInt(offset);
- if(this.endContainer === node && this.endOffset == offset){
- return;
- }
- delete this._cachedBookmark;
- this.endContainer = node;
- this.endOffset = offset;
- if(!this.startContainer){
- this.setStart(node, offset);
- }else{
- this._updateInternal();
- }
- },
- setStartAfter: function(node, offset){
- this._setPoint('setStart', node, offset, 1);
- },
- setStartBefore: function(node, offset){
- this._setPoint('setStart', node, offset, 0);
- },
- setEndAfter: function(node, offset){
- this._setPoint('setEnd', node, offset, 1);
- },
- setEndBefore: function(node, offset){
- this._setPoint('setEnd', node, offset, 0);
- },
- _setPoint: function(what, node, offset, ext){
- var index = dijit.range.getIndex(node, node.parentNode).o;
- this[what](node.parentNode, index.pop()+ext);
- },
- _getIERange: function(){
- var r = (this._body || this.endContainer.ownerDocument.body).createTextRange();
- dijit.range.ie.setRange(r, this.startContainer, this.startOffset, this.endContainer, this.endOffset, this.collapsed);
- return r;
- },
- getBookmark: function(body){
- this._getIERange();
- return this._cachedBookmark;
- },
- _select: function(){
- var r = this._getIERange();
- r.select();
- },
- deleteContents: function(){
- var r = this._getIERange();
- r.pasteHTML('');
- this.endContainer = this.startContainer;
- this.endOffset = this.startOffset;
- this.collapsed = true;
- },
- cloneRange: function(){
- var r = new dijit.range.W3CRange([this.startContainer,this.startOffset,
- this.endContainer,this.endOffset]);
- r._body = this._body;
- return r;
- },
- detach: function(){
- this._body = null;
- this.commonAncestorContainer = null;
- this.startContainer = null;
- this.startOffset = 0;
- this.endContainer = null;
- this.endOffset = 0;
- this.collapsed = true;
- }
- });
- }
- }
- if(!dojo._hasResource["dijit._editor.selection"]){
- dojo._hasResource["dijit._editor.selection"] = true;
- dojo.provide("dijit._editor.selection");
- dojo.getObject("_editor.selection", true, dijit);
- dojo.mixin(dijit._editor.selection, {
- getType: function(){
-
-
- if(dojo.isIE < 9){
- return dojo.doc.selection.type.toLowerCase();
- }else{
- var stype = "text";
-
- var oSel;
- try{
- oSel = dojo.global.getSelection();
- }catch(e){ }
- if(oSel && oSel.rangeCount == 1){
- var oRange = oSel.getRangeAt(0);
- if( (oRange.startContainer == oRange.endContainer) &&
- ((oRange.endOffset - oRange.startOffset) == 1) &&
- (oRange.startContainer.nodeType != 3 )
- ){
- stype = "control";
- }
- }
- return stype;
- }
- },
- getSelectedText: function(){
-
-
- if(dojo.isIE < 9){
- if(dijit._editor.selection.getType() == 'control'){
- return null;
- }
- return dojo.doc.selection.createRange().text;
- }else{
- var selection = dojo.global.getSelection();
- if(selection){
- return selection.toString();
- }
- }
- return '';
- },
- getSelectedHtml: function(){
-
-
- if(dojo.isIE < 9){
- if(dijit._editor.selection.getType() == 'control'){
- return null;
- }
- return dojo.doc.selection.createRange().htmlText;
- }else{
- var selection = dojo.global.getSelection();
- if(selection && selection.rangeCount){
- var i;
- var html = "";
- for(i = 0; i < selection.rangeCount; i++){
-
- var frag = selection.getRangeAt(i).cloneContents();
- var div = dojo.doc.createElement("div");
- div.appendChild(frag);
- html += div.innerHTML;
- }
- return html;
- }
- return null;
- }
- },
- getSelectedElement: function(){
-
-
-
-
- if(dijit._editor.selection.getType() == "control"){
- if(dojo.isIE < 9){
- var range = dojo.doc.selection.createRange();
- if(range && range.item){
- return dojo.doc.selection.createRange().item(0);
- }
- }else{
- var selection = dojo.global.getSelection();
- return selection.anchorNode.childNodes[ selection.anchorOffset ];
- }
- }
- return null;
- },
- getParentElement: function(){
-
-
- if(dijit._editor.selection.getType() == "control"){
- var p = this.getSelectedElement();
- if(p){ return p.parentNode; }
- }else{
- if(dojo.isIE < 9){
- var r = dojo.doc.selection.createRange();
- r.collapse(true);
- return r.parentElement();
- }else{
- var selection = dojo.global.getSelection();
- if(selection){
- var node = selection.anchorNode;
- while(node && (node.nodeType != 1)){
- node = node.parentNode;
- }
- return node;
- }
- }
- }
- return null;
- },
- hasAncestorElement: function(/*String*/tagName /* ... */){
-
-
-
-
-
- return this.getAncestorElement.apply(this, arguments) != null;
- },
- getAncestorElement: function(/*String*/tagName /* ... */){
-
-
-
-
-
- var node = this.getSelectedElement() || this.getParentElement();
- return this.getParentOfType(node, arguments);
- },
- isTag: function(/*DomNode*/ node, /*String[]*/ tags){
-
-
-
-
-
-
- if(node && node.tagName){
- var _nlc = node.tagName.toLowerCase();
- for(var i=0; i<tags.length; i++){
- var _tlc = String(tags[i]).toLowerCase();
- if(_nlc == _tlc){
- return _tlc;
- }
- }
- }
- return "";
- },
- getParentOfType: function(/*DomNode*/ node, /*String[]*/ tags){
-
-
-
-
-
-
- while(node){
- if(this.isTag(node, tags).length){
- return node;
- }
- node = node.parentNode;
- }
- return null;
- },
- collapse: function(/*Boolean*/beginning){
-
-
-
-
- if(window.getSelection){
- var selection = dojo.global.getSelection();
- if(selection.removeAllRanges){
- if(beginning){
- selection.collapseToStart();
- }else{
- selection.collapseToEnd();
- }
- }else{
-
- selection.collapse(beginning);
- }
- }else if(dojo.isIE){
- var range = dojo.doc.selection.createRange();
- range.collapse(beginning);
- range.select();
- }
- },
- remove: function(){
-
-
- var sel = dojo.doc.selection;
- if(dojo.isIE < 9){
- if(sel.type.toLowerCase() != "none"){
- sel.clear();
- }
- return sel;
- }else{
- sel = dojo.global.getSelection();
- sel.deleteFromDocument();
- return sel;
- }
- },
- selectElementChildren: function(/*DomNode*/element,/*Boolean?*/nochangefocus){
-
-
-
-
-
-
-
- var win = dojo.global;
- var doc = dojo.doc;
- var range;
- element = dojo.byId(element);
- if(doc.selection && dojo.isIE < 9 && dojo.body().createTextRange){
- range = element.ownerDocument.body.createTextRange();
- range.moveToElementText(element);
- if(!nochangefocus){
- try{
- range.select();
- }catch(e){ }
- }
- }else if(win.getSelection){
- var selection = dojo.global.getSelection();
- if(dojo.isOpera){
-
-
-
- if(selection.rangeCount){
- range = selection.getRangeAt(0);
- }else{
- range = doc.createRange();
- }
- range.setStart(element, 0);
- range.setEnd(element,(element.nodeType == 3)?element.length:element.childNodes.length);
- selection.addRange(range);
- }else{
- selection.selectAllChildren(element);
- }
- }
- },
- selectElement: function(/*DomNode*/element,/*Boolean?*/nochangefocus){
-
-
-
-
-
-
- var range;
- var doc = dojo.doc;
- var win = dojo.global;
- element = dojo.byId(element);
- if(dojo.isIE < 9 && dojo.body().createTextRange){
- try{
- var tg = element.tagName ? element.tagName.toLowerCase() : "";
- if(tg === "img" || tg === "table"){
- range = dojo.body().createControlRange();
- }else{
- range = dojo.body().createRange();
- }
- range.addElement(element);
- if(!nochangefocus){
- range.select();
- }
- }catch(e){
- this.selectElementChildren(element,nochangefocus);
- }
- }else if(dojo.global.getSelection){
- var selection = win.getSelection();
- range = doc.createRange();
- if(selection.removeAllRanges){
-
- if(dojo.isOpera){
-
-
- if(selection.getRangeAt(0)){
- range = selection.getRangeAt(0);
- }
- }
- range.selectNode(element);
- selection.removeAllRanges();
- selection.addRange(range);
- }
- }
- },
- inSelection: function(node){
-
-
-
-
-
- if(node){
- var newRange;
- var doc = dojo.doc;
- var range;
- if(dojo.global.getSelection){
-
- var sel = dojo.global.getSelection();
- if(sel && sel.rangeCount > 0){
- range = sel.getRangeAt(0);
- }
- if(range && range.compareBoundaryPoints && doc.createRange){
- try{
- newRange = doc.createRange();
- newRange.setStart(node, 0);
- if(range.compareBoundaryPoints(range.START_TO_END, newRange) === 1){
- return true;
- }
- }catch(e){ }
- }
- }else if(doc.selection){
-
-
-
- range = doc.selection.createRange();
- try{
- newRange = node.ownerDocument.body.createControlRange();
- if(newRange){
- newRange.addElement(node);
- }
- }catch(e1){
- try{
- newRange = node.ownerDocument.body.createTextRange();
- newRange.moveToElementText(node);
- }catch(e2){}
- }
- if(range && newRange){
-
- if(range.compareEndPoints("EndToStart", newRange) === 1){
- return true;
- }
- }
- }
- }
- return false;
- }
- });
- }
- if(!dojo._hasResource["dojo.data.util.sorter"]){
- dojo._hasResource["dojo.data.util.sorter"] = true;
- dojo.provide("dojo.data.util.sorter");
- dojo.getObject("data.util.sorter", true, dojo);
- dojo.data.util.sorter.basicComparator = function( /*anything*/ a,
- /*anything*/ b){
-
-
-
-
-
-
-
-
-
-
-
- var r = -1;
- if(a === null){
- a = undefined;
- }
- if(b === null){
- b = undefined;
- }
- if(a == b){
- r = 0;
- }else if(a > b || a == null){
- r = 1;
- }
- return r;
- };
- dojo.data.util.sorter.createSortFunction = function( /* attributes array */sortSpec,
- /*dojo.data.core.Read*/ store){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var sortFunctions=[];
- function createSortFunction(attr, dir, comp, s){
-
-
- return function(itemA, itemB){
- var a = s.getValue(itemA, attr);
- var b = s.getValue(itemB, attr);
- return dir * comp(a,b);
- };
- }
- var sortAttribute;
- var map = store.comparatorMap;
- var bc = dojo.data.util.sorter.basicComparator;
- for(var i = 0; i < sortSpec.length; i++){
- sortAttribute = sortSpec[i];
- var attr = sortAttribute.attribute;
- if(attr){
- var dir = (sortAttribute.descending) ? -1 : 1;
- var comp = bc;
- if(map){
- if(typeof attr !== "string" && ("toString" in attr)){
- attr = attr.toString();
- }
- comp = map[attr] || bc;
- }
- sortFunctions.push(createSortFunction(attr,
- dir, comp, store));
- }
- }
- return function(rowA, rowB){
- var i=0;
- while(i < sortFunctions.length){
- var ret = sortFunctions[i++](rowA, rowB);
- if(ret !== 0){
- return ret;
- }
- }
- return 0;
- };
- };
- }
- if(!dojo._hasResource["dojo.data.util.simpleFetch"]){
- dojo._hasResource["dojo.data.util.simpleFetch"] = true;
- dojo.provide("dojo.data.util.simpleFetch");
- dojo.getObject("data.util.simpleFetch", true, dojo);
- dojo.data.util.simpleFetch.fetch = function(/* Object? */ request){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- request = request || {};
- if(!request.store){
- request.store = this;
- }
- var self = this;
- var _errorHandler = function(errorData, requestObject){
- if(requestObject.onError){
- var scope = requestObject.scope || dojo.global;
- requestObject.onError.call(scope, errorData, requestObject);
- }
- };
- var _fetchHandler = function(items, requestObject){
- var oldAbortFunction = requestObject.abort || null;
- var aborted = false;
- var startIndex = requestObject.start?requestObject.start:0;
- var endIndex = (requestObject.count && (requestObject.count !== Infinity))?(startIndex + requestObject.count):items.length;
- requestObject.abort = function(){
- aborted = true;
- if(oldAbortFunction){
- oldAbortFunction.call(requestObject);
- }
- };
- var scope = requestObject.scope || dojo.global;
- if(!requestObject.store){
- requestObject.store = self;
- }
- if(requestObject.onBegin){
- requestObject.onBegin.call(scope, items.length, requestObject);
- }
- if(requestObject.sort){
- items.sort(dojo.data.util.sorter.createSortFunction(requestObject.sort, self));
- }
- if(requestObject.onItem){
- for(var i = startIndex; (i < items.length) && (i < endIndex); ++i){
- var item = items[i];
- if(!aborted){
- requestObject.onItem.call(scope, item, requestObject);
- }
- }
- }
- if(requestObject.onComplete && !aborted){
- var subset = null;
- if(!requestObject.onItem){
- subset = items.slice(startIndex, endIndex);
- }
- requestObject.onComplete.call(scope, subset, requestObject);
- }
- };
- this._fetchItems(request, _fetchHandler, _errorHandler);
- return request;
- };
- }
- if(!dojo._hasResource["dojo.data.util.filter"]){
- dojo._hasResource["dojo.data.util.filter"] = true;
- dojo.provide("dojo.data.util.filter");
- dojo.getObject("data.util.filter", true, dojo);
- dojo.data.util.filter.patternToRegExp = function(/*String*/pattern, /*boolean?*/ ignoreCase){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var rxp = "^";
- var c = null;
- for(var i = 0; i < pattern.length; i++){
- c = pattern.charAt(i);
- switch(c){
- case '\\':
- rxp += c;
- i++;
- rxp += pattern.charAt(i);
- break;
- case '*':
- rxp += ".*"; break;
- case '?':
- rxp += "."; break;
- case '$':
- case '^':
- case '/':
- case '+':
- case '.':
- case '|':
- case '(':
- case ')':
- case '{':
- case '}':
- case '[':
- case ']':
- rxp += "\\";
- default:
- rxp += c;
- }
- }
- rxp += "$";
- if(ignoreCase){
- return new RegExp(rxp,"mi");
- }else{
- return new RegExp(rxp,"m");
- }
-
- };
- }
- if(!dojo._hasResource["dijit.form.TextBox"]){
- dojo._hasResource["dijit.form.TextBox"] = true;
- dojo.provide("dijit.form.TextBox");
- dojo.declare(
- "dijit.form.TextBox",
- dijit.form._FormValueWidget,
- {
-
-
-
-
- trim: false,
-
-
- uppercase: false,
-
-
- lowercase: false,
-
-
- propercase: false,
-
-
- maxLength: "",
-
-
- selectOnClick: false,
-
-
-
- placeHolder: "",
-
- templateString: dojo.cache("dijit.form", "templates/TextBox.html", "<div class=\"dijit dijitReset dijitInline dijitLeft\" id=\"widget_${id}\" role=\"presentation\"\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class=\"dijitReset dijitInputInner\" dojoAttachPoint='textbox,focusNode' autocomplete=\"off\"\n\t\t\t${!nameAttrSetting} type='${type}'\n\t/></div\n></div>\n"),
- _singleNodeTemplate: '<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
- _buttonInputDisabled: dojo.isIE ? "disabled" : "",
- baseClass: "dijitTextBox",
- attributeMap: dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap, {
- maxLength: "focusNode"
- }),
-
- postMixInProperties: function(){
- var type = this.type.toLowerCase();
- if(this.templateString && this.templateString.toLowerCase() == "input" || ((type == "hidden" || type == "file") && this.templateString == dijit.form.TextBox.prototype.templateString)){
- this.templateString = this._singleNodeTemplate;
- }
- this.inherited(arguments);
- },
- _setPlaceHolderAttr: function(v){
- this._set("placeHolder", v);
- if(!this._phspan){
- this._attachPoints.push('_phspan');
-
- this._phspan = dojo.create('span',{className:'dijitPlaceHolder dijitInputField'},this.textbox,'after');
- }
- this._phspan.innerHTML="";
- this._phspan.appendChild(document.createTextNode(v));
-
- this._updatePlaceHolder();
- },
-
- _updatePlaceHolder: function(){
- if(this._phspan){
- this._phspan.style.display=(this.placeHolder&&!this._focused&&!this.textbox.value)?"":"none";
- }
- },
- _getValueAttr: function(){
-
-
-
-
-
-
-
-
-
- return this.parse(this.get('displayedValue'), this.constraints);
- },
- _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var filteredValue;
- if(value !== undefined){
-
-
- filteredValue = this.filter(value);
- if(typeof formattedValue != "string"){
- if(filteredValue !== null && ((typeof filteredValue != "number") || !isNaN(filteredValue))){
- formattedValue = this.filter(this.format(filteredValue, this.constraints));
- }else{ formattedValue = ''; }
- }
- }
- if(formattedValue != null && formattedValue != undefined && ((typeof formattedValue) != "number" || !isNaN(formattedValue)) && this.textbox.value != formattedValue){
- this.textbox.value = formattedValue;
- this._set("displayedValue", this.get("displayedValue"));
- }
- this._updatePlaceHolder();
- this.inherited(arguments, [filteredValue, priorityChange]);
- },
-
-
-
-
-
-
-
-
-
-
-
-
- displayedValue: "",
- getDisplayedValue: function(){
-
-
-
-
- dojo.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.", "", "2.0");
- return this.get('displayedValue');
- },
- _getDisplayedValueAttr: function(){
-
-
-
-
-
-
-
-
-
-
-
-
- return this.filter(this.textbox.value);
- },
- setDisplayedValue: function(/*String*/ value){
-
-
-
-
- dojo.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.", "", "2.0");
- this.set('displayedValue', value);
- },
- _setDisplayedValueAttr: function(/*String*/ value){
-
-
-
-
-
-
- if(value === null || value === undefined){ value = '' }
- else if(typeof value != "string"){ value = String(value) }
- this.textbox.value = value;
-
-
-
- this._setValueAttr(this.get('value'), undefined);
- this._set("displayedValue", this.get('displayedValue'));
- },
- format: function(/*String*/ value, /*Object*/ constraints){
-
-
-
-
- return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value));
- },
- parse: function(/*String*/ value, /*Object*/ constraints){
-
-
-
-
- return value;
- },
- _refreshState: function(){
-
-
-
-
-
-
- },
- _onInput: function(e){
- if(e && e.type && /key/i.test(e.type) && e.keyCode){
- switch(e.keyCode){
- case dojo.keys.SHIFT:
- case dojo.keys.ALT:
- case dojo.keys.CTRL:
- case dojo.keys.TAB:
- return;
- }
- }
- if(this.intermediateChanges){
- var _this = this;
-
- setTimeout(function(){ _this._handleOnChange(_this.get('value'), false); }, 0);
- }
- this._refreshState();
-
- this._set("displayedValue", this.get("displayedValue"));
- },
- postCreate: function(){
- if(dojo.isIE){
-
- setTimeout(dojo.hitch(this, function(){
- var s = dojo.getComputedStyle(this.domNode);
- if(s){
- var ff = s.fontFamily;
- if(ff){
- var inputs = this.domNode.getElementsByTagName("INPUT");
- if(inputs){
- for(var i=0; i < inputs.length; i++){
- inputs[i].style.fontFamily = ff;
- }
- }
- }
- }
- }), 0);
- }
-
-
- this.textbox.setAttribute("value", this.textbox.value);
- this.inherited(arguments);
- if(dojo.isMoz || dojo.isOpera){
- this.connect(this.textbox, "oninput", "_onInput");
- }else{
- this.connect(this.textbox, "onkeydown", "_onInput");
- this.connect(this.textbox, "onkeyup", "_onInput");
- this.connect(this.textbox, "onpaste", "_onInput");
- this.connect(this.textbox, "oncut", "_onInput");
- }
- },
- _blankValue: '',
- filter: function(val){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(val === null){ return this._blankValue; }
- if(typeof val != "string"){ return val; }
- if(this.trim){
- val = dojo.trim(val);
- }
- if(this.uppercase){
- val = val.toUpperCase();
- }
- if(this.lowercase){
- val = val.toLowerCase();
- }
- if(this.propercase){
- val = val.replace(/[^\s]+/g, function(word){
- return word.substring(0,1).toUpperCase() + word.substring(1);
- });
- }
- return val;
- },
- _setBlurValue: function(){
- this._setValueAttr(this.get('value'), true);
- },
- _onBlur: function(e){
- if(this.disabled){ return; }
- this._setBlurValue();
- this.inherited(arguments);
- if(this._selectOnClickHandle){
- this.disconnect(this._selectOnClickHandle);
- }
- if(this.selectOnClick && dojo.isMoz){
- this.textbox.selectionStart = this.textbox.selectionEnd = undefined;
- }
-
- this._updatePlaceHolder();
- },
- _onFocus: function(/*String*/ by){
- if(this.disabled || this.readOnly){ return; }
-
-
-
- if(this.selectOnClick && by == "mouse"){
- this._selectOnClickHandle = this.connect(this.domNode, "onmouseup", function(){
-
-
- this.disconnect(this._selectOnClickHandle);
-
-
- var textIsNotSelected;
- if(dojo.isIE){
- var range = dojo.doc.selection.createRange();
- var parent = range.parentElement();
- textIsNotSelected = parent == this.textbox && range.text.length == 0;
- }else{
- textIsNotSelected = this.textbox.selectionStart == this.textbox.selectionEnd;
- }
- if(textIsNotSelected){
- dijit.selectInputText(this.textbox);
- }
- });
- }
- this._updatePlaceHolder();
-
-
-
- this.inherited(arguments);
- this._refreshState();
- },
- reset: function(){
-
-
- this.textbox.value = '';
- this.inherited(arguments);
- }
- }
- );
- dijit.selectInputText = function(/*DomNode*/ element, /*Number?*/ start, /*Number?*/ stop){
-
-
-
- var _window = dojo.global;
- var _document = dojo.doc;
- element = dojo.byId(element);
- if(isNaN(start)){ start = 0; }
- if(isNaN(stop)){ stop = element.value ? element.value.length : 0; }
- dijit.focus(element);
- if(_document["selection"] && dojo.body()["createTextRange"]){
- if(element.createTextRange){
- var r = element.createTextRange();
- r.collapse(true);
- r.moveStart("character", -99999);
- r.moveStart("character", start);
- r.moveEnd("character", stop-start);
- r.select();
- }
- }else if(_window["getSelection"]){
- if(element.setSelectionRange){
- element.setSelectionRange(start, stop);
- }
- }
- };
- }
- if(!dojo._hasResource["dijit.Tooltip"]){
- dojo._hasResource["dijit.Tooltip"] = true;
- dojo.provide("dijit.Tooltip");
- dojo.declare(
- "dijit._MasterTooltip",
- [dijit._Widget, dijit._Templated],
- {
-
-
-
-
-
-
-
-
-
- duration: dijit.defaultDuration,
- templateString: dojo.cache("dijit", "templates/Tooltip.html", "<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\"\n\t><div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" role='alert'></div\n\t><div class=\"dijitTooltipConnector\" dojoAttachPoint=\"connectorNode\"></div\n></div>\n"),
- postCreate: function(){
- dojo.body().appendChild(this.domNode);
- this.bgIframe = new dijit.BackgroundIframe(this.domNode);
-
- this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
- this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
- },
- show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
-
-
-
- if(this.aroundNode && this.aroundNode === aroundNode){
- return;
- }
-
- this.domNode.width = "auto";
- if(this.fadeOut.status() == "playing"){
-
- this._onDeck=arguments;
- return;
- }
- this.containerNode.innerHTML=innerHTML;
- var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));
-
- dojo.style(this.domNode, "opacity", 0);
- this.fadeIn.play();
- this.isShowingNow = true;
- this.aroundNode = aroundNode;
- },
- orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ tooltipCorner, /*Object*/ spaceAvailable, /*Object*/ aroundNodeCoords){
-
-
-
-
-
-
- this.connectorNode.style.top = "";
-
-
- var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;
- node.className = "dijitTooltip " +
- {
- "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
- "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
- "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
- "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
- "BR-BL": "dijitTooltipRight",
- "BL-BR": "dijitTooltipLeft"
- }[aroundCorner + "-" + tooltipCorner];
-
-
- this.domNode.style.width = "auto";
- var size = dojo.contentBox(this.domNode);
-
- var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
- var widthWasReduced = width < size.w;
-
- this.domNode.style.width = width+"px";
-
-
- if(widthWasReduced){
- this.containerNode.style.overflow = "auto";
- var scrollWidth = this.containerNode.scrollWidth;
- this.containerNode.style.overflow = "visible";
- if(scrollWidth > width){
- scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
- this.domNode.style.width = scrollWidth + "px";
- }
- }
-
-
- if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
- var mb = dojo.marginBox(node);
- var tooltipConnectorHeight = this.connectorNode.offsetHeight;
- if(mb.h > spaceAvailable.h){
-
- var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
- this.connectorNode.style.top = aroundNodePlacement + "px";
- this.connectorNode.style.bottom = "";
- }else{
-
-
-
- this.connectorNode.style.bottom = Math.min(
- Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
- mb.h - tooltipConnectorHeight) + "px";
- this.connectorNode.style.top = "";
- }
- }else{
-
- this.connectorNode.style.top = "";
- this.connectorNode.style.bottom = "";
- }
-
- return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
- },
- _onShow: function(){
-
-
-
-
- if(dojo.isIE){
-
- this.domNode.style.filter="";
- }
- },
- hide: function(aroundNode){
-
-
- if(this._onDeck && this._onDeck[1] == aroundNode){
-
-
- this._onDeck=null;
- }else if(this.aroundNode === aroundNode){
-
- this.fadeIn.stop();
- this.isShowingNow = false;
- this.aroundNode = null;
- this.fadeOut.play();
- }else{
-
- }
- },
- _onHide: function(){
-
-
-
-
- this.domNode.style.cssText="";
- this.containerNode.innerHTML="";
- if(this._onDeck){
-
- this.show.apply(this, this._onDeck);
- this._onDeck=null;
- }
- }
- }
- );
- dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
-
-
-
-
- if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
- return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
- };
- dijit.hideTooltip = function(aroundNode){
-
-
- if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
- return dijit._masterTT.hide(aroundNode);
- };
- dojo.declare(
- "dijit.Tooltip",
- dijit._Widget,
- {
-
-
-
-
-
- label: "",
-
-
-
- showDelay: 400,
-
-
-
- connectId: [],
-
-
- position: [],
- _setConnectIdAttr: function(/*String*/ newId){
-
-
-
- dojo.forEach(this._connections || [], function(nested){
- dojo.forEach(nested, dojo.hitch(this, "disconnect"));
- }, this);
-
- var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
- this._connections = dojo.map(ary, function(id){
- var node = dojo.byId(id);
- return node ? [
- this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
- this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
- this.connect(node, "onfocus", "_onTargetFocus"),
- this.connect(node, "onblur", "_onTargetBlur")
- ] : [];
- }, this);
-
- this._set("connectId", newId);
- this._connectIds = ary;
- },
- addTarget: function(/*DOMNODE || String*/ node){
-
-
-
- var id = node.id || node;
- if(dojo.indexOf(this._connectIds, id) == -1){
- this.set("connectId", this._connectIds.concat(id));
- }
- },
- removeTarget: function(/*DOMNODE || String*/ node){
-
-
-
-
- var id = node.id || node,
- idx = dojo.indexOf(this._connectIds, id);
- if(idx >= 0){
-
- this._connectIds.splice(idx, 1);
- this.set("connectId", this._connectIds);
- }
- },
- buildRendering: function(){
- this.inherited(arguments);
- dojo.addClass(this.domNode,"dijitTooltipData");
- },
- startup: function(){
- this.inherited(arguments);
-
-
- var ids = this.connectId;
- dojo.forEach(dojo.isArrayLike(ids) ? ids : [ids], this.addTarget, this);
- },
- _onTargetMouseEnter: function(/*Event*/ e){
-
-
-
-
- this._onHover(e);
- },
- _onTargetMouseLeave: function(/*Event*/ e){
-
-
-
-
- this._onUnHover(e);
- },
- _onTargetFocus: function(/*Event*/ e){
-
-
-
-
- this._focus = true;
- this._onHover(e);
- },
- _onTargetBlur: function(/*Event*/ e){
-
-
-
-
- this._focus = false;
- this._onUnHover(e);
- },
- _onHover: function(/*Event*/ e){
-
-
-
-
-
- if(!this._showTimer){
- var target = e.target;
- this._showTimer = setTimeout(dojo.hitch(this, function(){this.open(target)}), this.showDelay);
- }
- },
- _onUnHover: function(/*Event*/ e){
-
-
-
-
-
-
-
- if(this._focus){ return; }
- if(this._showTimer){
- clearTimeout(this._showTimer);
- delete this._showTimer;
- }
- this.close();
- },
- open: function(/*DomNode*/ target){
-
-
-
-
- if(this._showTimer){
- clearTimeout(this._showTimer);
- delete this._showTimer;
- }
- dijit.showTooltip(this.label || this.domNode.innerHTML, target, this.position, !this.isLeftToRight());
- this._connectNode = target;
- this.onShow(target, this.position);
- },
- close: function(){
-
-
-
-
- if(this._connectNode){
-
- dijit.hideTooltip(this._connectNode);
- delete this._connectNode;
- this.onHide();
- }
- if(this._showTimer){
-
- clearTimeout(this._showTimer);
- delete this._showTimer;
- }
- },
- onShow: function(target, position){
-
-
-
-
- },
- onHide: function(){
-
-
-
-
- },
- uninitialize: function(){
- this.close();
- this.inherited(arguments);
- }
- }
- );
- dijit.Tooltip.defaultPosition = ["after", "before"];
- }
- if(!dojo._hasResource["dijit.form.ValidationTextBox"]){
- dojo._hasResource["dijit.form.ValidationTextBox"] = true;
- dojo.provide("dijit.form.ValidationTextBox");
- dojo.declare(
- "dijit.form.ValidationTextBox",
- dijit.form.TextBox,
- {
-
-
-
-
- templateString: dojo.cache("dijit.form", "templates/ValidationTextBox.html", "<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\" role=\"presentation\"\n\t><div class='dijitReset dijitValidationContainer'\n\t\t><input class=\"dijitReset dijitInputField dijitValidationIcon dijitValidationInner\" value=\"Χ \" type=\"text\" tabIndex=\"-1\" readonly=\"readonly\" role=\"presentation\"\n\t/></div\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class=\"dijitReset dijitInputInner\" dojoAttachPoint='textbox,focusNode' autocomplete=\"off\"\n\t\t\t${!nameAttrSetting} type='${type}'\n\t/></div\n></div>\n"),
- baseClass: "dijitTextBox dijitValidationTextBox",
-
-
- required: false,
-
-
-
-
-
-
-
- promptMessage: "",
-
-
-
-
- invalidMessage: "$_unset_$",
-
-
-
-
- missingMessage: "$_unset_$",
-
-
-
-
- message: "",
-
-
- constraints: {},
-
-
-
- regExp: ".*",
- regExpGen: function(/*dijit.form.ValidationTextBox.__Constraints*/ constraints){
-
-
-
-
-
- return this.regExp;
- },
-
-
- state: "",
-
-
- tooltipPosition: [],
- _setValueAttr: function(){
-
-
- this.inherited(arguments);
- this.validate(this._focused);
- },
- validator: function(/*anything*/ value, /*dijit.form.ValidationTextBox.__Constraints*/ constraints){
-
-
-
-
- return (new RegExp("^(?:" + this.regExpGen(constraints) + ")"+(this.required?"":"?")+"$")).test(value) &&
- (!this.required || !this._isEmpty(value)) &&
- (this._isEmpty(value) || this.parse(value, constraints) !== undefined);
- },
- _isValidSubset: function(){
-
-
-
- return this.textbox.value.search(this._partialre) == 0;
- },
- isValid: function(/*Boolean*/ isFocused){
-
-
-
-
-
- return this.validator(this.textbox.value, this.constraints);
- },
- _isEmpty: function(value){
-
-
- return (this.trim ? /^\s*$/ : /^$/).test(value);
- },
- getErrorMessage: function(/*Boolean*/ isFocused){
-
-
-
-
- return (this.required && this._isEmpty(this.textbox.value)) ? this.missingMessage : this.invalidMessage;
- },
- getPromptMessage: function(/*Boolean*/ isFocused){
-
-
-
-
- return this.promptMessage;
- },
- _maskValidSubsetError: true,
- validate: function(/*Boolean*/ isFocused){
-
-
-
-
-
-
- var message = "";
- var isValid = this.disabled || this.isValid(isFocused);
- if(isValid){ this._maskValidSubsetError = true; }
- var isEmpty = this._isEmpty(this.textbox.value);
- var isValidSubset = !isValid && isFocused && this._isValidSubset();
- this._set("state", isValid ? "" : (((((!this._hasBeenBlurred || isFocused) && isEmpty) || isValidSubset) && this._maskValidSubsetError) ? "Incomplete" : "Error"));
- dijit.setWaiState(this.focusNode, "invalid", isValid ? "false" : "true");
- if(this.state == "Error"){
- this._maskValidSubsetError = isFocused && isValidSubset;
- message = this.getErrorMessage(isFocused);
- }else if(this.state == "Incomplete"){
- message = this.getPromptMessage(isFocused);
- this._maskValidSubsetError = !this._hasBeenBlurred || isFocused;
- }else if(isEmpty){
- message = this.getPromptMessage(isFocused);
- }
- this.set("message", message);
- return isValid;
- },
- displayMessage: function(/*String*/ message){
-
-
-
-
-
- dijit.hideTooltip(this.domNode);
- if(message && this._focused){
- dijit.showTooltip(message, this.domNode, this.tooltipPosition, !this.isLeftToRight());
- }
- },
- _refreshState: function(){
-
- this.validate(this._focused);
- this.inherited(arguments);
- },
-
- constructor: function(){
- this.constraints = {};
- },
- _setConstraintsAttr: function(/*Object*/ constraints){
- if(!constraints.locale && this.lang){
- constraints.locale = this.lang;
- }
- this._set("constraints", constraints);
- this._computePartialRE();
- },
- _computePartialRE: function(){
- var p = this.regExpGen(this.constraints);
- this.regExp = p;
- var partialre = "";
-
-
- if(p != ".*"){ this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,
- function (re){
- switch(re.charAt(0)){
- case '{':
- case '+':
- case '?':
- case '*':
- case '^':
- case '$':
- case '|':
- case '(':
- partialre += re;
- break;
- case ")":
- partialre += "|$)";
- break;
- default:
- partialre += "(?:"+re+"|$)";
- break;
- }
- }
- );}
- try{
- "".search(partialre);
- }catch(e){
- partialre = this.regExp;
- console.warn('RegExp error in ' + this.declaredClass + ': ' + this.regExp);
- }
- this._partialre = "^(?:" + partialre + ")$";
- },
- postMixInProperties: function(){
- this.inherited(arguments);
- this.messages = dojo.i18n.getLocalization("dijit.form", "validate", this.lang);
- if(this.invalidMessage == "$_unset_$"){ this.invalidMessage = this.messages.invalidMessage; }
- if(!this.invalidMessage){ this.invalidMessage = this.promptMessage; }
- if(this.missingMessage == "$_unset_$"){ this.missingMessage = this.messages.missingMessage; }
- if(!this.missingMessage){ this.missingMessage = this.invalidMessage; }
- this._setConstraintsAttr(this.constraints);
- },
- _setDisabledAttr: function(/*Boolean*/ value){
- this.inherited(arguments);
- this._refreshState();
- },
- _setRequiredAttr: function(/*Boolean*/ value){
- this._set("required", value);
- dijit.setWaiState(this.focusNode, "required", value);
- this._refreshState();
- },
- _setMessageAttr: function(/*String*/ message){
- this._set("message", message);
- this.displayMessage(message);
- },
- reset:function(){
-
-
- this._maskValidSubsetError = true;
- this.inherited(arguments);
- },
- _onBlur: function(){
-
-
- this.displayMessage('');
- this.inherited(arguments);
- }
- }
- );
- dojo.declare(
- "dijit.form.MappedTextBox",
- dijit.form.ValidationTextBox,
- {
-
-
-
-
-
-
-
-
-
-
-
-
- postMixInProperties: function(){
- this.inherited(arguments);
-
-
- this.nameAttrSetting = "";
- },
- serialize: function(/*anything*/ val, /*Object?*/ options){
-
-
-
-
-
-
- return val.toString ? val.toString() : "";
- },
- toString: function(){
-
-
-
-
- var val = this.filter(this.get('value'));
- return val != null ? (typeof val == "string" ? val : this.serialize(val, this.constraints)) : "";
- },
- validate: function(){
-
- this.valueNode.value = this.toString();
- return this.inherited(arguments);
- },
- buildRendering: function(){
-
- this.inherited(arguments);
-
-
-
-
- this.valueNode = dojo.place("<input type='hidden'" + (this.name ? " name='" + this.name.replace(/'/g, """) + "'" : "") + "/>", this.textbox, "after");
- },
- reset: function(){
-
-
- this.valueNode.value = '';
- this.inherited(arguments);
- }
- }
- );
- dojo.declare(
- "dijit.form.RangeBoundTextBox",
- dijit.form.MappedTextBox,
- {
-
-
-
-
- rangeMessage: "",
-
- rangeCheck: function(/*Number*/ primitive, /*dijit.form.RangeBoundTextBox.__Constraints*/ constraints){
-
-
-
-
- return ("min" in constraints? (this.compare(primitive,constraints.min) >= 0) : true) &&
- ("max" in constraints? (this.compare(primitive,constraints.max) <= 0) : true);
- },
- isInRange: function(/*Boolean*/ isFocused){
-
-
-
-
- return this.rangeCheck(this.get('value'), this.constraints);
- },
- _isDefinitelyOutOfRange: function(){
-
-
-
- var val = this.get('value');
- var isTooLittle = false;
- var isTooMuch = false;
- if("min" in this.constraints){
- var min = this.constraints.min;
- min = this.compare(val, ((typeof min == "number") && min >= 0 && val !=0) ? 0 : min);
- isTooLittle = (typeof min == "number") && min < 0;
- }
- if("max" in this.constraints){
- var max = this.constraints.max;
- max = this.compare(val, ((typeof max != "number") || max > 0) ? max : 0);
- isTooMuch = (typeof max == "number") && max > 0;
- }
- return isTooLittle || isTooMuch;
- },
- _isValidSubset: function(){
-
-
-
-
- return this.inherited(arguments) && !this._isDefinitelyOutOfRange();
- },
- isValid: function(/*Boolean*/ isFocused){
-
- return this.inherited(arguments) &&
- ((this._isEmpty(this.textbox.value) && !this.required) || this.isInRange(isFocused));
- },
- getErrorMessage: function(/*Boolean*/ isFocused){
-
- var v = this.get('value');
- if(v !== null && v !== '' && v !== undefined && (typeof v != "number" || !isNaN(v)) && !this.isInRange(isFocused)){
- return this.rangeMessage;
- }
- return this.inherited(arguments);
- },
- postMixInProperties: function(){
- this.inherited(arguments);
- if(!this.rangeMessage){
- this.messages = dojo.i18n.getLocalization("dijit.form", "validate", this.lang);
- this.rangeMessage = this.messages.rangeMessage;
- }
- },
- _setConstraintsAttr: function(/*Object*/ constraints){
- this.inherited(arguments);
- if(this.focusNode){
- if(this.constraints.min !== undefined){
- dijit.setWaiState(this.focusNode, "valuemin", this.constraints.min);
- }else{
- dijit.removeWaiState(this.focusNode, "valuemin");
- }
- if(this.constraints.max !== undefined){
- dijit.setWaiState(this.focusNode, "valuemax", this.constraints.max);
- }else{
- dijit.removeWaiState(this.focusNode, "valuemax");
- }
- }
- },
- _setValueAttr: function(/*Number*/ value, /*Boolean?*/ priorityChange){
-
-
- dijit.setWaiState(this.focusNode, "valuenow", value);
- this.inherited(arguments);
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.form.ComboBox"]){
- dojo._hasResource["dijit.form.ComboBox"] = true;
- dojo.provide("dijit.form.ComboBox");
- dojo.declare(
- "dijit.form.ComboBoxMixin",
- dijit._HasDropDown,
- {
-
-
-
-
-
-
-
-
-
- item: null,
-
-
-
- pageSize: Infinity,
-
-
- store: null,
-
-
-
-
-
-
- fetchProperties:{},
-
-
-
-
- query: {},
-
-
-
-
- autoComplete: true,
-
-
-
-
-
-
-
-
-
- highlightMatch: "first",
-
-
-
- searchDelay: 100,
-
-
-
- searchAttr: "name",
-
-
-
-
- labelAttr: "",
-
-
-
- labelType: "text",
-
-
-
-
-
-
-
-
-
- queryExpr: "${0}*",
-
-
- ignoreCase: true,
-
-
-
- hasDownArrow: true,
- templateString: dojo.cache("dijit.form", "templates/DropDownBox.html", "<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\"\n\trole=\"combobox\"\n\t><div class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer'\n\t\tdojoAttachPoint=\"_buttonNode, _popupStateNode\" role=\"presentation\"\n\t\t><input class=\"dijitReset dijitInputField dijitArrowButtonInner\" value=\"▼ \" type=\"text\" tabIndex=\"-1\" readonly=\"readonly\" role=\"presentation\"\n\t\t\t${_buttonInputDisabled}\n\t/></div\n\t><div class='dijitReset dijitValidationContainer'\n\t\t><input class=\"dijitReset dijitInputField dijitValidationIcon dijitValidationInner\" value=\"Χ \" type=\"text\" tabIndex=\"-1\" readonly=\"readonly\" role=\"presentation\"\n\t/></div\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class='dijitReset dijitInputInner' ${!nameAttrSetting} type=\"text\" autocomplete=\"off\"\n\t\t\tdojoAttachPoint=\"textbox,focusNode\" role=\"textbox\" aria-haspopup=\"true\"\n\t/></div\n></div>\n"),
- baseClass: "dijitTextBox dijitComboBox",
-
-
-
- dropDownClass: "dijit.form._ComboBoxMenu",
-
-
- cssStateNodes: {
- "_buttonNode": "dijitDownArrowButton"
- },
-
- maxHeight: -1,
-
- _stopClickEvents: false,
- _getCaretPos: function(/*DomNode*/ element){
-
- var pos = 0;
- if(typeof(element.selectionStart) == "number"){
-
- pos = element.selectionStart;
- }else if(dojo.isIE){
-
-
-
-
- var tr = dojo.doc.selection.createRange().duplicate();
- var ntr = element.createTextRange();
- tr.move("character",0);
- ntr.move("character",0);
- try{
-
-
-
- ntr.setEndPoint("EndToEnd", tr);
- pos = String(ntr.text).replace(/\r/g,"").length;
- }catch(e){
-
- }
- }
- return pos;
- },
- _setCaretPos: function(/*DomNode*/ element, /*Number*/ location){
- location = parseInt(location);
- dijit.selectInputText(element, location, location);
- },
- _setDisabledAttr: function(/*Boolean*/ value){
-
-
- this.inherited(arguments);
- dijit.setWaiState(this.domNode, "disabled", value);
- },
- _abortQuery: function(){
-
- if(this.searchTimer){
- clearTimeout(this.searchTimer);
- this.searchTimer = null;
- }
- if(this._fetchHandle){
- if(this._fetchHandle.abort){ this._fetchHandle.abort(); }
- this._fetchHandle = null;
- }
- },
- _onInput: function(/*Event*/ evt){
-
-
- if(!this.searchTimer && (evt.type == 'paste' || evt.type == 'input') && this._lastInput != this.textbox.value){
- this.searchTimer = setTimeout(dojo.hitch(this, function(){
- this._onKey({charOrCode: 229});
- }), 100);
- }
- this.inherited(arguments);
- },
- _onKey: function(/*Event*/ evt){
-
-
- var key = evt.charOrCode;
-
- if(evt.altKey || ((evt.ctrlKey || evt.metaKey) && (key != 'x' && key != 'v')) || key == dojo.keys.SHIFT){
- return;
- }
-
- var doSearch = false;
- var pw = this.dropDown;
- var dk = dojo.keys;
- var highlighted = null;
- this._prev_key_backspace = false;
- this._abortQuery();
-
-
-
-
-
-
- this.inherited(arguments);
- if(this._opened){
- highlighted = pw.getHighlightedOption();
- }
- switch(key){
- case dk.PAGE_DOWN:
- case dk.DOWN_ARROW:
- case dk.PAGE_UP:
- case dk.UP_ARROW:
-
-
- if(this._opened){
- this._announceOption(highlighted);
- }
- dojo.stopEvent(evt);
- break;
- case dk.ENTER:
-
-
-
- if(highlighted){
-
- if(highlighted == pw.nextButton){
- this._nextSearch(1);
- dojo.stopEvent(evt);
- break;
- }else if(highlighted == pw.previousButton){
- this._nextSearch(-1);
- dojo.stopEvent(evt);
- break;
- }
- }else{
-
- this._setBlurValue();
- this._setCaretPos(this.focusNode, this.focusNode.value.length);
- }
-
-
-
-
- if(this._opened || this._fetchHandle){
- dojo.stopEvent(evt);
- }
-
- case dk.TAB:
- var newvalue = this.get('displayedValue');
-
-
- if(pw && (
- newvalue == pw._messages["previousMessage"] ||
- newvalue == pw._messages["nextMessage"])
- ){
- break;
- }
- if(highlighted){
- this._selectOption();
- }
- if(this._opened){
- this._lastQuery = null;
- this.closeDropDown();
- }
- break;
- case ' ':
- if(highlighted){
-
- dojo.stopEvent(evt);
- this._selectOption();
- this.closeDropDown();
- }else{
-
- doSearch = true;
- }
- break;
- case dk.DELETE:
- case dk.BACKSPACE:
- this._prev_key_backspace = true;
- doSearch = true;
- break;
- default:
-
-
-
- doSearch = typeof key == 'string' || key == 229;
- }
- if(doSearch){
-
-
- this.item = undefined;
- this.searchTimer = setTimeout(dojo.hitch(this, "_startSearchFromInput"),1);
- }
- },
- _autoCompleteText: function(/*String*/ text){
-
-
-
-
-
-
- var fn = this.focusNode;
-
- dijit.selectInputText(fn, fn.value.length);
-
- var caseFilter = this.ignoreCase? 'toLowerCase' : 'substr';
- if(text[caseFilter](0).indexOf(this.focusNode.value[caseFilter](0)) == 0){
- var cpos = this._getCaretPos(fn);
-
- if((cpos+1) > fn.value.length){
-
-
- fn.value = text;
-
- dijit.selectInputText(fn, cpos);
- }
- }else{
-
- fn.value = text;
- dijit.selectInputText(fn);
- }
- },
- _openResultList: function(/*Object*/ results, /*Object*/ dataObject){
-
-
-
-
-
-
- this._fetchHandle = null;
- if( this.disabled ||
- this.readOnly ||
- (dataObject.query[this.searchAttr] != this._lastQuery)
- ){
- return;
- }
- var wasSelected = this.dropDown._highlighted_option && dojo.hasClass(this.dropDown._highlighted_option, "dijitMenuItemSelected");
- this.dropDown.clearResultList();
- if(!results.length && !this._maxOptions){
- this.closeDropDown();
- return;
- }
-
-
-
-
-
- dataObject._maxOptions = this._maxOptions;
- var nodes = this.dropDown.createOptions(
- results,
- dataObject,
- dojo.hitch(this, "_getMenuLabelFromItem")
- );
-
- this._showResultList();
-
-
-
- if(dataObject.direction){
- if(1 == dataObject.direction){
- this.dropDown.highlightFirstOption();
- }else if(-1 == dataObject.direction){
- this.dropDown.highlightLastOption();
- }
- if(wasSelected){
- this._announceOption(this.dropDown.getHighlightedOption());
- }
- }else if(this.autoComplete && !this._prev_key_backspace
-
-
-
-
- && !/^[*]+$/.test(dataObject.query[this.searchAttr])){
- this._announceOption(nodes[1]);
- }
- },
- _showResultList: function(){
-
-
-
- this.closeDropDown(true);
-
- this.displayMessage("");
- this.openDropDown();
- dijit.setWaiState(this.domNode, "expanded", "true");
- },
- loadDropDown: function(/*Function*/ callback){
-
-
-
-
- this._startSearchAll();
- },
- isLoaded: function(){
-
-
- return false;
- },
- closeDropDown: function(){
-
-
-
- this._abortQuery();
- if(this._opened){
- this.inherited(arguments);
- dijit.setWaiState(this.domNode, "expanded", "false");
- dijit.removeWaiState(this.focusNode,"activedescendant");
- }
- },
- _setBlurValue: function(){
-
-
-
-
-
- var newvalue = this.get('displayedValue');
- var pw = this.dropDown;
- if(pw && (
- newvalue == pw._messages["previousMessage"] ||
- newvalue == pw._messages["nextMessage"]
- )
- ){
- this._setValueAttr(this._lastValueReported, true);
- }else if(typeof this.item == "undefined"){
-
- this.item = null;
- this.set('displayedValue', newvalue);
- }else{
- if(this.value != this._lastValueReported){
- dijit.form._FormValueWidget.prototype._setValueAttr.call(this, this.value, true);
- }
- this._refreshState();
- }
- },
- _onBlur: function(){
-
-
- this.closeDropDown();
- this.inherited(arguments);
- },
- _setItemAttr: function(/*item*/ item, /*Boolean?*/ priorityChange, /*String?*/ displayedValue){
-
-
-
-
-
-
-
-
- if(!displayedValue){
- displayedValue = this.store.getValue(item, this.searchAttr);
- }
- var value = this._getValueField() != this.searchAttr? this.store.getIdentity(item) : displayedValue;
- this._set("item", item);
- dijit.form.ComboBox.superclass._setValueAttr.call(this, value, priorityChange, displayedValue);
- },
- _announceOption: function(/*Node*/ node){
-
-
-
-
- if(!node){
- return;
- }
-
- var newValue;
- if(node == this.dropDown.nextButton ||
- node == this.dropDown.previousButton){
- newValue = node.innerHTML;
- this.item = undefined;
- this.value = '';
- }else{
- newValue = this.store.getValue(node.item, this.searchAttr).toString();
- this.set('item', node.item, false, newValue);
- }
-
- this.focusNode.value = this.focusNode.value.substring(0, this._lastInput.length);
-
- dijit.setWaiState(this.focusNode, "activedescendant", dojo.attr(node, "id"));
-
- this._autoCompleteText(newValue);
- },
- _selectOption: function(/*Event*/ evt){
-
-
- if(evt){
- this._announceOption(evt.target);
- }
- this.closeDropDown();
- this._setCaretPos(this.focusNode, this.focusNode.value.length);
- dijit.form._FormValueWidget.prototype._setValueAttr.call(this, this.value, true);
- },
- _startSearchAll: function(){
- this._startSearch('');
- },
- _startSearchFromInput: function(){
- this._startSearch(this.focusNode.value.replace(/([\\\*\?])/g, "\\$1"));
- },
- _getQueryString: function(/*String*/ text){
- return dojo.string.substitute(this.queryExpr, [text]);
- },
- _startSearch: function(/*String*/ key){
-
-
-
- if(!this.dropDown){
- var popupId = this.id + "_popup",
- dropDownConstructor = dojo.getObject(this.dropDownClass, false);
- this.dropDown = new dropDownConstructor({
- onChange: dojo.hitch(this, this._selectOption),
- id: popupId,
- dir: this.dir
- });
- dijit.removeWaiState(this.focusNode,"activedescendant");
- dijit.setWaiState(this.textbox,"owns",popupId);
- }
-
-
- var query = dojo.clone(this.query);
- this._lastInput = key;
- this._lastQuery = query[this.searchAttr] = this._getQueryString(key);
-
-
-
- this.searchTimer=setTimeout(dojo.hitch(this, function(query, _this){
- this.searchTimer = null;
- var fetch = {
- queryOptions: {
- ignoreCase: this.ignoreCase,
- deep: true
- },
- query: query,
- onBegin: dojo.hitch(this, "_setMaxOptions"),
- onComplete: dojo.hitch(this, "_openResultList"),
- onError: function(errText){
- _this._fetchHandle = null;
- console.error('dijit.form.ComboBox: ' + errText);
- _this.closeDropDown();
- },
- start: 0,
- count: this.pageSize
- };
- dojo.mixin(fetch, _this.fetchProperties);
- this._fetchHandle = _this.store.fetch(fetch);
- var nextSearch = function(dataObject, direction){
- dataObject.start += dataObject.count*direction;
-
-
-
- dataObject.direction = direction;
- this._fetchHandle = this.store.fetch(dataObject);
- this.focus();
- };
- this._nextSearch = this.dropDown.onPage = dojo.hitch(this, nextSearch, this._fetchHandle);
- }, query, this), this.searchDelay);
- },
- _setMaxOptions: function(size, request){
- this._maxOptions = size;
- },
- _getValueField: function(){
-
-
-
- return this.searchAttr;
- },
-
- constructor: function(){
- this.query={};
- this.fetchProperties={};
- },
- postMixInProperties: function(){
- if(!this.store){
- var srcNodeRef = this.srcNodeRef;
-
- this.store = new dijit.form._ComboBoxDataStore(srcNodeRef);
-
-
-
-
-
-
-
- if(!("value" in this.params)){
- var item = (this.item = this.store.fetchSelectedItem());
- if(item){
- var valueField = this._getValueField();
- this.value = this.store.getValue(item, valueField);
- }
- }
- }
- this.inherited(arguments);
- },
- postCreate: function(){
-
-
-
-
-
- var label=dojo.query('label[for="'+this.id+'"]');
- if(label.length){
- label[0].id = (this.id+"_label");
- dijit.setWaiState(this.domNode, "labelledby", label[0].id);
- }
- this.inherited(arguments);
- },
- _setHasDownArrowAttr: function(val){
- this.hasDownArrow = val;
- this._buttonNode.style.display = val ? "" : "none";
- },
- _getMenuLabelFromItem: function(/*Item*/ item){
- var label = this.labelFunc(item, this.store),
- labelType = this.labelType;
-
- if(this.highlightMatch != "none" && this.labelType == "text" && this._lastInput){
- label = this.doHighlight(label, this._escapeHtml(this._lastInput));
- labelType = "html";
- }
- return {html: labelType == "html", label: label};
- },
- doHighlight: function(/*String*/ label, /*String*/ find){
-
-
-
-
-
-
- var
-
- modifiers = (this.ignoreCase ? "i" : "") + (this.highlightMatch == "all" ? "g" : ""),
- i = this.queryExpr.indexOf("${0}");
- find = dojo.regexp.escapeString(find);
- return this._escapeHtml(label).replace(
-
- new RegExp((i == 0 ? "^" : "") + "("+ find +")" + (i == (this.queryExpr.length - 4) ? "$" : ""), modifiers),
- '<span class="dijitComboBoxHighlightMatch">$1</span>'
- );
- },
- _escapeHtml: function(/*String*/ str){
-
-
-
- str = String(str).replace(/&/gm, "&").replace(/</gm, "<")
- .replace(/>/gm, ">").replace(/"/gm, """);
- return str;
- },
- reset: function(){
-
-
- this.item = null;
- this.inherited(arguments);
- },
- labelFunc: function(/*item*/ item, /*dojo.data.store*/ store){
-
-
-
-
-
-
-
-
- return store.getValue(item, this.labelAttr || this.searchAttr).toString();
- }
- }
- );
- dojo.declare(
- "dijit.form._ComboBoxMenu",
- [dijit._Widget, dijit._Templated, dijit._CssStateMixin],
- {
-
-
-
-
- templateString: "<ul class='dijitReset dijitMenu' dojoAttachEvent='onmousedown:_onMouseDown,onmouseup:_onMouseUp,onmouseover:_onMouseOver,onmouseout:_onMouseOut' style='overflow: \"auto\"; overflow-x: \"hidden\";'>"
- +"<li class='dijitMenuItem dijitMenuPreviousButton' dojoAttachPoint='previousButton' role='option'></li>"
- +"<li class='dijitMenuItem dijitMenuNextButton' dojoAttachPoint='nextButton' role='option'></li>"
- +"</ul>",
-
-
- _messages: null,
-
- baseClass: "dijitComboBoxMenu",
- postMixInProperties: function(){
- this.inherited(arguments);
- this._messages = dojo.i18n.getLocalization("dijit.form", "ComboBox", this.lang);
- },
- buildRendering: function(){
- this.inherited(arguments);
-
- this.previousButton.innerHTML = this._messages["previousMessage"];
- this.nextButton.innerHTML = this._messages["nextMessage"];
- },
- _setValueAttr: function(/*Object*/ value){
- this.value = value;
- this.onChange(value);
- },
-
- onChange: function(/*Object*/ value){
-
-
-
-
-
- },
- onPage: function(/*Number*/ direction){
-
-
-
-
- },
- onClose: function(){
-
-
-
-
- this._blurOptionNode();
- },
- _createOption: function(/*Object*/ item, labelFunc){
-
-
-
- var menuitem = dojo.create("li", {
- "class": "dijitReset dijitMenuItem" +(this.isLeftToRight() ? "" : " dijitMenuItemRtl"),
- role: "option"
- });
- var labelObject = labelFunc(item);
- if(labelObject.html){
- menuitem.innerHTML = labelObject.label;
- }else{
- menuitem.appendChild(
- dojo.doc.createTextNode(labelObject.label)
- );
- }
-
- if(menuitem.innerHTML == ""){
- menuitem.innerHTML = " ";
- }
- menuitem.item=item;
- return menuitem;
- },
- createOptions: function(results, dataObject, labelFunc){
-
-
-
-
-
-
-
-
-
-
-
- this.previousButton.style.display = (dataObject.start == 0) ? "none" : "";
- dojo.attr(this.previousButton, "id", this.id + "_prev");
-
-
-
-
- dojo.forEach(results, function(item, i){
- var menuitem = this._createOption(item, labelFunc);
- dojo.attr(menuitem, "id", this.id + i);
- this.domNode.insertBefore(menuitem, this.nextButton);
- }, this);
-
- var displayMore = false;
-
- if(dataObject._maxOptions && dataObject._maxOptions != -1){
- if((dataObject.start + dataObject.count) < dataObject._maxOptions){
- displayMore = true;
- }else if((dataObject.start + dataObject.count) > dataObject._maxOptions && dataObject.count == results.length){
-
-
-
- displayMore = true;
- }
- }else if(dataObject.count == results.length){
-
-
- displayMore = true;
- }
- this.nextButton.style.display = displayMore ? "" : "none";
- dojo.attr(this.nextButton,"id", this.id + "_next");
- return this.domNode.childNodes;
- },
- clearResultList: function(){
-
-
- while(this.domNode.childNodes.length>2){
- this.domNode.removeChild(this.domNode.childNodes[this.domNode.childNodes.length-2]);
- }
- this._blurOptionNode();
- },
- _onMouseDown: function(/*Event*/ evt){
- dojo.stopEvent(evt);
- },
- _onMouseUp: function(/*Event*/ evt){
- if(evt.target === this.domNode || !this._highlighted_option){
-
-
- return;
- }else if(evt.target == this.previousButton){
- this._blurOptionNode();
- this.onPage(-1);
- }else if(evt.target == this.nextButton){
- this._blurOptionNode();
- this.onPage(1);
- }else{
- var tgt = evt.target;
-
- while(!tgt.item){
-
- tgt = tgt.parentNode;
- }
- this._setValueAttr({ target: tgt }, true);
- }
- },
- _onMouseOver: function(/*Event*/ evt){
- if(evt.target === this.domNode){ return; }
- var tgt = evt.target;
- if(!(tgt == this.previousButton || tgt == this.nextButton)){
-
- while(!tgt.item){
-
- tgt = tgt.parentNode;
- }
- }
- this._focusOptionNode(tgt);
- },
- _onMouseOut: function(/*Event*/ evt){
- if(evt.target === this.domNode){ return; }
- this._blurOptionNode();
- },
- _focusOptionNode: function(/*DomNode*/ node){
-
-
- if(this._highlighted_option != node){
- this._blurOptionNode();
- this._highlighted_option = node;
- dojo.addClass(this._highlighted_option, "dijitMenuItemSelected");
- }
- },
- _blurOptionNode: function(){
-
-
- if(this._highlighted_option){
- dojo.removeClass(this._highlighted_option, "dijitMenuItemSelected");
- this._highlighted_option = null;
- }
- },
- _highlightNextOption: function(){
-
-
-
-
-
-
- if(!this.getHighlightedOption()){
- var fc = this.domNode.firstChild;
- this._focusOptionNode(fc.style.display == "none" ? fc.nextSibling : fc);
- }else{
- var ns = this._highlighted_option.nextSibling;
- if(ns && ns.style.display != "none"){
- this._focusOptionNode(ns);
- }else{
- this.highlightFirstOption();
- }
- }
-
- dojo.window.scrollIntoView(this._highlighted_option);
- },
- highlightFirstOption: function(){
-
-
- var first = this.domNode.firstChild;
- var second = first.nextSibling;
- this._focusOptionNode(second.style.display == "none" ? first : second);
- dojo.window.scrollIntoView(this._highlighted_option);
- },
- highlightLastOption: function(){
-
-
- this._focusOptionNode(this.domNode.lastChild.previousSibling);
- dojo.window.scrollIntoView(this._highlighted_option);
- },
- _highlightPrevOption: function(){
-
-
-
-
- if(!this.getHighlightedOption()){
- var lc = this.domNode.lastChild;
- this._focusOptionNode(lc.style.display == "none" ? lc.previousSibling : lc);
- }else{
- var ps = this._highlighted_option.previousSibling;
- if(ps && ps.style.display != "none"){
- this._focusOptionNode(ps);
- }else{
- this.highlightLastOption();
- }
- }
- dojo.window.scrollIntoView(this._highlighted_option);
- },
- _page: function(/*Boolean*/ up){
-
-
- var scrollamount = 0;
- var oldscroll = this.domNode.scrollTop;
- var height = dojo.style(this.domNode, "height");
-
- if(!this.getHighlightedOption()){
- this._highlightNextOption();
- }
- while(scrollamount<height){
- if(up){
-
- if(!this.getHighlightedOption().previousSibling ||
- this._highlighted_option.previousSibling.style.display == "none"){
- break;
- }
- this._highlightPrevOption();
- }else{
-
- if(!this.getHighlightedOption().nextSibling ||
- this._highlighted_option.nextSibling.style.display == "none"){
- break;
- }
- this._highlightNextOption();
- }
-
- var newscroll=this.domNode.scrollTop;
- scrollamount+=(newscroll-oldscroll)*(up ? -1:1);
- oldscroll=newscroll;
- }
- },
- pageUp: function(){
-
-
-
-
-
- this._page(true);
- },
- pageDown: function(){
-
-
-
-
-
- this._page(false);
- },
- getHighlightedOption: function(){
-
-
- var ho = this._highlighted_option;
- return (ho && ho.parentNode) ? ho : null;
- },
- handleKey: function(evt){
-
-
-
- switch(evt.charOrCode){
- case dojo.keys.DOWN_ARROW:
- this._highlightNextOption();
- return false;
- case dojo.keys.PAGE_DOWN:
- this.pageDown();
- return false;
- case dojo.keys.UP_ARROW:
- this._highlightPrevOption();
- return false;
- case dojo.keys.PAGE_UP:
- this.pageUp();
- return false;
- default:
- return true;
- }
- }
- }
- );
- dojo.declare(
- "dijit.form.ComboBox",
- [dijit.form.ValidationTextBox, dijit.form.ComboBoxMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _setValueAttr: function(/*String*/ value, /*Boolean?*/ priorityChange, /*String?*/ displayedValue){
-
-
-
-
- this._set("item", null);
- if(!value){ value = ''; }
- dijit.form.ValidationTextBox.prototype._setValueAttr.call(this, value, priorityChange, displayedValue);
- }
- }
- );
- dojo.declare("dijit.form._ComboBoxDataStore", null, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- constructor: function( /*DomNode*/ root){
- this.root = root;
- if(root.tagName != "SELECT" && root.firstChild){
- root = dojo.query("select", root);
- if(root.length > 0){
- root = root[0];
- }else{
- this.root.innerHTML = "<SELECT>"+this.root.innerHTML+"</SELECT>";
- root = this.root.firstChild;
- }
- this.root = root;
- }
- dojo.query("> option", root).forEach(function(node){
-
-
-
- node.innerHTML = dojo.trim(node.innerHTML);
- });
- },
- getValue: function( /*item*/ item,
- /*attribute-name-string*/ attribute,
- /*value?*/ defaultValue){
- return (attribute == "value") ? item.value : (item.innerText || item.textContent || '');
- },
- isItemLoaded: function(/*anything*/ something){
- return true;
- },
- getFeatures: function(){
- return {"dojo.data.api.Read": true, "dojo.data.api.Identity": true};
- },
- _fetchItems: function( /*Object*/ args,
- /*Function*/ findCallback,
- /*Function*/ errorCallback){
-
-
- if(!args.query){ args.query = {}; }
- if(!args.query.name){ args.query.name = ""; }
- if(!args.queryOptions){ args.queryOptions = {}; }
- var matcher = dojo.data.util.filter.patternToRegExp(args.query.name, args.queryOptions.ignoreCase),
- items = dojo.query("> option", this.root).filter(function(option){
- return (option.innerText || option.textContent || '').match(matcher);
- } );
- if(args.sort){
- items.sort(dojo.data.util.sorter.createSortFunction(args.sort, this));
- }
- findCallback(items, args);
- },
- close: function(/*dojo.data.api.Request || args || null*/ request){
- return;
- },
- getLabel: function(/*item*/ item){
- return item.innerHTML;
- },
- getIdentity: function(/*item*/ item){
- return dojo.attr(item, "value");
- },
- fetchItemByIdentity: function(/*Object*/ args){
-
-
-
-
-
-
-
-
-
-
-
- var item = dojo.query("> option[value='" + args.identity + "']", this.root)[0];
- args.onItem(item);
- },
- fetchSelectedItem: function(){
-
-
-
- var root = this.root,
- si = root.selectedIndex;
- return typeof si == "number"
- ? dojo.query("> option:nth-child(" + (si != -1 ? si+1 : 1) + ")", root)[0]
- : null;
- }
- });
- dojo.extend(dijit.form._ComboBoxDataStore,dojo.data.util.simpleFetch);
- }
- if(!dojo._hasResource["dijit.form.FilteringSelect"]){
- dojo._hasResource["dijit.form.FilteringSelect"] = true;
- dojo.provide("dijit.form.FilteringSelect");
- dojo.declare(
- "dijit.form.FilteringSelect",
- [dijit.form.MappedTextBox, dijit.form.ComboBoxMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- required: true,
- _lastDisplayedValue: "",
- _isValidSubset: function(){
- return this._opened;
- },
- isValid: function(){
-
- return this.item || (!this.required && this.get('displayedValue') == "");
- },
- _refreshState: function(){
- if(!this.searchTimer){
- this.inherited(arguments);
- }
- },
- _callbackSetLabel: function(
- /*Array*/ result,
- /*Object*/ dataObject,
- /*Boolean?*/ priorityChange){
-
-
-
-
-
-
- if((dataObject && dataObject.query[this.searchAttr] != this._lastQuery) || (!dataObject && result.length && this.store.getIdentity(result[0]) != this._lastQuery)){
- return;
- }
- if(!result.length){
-
-
- this.valueNode.value = "";
- dijit.form.TextBox.superclass._setValueAttr.call(this, "", priorityChange || (priorityChange === undefined && !this._focused));
- this._set("item", null);
- this.validate(this._focused);
- }else{
- this.set('item', result[0], priorityChange);
- }
- },
- _openResultList: function(/*Object*/ results, /*Object*/ dataObject){
-
-
-
- if(dataObject.query[this.searchAttr] != this._lastQuery){
- return;
- }
- dijit.form.ComboBoxMixin.prototype._openResultList.apply(this, arguments);
- if(this.item === undefined){
-
-
-
- this.validate(true);
- }
- },
- _getValueAttr: function(){
-
-
-
-
- return this.valueNode.value;
- },
- _getValueField: function(){
-
- return "value";
- },
- _setValueAttr: function(/*String*/ value, /*Boolean?*/ priorityChange){
-
-
-
-
-
- if(!this._onChangeActive){ priorityChange = null; }
- this._lastQuery = value;
- if(value === null || value === ''){
- this._setDisplayedValueAttr('', priorityChange);
- return;
- }
-
- var self = this;
- this.store.fetchItemByIdentity({
- identity: value,
- onItem: function(item){
- self._callbackSetLabel(item? [item] : [], undefined, priorityChange);
- }
- });
- },
- _setItemAttr: function(/*item*/ item, /*Boolean?*/ priorityChange, /*String?*/ displayedValue){
-
-
-
-
-
-
-
-
- this.inherited(arguments);
- this.valueNode.value = this.value;
- this._lastDisplayedValue = this.textbox.value;
- },
- _getDisplayQueryString: function(/*String*/ text){
- return text.replace(/([\\\*\?])/g, "\\$1");
- },
- _setDisplayedValueAttr: function(/*String*/ label, /*Boolean?*/ priorityChange){
-
-
-
-
-
- if(label == null){ label = ''; }
-
-
-
-
- if(!this._created){
- if(!("displayedValue" in this.params)){
- return;
- }
- priorityChange = false;
- }
-
-
- if(this.store){
- this.closeDropDown();
- var query = dojo.clone(this.query);
-
- this._lastQuery = query[this.searchAttr] = this._getDisplayQueryString(label);
-
-
-
-
- this.textbox.value = label;
- this._lastDisplayedValue = label;
- this._set("displayedValue", label);
- var _this = this;
- var fetch = {
- query: query,
- queryOptions: {
- ignoreCase: this.ignoreCase,
- deep: true
- },
- onComplete: function(result, dataObject){
- _this._fetchHandle = null;
- dojo.hitch(_this, "_callbackSetLabel")(result, dataObject, priorityChange);
- },
- onError: function(errText){
- _this._fetchHandle = null;
- console.error('dijit.form.FilteringSelect: ' + errText);
- dojo.hitch(_this, "_callbackSetLabel")([], undefined, false);
- }
- };
- dojo.mixin(fetch, this.fetchProperties);
- this._fetchHandle = this.store.fetch(fetch);
- }
- },
- undo: function(){
- this.set('displayedValue', this._lastDisplayedValue);
- }
- }
- );
- }
- if(!dojo._hasResource["dojo.data.ItemFileReadStore"]){
- dojo._hasResource["dojo.data.ItemFileReadStore"] = true;
- dojo.provide("dojo.data.ItemFileReadStore");
- dojo.declare("dojo.data.ItemFileReadStore", null,{
-
-
-
-
-
-
-
-
-
-
-
- constructor: function(/* Object */ keywordParameters){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this._arrayOfAllItems = [];
- this._arrayOfTopLevelItems = [];
- this._loadFinished = false;
- this._jsonFileUrl = keywordParameters.url;
- this._ccUrl = keywordParameters.url;
- this.url = keywordParameters.url;
- this._jsonData = keywordParameters.data;
- this.data = null;
- this._datatypeMap = keywordParameters.typeMap || {};
- if(!this._datatypeMap['Date']){
-
-
-
- this._datatypeMap['Date'] = {
- type: Date,
- deserialize: function(value){
- return dojo.date.stamp.fromISOString(value);
- }
- };
- }
- this._features = {'dojo.data.api.Read':true, 'dojo.data.api.Identity':true};
- this._itemsByIdentity = null;
- this._storeRefPropName = "_S";
- this._itemNumPropName = "_0";
- this._rootItemPropName = "_RI";
- this._reverseRefMap = "_RRM";
- this._loadInProgress = false;
- this._queuedFetches = [];
- if(keywordParameters.urlPreventCache !== undefined){
- this.urlPreventCache = keywordParameters.urlPreventCache?true:false;
- }
- if(keywordParameters.hierarchical !== undefined){
- this.hierarchical = keywordParameters.hierarchical?true:false;
- }
- if(keywordParameters.clearOnClose){
- this.clearOnClose = true;
- }
- if("failOk" in keywordParameters){
- this.failOk = keywordParameters.failOk?true:false;
- }
- },
-
- url: "",
-
-
- _ccUrl: "",
- data: null,
- typeMap: null,
-
-
-
-
-
- clearOnClose: false,
-
-
-
- urlPreventCache: false,
-
-
- failOk: false,
-
-
-
-
-
- hierarchical: true,
- _assertIsItem: function(/* item */ item){
-
-
-
-
- if(!this.isItem(item)){
- throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");
- }
- },
- _assertIsAttribute: function(/* attribute-name-string */ attribute){
-
-
-
-
- if(typeof attribute !== "string"){
- throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");
- }
- },
- getValue: function( /* item */ item,
- /* attribute-name-string */ attribute,
- /* value? */ defaultValue){
-
-
- var values = this.getValues(item, attribute);
- return (values.length > 0)?values[0]:defaultValue;
- },
- getValues: function(/* item */ item,
- /* attribute-name-string */ attribute){
-
-
- this._assertIsItem(item);
- this._assertIsAttribute(attribute);
-
- return (item[attribute] || []).slice(0);
- },
- getAttributes: function(/* item */ item){
-
-
- this._assertIsItem(item);
- var attributes = [];
- for(var key in item){
-
- if((key !== this._storeRefPropName) && (key !== this._itemNumPropName) && (key !== this._rootItemPropName) && (key !== this._reverseRefMap)){
- attributes.push(key);
- }
- }
- return attributes;
- },
- hasAttribute: function( /* item */ item,
- /* attribute-name-string */ attribute){
-
-
- this._assertIsItem(item);
- this._assertIsAttribute(attribute);
- return (attribute in item);
- },
- containsValue: function(/* item */ item,
- /* attribute-name-string */ attribute,
- /* anything */ value){
-
-
- var regexp = undefined;
- if(typeof value === "string"){
- regexp = dojo.data.util.filter.patternToRegExp(value, false);
- }
- return this._containsValue(item, attribute, value, regexp);
- },
- _containsValue: function( /* item */ item,
- /* attribute-name-string */ attribute,
- /* anything */ value,
- /* RegExp?*/ regexp){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return dojo.some(this.getValues(item, attribute), function(possibleValue){
- if(possibleValue !== null && !dojo.isObject(possibleValue) && regexp){
- if(possibleValue.toString().match(regexp)){
- return true;
- }
- }else if(value === possibleValue){
- return true;
- }
- });
- },
- isItem: function(/* anything */ something){
-
-
- if(something && something[this._storeRefPropName] === this){
- if(this._arrayOfAllItems[something[this._itemNumPropName]] === something){
- return true;
- }
- }
- return false;
- },
- isItemLoaded: function(/* anything */ something){
-
-
- return this.isItem(something);
- },
- loadItem: function(/* object */ keywordArgs){
-
-
- this._assertIsItem(keywordArgs.item);
- },
- getFeatures: function(){
-
-
- return this._features;
- },
- getLabel: function(/* item */ item){
-
-
- if(this._labelAttr && this.isItem(item)){
- return this.getValue(item,this._labelAttr);
- }
- return undefined;
- },
- getLabelAttributes: function(/* item */ item){
-
-
- if(this._labelAttr){
- return [this._labelAttr];
- }
- return null;
- },
- _fetchItems: function( /* Object */ keywordArgs,
- /* Function */ findCallback,
- /* Function */ errorCallback){
-
-
- var self = this,
- filter = function(requestArgs, arrayOfItems){
- var items = [],
- i, key;
- if(requestArgs.query){
- var value,
- ignoreCase = requestArgs.queryOptions ? requestArgs.queryOptions.ignoreCase : false;
-
-
- var regexpList = {};
- for(key in requestArgs.query){
- value = requestArgs.query[key];
- if(typeof value === "string"){
- regexpList[key] = dojo.data.util.filter.patternToRegExp(value, ignoreCase);
- }else if(value instanceof RegExp){
- regexpList[key] = value;
- }
- }
- for(i = 0; i < arrayOfItems.length; ++i){
- var match = true;
- var candidateItem = arrayOfItems[i];
- if(candidateItem === null){
- match = false;
- }else{
- for(key in requestArgs.query){
- value = requestArgs.query[key];
- if(!self._containsValue(candidateItem, key, value, regexpList[key])){
- match = false;
- }
- }
- }
- if(match){
- items.push(candidateItem);
- }
- }
- findCallback(items, requestArgs);
- }else{
-
-
-
-
-
- for(i = 0; i < arrayOfItems.length; ++i){
- var item = arrayOfItems[i];
- if(item !== null){
- items.push(item);
- }
- }
- findCallback(items, requestArgs);
- }
- };
- if(this._loadFinished){
- filter(keywordArgs, this._getItemsArray(keywordArgs.queryOptions));
- }else{
-
-
-
-
-
-
- if(this._jsonFileUrl !== this._ccUrl){
- dojo.deprecated("dojo.data.ItemFileReadStore: ",
- "To change the url, set the url property of the store," +
- " not _jsonFileUrl. _jsonFileUrl support will be removed in 2.0");
- this._ccUrl = this._jsonFileUrl;
- this.url = this._jsonFileUrl;
- }else if(this.url !== this._ccUrl){
- this._jsonFileUrl = this.url;
- this._ccUrl = this.url;
- }
-
- if(this.data != null){
- this._jsonData = this.data;
- this.data = null;
- }
- if(this._jsonFileUrl){
-
-
-
- if(this._loadInProgress){
- this._queuedFetches.push({args: keywordArgs, filter: filter});
- }else{
- this._loadInProgress = true;
- var getArgs = {
- url: self._jsonFileUrl,
- handleAs: "json-comment-optional",
- preventCache: this.urlPreventCache,
- failOk: this.failOk
- };
- var getHandler = dojo.xhrGet(getArgs);
- getHandler.addCallback(function(data){
- try{
- self._getItemsFromLoadedData(data);
- self._loadFinished = true;
- self._loadInProgress = false;
-
- filter(keywordArgs, self._getItemsArray(keywordArgs.queryOptions));
- self._handleQueuedFetches();
- }catch(e){
- self._loadFinished = true;
- self._loadInProgress = false;
- errorCallback(e, keywordArgs);
- }
- });
- getHandler.addErrback(function(error){
- self._loadInProgress = false;
- errorCallback(error, keywordArgs);
- });
-
-
-
-
- var oldAbort = null;
- if(keywordArgs.abort){
- oldAbort = keywordArgs.abort;
- }
- keywordArgs.abort = function(){
- var df = getHandler;
- if(df && df.fired === -1){
- df.cancel();
- df = null;
- }
- if(oldAbort){
- oldAbort.call(keywordArgs);
- }
- };
- }
- }else if(this._jsonData){
- try{
- this._loadFinished = true;
- this._getItemsFromLoadedData(this._jsonData);
- this._jsonData = null;
- filter(keywordArgs, this._getItemsArray(keywordArgs.queryOptions));
- }catch(e){
- errorCallback(e, keywordArgs);
- }
- }else{
- errorCallback(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."), keywordArgs);
- }
- }
- },
- _handleQueuedFetches: function(){
-
-
-
- if(this._queuedFetches.length > 0){
- for(var i = 0; i < this._queuedFetches.length; i++){
- var fData = this._queuedFetches[i],
- delayedQuery = fData.args,
- delayedFilter = fData.filter;
- if(delayedFilter){
- delayedFilter(delayedQuery, this._getItemsArray(delayedQuery.queryOptions));
- }else{
- this.fetchItemByIdentity(delayedQuery);
- }
- }
- this._queuedFetches = [];
- }
- },
- _getItemsArray: function(/*object?*/queryOptions){
-
-
-
- if(queryOptions && queryOptions.deep){
- return this._arrayOfAllItems;
- }
- return this._arrayOfTopLevelItems;
- },
- close: function(/*dojo.data.api.Request || keywordArgs || null */ request){
-
-
- if(this.clearOnClose &&
- this._loadFinished &&
- !this._loadInProgress){
-
-
-
-
- if(((this._jsonFileUrl == "" || this._jsonFileUrl == null) &&
- (this.url == "" || this.url == null)
- ) && this.data == null){
- console.debug("dojo.data.ItemFileReadStore: WARNING! Data reload " +
- " information has not been provided." +
- " Please set 'url' or 'data' to the appropriate value before" +
- " the next fetch");
- }
- this._arrayOfAllItems = [];
- this._arrayOfTopLevelItems = [];
- this._loadFinished = false;
- this._itemsByIdentity = null;
- this._loadInProgress = false;
- this._queuedFetches = [];
- }
- },
- _getItemsFromLoadedData: function(/* Object */ dataObject){
-
-
-
-
-
-
-
-
-
-
-
-
- var addingArrays = false,
- self = this;
-
- function valueIsAnItem(/* anything */ aValue){
-
-
-
-
-
-
-
-
-
-
-
-
-
- var isItem = (
- (aValue !== null) &&
- (typeof aValue === "object") &&
- (!dojo.isArray(aValue) || addingArrays) &&
- (!dojo.isFunction(aValue)) &&
- (aValue.constructor == Object || dojo.isArray(aValue)) &&
- (typeof aValue._reference === "undefined") &&
- (typeof aValue._type === "undefined") &&
- (typeof aValue._value === "undefined") &&
- self.hierarchical
- );
- return isItem;
- }
-
- function addItemAndSubItemsToArrayOfAllItems(/* Item */ anItem){
- self._arrayOfAllItems.push(anItem);
- for(var attribute in anItem){
- var valueForAttribute = anItem[attribute];
- if(valueForAttribute){
- if(dojo.isArray(valueForAttribute)){
- var valueArray = valueForAttribute;
- for(var k = 0; k < valueArray.length; ++k){
- var singleValue = valueArray[k];
- if(valueIsAnItem(singleValue)){
- addItemAndSubItemsToArrayOfAllItems(singleValue);
- }
- }
- }else{
- if(valueIsAnItem(valueForAttribute)){
- addItemAndSubItemsToArrayOfAllItems(valueForAttribute);
- }
- }
- }
- }
- }
- this._labelAttr = dataObject.label;
-
-
-
-
- var i,
- item;
- this._arrayOfAllItems = [];
- this._arrayOfTopLevelItems = dataObject.items;
- for(i = 0; i < this._arrayOfTopLevelItems.length; ++i){
- item = this._arrayOfTopLevelItems[i];
- if(dojo.isArray(item)){
- addingArrays = true;
- }
- addItemAndSubItemsToArrayOfAllItems(item);
- item[this._rootItemPropName]=true;
- }
-
-
-
-
-
-
-
-
- var allAttributeNames = {},
- key;
- for(i = 0; i < this._arrayOfAllItems.length; ++i){
- item = this._arrayOfAllItems[i];
- for(key in item){
- if(key !== this._rootItemPropName){
- var value = item[key];
- if(value !== null){
- if(!dojo.isArray(value)){
- item[key] = [value];
- }
- }else{
- item[key] = [null];
- }
- }
- allAttributeNames[key]=key;
- }
- }
-
-
- while(allAttributeNames[this._storeRefPropName]){
- this._storeRefPropName += "_";
- }
- while(allAttributeNames[this._itemNumPropName]){
- this._itemNumPropName += "_";
- }
- while(allAttributeNames[this._reverseRefMap]){
- this._reverseRefMap += "_";
- }
-
-
-
-
- var arrayOfValues;
- var identifier = dataObject.identifier;
- if(identifier){
- this._itemsByIdentity = {};
- this._features['dojo.data.api.Identity'] = identifier;
- for(i = 0; i < this._arrayOfAllItems.length; ++i){
- item = this._arrayOfAllItems[i];
- arrayOfValues = item[identifier];
- var identity = arrayOfValues[0];
- if(!Object.hasOwnProperty.call(this._itemsByIdentity, identity)){
- this._itemsByIdentity[identity] = item;
- }else{
- if(this._jsonFileUrl){
- throw new Error("dojo.data.ItemFileReadStore: The json data as specified by: [" + this._jsonFileUrl + "] is malformed. Items within the list have identifier: [" + identifier + "]. Value collided: [" + identity + "]");
- }else if(this._jsonData){
- throw new Error("dojo.data.ItemFileReadStore: The json data provided by the creation arguments is malformed. Items within the list have identifier: [" + identifier + "]. Value collided: [" + identity + "]");
- }
- }
- }
- }else{
- this._features['dojo.data.api.Identity'] = Number;
- }
-
-
- for(i = 0; i < this._arrayOfAllItems.length; ++i){
- item = this._arrayOfAllItems[i];
- item[this._storeRefPropName] = this;
- item[this._itemNumPropName] = i;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- for(i = 0; i < this._arrayOfAllItems.length; ++i){
- item = this._arrayOfAllItems[i];
- for(key in item){
- arrayOfValues = item[key];
- for(var j = 0; j < arrayOfValues.length; ++j){
- value = arrayOfValues[j];
- if(value !== null && typeof value == "object"){
- if(("_type" in value) && ("_value" in value)){
- var type = value._type;
- var mappingObj = this._datatypeMap[type];
- if(!mappingObj){
- throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '" + type + "'");
- }else if(dojo.isFunction(mappingObj)){
- arrayOfValues[j] = new mappingObj(value._value);
- }else if(dojo.isFunction(mappingObj.deserialize)){
- arrayOfValues[j] = mappingObj.deserialize(value._value);
- }else{
- throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");
- }
- }
- if(value._reference){
- var referenceDescription = value._reference;
- if(!dojo.isObject(referenceDescription)){
-
-
- arrayOfValues[j] = this._getItemByIdentity(referenceDescription);
- }else{
-
-
- for(var k = 0; k < this._arrayOfAllItems.length; ++k){
- var candidateItem = this._arrayOfAllItems[k],
- found = true;
- for(var refKey in referenceDescription){
- if(candidateItem[refKey] != referenceDescription[refKey]){
- found = false;
- }
- }
- if(found){
- arrayOfValues[j] = candidateItem;
- }
- }
- }
- if(this.referenceIntegrity){
- var refItem = arrayOfValues[j];
- if(this.isItem(refItem)){
- this._addReferenceToMap(refItem, item, key);
- }
- }
- }else if(this.isItem(value)){
-
-
-
- if(this.referenceIntegrity){
- this._addReferenceToMap(value, item, key);
- }
- }
- }
- }
- }
- }
- },
- _addReferenceToMap: function(/*item*/ refItem, /*item*/ parentItem, /*string*/ attribute){
-
-
-
-
-
-
-
-
-
-
-
-
- },
- getIdentity: function(/* item */ item){
-
-
- var identifier = this._features['dojo.data.api.Identity'];
- if(identifier === Number){
- return item[this._itemNumPropName];
- }else{
- var arrayOfValues = item[identifier];
- if(arrayOfValues){
- return arrayOfValues[0];
- }
- }
- return null;
- },
- fetchItemByIdentity: function(/* Object */ keywordArgs){
-
-
-
- var item,
- scope;
- if(!this._loadFinished){
- var self = this;
-
-
-
-
-
-
- if(this._jsonFileUrl !== this._ccUrl){
- dojo.deprecated("dojo.data.ItemFileReadStore: ",
- "To change the url, set the url property of the store," +
- " not _jsonFileUrl. _jsonFileUrl support will be removed in 2.0");
- this._ccUrl = this._jsonFileUrl;
- this.url = this._jsonFileUrl;
- }else if(this.url !== this._ccUrl){
- this._jsonFileUrl = this.url;
- this._ccUrl = this.url;
- }
-
-
- if(this.data != null && this._jsonData == null){
- this._jsonData = this.data;
- this.data = null;
- }
- if(this._jsonFileUrl){
- if(this._loadInProgress){
- this._queuedFetches.push({args: keywordArgs});
- }else{
- this._loadInProgress = true;
- var getArgs = {
- url: self._jsonFileUrl,
- handleAs: "json-comment-optional",
- preventCache: this.urlPreventCache,
- failOk: this.failOk
- };
- var getHandler = dojo.xhrGet(getArgs);
- getHandler.addCallback(function(data){
- var scope = keywordArgs.scope?keywordArgs.scope:dojo.global;
- try{
- self._getItemsFromLoadedData(data);
- self._loadFinished = true;
- self._loadInProgress = false;
- item = self._getItemByIdentity(keywordArgs.identity);
- if(keywordArgs.onItem){
- keywordArgs.onItem.call(scope, item);
- }
- self._handleQueuedFetches();
- }catch(error){
- self._loadInProgress = false;
- if(keywordArgs.onError){
- keywordArgs.onError.call(scope, error);
- }
- }
- });
- getHandler.addErrback(function(error){
- self._loadInProgress = false;
- if(keywordArgs.onError){
- var scope = keywordArgs.scope?keywordArgs.scope:dojo.global;
- keywordArgs.onError.call(scope, error);
- }
- });
- }
- }else if(this._jsonData){
-
- self._getItemsFromLoadedData(self._jsonData);
- self._jsonData = null;
- self._loadFinished = true;
- item = self._getItemByIdentity(keywordArgs.identity);
- if(keywordArgs.onItem){
- scope = keywordArgs.scope?keywordArgs.scope:dojo.global;
- keywordArgs.onItem.call(scope, item);
- }
- }
- }else{
-
- item = this._getItemByIdentity(keywordArgs.identity);
- if(keywordArgs.onItem){
- scope = keywordArgs.scope?keywordArgs.scope:dojo.global;
- keywordArgs.onItem.call(scope, item);
- }
- }
- },
- _getItemByIdentity: function(/* Object */ identity){
-
-
- var item = null;
- if(this._itemsByIdentity &&
- Object.hasOwnProperty.call(this._itemsByIdentity, identity)){
- item = this._itemsByIdentity[identity];
- }else if (Object.hasOwnProperty.call(this._arrayOfAllItems, identity)){
- item = this._arrayOfAllItems[identity];
- }
- if(item === undefined){
- item = null;
- }
- return item;
- },
- getIdentityAttributes: function(/* item */ item){
-
-
-
- var identifier = this._features['dojo.data.api.Identity'];
- if(identifier === Number){
-
-
-
-
- return null;
- }else{
- return [identifier];
- }
- },
-
- _forceLoad: function(){
-
-
-
- var self = this;
-
-
-
-
-
-
- if(this._jsonFileUrl !== this._ccUrl){
- dojo.deprecated("dojo.data.ItemFileReadStore: ",
- "To change the url, set the url property of the store," +
- " not _jsonFileUrl. _jsonFileUrl support will be removed in 2.0");
- this._ccUrl = this._jsonFileUrl;
- this.url = this._jsonFileUrl;
- }else if(this.url !== this._ccUrl){
- this._jsonFileUrl = this.url;
- this._ccUrl = this.url;
- }
-
- if(this.data != null){
- this._jsonData = this.data;
- this.data = null;
- }
- if(this._jsonFileUrl){
- var getArgs = {
- url: this._jsonFileUrl,
- handleAs: "json-comment-optional",
- preventCache: this.urlPreventCache,
- failOk: this.failOk,
- sync: true
- };
- var getHandler = dojo.xhrGet(getArgs);
- getHandler.addCallback(function(data){
- try{
-
-
-
-
-
-
- if(self._loadInProgress !== true && !self._loadFinished){
- self._getItemsFromLoadedData(data);
- self._loadFinished = true;
- }else if(self._loadInProgress){
-
-
-
- throw new Error("dojo.data.ItemFileReadStore: Unable to perform a synchronous load, an async load is in progress.");
- }
- }catch(e){
- console.log(e);
- throw e;
- }
- });
- getHandler.addErrback(function(error){
- throw error;
- });
- }else if(this._jsonData){
- self._getItemsFromLoadedData(self._jsonData);
- self._jsonData = null;
- self._loadFinished = true;
- }
- }
- });
- dojo.extend(dojo.data.ItemFileReadStore,dojo.data.util.simpleFetch);
- }
- if(!dojo._hasResource["dijit._editor.plugins.FontChoice"]){
- dojo._hasResource["dijit._editor.plugins.FontChoice"] = true;
- dojo.provide("dijit._editor.plugins.FontChoice");
- dojo.declare("dijit._editor.plugins._FontDropDown",
- [dijit._Widget, dijit._Templated],{
-
-
-
-
-
-
- label: "",
-
-
- widgetsInTemplate: true,
-
-
-
- plainText: false,
-
-
- templateString:
- "<span style='white-space: nowrap' class='dijit dijitReset dijitInline'>" +
- "<label class='dijitLeft dijitInline' for='${selectId}'>${label}</label>" +
- "<input dojoType='dijit.form.FilteringSelect' required='false' labelType='html' labelAttr='label' searchAttr='name' " +
- "tabIndex='-1' id='${selectId}' dojoAttachPoint='select' value=''/>" +
- "</span>",
- postMixInProperties: function(){
-
-
- this.inherited(arguments);
- this.strings = dojo.i18n.getLocalization("dijit._editor", "FontChoice");
-
- this.label = this.strings[this.command];
- this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
- this.selectId = this.id + "_select";
- this.inherited(arguments);
- },
- postCreate: function(){
-
-
-
-
-
- var items = dojo.map(this.values, function(value){
- var name = this.strings[value] || value;
- return {
- label: this.getLabel(value, name),
- name: name,
- value: value
- };
- }, this);
- this.select.store = new dojo.data.ItemFileReadStore({
- data: {
- identifier: "value",
- items: items
- }
- });
- this.select.set("value", "", false);
- this.disabled = this.select.get("disabled");
- },
- _setValueAttr: function(value, priorityChange){
-
-
-
-
-
-
-
-
-
- priorityChange = priorityChange !== false?true:false;
- this.select.set('value', dojo.indexOf(this.values,value) < 0 ? "" : value, priorityChange);
- if(!priorityChange){
-
- this.select._lastValueReported=null;
- }
- },
- _getValueAttr: function(){
-
-
-
- return this.select.get('value');
- },
- focus: function(){
-
-
-
- this.select.focus();
- },
- _setDisabledAttr: function(value){
-
-
-
-
-
- this.disabled = value;
- this.select.set("disabled", value);
- }
- });
- dojo.declare("dijit._editor.plugins._FontNameDropDown", dijit._editor.plugins._FontDropDown, {
-
-
-
-
- generic: false,
-
-
- command: "fontName",
- postMixInProperties: function(){
-
-
- if(!this.values){
- this.values = this.generic ?
- ["serif", "sans-serif", "monospace", "cursive", "fantasy"] :
- ["Arial", "Times New Roman", "Comic Sans MS", "Courier New"];
- }
- this.inherited(arguments);
- },
- getLabel: function(value, name){
-
-
-
-
-
-
-
-
- if(this.plainText){
- return name;
- }else{
- return "<div style='font-family: "+value+"'>" + name + "</div>";
- }
- },
- _setValueAttr: function(value, priorityChange){
-
-
-
- priorityChange = priorityChange !== false?true:false;
- if(this.generic){
- var map = {
- "Arial": "sans-serif",
- "Helvetica": "sans-serif",
- "Myriad": "sans-serif",
- "Times": "serif",
- "Times New Roman": "serif",
- "Comic Sans MS": "cursive",
- "Apple Chancery": "cursive",
- "Courier": "monospace",
- "Courier New": "monospace",
- "Papyrus": "fantasy",
- "Estrangelo Edessa": "cursive",
- "Gabriola": "fantasy"
- };
- value = map[value] || value;
- }
- this.inherited(arguments, [value, priorityChange]);
- }
- });
- dojo.declare("dijit._editor.plugins._FontSizeDropDown", dijit._editor.plugins._FontDropDown, {
-
-
-
-
- command: "fontSize",
-
-
- values: [1,2,3,4,5,6,7],
- getLabel: function(value, name){
-
-
-
-
-
-
-
-
-
-
- if(this.plainText){
- return name;
- }else{
- return "<font size=" + value + "'>" + name + "</font>";
- }
- },
- _setValueAttr: function(value, priorityChange){
-
-
-
- priorityChange = priorityChange !== false?true:false;
- if(value.indexOf && value.indexOf("px") != -1){
- var pixels = parseInt(value, 10);
- value = {10:1, 13:2, 16:3, 18:4, 24:5, 32:6, 48:7}[pixels] || value;
- }
- this.inherited(arguments, [value, priorityChange]);
- }
- });
- dojo.declare("dijit._editor.plugins._FormatBlockDropDown", dijit._editor.plugins._FontDropDown, {
-
-
-
-
- command: "formatBlock",
-
-
- values: ["noFormat", "p", "h1", "h2", "h3", "pre"],
- postCreate: function(){
-
-
- this.inherited(arguments);
- this.set("value", "noFormat", false);
- },
- getLabel: function(value, name){
-
-
-
-
-
-
-
-
- if(this.plainText || value == "noFormat"){
- return name;
- }else{
- return "<" + value + ">" + name + "</" + value + ">";
- }
- },
- _execCommand: function(editor, command, choice){
-
-
-
- if(choice === "noFormat"){
- var start;
- var end;
- var sel = dijit.range.getSelection(editor.window);
- if(sel && sel.rangeCount > 0){
- var range = sel.getRangeAt(0);
- var node, tag;
- if(range){
- start = range.startContainer;
- end = range.endContainer;
-
- while(start && start !== editor.editNode &&
- start !== editor.document.body &&
- start.nodeType !== 1){
- start = start.parentNode;
- }
- while(end && end !== editor.editNode &&
- end !== editor.document.body &&
- end.nodeType !== 1){
- end = end.parentNode;
- }
- var processChildren = dojo.hitch(this, function(node, array){
- if(node.childNodes && node.childNodes.length){
- var i;
- for(i = 0; i < node.childNodes.length; i++){
- var c = node.childNodes[i];
- if(c.nodeType == 1){
- if(dojo.withGlobal(editor.window, "inSelection", dijit._editor.selection, [c])){
- var tag = c.tagName? c.tagName.toLowerCase(): "";
- if(dojo.indexOf(this.values, tag) !== -1){
- array.push(c);
- }
- processChildren(c,array);
- }
- }
- }
- }
- });
- var unformatNodes = dojo.hitch(this, function(nodes){
-
-
-
-
- if(nodes && nodes.length){
- editor.beginEditing();
- while(nodes.length){
- this._removeFormat(editor, nodes.pop());
- }
- editor.endEditing();
- }
- });
- var clearNodes = [];
- if(start == end){
-
-
- var block;
- node = start;
- while(node && node !== editor.editNode && node !== editor.document.body){
- if(node.nodeType == 1){
- tag = node.tagName? node.tagName.toLowerCase(): "";
- if(dojo.indexOf(this.values, tag) !== -1){
- block = node;
- break;
- }
- }
- node = node.parentNode;
- }
-
-
- processChildren(start, clearNodes);
- if(block) { clearNodes = [block].concat(clearNodes); }
- unformatNodes(clearNodes);
- }else{
-
- node = start;
- while(dojo.withGlobal(editor.window, "inSelection", dijit._editor.selection, [node])){
- if(node.nodeType == 1){
- tag = node.tagName? node.tagName.toLowerCase(): "";
- if(dojo.indexOf(this.values, tag) !== -1){
- clearNodes.push(node);
- }
- processChildren(node,clearNodes);
- }
- node = node.nextSibling;
- }
- unformatNodes(clearNodes);
- }
- editor.onDisplayChanged();
- }
- }
- }else{
- editor.execCommand(command, choice);
- }
- },
- _removeFormat: function(editor, node){
-
-
-
-
- if(editor.customUndo){
-
-
-
-
- while(node.firstChild){
- dojo.place(node.firstChild, node, "before");
- }
- node.parentNode.removeChild(node);
- }else{
-
-
- dojo.withGlobal(editor.window,
- "selectElementChildren", dijit._editor.selection, [node]);
- var html = dojo.withGlobal(editor.window,
- "getSelectedHtml", dijit._editor.selection, [null]);
- dojo.withGlobal(editor.window,
- "selectElement", dijit._editor.selection, [node]);
- editor.execCommand("inserthtml", html||"");
- }
- }
- });
- dojo.declare("dijit._editor.plugins.FontChoice", dijit._editor._Plugin,{
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- useDefaultCommand: false,
- _initButton: function(){
-
-
-
-
-
-
- var clazz = {
- fontName: dijit._editor.plugins._FontNameDropDown,
- fontSize: dijit._editor.plugins._FontSizeDropDown,
- formatBlock: dijit._editor.plugins._FormatBlockDropDown
- }[this.command],
- params = this.params;
-
-
- if(this.params.custom){
- params.values = this.params.custom;
- }
- var editor = this.editor;
- this.button = new clazz(dojo.delegate({dir: editor.dir, lang: editor.lang}, params));
-
- this.connect(this.button.select, "onChange", function(choice){
-
-
- this.editor.focus();
-
- if(this.command == "fontName" && choice.indexOf(" ") != -1){ choice = "'" + choice + "'"; }
-
-
- if(this.button._execCommand){
- this.button._execCommand(this.editor, this.command, choice);
- }else{
- this.editor.execCommand(this.command, choice);
- }
- });
- },
- updateState: function(){
-
-
-
-
-
-
-
-
- var _e = this.editor;
- var _c = this.command;
- if(!_e || !_e.isLoaded || !_c.length){ return; }
-
- if(this.button){
- var disabled = this.get("disabled");
- this.button.set("disabled", disabled);
- if(disabled){ return; }
- var value;
- try{
- value = _e.queryCommandValue(_c) || "";
- }catch(e){
-
- value = "";
- }
-
- var quoted = dojo.isString(value) && value.match(/'([^']*)'/);
- if(quoted){ value = quoted[1]; }
- if(_c === "formatBlock"){
- if(!value || value == "p"){
-
-
-
- value = null;
- var elem;
-
- var sel = dijit.range.getSelection(this.editor.window);
- if(sel && sel.rangeCount > 0){
- var range = sel.getRangeAt(0);
- if(range){
- elem = range.endContainer;
- }
- }
-
- while(elem && elem !== _e.editNode && elem !== _e.document){
- var tg = elem.tagName?elem.tagName.toLowerCase():"";
- if(tg && dojo.indexOf(this.button.values, tg) > -1){
- value = tg;
- break;
- }
- elem = elem.parentNode;
- }
- if(!value){
-
- value = "noFormat";
- }
- }else{
-
-
- if(dojo.indexOf(this.button.values, value) < 0){
- value = "noFormat";
- }
- }
- }
- if(value !== this.button.get("value")){
-
-
- this.button.set('value', value, false);
- }
- }
- }
- });
- dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
- if(o.plugin){ return; }
- switch(o.args.name){
- case "fontName": case "fontSize": case "formatBlock":
- o.plugin = new dijit._editor.plugins.FontChoice({
- command: o.args.name,
- plainText: o.args.plainText?o.args.plainText:false
- });
- }
- });
- }
- if(!dojo._hasResource["dijit._Contained"]){
- dojo._hasResource["dijit._Contained"] = true;
- dojo.provide("dijit._Contained");
- dojo.declare("dijit._Contained",
- null,
- {
-
-
-
-
-
-
- getParent: function(){
-
-
-
- var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
- return parent && parent.isContainer ? parent : null;
- },
- _getSibling: function(/*String*/ which){
-
-
-
-
-
-
- var node = this.domNode;
- do{
- node = node[which+"Sibling"];
- }while(node && node.nodeType != 1);
- return node && dijit.byNode(node);
- },
- getPreviousSibling: function(){
-
-
-
- return this._getSibling("previous");
- },
- getNextSibling: function(){
-
-
-
- return this._getSibling("next");
- },
- getIndexInParent: function(){
-
-
-
-
- var p = this.getParent();
- if(!p || !p.getIndexOfChild){
- return -1;
- }
- return p.getIndexOfChild(this);
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.layout._LayoutWidget"]){
- dojo._hasResource["dijit.layout._LayoutWidget"] = true;
- dojo.provide("dijit.layout._LayoutWidget");
- dojo.declare("dijit.layout._LayoutWidget",
- [dijit._Widget, dijit._Container, dijit._Contained],
- {
-
-
-
-
-
-
-
- baseClass: "dijitLayoutContainer",
-
-
-
- isLayoutContainer: true,
- buildRendering: function(){
- this.inherited(arguments);
- dojo.addClass(this.domNode, "dijitContainer");
- },
- startup: function(){
-
-
-
-
-
-
-
-
-
-
- if(this._started){ return; }
-
-
- this.inherited(arguments);
-
- var parent = this.getParent && this.getParent()
- if(!(parent && parent.isLayoutContainer)){
-
-
- this.resize();
-
-
-
-
-
- this.connect(dojo.isIE ? this.domNode : dojo.global, 'onresize', function(){
-
- this.resize();
- });
- }
- },
- resize: function(changeSize, resultSize){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var node = this.domNode;
-
- if(changeSize){
- dojo.marginBox(node, changeSize);
-
- if(changeSize.t){ node.style.top = changeSize.t + "px"; }
- if(changeSize.l){ node.style.left = changeSize.l + "px"; }
- }
-
-
-
- var mb = resultSize || {};
- dojo.mixin(mb, changeSize || {});
- if( !("h" in mb) || !("w" in mb) ){
- mb = dojo.mixin(dojo.marginBox(node), mb);
- }
-
-
- var cs = dojo.getComputedStyle(node);
- var me = dojo._getMarginExtents(node, cs);
- var be = dojo._getBorderExtents(node, cs);
- var bb = (this._borderBox = {
- w: mb.w - (me.w + be.w),
- h: mb.h - (me.h + be.h)
- });
- var pe = dojo._getPadExtents(node, cs);
- this._contentBox = {
- l: dojo._toPixelValue(node, cs.paddingLeft),
- t: dojo._toPixelValue(node, cs.paddingTop),
- w: bb.w - pe.w,
- h: bb.h - pe.h
- };
-
- this.layout();
- },
- layout: function(){
-
-
-
-
-
-
-
-
- },
- _setupChild: function(/*dijit._Widget*/child){
-
-
-
-
- var cls = this.baseClass + "-child "
- + (child.baseClass ? this.baseClass + "-" + child.baseClass : "");
- dojo.addClass(child.domNode, cls);
- },
- addChild: function(/*dijit._Widget*/ child, /*Integer?*/ insertIndex){
-
- this.inherited(arguments);
- if(this._started){
- this._setupChild(child);
- }
- },
- removeChild: function(/*dijit._Widget*/ child){
-
- var cls = this.baseClass + "-child"
- + (child.baseClass ?
- " " + this.baseClass + "-" + child.baseClass : "");
- dojo.removeClass(child.domNode, cls);
-
- this.inherited(arguments);
- }
- }
- );
- dijit.layout.marginBox2contentBox = function(/*DomNode*/ node, /*Object*/ mb){
-
-
-
-
- var cs = dojo.getComputedStyle(node);
- var me = dojo._getMarginExtents(node, cs);
- var pb = dojo._getPadBorderExtents(node, cs);
- return {
- l: dojo._toPixelValue(node, cs.paddingLeft),
- t: dojo._toPixelValue(node, cs.paddingTop),
- w: mb.w - (me.w + pb.w),
- h: mb.h - (me.h + pb.h)
- };
- };
- (function(){
- var capitalize = function(word){
- return word.substring(0,1).toUpperCase() + word.substring(1);
- };
- var size = function(widget, dim){
-
- var newSize = widget.resize ? widget.resize(dim) : dojo.marginBox(widget.domNode, dim);
-
- if(newSize){
-
- dojo.mixin(widget, newSize);
- }else{
-
-
- dojo.mixin(widget, dojo.marginBox(widget.domNode));
- dojo.mixin(widget, dim);
- }
- };
- dijit.layout.layoutChildren = function(/*DomNode*/ container, /*Object*/ dim, /*Widget[]*/ children,
- /*String?*/ changedRegionId, /*Number?*/ changedRegionSize){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dim = dojo.mixin({}, dim);
- dojo.addClass(container, "dijitLayoutContainer");
-
-
-
- children = dojo.filter(children, function(item){ return item.region != "center" && item.layoutAlign != "client"; })
- .concat(dojo.filter(children, function(item){ return item.region == "center" || item.layoutAlign == "client"; }));
-
- dojo.forEach(children, function(child){
- var elm = child.domNode,
- pos = (child.region || child.layoutAlign);
-
- var elmStyle = elm.style;
- elmStyle.left = dim.l+"px";
- elmStyle.top = dim.t+"px";
- elmStyle.position = "absolute";
- dojo.addClass(elm, "dijitAlign" + capitalize(pos));
-
- var sizeSetting = {};
-
-
- if(changedRegionId && changedRegionId == child.id){
- sizeSetting[child.region == "top" || child.region == "bottom" ? "h" : "w"] = changedRegionSize;
- }
-
-
- if(pos == "top" || pos == "bottom"){
- sizeSetting.w = dim.w;
- size(child, sizeSetting);
- dim.h -= child.h;
- if(pos == "top"){
- dim.t += child.h;
- }else{
- elmStyle.top = dim.t + dim.h + "px";
- }
- }else if(pos == "left" || pos == "right"){
- sizeSetting.h = dim.h;
- size(child, sizeSetting);
- dim.w -= child.w;
- if(pos == "left"){
- dim.l += child.w;
- }else{
- elmStyle.left = dim.l + dim.w + "px";
- }
- }else if(pos == "client" || pos == "center"){
- size(child, dim);
- }
- });
- };
- })();
- }
- if(!dojo._hasResource["dijit.layout._ContentPaneResizeMixin"]){
- dojo._hasResource["dijit.layout._ContentPaneResizeMixin"] = true;
- dojo.provide("dijit.layout._ContentPaneResizeMixin");
- dojo.declare("dijit.layout._ContentPaneResizeMixin", null, {
-
-
-
-
-
-
-
-
-
-
-
- doLayout: true,
-
-
-
-
- isContainer: true,
-
-
-
- isLayoutContainer: true,
- _startChildren: function(){
-
-
-
- dojo.forEach(this.getChildren(), function(child){
- child.startup();
- child._started = true;
- });
- },
- startup: function(){
-
-
-
-
- if(this._started){ return; }
- var parent = dijit._Contained.prototype.getParent.call(this);
- this._childOfLayoutWidget = parent && parent.isLayoutContainer;
-
-
- this._needLayout = !this._childOfLayoutWidget;
- this.inherited(arguments);
- this._startChildren();
- if(this._isShown()){
- this._onShow();
- }
- if(!this._childOfLayoutWidget){
-
-
-
-
-
- this.connect(dojo.isIE ? this.domNode : dojo.global, 'onresize', function(){
-
- this._needLayout = !this._childOfLayoutWidget;
- this.resize();
- });
- }
- },
- _checkIfSingleChild: function(){
-
-
-
-
-
- var childNodes = dojo.query("> *", this.containerNode).filter(function(node){
- return node.tagName !== "SCRIPT";
- }),
- childWidgetNodes = childNodes.filter(function(node){
- return dojo.hasAttr(node, "data-dojo-type") || dojo.hasAttr(node, "dojoType") || dojo.hasAttr(node, "widgetId");
- }),
- candidateWidgets = dojo.filter(childWidgetNodes.map(dijit.byNode), function(widget){
- return widget && widget.domNode && widget.resize;
- });
- if(
-
- childNodes.length == childWidgetNodes.length &&
-
- candidateWidgets.length == 1
- ){
- this._singleChild = candidateWidgets[0];
- }else{
- delete this._singleChild;
- }
-
- dojo.toggleClass(this.containerNode, this.baseClass + "SingleChild", !!this._singleChild);
- },
- resize: function(changeSize, resultSize){
-
-
-
-
-
-
-
- if(!this._wasShown && this.open !== false){
- this._onShow();
- }
- this._resizeCalled = true;
- this._scheduleLayout(changeSize, resultSize);
- },
- _scheduleLayout: function(changeSize, resultSize){
-
-
-
- if(this._isShown()){
- this._layout(changeSize, resultSize);
- }else{
- this._needLayout = true;
- this._changeSize = changeSize;
- this._resultSize = resultSize;
- }
- },
- _layout: function(changeSize, resultSize){
-
-
-
-
-
-
-
-
-
- if(changeSize){
- dojo.marginBox(this.domNode, changeSize);
- }
-
- var cn = this.containerNode;
- if(cn === this.domNode){
-
-
-
- var mb = resultSize || {};
- dojo.mixin(mb, changeSize || {});
- if(!("h" in mb) || !("w" in mb)){
- mb = dojo.mixin(dojo.marginBox(cn), mb);
- }
- this._contentBox = dijit.layout.marginBox2contentBox(cn, mb);
- }else{
- this._contentBox = dojo.contentBox(cn);
- }
- this._layoutChildren();
- delete this._needLayout;
- },
-
- _layoutChildren: function(){
-
-
- if(this.doLayout){
- this._checkIfSingleChild();
- }
- if(this._singleChild && this._singleChild.resize){
- var cb = this._contentBox || dojo.contentBox(this.containerNode);
-
-
- this._singleChild.resize({w: cb.w, h: cb.h});
- }else{
-
-
- dojo.forEach(this.getChildren(), function(widget){
- if(widget.resize){
- widget.resize();
- }
- });
- }
- },
- _isShown: function(){
-
-
-
-
-
-
-
- if(this._childOfLayoutWidget){
-
- if(this._resizeCalled && "open" in this){
- return this.open;
- }
- return this._resizeCalled;
- }else if("open" in this){
- return this.open;
- }else{
- var node = this.domNode, parent = this.domNode.parentNode;
- return (node.style.display != 'none') && (node.style.visibility != 'hidden') && !dojo.hasClass(node, "dijitHidden") &&
- parent && parent.style && (parent.style.display != 'none');
- }
- },
- _onShow: function(){
-
-
-
-
-
-
-
-
-
-
- this._wasShown = true;
- if(this._needLayout){
-
- this._layout(this._changeSize, this._resultSize);
- }
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dojo.html"]){
- dojo._hasResource["dojo.html"] = true;
- dojo.provide("dojo.html");
- dojo.getObject("html", true, dojo);
- (function(){
-
- var idCounter = 0,
- d = dojo;
-
- dojo.html._secureForInnerHtml = function(/*String*/ cont){
-
-
-
-
-
-
-
-
- return cont.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig, "");
- };
- dojo.html._emptyNode = dojo.empty;
- dojo.html._setNodeContent = function(/* DomNode */ node, /* String|DomNode|NodeList */ cont){
-
-
-
-
-
-
-
-
-
- d.empty(node);
- if(cont) {
- if(typeof cont == "string") {
- cont = d._toDom(cont, node.ownerDocument);
- }
- if(!cont.nodeType && d.isArrayLike(cont)) {
-
- for(var startlen=cont.length, i=0; i<cont.length; i=startlen==cont.length ? i+1 : 0) {
- d.place( cont[i], node, "last");
- }
- } else {
-
- d.place(cont, node, "last");
- }
- }
-
- return node;
- };
-
- dojo.declare("dojo.html._ContentSetter", null,
- {
-
-
- node: "",
-
-
- content: "",
-
-
-
- id: "",
-
-
-
- cleanContent: false,
-
-
-
- extractContent: false,
-
-
- parseContent: false,
-
-
-
-
-
- parserScope: dojo._scopeName,
-
-
- startup: true,
-
-
- constructor: function(/* Object */params, /* String|DomNode */node){
-
-
-
-
-
- dojo.mixin(this, params || {});
-
-
- node = this.node = dojo.byId( this.node || node );
-
- if(!this.id){
- this.id = [
- "Setter",
- (node) ? node.id || node.tagName : "",
- idCounter++
- ].join("_");
- }
- },
- set: function(/* String|DomNode|NodeList? */ cont, /* Object? */ params){
-
-
-
-
-
- if(undefined !== cont){
- this.content = cont;
- }
-
- if(params){
- this._mixin(params);
- }
- this.onBegin();
- this.setContent();
- this.onEnd();
- return this.node;
- },
- setContent: function(){
-
-
- var node = this.node;
- if(!node) {
-
- throw new Error(this.declaredClass + ": setContent given no node");
- }
- try{
- node = dojo.html._setNodeContent(node, this.content);
- }catch(e){
-
-
-
-
- var errMess = this.onContentError(e);
- try{
- node.innerHTML = errMess;
- }catch(e){
- console.error('Fatal ' + this.declaredClass + '.setContent could not change content due to '+e.message, e);
- }
- }
-
- this.node = node;
- },
-
- empty: function() {
-
-
-
-
-
- if(this.parseResults && this.parseResults.length) {
- dojo.forEach(this.parseResults, function(w) {
- if(w.destroy){
- w.destroy();
- }
- });
- delete this.parseResults;
- }
-
-
- dojo.html._emptyNode(this.node);
- },
-
- onBegin: function(){
-
-
-
-
-
-
- var cont = this.content;
-
- if(dojo.isString(cont)){
- if(this.cleanContent){
- cont = dojo.html._secureForInnerHtml(cont);
- }
-
- if(this.extractContent){
- var match = cont.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
- if(match){ cont = match[1]; }
- }
- }
-
- this.empty();
-
- this.content = cont;
- return this.node;
- },
-
- onEnd: function(){
-
-
-
-
- if(this.parseContent){
-
- this._parse();
- }
- return this.node;
- },
-
- tearDown: function(){
-
-
-
-
-
-
- delete this.parseResults;
- delete this.node;
- delete this.content;
- },
-
- onContentError: function(err){
- return "Error occured setting content: " + err;
- },
-
- _mixin: function(params){
-
-
-
-
- var empty = {}, key;
- for(key in params){
- if(key in empty){ continue; }
-
-
- this[key] = params[key];
- }
- },
- _parse: function(){
-
-
-
- var rootNode = this.node;
- try{
-
- var inherited = {};
- dojo.forEach(["dir", "lang", "textDir"], function(name){
- if(this[name]){
- inherited[name] = this[name];
- }
- }, this);
- this.parseResults = dojo.parser.parse({
- rootNode: rootNode,
- noStart: !this.startup,
- inherited: inherited,
- scope: this.parserScope
- });
- }catch(e){
- this._onError('Content', e, "Error parsing in _ContentSetter#"+this.id);
- }
- },
-
- _onError: function(type, err, consoleText){
-
-
-
- var errText = this['on' + type + 'Error'].call(this, err);
- if(consoleText){
- console.error(consoleText, err);
- }else if(errText){
- dojo.html._setNodeContent(this.node, errText, true);
- }
- }
- });
- dojo.html.set = function(/* DomNode */ node, /* String|DomNode|NodeList */ cont, /* Object? */ params){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(undefined == cont){
- console.warn("dojo.html.set: no cont argument provided, using empty string");
- cont = "";
- }
- if(!params){
-
- return dojo.html._setNodeContent(node, cont, true);
- }else{
-
-
- var op = new dojo.html._ContentSetter(dojo.mixin(
- params,
- { content: cont, node: node }
- ));
- return op.set();
- }
- };
- })();
- }
- if(!dojo._hasResource["dijit.layout.ContentPane"]){
- dojo._hasResource["dijit.layout.ContentPane"] = true;
- dojo.provide("dijit.layout.ContentPane");
- dojo.declare(
- "dijit.layout.ContentPane", [dijit._Widget, dijit.layout._ContentPaneResizeMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- href: "",
-
-
-
- extractContent: false,
-
-
- parseOnLoad: true,
-
-
-
-
-
- parserScope: dojo._scopeName,
-
-
- preventCache: false,
-
-
- preload: false,
-
-
- refreshOnShow: false,
-
-
- loadingMessage: "<span class='dijitContentPaneLoading'>${loadingState}</span>",
-
-
- errorMessage: "<span class='dijitContentPaneError'>${errorState}</span>",
-
-
-
-
-
-
-
- isLoaded: false,
- baseClass: "dijitContentPane",
-
-
-
- ioArgs: {},
-
-
-
-
-
-
-
-
- onLoadDeferred: null,
-
-
-
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- title: []
- }),
-
- stopParser: true,
-
-
-
-
- template: false,
- create: function(params, srcNodeRef){
-
-
-
- if((!params || !params.template) && srcNodeRef && !("href" in params) && !("content" in params)){
- var df = dojo.doc.createDocumentFragment();
- srcNodeRef = dojo.byId(srcNodeRef)
- while(srcNodeRef.firstChild){
- df.appendChild(srcNodeRef.firstChild);
- }
- params = dojo.delegate(params, {content: df});
- }
- this.inherited(arguments, [params, srcNodeRef]);
- },
- postMixInProperties: function(){
- this.inherited(arguments);
- var messages = dojo.i18n.getLocalization("dijit", "loading", this.lang);
- this.loadingMessage = dojo.string.substitute(this.loadingMessage, messages);
- this.errorMessage = dojo.string.substitute(this.errorMessage, messages);
- },
- buildRendering: function(){
- this.inherited(arguments);
-
-
- if(!this.containerNode){
- this.containerNode = this.domNode;
- }
-
-
- this.domNode.title = "";
- if(!dojo.attr(this.domNode,"role")){
- dijit.setWaiRole(this.domNode, "group");
- }
- },
- _startChildren: function(){
-
-
-
- this.inherited(arguments);
-
- if(this._contentSetter){
- dojo.forEach(this._contentSetter.parseResults, function(obj){
- if(!obj._started && !obj._destroyed && dojo.isFunction(obj.startup)){
- obj.startup();
- obj._started = true;
- }
- }, this);
- }
- },
- setHref: function(/*String|Uri*/ href){
-
-
- dojo.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.", "", "2.0");
- return this.set("href", href);
- },
- _setHrefAttr: function(/*String|Uri*/ href){
-
-
-
-
-
-
-
-
- this.cancel();
- this.onLoadDeferred = new dojo.Deferred(dojo.hitch(this, "cancel"));
- this.onLoadDeferred.addCallback(dojo.hitch(this, "onLoad"));
- this._set("href", href);
-
-
-
- if(this.preload || (this._created && this._isShown())){
- this._load();
- }else{
-
-
- this._hrefChanged = true;
- }
- return this.onLoadDeferred;
- },
- setContent: function(/*String|DomNode|Nodelist*/data){
-
-
- dojo.deprecated("dijit.layout.ContentPane.setContent() is deprecated. Use set('content', ...) instead.", "", "2.0");
- this.set("content", data);
- },
- _setContentAttr: function(/*String|DomNode|Nodelist*/data){
-
-
-
-
-
-
-
-
-
-
- this._set("href", "");
-
- this.cancel();
-
-
- this.onLoadDeferred = new dojo.Deferred(dojo.hitch(this, "cancel"));
- if(this._created){
-
-
-
- this.onLoadDeferred.addCallback(dojo.hitch(this, "onLoad"));
- }
- this._setContent(data || "");
- this._isDownloaded = false;
- return this.onLoadDeferred;
- },
- _getContentAttr: function(){
-
-
- return this.containerNode.innerHTML;
- },
- cancel: function(){
-
-
- if(this._xhrDfd && (this._xhrDfd.fired == -1)){
- this._xhrDfd.cancel();
- }
- delete this._xhrDfd;
- this.onLoadDeferred = null;
- },
- uninitialize: function(){
- if(this._beingDestroyed){
- this.cancel();
- }
- this.inherited(arguments);
- },
- destroyRecursive: function(/*Boolean*/ preserveDom){
-
-
-
- if(this._beingDestroyed){
- return;
- }
- this.inherited(arguments);
- },
- _onShow: function(){
-
-
-
-
-
-
-
-
-
- this.inherited(arguments);
- if(this.href){
- if(!this._xhrDfd &&
- (!this.isLoaded || this._hrefChanged || this.refreshOnShow)
- ){
- return this.refresh();
- }
- }
- },
- refresh: function(){
-
-
-
-
-
-
-
- this.cancel();
- this.onLoadDeferred = new dojo.Deferred(dojo.hitch(this, "cancel"));
- this.onLoadDeferred.addCallback(dojo.hitch(this, "onLoad"));
- this._load();
- return this.onLoadDeferred;
- },
- _load: function(){
-
-
-
- this._setContent(this.onDownloadStart(), true);
- var self = this;
- var getArgs = {
- preventCache: (this.preventCache || this.refreshOnShow),
- url: this.href,
- handleAs: "text"
- };
- if(dojo.isObject(this.ioArgs)){
- dojo.mixin(getArgs, this.ioArgs);
- }
- var hand = (this._xhrDfd = (this.ioMethod || dojo.xhrGet)(getArgs));
- hand.addCallback(function(html){
- try{
- self._isDownloaded = true;
- self._setContent(html, false);
- self.onDownloadEnd();
- }catch(err){
- self._onError('Content', err);
- }
- delete self._xhrDfd;
- return html;
- });
- hand.addErrback(function(err){
- if(!hand.canceled){
-
- self._onError('Download', err);
- }
- delete self._xhrDfd;
- return err;
- });
-
- delete this._hrefChanged;
- },
- _onLoadHandler: function(data){
-
-
- this._set("isLoaded", true);
- try{
- this.onLoadDeferred.callback(data);
- }catch(e){
- console.error('Error '+this.widgetId+' running custom onLoad code: ' + e.message);
- }
- },
- _onUnloadHandler: function(){
-
-
- this._set("isLoaded", false);
- try{
- this.onUnload();
- }catch(e){
- console.error('Error '+this.widgetId+' running custom onUnload code: ' + e.message);
- }
- },
- destroyDescendants: function(){
-
-
-
- if(this.isLoaded){
- this._onUnloadHandler();
- }
-
-
-
-
- var setter = this._contentSetter;
- dojo.forEach(this.getChildren(), function(widget){
- if(widget.destroyRecursive){
- widget.destroyRecursive();
- }
- });
- if(setter){
-
-
- dojo.forEach(setter.parseResults, function(widget){
- if(widget.destroyRecursive && widget.domNode && widget.domNode.parentNode == dojo.body()){
- widget.destroyRecursive();
- }
- });
- delete setter.parseResults;
- }
-
- dojo.html._emptyNode(this.containerNode);
-
- delete this._singleChild;
- },
- _setContent: function(/*String|DocumentFragment*/ cont, /*Boolean*/ isFakeContent){
-
-
-
- this.destroyDescendants();
-
-
-
-
-
- var setter = this._contentSetter;
- if(! (setter && setter instanceof dojo.html._ContentSetter)){
- setter = this._contentSetter = new dojo.html._ContentSetter({
- node: this.containerNode,
- _onError: dojo.hitch(this, this._onError),
- onContentError: dojo.hitch(this, function(e){
-
-
- var errMess = this.onContentError(e);
- try{
- this.containerNode.innerHTML = errMess;
- }catch(e){
- console.error('Fatal '+this.id+' could not change content due to '+e.message, e);
- }
- })
- });
- };
- var setterParams = dojo.mixin({
- cleanContent: this.cleanContent,
- extractContent: this.extractContent,
- parseContent: this.parseOnLoad,
- parserScope: this.parserScope,
- startup: false,
- dir: this.dir,
- lang: this.lang
- }, this._contentSetterParams || {});
- setter.set( (dojo.isObject(cont) && cont.domNode) ? cont.domNode : cont, setterParams );
-
- delete this._contentSetterParams;
- if(this.doLayout){
- this._checkIfSingleChild();
- }
- if(!isFakeContent){
- if(this._started){
-
- this._startChildren();
-
-
-
-
- this._scheduleLayout();
- }
- this._onLoadHandler(cont);
- }
- },
- _onError: function(type, err, consoleText){
- this.onLoadDeferred.errback(err);
-
-
- var errText = this['on' + type + 'Error'].call(this, err);
- if(consoleText){
- console.error(consoleText, err);
- }else if(errText){
- this._setContent(errText, true);
- }
- },
-
- onLoad: function(data){
-
-
-
-
- },
- onUnload: function(){
-
-
-
-
- },
- onDownloadStart: function(){
-
-
-
-
-
-
-
-
- return this.loadingMessage;
- },
- onContentError: function(/*Error*/ error){
-
-
-
-
-
-
-
-
-
-
- },
- onDownloadError: function(/*Error*/ error){
-
-
-
-
-
-
-
-
-
-
- return this.errorMessage;
- },
- onDownloadEnd: function(){
-
-
-
-
- }
- });
- }
- if(!dojo._hasResource["dijit.form._FormMixin"]){
- dojo._hasResource["dijit.form._FormMixin"] = true;
- dojo.provide("dijit.form._FormMixin");
- dojo.declare("dijit.form._FormMixin", null, {
-
-
-
-
-
-
-
-
-
-
-
-
- state: "",
-
-
-
-
-
-
- reset: function(){
- dojo.forEach(this.getDescendants(), function(widget){
- if(widget.reset){
- widget.reset();
- }
- });
- },
- validate: function(){
-
-
-
-
-
-
-
- var didFocus = false;
- return dojo.every(dojo.map(this.getDescendants(), function(widget){
-
-
- widget._hasBeenBlurred = true;
- var valid = widget.disabled || !widget.validate || widget.validate();
- if(!valid && !didFocus){
-
- dojo.window.scrollIntoView(widget.containerNode || widget.domNode);
- widget.focus();
- didFocus = true;
- }
- return valid;
- }), function(item){ return item; });
- },
- setValues: function(val){
- dojo.deprecated(this.declaredClass+"::setValues() is deprecated. Use set('value', val) instead.", "", "2.0");
- return this.set('value', val);
- },
- _setValueAttr: function(/*Object*/ obj){
-
-
-
- var map = { };
- dojo.forEach(this.getDescendants(), function(widget){
- if(!widget.name){ return; }
- var entry = map[widget.name] || (map[widget.name] = [] );
- entry.push(widget);
- });
- for(var name in map){
- if(!map.hasOwnProperty(name)){
- continue;
- }
- var widgets = map[name],
- values = dojo.getObject(name, false, obj);
- if(values === undefined){
- continue;
- }
- if(!dojo.isArray(values)){
- values = [ values ];
- }
- if(typeof widgets[0].checked == 'boolean'){
-
- dojo.forEach(widgets, function(w, i){
- w.set('value', dojo.indexOf(values, w.value) != -1);
- });
- }else if(widgets[0].multiple){
-
- widgets[0].set('value', values);
- }else{
-
- dojo.forEach(widgets, function(w, i){
- w.set('value', values[i]);
- });
- }
- }
-
-
-
-
- },
- getValues: function(){
- dojo.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.", "", "2.0");
- return this.get('value');
- },
- _getValueAttr: function(){
-
-
-
-
-
-
-
-
-
-
-
-
-
- var obj = { };
- dojo.forEach(this.getDescendants(), function(widget){
- var name = widget.name;
- if(!name || widget.disabled){ return; }
-
- var value = widget.get('value');
-
- if(typeof widget.checked == 'boolean'){
- if(/Radio/.test(widget.declaredClass)){
-
- if(value !== false){
- dojo.setObject(name, value, obj);
- }else{
-
- value = dojo.getObject(name, false, obj);
- if(value === undefined){
- dojo.setObject(name, null, obj);
- }
- }
- }else{
-
- var ary=dojo.getObject(name, false, obj);
- if(!ary){
- ary=[];
- dojo.setObject(name, ary, obj);
- }
- if(value !== false){
- ary.push(value);
- }
- }
- }else{
- var prev=dojo.getObject(name, false, obj);
- if(typeof prev != "undefined"){
- if(dojo.isArray(prev)){
- prev.push(value);
- }else{
- dojo.setObject(name, [prev, value], obj);
- }
- }else{
-
- dojo.setObject(name, value, obj);
- }
- }
- });
-
- return obj;
- },
- isValid: function(){
-
-
-
- return this.state == "";
- },
- onValidStateChange: function(isValid){
-
-
-
-
-
-
- },
- _getState: function(){
-
-
- var states = dojo.map(this._descendants, function(w){
- return w.get("state") || "";
- });
- return dojo.indexOf(states, "Error") >= 0 ? "Error" :
- dojo.indexOf(states, "Incomplete") >= 0 ? "Incomplete" : "";
- },
- disconnectChildren: function(){
-
-
-
- dojo.forEach(this._childConnections || [], dojo.hitch(this, "disconnect"));
- dojo.forEach(this._childWatches || [], function(w){ w.unwatch(); });
- },
- connectChildren: function(/*Boolean*/ inStartup){
-
-
-
-
-
-
-
- var _this = this;
-
- this.disconnectChildren();
- this._descendants = this.getDescendants();
-
- var set = inStartup ? function(name, val){ _this[name] = val; } : dojo.hitch(this, "_set");
- set("value", this.get("value"));
- set("state", this._getState());
- // Monitor changes to error state and disabled state in order to update
- // Form.state
- var conns = (this._childConnections = []),
- watches = (this._childWatches = []);
- dojo.forEach(dojo.filter(this._descendants,
- function(item){ return item.validate; }
- ),
- function(widget){
-
-
- dojo.forEach(["state", "disabled"], function(attr){
- watches.push(widget.watch(attr, function(attr, oldVal, newVal){
- _this.set("state", _this._getState());
- }));
- });
- });
-
- var onChange = function(){
-
-
-
-
-
-
-
-
-
- if(_this._onChangeDelayTimer){
- clearTimeout(_this._onChangeDelayTimer);
- }
- _this._onChangeDelayTimer = setTimeout(function(){
- delete _this._onChangeDelayTimer;
- _this._set("value", _this.get("value"));
- }, 10);
- };
- dojo.forEach(
- dojo.filter(this._descendants, function(item){ return item.onChange; } ),
- function(widget){
-
-
-
-
-
- conns.push(_this.connect(widget, "onChange", onChange));
-
-
- watches.push(widget.watch("disabled", onChange));
- }
- );
- },
- startup: function(){
- this.inherited(arguments);
-
-
- this.connectChildren(true);
-
- this.watch("state", function(attr, oldVal, newVal){ this.onValidStateChange(newVal == ""); });
- },
- destroy: function(){
- this.disconnectChildren();
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit._DialogMixin"]){
- dojo._hasResource["dijit._DialogMixin"] = true;
- dojo.provide("dijit._DialogMixin");
- dojo.declare("dijit._DialogMixin", null,
- {
-
-
- attributeMap: dijit._Widget.prototype.attributeMap,
- execute: function(/*Object*/ formContents){
-
-
-
-
-
-
-
-
-
-
-
- },
- onCancel: function(){
-
-
-
-
-
-
-
-
- },
- onExecute: function(){
-
-
-
-
-
-
-
-
- },
- _onSubmit: function(){
-
-
-
-
- this.onExecute();
- this.execute(this.get('value'));
- },
- _getFocusItems: function(){
-
-
-
-
-
- var elems = dijit._getTabNavigable(this.containerNode);
- this._firstFocusItem = elems.lowest || elems.first || this.closeButtonNode || this.domNode;
- this._lastFocusItem = elems.last || elems.highest || this._firstFocusItem;
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.TooltipDialog"]){
- dojo._hasResource["dijit.TooltipDialog"] = true;
- dojo.provide("dijit.TooltipDialog");
- dojo.declare(
- "dijit.TooltipDialog",
- [dijit.layout.ContentPane, dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin],
- {
-
-
-
-
- title: "",
-
-
-
-
-
- doLayout: false,
-
-
-
-
- autofocus: true,
-
-
- baseClass: "dijitTooltipDialog",
-
-
-
- _firstFocusItem: null,
-
-
-
- _lastFocusItem: null,
- templateString: dojo.cache("dijit", "templates/TooltipDialog.html", "<div role=\"presentation\" tabIndex=\"-1\">\n\t<div class=\"dijitTooltipContainer\" role=\"presentation\">\n\t\t<div class =\"dijitTooltipContents dijitTooltipFocusNode\" dojoAttachPoint=\"containerNode\" role=\"dialog\"></div>\n\t</div>\n\t<div class=\"dijitTooltipConnector\" role=\"presentation\"></div>\n</div>\n"),
- _setTitleAttr: function(/*String*/ title){
- this.containerNode.title = title;
- this._set("title", title)
- },
- postCreate: function(){
- this.inherited(arguments);
- this.connect(this.containerNode, "onkeypress", "_onKey");
- },
- orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ corner){
-
-
-
-
-
-
- var newC = "dijitTooltipAB" + (corner.charAt(1) == 'L' ? "Left" : "Right")
- + " dijitTooltip"
- + (corner.charAt(0) == 'T' ? "Below" : "Above");
-
- dojo.replaceClass(this.domNode, newC, this._currentOrientClass || "");
- this._currentOrientClass = newC;
- },
- focus: function(){
-
-
- this._getFocusItems(this.containerNode);
- dijit.focus(this._firstFocusItem);
- },
- onOpen: function(/*Object*/ pos){
-
-
-
-
-
- this.orient(this.domNode,pos.aroundCorner, pos.corner);
- this._onShow();
- },
- onClose: function(){
-
-
-
-
-
- this.onHide();
- },
- _onKey: function(/*Event*/ evt){
-
-
-
-
-
-
- var node = evt.target;
- var dk = dojo.keys;
- if(evt.charOrCode === dk.TAB){
- this._getFocusItems(this.containerNode);
- }
- var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
- if(evt.charOrCode == dk.ESCAPE){
-
- setTimeout(dojo.hitch(this, "onCancel"), 0);
- dojo.stopEvent(evt);
- }else if(node == this._firstFocusItem && evt.shiftKey && evt.charOrCode === dk.TAB){
- if(!singleFocusItem){
- dijit.focus(this._lastFocusItem);
- }
- dojo.stopEvent(evt);
- }else if(node == this._lastFocusItem && evt.charOrCode === dk.TAB && !evt.shiftKey){
- if(!singleFocusItem){
- dijit.focus(this._firstFocusItem);
- }
- dojo.stopEvent(evt);
- }else if(evt.charOrCode === dk.TAB){
-
-
- evt.stopPropagation();
- }
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.form.DropDownButton"]){
- dojo._hasResource["dijit.form.DropDownButton"] = true;
- dojo.provide("dijit.form.DropDownButton");
- }
- if(!dojo._hasResource["dijit.form._FormSelectWidget"]){
- dojo._hasResource["dijit.form._FormSelectWidget"] = true;
- dojo.provide("dijit.form._FormSelectWidget");
- dojo.declare("dijit.form._FormSelectWidget", dijit.form._FormValueWidget, {
-
-
-
-
-
-
-
- multiple: false,
-
-
-
- options: null,
-
-
-
-
- store: null,
-
-
- query: null,
-
-
- queryOptions: null,
-
-
-
- onFetch: null,
-
-
-
- sortByLabel: true,
-
-
-
-
-
- loadChildrenOnOpen: false,
- getOptions: function(/*anything*/ valueOrIdx){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var lookupValue = valueOrIdx, opts = this.options || [], l = opts.length;
- if(lookupValue === undefined){
- return opts;
- }
- if(dojo.isArray(lookupValue)){
- return dojo.map(lookupValue, "return this.getOptions(item);", this);
- }
- if(dojo.isObject(valueOrIdx)){
-
-
- if(!dojo.some(this.options, function(o, idx){
- if(o === lookupValue ||
- (o.value && o.value === lookupValue.value)){
- lookupValue = idx;
- return true;
- }
- return false;
- })){
- lookupValue = -1;
- }
- }
- if(typeof lookupValue == "string"){
- for(var i=0; i<l; i++){
- if(opts[i].value === lookupValue){
- lookupValue = i;
- break;
- }
- }
- }
- if(typeof lookupValue == "number" && lookupValue >= 0 && lookupValue < l){
- return this.options[lookupValue]
- }
- return null;
- },
- addOption: function(/*dijit.form.__SelectOption|dijit.form.__SelectOption[]*/ option){
-
-
-
-
-
- if(!dojo.isArray(option)){ option = [option]; }
- dojo.forEach(option, function(i){
- if(i && dojo.isObject(i)){
- this.options.push(i);
- }
- }, this);
- this._loadChildren();
- },
- removeOption: function(/*String|dijit.form.__SelectOption|Number|Array*/ valueOrIdx){
-
-
-
-
-
-
-
- if(!dojo.isArray(valueOrIdx)){ valueOrIdx = [valueOrIdx]; }
- var oldOpts = this.getOptions(valueOrIdx);
- dojo.forEach(oldOpts, function(i){
-
-
- if(i){
- this.options = dojo.filter(this.options, function(node, idx){
- return (node.value !== i.value || node.label !== i.label);
- });
- this._removeOptionItem(i);
- }
- }, this);
- this._loadChildren();
- },
- updateOption: function(/*dijit.form.__SelectOption|dijit.form.__SelectOption[]*/ newOption){
-
-
-
-
-
- if(!dojo.isArray(newOption)){ newOption = [newOption]; }
- dojo.forEach(newOption, function(i){
- var oldOpt = this.getOptions(i), k;
- if(oldOpt){
- for(k in i){ oldOpt[k] = i[k]; }
- }
- }, this);
- this._loadChildren();
- },
- setStore: function(/*dojo.data.api.Identity*/ store,
- /*anything?*/ selectedValue,
- /*Object?*/ fetchArgs){
-
-
-
-
-
-
-
-
-
-
-
-
-
- var oStore = this.store;
- fetchArgs = fetchArgs || {};
- if(oStore !== store){
-
- dojo.forEach(this._notifyConnections || [], dojo.disconnect);
- delete this._notifyConnections;
- if(store && store.getFeatures()["dojo.data.api.Notification"]){
- this._notifyConnections = [
- dojo.connect(store, "onNew", this, "_onNewItem"),
- dojo.connect(store, "onDelete", this, "_onDeleteItem"),
- dojo.connect(store, "onSet", this, "_onSetItem")
- ];
- }
- this._set("store", store);
- }
-
- this._onChangeActive = false;
-
- if(this.options && this.options.length){
- this.removeOption(this.options);
- }
-
- if(store){
- this._loadingStore = true;
- store.fetch(dojo.delegate(fetchArgs, {
- onComplete: function(items, opts){
- if(this.sortByLabel && !fetchArgs.sort && items.length){
- items.sort(dojo.data.util.sorter.createSortFunction([{
- attribute: store.getLabelAttributes(items[0])[0]
- }], store));
- }
-
- if(fetchArgs.onFetch){
- items = fetchArgs.onFetch.call(this, items, opts);
- }
-
- dojo.forEach(items, function(i){
- this._addOptionForItem(i);
- }, this);
-
-
-
- this._loadingStore = false;
- this.set("value", "_pendingValue" in this ? this._pendingValue : selectedValue);
- delete this._pendingValue;
-
- if(!this.loadChildrenOnOpen){
- this._loadChildren();
- }else{
- this._pseudoLoadChildren(items);
- }
- this._fetchedWith = opts;
- this._lastValueReported = this.multiple ? [] : null;
- this._onChangeActive = true;
- this.onSetStore();
- this._handleOnChange(this.value);
- },
- scope: this
- }));
- }else{
- delete this._fetchedWith;
- }
- return oStore;
- },
-
-
- _setValueAttr: function(/*anything*/ newValue, /*Boolean?*/ priorityChange){
-
-
-
- if(this._loadingStore){
-
-
- this._pendingValue = newValue;
- return;
- }
- var opts = this.getOptions() || [];
- if(!dojo.isArray(newValue)){
- newValue = [newValue];
- }
- dojo.forEach(newValue, function(i, idx){
- if(!dojo.isObject(i)){
- i = i + "";
- }
- if(typeof i === "string"){
- newValue[idx] = dojo.filter(opts, function(node){
- return node.value === i;
- })[0] || {value: "", label: ""};
- }
- }, this);
-
- newValue = dojo.filter(newValue, function(i){ return i && i.value; });
- if(!this.multiple && (!newValue[0] || !newValue[0].value) && opts.length){
- newValue[0] = opts[0];
- }
- dojo.forEach(opts, function(i){
- i.selected = dojo.some(newValue, function(v){ return v.value === i.value; });
- });
- var val = dojo.map(newValue, function(i){ return i.value; }),
- disp = dojo.map(newValue, function(i){ return i.label; });
- this._set("value", this.multiple ? val : val[0]);
- this._setDisplay(this.multiple ? disp : disp[0]);
- this._updateSelection();
- this._handleOnChange(this.value, priorityChange);
- },
- _getDisplayedValueAttr: function(){
-
-
- var val = this.get("value");
- if(!dojo.isArray(val)){
- val = [val];
- }
- var ret = dojo.map(this.getOptions(val), function(v){
- if(v && "label" in v){
- return v.label;
- }else if(v){
- return v.value;
- }
- return null;
- }, this);
- return this.multiple ? ret : ret[0];
- },
- _loadChildren: function(){
-
-
-
- if(this._loadingStore){ return; }
- dojo.forEach(this._getChildren(), function(child){
- child.destroyRecursive();
- });
-
- dojo.forEach(this.options, this._addOptionItem, this);
-
- this._updateSelection();
- },
- _updateSelection: function(){
-
-
- this._set("value", this._getValueFromOpts());
- var val = this.value;
- if(!dojo.isArray(val)){
- val = [val];
- }
- if(val && val[0]){
- dojo.forEach(this._getChildren(), function(child){
- var isSelected = dojo.some(val, function(v){
- return child.option && (v === child.option.value);
- });
- dojo.toggleClass(child.domNode, this.baseClass + "SelectedOption", isSelected);
- dijit.setWaiState(child.domNode, "selected", isSelected);
- }, this);
- }
- },
- _getValueFromOpts: function(){
-
-
-
- var opts = this.getOptions() || [];
- if(!this.multiple && opts.length){
-
- var opt = dojo.filter(opts, function(i){
- return i.selected;
- })[0];
- if(opt && opt.value){
- return opt.value
- }else{
- opts[0].selected = true;
- return opts[0].value;
- }
- }else if(this.multiple){
-
- return dojo.map(dojo.filter(opts, function(i){
- return i.selected;
- }), function(i){
- return i.value;
- }) || [];
- }
- return "";
- },
-
- _onNewItem: function(/*item*/ item, /*Object?*/ parentInfo){
- if(!parentInfo || !parentInfo.parent){
-
- this._addOptionForItem(item);
- }
- },
- _onDeleteItem: function(/*item*/ item){
- var store = this.store;
- this.removeOption(store.getIdentity(item));
- },
- _onSetItem: function(/*item*/ item){
- this.updateOption(this._getOptionObjForItem(item));
- },
- _getOptionObjForItem: function(item){
-
-
-
-
-
- var store = this.store, label = store.getLabel(item),
- value = (label ? store.getIdentity(item) : null);
- return {value: value, label: label, item:item};
- },
- _addOptionForItem: function(/*item*/ item){
-
-
- var store = this.store;
- if(!store.isItemLoaded(item)){
-
- store.loadItem({item: item, onComplete: function(i){
- this._addOptionForItem(item);
- },
- scope: this});
- return;
- }
- var newOpt = this._getOptionObjForItem(item);
- this.addOption(newOpt);
- },
- constructor: function(/*Object*/ keywordArgs){
-
-
-
- this._oValue = (keywordArgs || {}).value || null;
- },
- buildRendering: function(){
- this.inherited(arguments);
- dojo.setSelectable(this.focusNode, false);
- },
- _fillContent: function(){
-
-
-
-
- var opts = this.options;
- if(!opts){
- opts = this.options = this.srcNodeRef ? dojo.query(">",
- this.srcNodeRef).map(function(node){
- if(node.getAttribute("type") === "separator"){
- return { value: "", label: "", selected: false, disabled: false };
- }
- return {
- value: (node.getAttribute("data-" + dojo._scopeName + "-value") || node.getAttribute("value")),
- label: String(node.innerHTML),
-
-
-
- selected: node.getAttribute("selected") || false,
- disabled: node.getAttribute("disabled") || false
- };
- }, this) : [];
- }
- if(!this.value){
- this._set("value", this._getValueFromOpts());
- }else if(this.multiple && typeof this.value == "string"){
- this._set("value", this.value.split(","));
- }
- },
- postCreate: function(){
-
-
-
- this.inherited(arguments);
-
- this.connect(this, "onChange", "_updateSelection");
- this.connect(this, "startup", "_loadChildren");
- this._setValueAttr(this.value, null);
- },
- startup: function(){
-
-
- this.inherited(arguments);
- var store = this.store, fetchArgs = {};
- dojo.forEach(["query", "queryOptions", "onFetch"], function(i){
- if(this[i]){
- fetchArgs[i] = this[i];
- }
- delete this[i];
- }, this);
- if(store && store.getFeatures()["dojo.data.api.Identity"]){
-
-
- this.store = null;
- this.setStore(store, this._oValue, fetchArgs);
- }
- },
- destroy: function(){
-
-
- dojo.forEach(this._notifyConnections || [], dojo.disconnect);
- this.inherited(arguments);
- },
- _addOptionItem: function(/*dijit.form.__SelectOption*/ option){
-
-
-
-
-
- },
- _removeOptionItem: function(/*dijit.form.__SelectOption*/ option){
-
-
-
- },
- _setDisplay: function(/*String or String[]*/ newDisplay){
-
-
-
-
- },
- _getChildren: function(){
-
-
- return [];
- },
- _getSelectedOptionsAttr: function(){
-
-
-
- return this.getOptions(this.get("value"));
- },
- _pseudoLoadChildren: function(/*item[]*/ items){
-
-
-
-
-
- },
- onSetStore: function(){
-
-
-
-
- }
- });
- }
- if(!dojo._hasResource["dijit._KeyNavContainer"]){
- dojo._hasResource["dijit._KeyNavContainer"] = true;
- dojo.provide("dijit._KeyNavContainer");
- dojo.declare("dijit._KeyNavContainer",
- dijit._Container,
- {
-
-
-
-
-
-
-
-
-
-
-
- tabIndex: "0",
- _keyNavCodes: {},
- connectKeyNavHandlers: function(/*dojo.keys[]*/ prevKeyCodes, /*dojo.keys[]*/ nextKeyCodes){
-
-
-
-
-
-
-
-
-
- var keyCodes = (this._keyNavCodes = {});
- var prev = dojo.hitch(this, this.focusPrev);
- var next = dojo.hitch(this, this.focusNext);
- dojo.forEach(prevKeyCodes, function(code){ keyCodes[code] = prev; });
- dojo.forEach(nextKeyCodes, function(code){ keyCodes[code] = next; });
- keyCodes[dojo.keys.HOME] = dojo.hitch(this, "focusFirstChild");
- keyCodes[dojo.keys.END] = dojo.hitch(this, "focusLastChild");
- this.connect(this.domNode, "onkeypress", "_onContainerKeypress");
- this.connect(this.domNode, "onfocus", "_onContainerFocus");
- },
- startupKeyNavChildren: function(){
-
-
-
-
- dojo.forEach(this.getChildren(), dojo.hitch(this, "_startupChild"));
- },
- addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
-
-
- dijit._KeyNavContainer.superclass.addChild.apply(this, arguments);
- this._startupChild(widget);
- },
- focus: function(){
-
-
- this.focusFirstChild();
- },
- focusFirstChild: function(){
-
-
-
-
- var child = this._getFirstFocusableChild();
- if(child){
- this.focusChild(child);
- }
- },
- focusLastChild: function(){
-
-
-
-
- var child = this._getLastFocusableChild();
- if(child){
- this.focusChild(child);
- }
- },
- focusNext: function(){
-
-
-
-
- var child = this._getNextFocusableChild(this.focusedChild, 1);
- this.focusChild(child);
- },
- focusPrev: function(){
-
-
-
-
-
- var child = this._getNextFocusableChild(this.focusedChild, -1);
- this.focusChild(child, true);
- },
- focusChild: function(/*dijit._Widget*/ widget, /*Boolean*/ last){
-
-
-
-
-
-
-
-
-
-
- if(this.focusedChild && widget !== this.focusedChild){
- this._onChildBlur(this.focusedChild);
- }
- widget.set("tabIndex", this.tabIndex);
- widget.focus(last ? "end" : "start");
- this._set("focusedChild", widget);
- },
- _startupChild: function(/*dijit._Widget*/ widget){
-
-
-
-
-
-
-
-
- widget.set("tabIndex", "-1");
-
- this.connect(widget, "_onFocus", function(){
-
- widget.set("tabIndex", this.tabIndex);
- });
- this.connect(widget, "_onBlur", function(){
- widget.set("tabIndex", "-1");
- });
- },
- _onContainerFocus: function(evt){
-
-
-
-
-
-
-
-
-
-
-
-
- if(evt.target !== this.domNode){ return; }
- this.focusFirstChild();
-
-
-
-
- dojo.attr(this.domNode, "tabIndex", "-1");
- },
- _onBlur: function(evt){
-
-
-
-
- if(this.tabIndex){
- dojo.attr(this.domNode, "tabIndex", this.tabIndex);
- }
- this.inherited(arguments);
- },
- _onContainerKeypress: function(evt){
-
-
-
-
-
- if(evt.ctrlKey || evt.altKey){ return; }
- var func = this._keyNavCodes[evt.charOrCode];
- if(func){
- func();
- dojo.stopEvent(evt);
- }
- },
- _onChildBlur: function(/*dijit._Widget*/ widget){
-
-
-
-
-
- },
- _getFirstFocusableChild: function(){
-
-
- return this._getNextFocusableChild(null, 1);
- },
- _getLastFocusableChild: function(){
-
-
- return this._getNextFocusableChild(null, -1);
- },
- _getNextFocusableChild: function(child, dir){
-
-
-
-
-
-
-
-
- if(child){
- child = this._getSiblingOfChild(child, dir);
- }
- var children = this.getChildren();
- for(var i=0; i < children.length; i++){
- if(!child){
- child = children[(dir>0) ? 0 : (children.length-1)];
- }
- if(child.isFocusable()){
- return child;
- }
- child = this._getSiblingOfChild(child, dir);
- }
-
- return null;
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.MenuItem"]){
- dojo._hasResource["dijit.MenuItem"] = true;
- dojo.provide("dijit.MenuItem");
- dojo.declare("dijit.MenuItem",
- [dijit._Widget, dijit._Templated, dijit._Contained, dijit._CssStateMixin],
- {
-
-
-
-
- templateString: dojo.cache("dijit", "templates/MenuItem.html", "<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitem\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitIcon dijitMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\">\n\t\t<div dojoAttachPoint=\"arrowWrapper\" style=\"visibility: hidden\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuExpand\"/>\n\t\t\t<span class=\"dijitMenuExpandA11y\">+</span>\n\t\t</div>\n\t</td>\n</tr>\n"),
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- label: { node: "containerNode", type: "innerHTML" },
- iconClass: { node: "iconNode", type: "class" }
- }),
- baseClass: "dijitMenuItem",
-
-
- label: '',
-
-
- iconClass: "",
-
-
-
-
-
- accelKey: "",
-
-
-
- disabled: false,
- _fillContent: function(/*DomNode*/ source){
-
-
- if(source && !("label" in this.params)){
- this.set('label', source.innerHTML);
- }
- },
- buildRendering: function(){
- this.inherited(arguments);
- var label = this.id+"_text";
- dojo.attr(this.containerNode, "id", label);
- if(this.accelKeyNode){
- dojo.attr(this.accelKeyNode, "id", this.id + "_accel");
- label += " " + this.id + "_accel";
- }
- dijit.setWaiState(this.domNode, "labelledby", label);
- dojo.setSelectable(this.domNode, false);
- },
- _onHover: function(){
-
-
-
-
- this.getParent().onItemHover(this);
- },
- _onUnhover: function(){
-
-
-
-
-
-
-
-
- this.getParent().onItemUnhover(this);
-
-
-
- this._set("hovering", false);
- },
- _onClick: function(evt){
-
-
-
-
- this.getParent().onItemClick(this, evt);
- dojo.stopEvent(evt);
- },
- onClick: function(/*Event*/ evt){
-
-
-
-
- },
- focus: function(){
-
-
- try{
- if(dojo.isIE == 8){
-
- this.containerNode.focus();
- }
- dijit.focus(this.focusNode);
- }catch(e){
-
- }
- },
- _onFocus: function(){
-
-
-
-
-
- this._setSelected(true);
- this.getParent()._onItemFocus(this);
- this.inherited(arguments);
- },
- _setSelected: function(selected){
-
-
-
-
-
- dojo.toggleClass(this.domNode, "dijitMenuItemSelected", selected);
- },
- setLabel: function(/*String*/ content){
-
-
-
-
- dojo.deprecated("dijit.MenuItem.setLabel() is deprecated. Use set('label', ...) instead.", "", "2.0");
- this.set("label", content);
- },
- setDisabled: function(/*Boolean*/ disabled){
-
-
-
-
- dojo.deprecated("dijit.Menu.setDisabled() is deprecated. Use set('disabled', bool) instead.", "", "2.0");
- this.set('disabled', disabled);
- },
- _setDisabledAttr: function(/*Boolean*/ value){
-
-
-
- dijit.setWaiState(this.focusNode, 'disabled', value ? 'true' : 'false');
- this._set("disabled", value);
- },
- _setAccelKeyAttr: function(/*String*/ value){
-
-
-
- this.accelKeyNode.style.display=value?"":"none";
- this.accelKeyNode.innerHTML=value;
-
- dojo.attr(this.containerNode,'colSpan',value?"1":"2");
-
- this._set("accelKey", value);
- }
- });
- }
- if(!dojo._hasResource["dijit.PopupMenuItem"]){
- dojo._hasResource["dijit.PopupMenuItem"] = true;
- dojo.provide("dijit.PopupMenuItem");
- dojo.declare("dijit.PopupMenuItem",
- dijit.MenuItem,
- {
- _fillContent: function(){
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(this.srcNodeRef){
- var nodes = dojo.query("*", this.srcNodeRef);
- dijit.PopupMenuItem.superclass._fillContent.call(this, nodes[0]);
-
- this.dropDownContainer = this.srcNodeRef;
- }
- },
- startup: function(){
- if(this._started){ return; }
- this.inherited(arguments);
-
-
- if(!this.popup){
- var node = dojo.query("[widgetId]", this.dropDownContainer)[0];
- this.popup = dijit.byNode(node);
- }
- dojo.body().appendChild(this.popup.domNode);
- this.popup.startup();
- this.popup.domNode.style.display="none";
- if(this.arrowWrapper){
- dojo.style(this.arrowWrapper, "visibility", "");
- }
- dijit.setWaiState(this.focusNode, "haspopup", "true");
- },
- destroyDescendants: function(){
- if(this.popup){
-
-
- if(!this.popup._destroyed){
- this.popup.destroyRecursive();
- }
- delete this.popup;
- }
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit.CheckedMenuItem"]){
- dojo._hasResource["dijit.CheckedMenuItem"] = true;
- dojo.provide("dijit.CheckedMenuItem");
- dojo.declare("dijit.CheckedMenuItem",
- dijit.MenuItem,
- {
-
-
- templateString: dojo.cache("dijit", "templates/CheckedMenuItem.html", "<tr class=\"dijitReset dijitMenuItem\" dojoAttachPoint=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\"\n\t\tdojoAttachEvent=\"onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"presentation\">\n\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitMenuItemIcon dijitCheckedMenuItemIcon\" dojoAttachPoint=\"iconNode\"/>\n\t\t<span class=\"dijitCheckedMenuItemIconChar\">✓</span>\n\t</td>\n\t<td class=\"dijitReset dijitMenuItemLabel\" colspan=\"2\" dojoAttachPoint=\"containerNode,labelNode\"></td>\n\t<td class=\"dijitReset dijitMenuItemAccelKey\" style=\"display: none\" dojoAttachPoint=\"accelKeyNode\"></td>\n\t<td class=\"dijitReset dijitMenuArrowCell\" role=\"presentation\"> </td>\n</tr>\n"),
-
-
- checked: false,
- _setCheckedAttr: function(/*Boolean*/ checked){
-
-
-
- dojo.toggleClass(this.domNode, "dijitCheckedMenuItemChecked", checked);
- dijit.setWaiState(this.domNode, "checked", checked);
- this._set("checked", checked);
- },
- onChange: function(/*Boolean*/ checked){
-
-
-
-
- },
- _onClick: function(/*Event*/ e){
-
-
-
-
- if(!this.disabled){
- this.set("checked", !this.checked);
- this.onChange(this.checked);
- }
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit.MenuSeparator"]){
- dojo._hasResource["dijit.MenuSeparator"] = true;
- dojo.provide("dijit.MenuSeparator");
- dojo.declare("dijit.MenuSeparator",
- [dijit._Widget, dijit._Templated, dijit._Contained],
- {
-
-
- templateString: dojo.cache("dijit", "templates/MenuSeparator.html", "<tr class=\"dijitMenuSeparator\">\n\t<td class=\"dijitMenuSeparatorIconCell\">\n\t\t<div class=\"dijitMenuSeparatorTop\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n\t<td colspan=\"3\" class=\"dijitMenuSeparatorLabelCell\">\n\t\t<div class=\"dijitMenuSeparatorTop dijitMenuSeparatorLabel\"></div>\n\t\t<div class=\"dijitMenuSeparatorBottom\"></div>\n\t</td>\n</tr>\n"),
- buildRendering: function(){
- this.inherited(arguments);
- dojo.setSelectable(this.domNode, false);
- },
- isFocusable: function(){
-
-
-
-
- return false;
- }
- });
- }
- if(!dojo._hasResource["dijit.Menu"]){
- dojo._hasResource["dijit.Menu"] = true;
- dojo.provide("dijit.Menu");
- dojo.declare("dijit._MenuBase",
- [dijit._Widget, dijit._Templated, dijit._KeyNavContainer],
- {
-
-
-
-
- parentMenu: null,
-
-
- popupDelay: 500,
- startup: function(){
- if(this._started){ return; }
- dojo.forEach(this.getChildren(), function(child){ child.startup(); });
- this.startupKeyNavChildren();
- this.inherited(arguments);
- },
- onExecute: function(){
-
-
-
-
-
-
-
- },
- onCancel: function(/*Boolean*/ closeAll){
-
-
-
-
-
-
- },
- _moveToPopup: function(/*Event*/ evt){
-
-
-
-
-
-
- if(this.focusedChild && this.focusedChild.popup && !this.focusedChild.disabled){
- this.focusedChild._onClick(evt);
- }else{
- var topMenu = this._getTopMenu();
- if(topMenu && topMenu._isMenuBar){
- topMenu.focusNext();
- }
- }
- },
- _onPopupHover: function(/*Event*/ evt){
-
-
-
-
-
-
-
- if(this.currentPopup && this.currentPopup._pendingClose_timer){
- var parentMenu = this.currentPopup.parentMenu;
-
- if(parentMenu.focusedChild){
- parentMenu.focusedChild._setSelected(false);
- }
- parentMenu.focusedChild = this.currentPopup.from_item;
- parentMenu.focusedChild._setSelected(true);
-
- this._stopPendingCloseTimer(this.currentPopup);
- }
- },
- onItemHover: function(/*MenuItem*/ item){
-
-
-
-
-
-
-
- if(this.isActive){
- this.focusChild(item);
- if(this.focusedChild.popup && !this.focusedChild.disabled && !this.hover_timer){
- this.hover_timer = setTimeout(dojo.hitch(this, "_openPopup"), this.popupDelay);
- }
- }
-
-
-
-
- if(this.focusedChild){
- this.focusChild(item);
- }
- this._hoveredChild = item;
- },
- _onChildBlur: function(item){
-
-
-
-
-
- this._stopPopupTimer();
- item._setSelected(false);
-
- var itemPopup = item.popup;
- if(itemPopup){
- this._stopPendingCloseTimer(itemPopup);
- itemPopup._pendingClose_timer = setTimeout(function(){
- itemPopup._pendingClose_timer = null;
- if(itemPopup.parentMenu){
- itemPopup.parentMenu.currentPopup = null;
- }
- dijit.popup.close(itemPopup);
- }, this.popupDelay);
- }
- },
- onItemUnhover: function(/*MenuItem*/ item){
-
-
-
-
- if(this.isActive){
- this._stopPopupTimer();
- }
- if(this._hoveredChild == item){ this._hoveredChild = null; }
- },
- _stopPopupTimer: function(){
-
-
-
-
-
- if(this.hover_timer){
- clearTimeout(this.hover_timer);
- this.hover_timer = null;
- }
- },
- _stopPendingCloseTimer: function(/*dijit._Widget*/ popup){
-
-
-
-
- if(popup._pendingClose_timer){
- clearTimeout(popup._pendingClose_timer);
- popup._pendingClose_timer = null;
- }
- },
- _stopFocusTimer: function(){
-
-
-
-
- if(this._focus_timer){
- clearTimeout(this._focus_timer);
- this._focus_timer = null;
- }
- },
- _getTopMenu: function(){
-
-
-
-
- for(var top=this; top.parentMenu; top=top.parentMenu);
- return top;
- },
- onItemClick: function(/*dijit._Widget*/ item, /*Event*/ evt){
-
-
-
-
-
- if(typeof this.isShowingNow == 'undefined'){
- this._markActive();
- }
- this.focusChild(item);
- if(item.disabled){ return false; }
- if(item.popup){
- this._openPopup();
- }else{
-
-
- this.onExecute();
-
- item.onClick(evt);
- }
- },
- _openPopup: function(){
-
-
-
-
- this._stopPopupTimer();
- var from_item = this.focusedChild;
- if(!from_item){ return; }
- var popup = from_item.popup;
- if(popup.isShowingNow){ return; }
- if(this.currentPopup){
- this._stopPendingCloseTimer(this.currentPopup);
- dijit.popup.close(this.currentPopup);
- }
- popup.parentMenu = this;
- popup.from_item = from_item;
- var self = this;
- dijit.popup.open({
- parent: this,
- popup: popup,
- around: from_item.domNode,
- orient: this._orient || (this.isLeftToRight() ?
- {'TR': 'TL', 'TL': 'TR', 'BR': 'BL', 'BL': 'BR'} :
- {'TL': 'TR', 'TR': 'TL', 'BL': 'BR', 'BR': 'BL'}),
- onCancel: function(){
-
-
- self.focusChild(from_item);
- self._cleanUp();
- from_item._setSelected(true);
- self.focusedChild = from_item;
- },
- onExecute: dojo.hitch(this, "_cleanUp")
- });
- this.currentPopup = popup;
-
- popup.connect(popup.domNode, "onmouseenter", dojo.hitch(self, "_onPopupHover"));
- if(popup.focus){
-
-
-
-
- popup._focus_timer = setTimeout(dojo.hitch(popup, function(){
- this._focus_timer = null;
- this.focus();
- }), 0);
- }
- },
- _markActive: function(){
-
-
-
-
-
-
-
-
-
-
-
- this.isActive = true;
- dojo.replaceClass(this.domNode, "dijitMenuActive", "dijitMenuPassive");
- },
- onOpen: function(/*Event*/ e){
-
-
-
-
-
-
- this.isShowingNow = true;
- this._markActive();
- },
- _markInactive: function(){
-
-
- this.isActive = false;
- dojo.replaceClass(this.domNode, "dijitMenuPassive", "dijitMenuActive");
- },
- onClose: function(){
-
-
-
-
-
-
- this._stopFocusTimer();
- this._markInactive();
- this.isShowingNow = false;
- this.parentMenu = null;
- },
- _closeChild: function(){
-
-
-
-
- this._stopPopupTimer();
- var fromItem = this.focusedChild && this.focusedChild.from_item;
- if(this.currentPopup){
-
-
- if(dijit._curFocus && dojo.isDescendant(dijit._curFocus, this.currentPopup.domNode)){
- this.focusedChild.focusNode.focus();
- }
-
- dijit.popup.close(this.currentPopup);
- this.currentPopup = null;
- }
- if(this.focusedChild){
- this.focusedChild._setSelected(false);
- this.focusedChild._onUnhover();
- this.focusedChild = null;
- }
- },
- _onItemFocus: function(/*MenuItem*/ item){
-
-
-
-
-
-
- if(this._hoveredChild && this._hoveredChild != item){
- this._hoveredChild._onUnhover();
- }
- },
- _onBlur: function(){
-
-
-
-
- this._cleanUp();
- this.inherited(arguments);
- },
- _cleanUp: function(){
-
-
-
-
- this._closeChild();
- if(typeof this.isShowingNow == 'undefined'){
- this._markInactive();
- }
- }
- });
- dojo.declare("dijit.Menu",
- dijit._MenuBase,
- {
-
-
-
-
-
- constructor: function(){
- this._bindings = [];
- },
- templateString: dojo.cache("dijit", "templates/Menu.html", "<table class=\"dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable\" role=\"menu\" tabIndex=\"${tabIndex}\" dojoAttachEvent=\"onkeypress:_onKeyPress\" cellspacing=\"0\">\n\t<tbody class=\"dijitReset\" dojoAttachPoint=\"containerNode\"></tbody>\n</table>\n"),
- baseClass: "dijitMenu",
-
-
-
- targetNodeIds: [],
-
-
-
- contextMenuForWindow: false,
-
-
- leftClickToOpen: false,
-
-
- refocus: true,
- postCreate: function(){
- if(this.contextMenuForWindow){
- this.bindDomNode(dojo.body());
- }else{
-
-
-
- dojo.forEach(this.targetNodeIds, this.bindDomNode, this);
- }
- var k = dojo.keys, l = this.isLeftToRight();
- this._openSubMenuKey = l ? k.RIGHT_ARROW : k.LEFT_ARROW;
- this._closeSubMenuKey = l ? k.LEFT_ARROW : k.RIGHT_ARROW;
- this.connectKeyNavHandlers([k.UP_ARROW], [k.DOWN_ARROW]);
- },
- _onKeyPress: function(/*Event*/ evt){
-
-
-
-
- if(evt.ctrlKey || evt.altKey){ return; }
- switch(evt.charOrCode){
- case this._openSubMenuKey:
- this._moveToPopup(evt);
- dojo.stopEvent(evt);
- break;
- case this._closeSubMenuKey:
- if(this.parentMenu){
- if(this.parentMenu._isMenuBar){
- this.parentMenu.focusPrev();
- }else{
- this.onCancel(false);
- }
- }else{
- dojo.stopEvent(evt);
- }
- break;
- }
- },
-
- _iframeContentWindow: function(/* HTMLIFrameElement */iframe_el){
-
-
-
-
- var win = dojo.window.get(this._iframeContentDocument(iframe_el)) ||
-
- this._iframeContentDocument(iframe_el)['__parent__'] ||
- (iframe_el.name && dojo.doc.frames[iframe_el.name]) || null;
- return win;
- },
- _iframeContentDocument: function(/* HTMLIFrameElement */iframe_el){
-
-
-
-
- var doc = iframe_el.contentDocument
- || (iframe_el.contentWindow && iframe_el.contentWindow.document)
- || (iframe_el.name && dojo.doc.frames[iframe_el.name] && dojo.doc.frames[iframe_el.name].document)
- || null;
- return doc;
- },
- bindDomNode: function(/*String|DomNode*/ node){
-
-
- node = dojo.byId(node);
- var cn;
-
-
- if(node.tagName.toLowerCase() == "iframe"){
- var iframe = node,
- win = this._iframeContentWindow(iframe);
- cn = dojo.withGlobal(win, dojo.body);
- }else{
-
-
-
- cn = (node == dojo.body() ? dojo.doc.documentElement : node);
- }
-
- var binding = {
- node: node,
- iframe: iframe
- };
-
-
-
- dojo.attr(node, "_dijitMenu" + this.id, this._bindings.push(binding));
-
-
-
-
- var doConnects = dojo.hitch(this, function(cn){
- return [
-
-
- dojo.connect(cn, this.leftClickToOpen ? "onclick" : "oncontextmenu", this, function(evt){
-
- dojo.stopEvent(evt);
- this._scheduleOpen(evt.target, iframe, {x: evt.pageX, y: evt.pageY});
- }),
- dojo.connect(cn, "onkeydown", this, function(evt){
- if(evt.shiftKey && evt.keyCode == dojo.keys.F10){
- dojo.stopEvent(evt);
- this._scheduleOpen(evt.target, iframe);
- }
- })
- ];
- });
- binding.connects = cn ? doConnects(cn) : [];
- if(iframe){
-
-
-
-
- binding.onloadHandler = dojo.hitch(this, function(){
-
-
- var win = this._iframeContentWindow(iframe);
- cn = dojo.withGlobal(win, dojo.body);
- binding.connects = doConnects(cn);
- });
- if(iframe.addEventListener){
- iframe.addEventListener("load", binding.onloadHandler, false);
- }else{
- iframe.attachEvent("onload", binding.onloadHandler);
- }
- }
- },
- unBindDomNode: function(/*String|DomNode*/ nodeName){
-
-
- var node;
- try{
- node = dojo.byId(nodeName);
- }catch(e){
-
-
-
- return;
- }
-
- var attrName = "_dijitMenu" + this.id;
- if(node && dojo.hasAttr(node, attrName)){
- var bid = dojo.attr(node, attrName)-1, b = this._bindings[bid];
- dojo.forEach(b.connects, dojo.disconnect);
-
- var iframe = b.iframe;
- if(iframe){
- if(iframe.removeEventListener){
- iframe.removeEventListener("load", b.onloadHandler, false);
- }else{
- iframe.detachEvent("onload", b.onloadHandler);
- }
- }
- dojo.removeAttr(node, attrName);
- delete this._bindings[bid];
- }
- },
- _scheduleOpen: function(/*DomNode?*/ target, /*DomNode?*/ iframe, /*Object?*/ coords){
-
-
-
-
-
-
-
-
-
-
- if(!this._openTimer){
- this._openTimer = setTimeout(dojo.hitch(this, function(){
- delete this._openTimer;
- this._openMyself({
- target: target,
- iframe: iframe,
- coords: coords
- });
- }), 1);
- }
- },
- _openMyself: function(args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var target = args.target,
- iframe = args.iframe,
- coords = args.coords;
-
-
- if(coords){
- if(iframe){
-
- var od = target.ownerDocument,
- ifc = dojo.position(iframe, true),
- win = this._iframeContentWindow(iframe),
- scroll = dojo.withGlobal(win, "_docScroll", dojo);
-
- var cs = dojo.getComputedStyle(iframe),
- tp = dojo._toPixelValue,
- left = (dojo.isIE && dojo.isQuirks ? 0 : tp(iframe, cs.paddingLeft)) + (dojo.isIE && dojo.isQuirks ? tp(iframe, cs.borderLeftWidth) : 0),
- top = (dojo.isIE && dojo.isQuirks ? 0 : tp(iframe, cs.paddingTop)) + (dojo.isIE && dojo.isQuirks ? tp(iframe, cs.borderTopWidth) : 0);
- coords.x += ifc.x + left - scroll.x;
- coords.y += ifc.y + top - scroll.y;
- }
- }else{
- coords = dojo.position(target, true);
- coords.x += 10;
- coords.y += 10;
- }
- var self=this;
- var savedFocus = dijit.getFocus(this);
- function closeAndRestoreFocus(){
-
- if(self.refocus){
- dijit.focus(savedFocus);
- }
- dijit.popup.close(self);
- }
- dijit.popup.open({
- popup: this,
- x: coords.x,
- y: coords.y,
- onExecute: closeAndRestoreFocus,
- onCancel: closeAndRestoreFocus,
- orient: this.isLeftToRight() ? 'L' : 'R'
- });
- this.focus();
- this._onBlur = function(){
- this.inherited('_onBlur', arguments);
-
-
- dijit.popup.close(this);
-
-
- };
- },
- uninitialize: function(){
- dojo.forEach(this._bindings, function(b){ if(b){ this.unBindDomNode(b.node); } }, this);
- this.inherited(arguments);
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.form.Select"]){
- dojo._hasResource["dijit.form.Select"] = true;
- dojo.provide("dijit.form.Select");
- dojo.declare("dijit.form._SelectMenu", dijit.Menu, {
-
-
- buildRendering: function(){
-
-
-
- this.inherited(arguments);
- var o = (this.menuTableNode = this.domNode);
- var n = (this.domNode = dojo.create("div", {style: {overflowX: "hidden", overflowY: "scroll"}}));
- if(o.parentNode){
- o.parentNode.replaceChild(n, o);
- }
- dojo.removeClass(o, "dijitMenuTable");
- n.className = o.className + " dijitSelectMenu";
- o.className = "dijitReset dijitMenuTable";
- dijit.setWaiRole(o,"listbox");
- dijit.setWaiRole(n,"presentation");
- n.appendChild(o);
- },
- postCreate: function(){
-
-
- this.inherited(arguments);
- this.connect(this.domNode, "onmousemove", dojo.stopEvent);
- },
- resize: function(/*Object*/ mb){
-
-
-
-
-
-
-
-
- if(mb){
- dojo.marginBox(this.domNode, mb);
- if("w" in mb){
-
-
-
- this.menuTableNode.style.width = "100%";
- }
- }
- }
- });
- dojo.declare("dijit.form.Select", [dijit.form._FormSelectWidget, dijit._HasDropDown], {
-
-
-
- baseClass: "dijitSelect",
- templateString: dojo.cache("dijit.form", "templates/Select.html", "<table class=\"dijit dijitReset dijitInline dijitLeft\"\n\tdojoAttachPoint=\"_buttonNode,tableNode,focusNode\" cellspacing='0' cellpadding='0'\n\trole=\"combobox\" aria-haspopup=\"true\"\n\t><tbody role=\"presentation\"><tr role=\"presentation\"\n\t\t><td class=\"dijitReset dijitStretch dijitButtonContents dijitButtonNode\" role=\"presentation\"\n\t\t\t><span class=\"dijitReset dijitInline dijitButtonText\" dojoAttachPoint=\"containerNode,_popupStateNode\"></span\n\t\t\t><input type=\"hidden\" ${!nameAttrSetting} dojoAttachPoint=\"valueNode\" value=\"${value}\" aria-hidden=\"true\"\n\t\t/></td><td class=\"dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton\"\n\t\t\t\tdojoAttachPoint=\"titleNode\" role=\"presentation\"\n\t\t\t><div class=\"dijitReset dijitArrowButtonInner\" role=\"presentation\"></div\n\t\t\t><div class=\"dijitReset dijitArrowButtonChar\" role=\"presentation\">▼</div\n\t\t></td\n\t></tr></tbody\n></table>\n"),
-
-
- attributeMap: dojo.mixin(dojo.clone(dijit.form._FormSelectWidget.prototype.attributeMap),{style:"tableNode"}),
-
-
- required: false,
-
-
- state: "",
-
-
- message: "",
-
-
- tooltipPosition: [],
-
-
- emptyLabel: " ",
-
-
- _isLoaded: false,
-
-
- _childrenLoaded: false,
- _fillContent: function(){
-
-
- this.inherited(arguments);
-
- if(this.options.length && !this.value && this.srcNodeRef){
- var si = this.srcNodeRef.selectedIndex || 0;
- this.value = this.options[si >= 0 ? si : 0].value;
- }
-
- this.dropDown = new dijit.form._SelectMenu({id: this.id + "_menu"});
- dojo.addClass(this.dropDown.domNode, this.baseClass + "Menu");
- },
- _getMenuItemForOption: function(/*dijit.form.__SelectOption*/ option){
-
-
-
- if(!option.value && !option.label){
-
- return new dijit.MenuSeparator();
- }else{
-
- var click = dojo.hitch(this, "_setValueAttr", option);
- var item = new dijit.MenuItem({
- option: option,
- label: option.label || this.emptyLabel,
- onClick: click,
- disabled: option.disabled || false
- });
- dijit.setWaiRole(item.focusNode, "listitem");
- return item;
- }
- },
- _addOptionItem: function(/*dijit.form.__SelectOption*/ option){
-
-
-
-
- if(this.dropDown){
- this.dropDown.addChild(this._getMenuItemForOption(option));
- }
- },
- _getChildren: function(){
- if(!this.dropDown){
- return [];
- }
- return this.dropDown.getChildren();
- },
- _loadChildren: function(/*Boolean*/ loadMenuItems){
-
-
-
-
-
-
- if(loadMenuItems === true){
-
-
-
- if(this.dropDown){
- delete this.dropDown.focusedChild;
- }
- if(this.options.length){
- this.inherited(arguments);
- }else{
-
-
- dojo.forEach(this._getChildren(), function(child){ child.destroyRecursive(); });
- var item = new dijit.MenuItem({label: " "});
- this.dropDown.addChild(item);
- }
- }else{
- this._updateSelection();
- }
- this._isLoaded = false;
- this._childrenLoaded = true;
- if(!this._loadingStore){
-
- this._setValueAttr(this.value);
- }
- },
- _setValueAttr: function(value){
- this.inherited(arguments);
- dojo.attr(this.valueNode, "value", this.get("value"));
- },
- _setDisplay: function(/*String*/ newDisplay){
-
-
- var lbl = newDisplay || this.emptyLabel;
- this.containerNode.innerHTML = '<span class="dijitReset dijitInline ' + this.baseClass + 'Label">' + lbl + '</span>';
- dijit.setWaiState(this.focusNode, "valuetext", lbl);
- },
- validate: function(/*Boolean*/ isFocused){
-
-
-
-
-
-
-
- var isValid = this.isValid(isFocused);
- this._set("state", isValid ? "" : "Error");
- dijit.setWaiState(this.focusNode, "invalid", isValid ? "false" : "true");
- var message = isValid ? "" : this._missingMsg;
- if(this.message !== message){
- this._set("message", message);
- dijit.hideTooltip(this.domNode);
- if(message){
- dijit.showTooltip(message, this.domNode, this.tooltipPosition, !this.isLeftToRight());
- }
- }
- return isValid;
- },
- isValid: function(/*Boolean*/ isFocused){
-
-
-
- return (!this.required || this.value === 0 || !(/^\s*$/.test(this.value || "")));
- },
- reset: function(){
-
-
- this.inherited(arguments);
- dijit.hideTooltip(this.domNode);
- this._set("state", "");
- this._set("message", "")
- },
- postMixInProperties: function(){
-
-
- this.inherited(arguments);
- this._missingMsg = dojo.i18n.getLocalization("dijit.form", "validate",
- this.lang).missingMessage;
- },
- postCreate: function(){
-
-
- this.inherited(arguments);
- this.connect(this.domNode, "onmousemove", dojo.stopEvent);
- },
- _setStyleAttr: function(/*String||Object*/ value){
- this.inherited(arguments);
- dojo.toggleClass(this.domNode, this.baseClass + "FixedWidth", !!this.tableNode.style.width);
- },
- isLoaded: function(){
- return this._isLoaded;
- },
- loadDropDown: function(/*Function*/ loadCallback){
-
-
- this._loadChildren(true);
- this._isLoaded = true;
- loadCallback();
- },
- closeDropDown: function(){
-
- this.inherited(arguments);
- if(this.dropDown && this.dropDown.menuTableNode){
-
-
-
- this.dropDown.menuTableNode.style.width = "";
- }
- },
- uninitialize: function(preserveDom){
- if(this.dropDown && !this.dropDown._destroyed){
- this.dropDown.destroyRecursive(preserveDom);
- delete this.dropDown;
- }
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit._editor.plugins.LinkDialog"]){
- dojo._hasResource["dijit._editor.plugins.LinkDialog"] = true;
- dojo.provide("dijit._editor.plugins.LinkDialog");
- dojo.declare("dijit._editor.plugins.LinkDialog", dijit._editor._Plugin, {
-
-
-
-
-
-
-
-
-
- buttonClass: dijit.form.DropDownButton,
-
- useDefaultCommand: false,
-
-
-
- urlRegExp: "((https?|ftps?|file)\\://|\./|/|)(/[a-zA-Z]{1,1}:/|)(((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)*(?:[a-zA-Z](?:[-\\da-zA-Z]{0,80}[\\da-zA-Z])?)\\.?)|(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])|(0[xX]0*[\\da-fA-F]?[\\da-fA-F]\\.){3}0[xX]0*[\\da-fA-F]?[\\da-fA-F]|(0+[0-3][0-7][0-7]\\.){3}0+[0-3][0-7][0-7]|(0|[1-9]\\d{0,8}|[1-3]\\d{9}|4[01]\\d{8}|42[0-8]\\d{7}|429[0-3]\\d{6}|4294[0-8]\\d{5}|42949[0-5]\\d{4}|429496[0-6]\\d{3}|4294967[01]\\d{2}|42949672[0-8]\\d|429496729[0-5])|0[xX]0*[\\da-fA-F]{1,8}|([\\da-fA-F]{1,4}\\:){7}[\\da-fA-F]{1,4}|([\\da-fA-F]{1,4}\\:){6}((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])))(\\:\\d+)?(/(?:[^?#\\s/]+/)*(?:[^?#\\s/]{0,}(?:\\?[^?#\\s/]*)?(?:#.*)?)?)?",
-
-
- emailRegExp: "<?(mailto\\:)([!#-'*+\\-\\/-9=?A-Z^-~]+[.])*[!#-'*+\\-\\/-9=?A-Z^-~]+" + "@" +
- "((?:(?:[\\da-zA-Z](?:[-\\da-zA-Z]{0,61}[\\da-zA-Z])?)\\.)+(?:[a-zA-Z](?:[-\\da-zA-Z]{0,6}[\\da-zA-Z])?)\\.?)|localhost|^[^-][a-zA-Z0-9_-]*>?",
-
-
- htmlTemplate: "<a href=\"${urlInput}\" _djrealurl=\"${urlInput}\"" +
- " target=\"${targetSelect}\"" +
- ">${textInput}</a>",
-
-
- tag: "a",
-
-
- _hostRxp: new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$"),
-
-
- _userAtRxp: new RegExp("^([!#-'*+\\-\\/-9=?A-Z^-~]+[.])*[!#-'*+\\-\\/-9=?A-Z^-~]+@", "i"),
-
-
- linkDialogTemplate: [
- "<table><tr><td>",
- "<label for='${id}_urlInput'>${url}</label>",
- "</td><td>",
- "<input dojoType='dijit.form.ValidationTextBox' required='true' " +
- "id='${id}_urlInput' name='urlInput' intermediateChanges='true'/>",
- "</td></tr><tr><td>",
- "<label for='${id}_textInput'>${text}</label>",
- "</td><td>",
- "<input dojoType='dijit.form.ValidationTextBox' required='true' id='${id}_textInput' " +
- "name='textInput' intermediateChanges='true'/>",
- "</td></tr><tr><td>",
- "<label for='${id}_targetSelect'>${target}</label>",
- "</td><td>",
- "<select id='${id}_targetSelect' name='targetSelect' dojoType='dijit.form.Select'>",
- "<option selected='selected' value='_self'>${currentWindow}</option>",
- "<option value='_blank'>${newWindow}</option>",
- "<option value='_top'>${topWindow}</option>",
- "<option value='_parent'>${parentWindow}</option>",
- "</select>",
- "</td></tr><tr><td colspan='2'>",
- "<button dojoType='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>",
- "<button dojoType='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>",
- "</td></tr></table>"
- ].join(""),
- _initButton: function(){
-
- var _this = this;
- this.tag = this.command == 'insertImage' ? 'img' : 'a';
- var messages = dojo.mixin(dojo.i18n.getLocalization("dijit", "common", this.lang),
- dojo.i18n.getLocalization("dijit._editor", "LinkDialog", this.lang));
- var dropDown = (this.dropDown = new dijit.TooltipDialog({
- title: messages[this.command + "Title"],
- execute: dojo.hitch(this, "setValue"),
- onOpen: function(){
- _this._onOpenDialog();
- dijit.TooltipDialog.prototype.onOpen.apply(this, arguments);
- },
- onCancel: function(){
- setTimeout(dojo.hitch(_this, "_onCloseDialog"),0);
- }
- }));
- messages.urlRegExp = this.urlRegExp;
- messages.id = dijit.getUniqueId(this.editor.id);
- this._uniqueId = messages.id;
- this._setContent(dropDown.title +
- "<div style='border-bottom: 1px black solid;padding-bottom:2pt;margin-bottom:4pt'></div>" +
- dojo.string.substitute(this.linkDialogTemplate, messages));
- dropDown.startup();
- this._urlInput = dijit.byId(this._uniqueId + "_urlInput");
- this._textInput = dijit.byId(this._uniqueId + "_textInput");
- this._setButton = dijit.byId(this._uniqueId + "_setButton");
- this.connect(dijit.byId(this._uniqueId + "_cancelButton"), "onClick", function(){
- this.dropDown.onCancel();
- });
- if(this._urlInput){
- this.connect(this._urlInput, "onChange", "_checkAndFixInput");
- }
- if(this._textInput){
- this.connect(this._textInput, "onChange", "_checkAndFixInput");
- }
-
- this._urlRegExp = new RegExp("^" + this.urlRegExp + "$", "i");
- this._emailRegExp = new RegExp("^" + this.emailRegExp + "$", "i");
- this._urlInput.isValid = dojo.hitch(this, function(){
-
- var value = this._urlInput.get("value");
- return this._urlRegExp.test(value) || this._emailRegExp.test(value);
- });
- this._connectTagEvents();
- this.inherited(arguments);
- },
- _checkAndFixInput: function(){
-
-
-
-
-
-
- var self = this;
- var url = this._urlInput.get("value");
- var fixupUrl = function(url){
- var appendHttp = false;
- var appendMailto = false;
- if(url && url.length > 1){
- url = dojo.trim(url);
- if(url.indexOf("mailto:") !== 0){
- if(url.indexOf("/") > 0){
- if(url.indexOf("://") === -1){
-
-
- if(url.charAt(0) !== '/' && url.indexOf("./") !== 0){
- if(self._hostRxp.test(url)){
- appendHttp = true;
- }
- }
- }
- }else if(self._userAtRxp.test(url)){
-
- appendMailto = true;
- }
- }
- }
- if(appendHttp){
- self._urlInput.set("value", "http://" + url);
- }
- if(appendMailto){
- self._urlInput.set("value", "mailto:" + url);
- }
- self._setButton.set("disabled", !self._isValid());
- };
- if(this._delayedCheck){
- clearTimeout(this._delayedCheck);
- this._delayedCheck = null;
- }
- this._delayedCheck = setTimeout(function(){
- fixupUrl(url);
- }, 250);
- },
- _connectTagEvents: function(){
-
-
- this.editor.onLoadDeferred.addCallback(dojo.hitch(this, function(){
- this.connect(this.editor.editNode, "ondblclick", this._onDblClick);
- }));
- },
- _isValid: function(){
-
-
-
-
-
- return this._urlInput.isValid() && this._textInput.isValid();
- },
- _setContent: function(staticPanel){
-
-
- this.dropDown.set({
- parserScope: "dojo",
- content: staticPanel
- });
- },
- _checkValues: function(args){
-
-
-
-
-
-
- if(args && args.urlInput){
- args.urlInput = args.urlInput.replace(/"/g, """);
- }
- return args;
- },
- setValue: function(args){
-
-
-
-
-
- this._onCloseDialog();
- if(dojo.isIE < 9){
- var sel = dijit.range.getSelection(this.editor.window);
- var range = sel.getRangeAt(0);
- var a = range.endContainer;
- if(a.nodeType === 3){
-
-
-
- a = a.parentNode;
- }
- if(a && (a.nodeName && a.nodeName.toLowerCase() !== this.tag)){
-
-
- a = dojo.withGlobal(this.editor.window,
- "getSelectedElement", dijit._editor.selection, [this.tag]);
- }
- if(a && (a.nodeName && a.nodeName.toLowerCase() === this.tag)){
-
-
-
-
- if(this.editor.queryCommandEnabled("unlink")){
-
-
- dojo.withGlobal(this.editor.window,
- "selectElementChildren", dijit._editor.selection, [a]);
- this.editor.execCommand("unlink");
- }
- }
- }
-
- args = this._checkValues(args);
- this.editor.execCommand('inserthtml',
- dojo.string.substitute(this.htmlTemplate, args));
-
-
-
- dojo.query("a", this.editor.document).forEach(function(a){
- if(!a.innerHTML && !domAttr.has(a, "name")){
-
-
-
- a.parentNode.removeChild(a);
- }
- }, this);
-
- },
- _onCloseDialog: function(){
-
-
- this.editor.focus();
- },
- _getCurrentValues: function(a){
-
-
-
-
-
-
- var url, text, target;
- if(a && a.tagName.toLowerCase() === this.tag){
- url = a.getAttribute('_djrealurl') || a.getAttribute('href');
- target = a.getAttribute('target') || "_self";
- text = a.textContent || a.innerText;
- dojo.withGlobal(this.editor.window, "selectElement", dijit._editor.selection, [a, true]);
- }else{
- text = dojo.withGlobal(this.editor.window, dijit._editor.selection.getSelectedText);
- }
- return {urlInput: url || '', textInput: text || '', targetSelect: target || ''};
- },
- _onOpenDialog: function(){
-
-
-
- var a;
- if(dojo.isIE < 9){
-
-
- var sel = dijit.range.getSelection(this.editor.window);
- var range = sel.getRangeAt(0);
- a = range.endContainer;
- if(a.nodeType === 3){
-
-
-
- a = a.parentNode;
- }
- if(a && (a.nodeName && a.nodeName.toLowerCase() !== this.tag)){
-
-
- a = dojo.withGlobal(this.editor.window,
- "getSelectedElement", dijit._editor.selection, [this.tag]);
- }
- }else{
- a = dojo.withGlobal(this.editor.window,
- "getAncestorElement", dijit._editor.selection, [this.tag]);
- }
- this.dropDown.reset();
- this._setButton.set("disabled", true);
- this.dropDown.set("value", this._getCurrentValues(a));
- },
- _onDblClick: function(e){
-
-
-
-
-
-
-
-
- if(e && e.target){
- var t = e.target;
- var tg = t.tagName? t.tagName.toLowerCase() : "";
- if(tg === this.tag && dojo.attr(t,"href")){
- dojo.withGlobal(this.editor.window,
- "selectElement",
- dijit._editor.selection, [t]);
- this.editor.onDisplayChanged();
-
- setTimeout(dojo.hitch(this, function(){
-
-
- this.button.set("disabled", false);
- this.button.openDropDown();
- }), 10);
- }
- }
- }
- });
- dojo.declare("dijit._editor.plugins.ImgLinkDialog", [dijit._editor.plugins.LinkDialog], {
-
-
-
-
-
-
-
-
-
- linkDialogTemplate: [
- "<table><tr><td>",
- "<label for='${id}_urlInput'>${url}</label>",
- "</td><td>",
- "<input dojoType='dijit.form.ValidationTextBox' regExp='${urlRegExp}' " +
- "required='true' id='${id}_urlInput' name='urlInput' intermediateChanges='true'/>",
- "</td></tr><tr><td>",
- "<label for='${id}_textInput'>${text}</label>",
- "</td><td>",
- "<input dojoType='dijit.form.ValidationTextBox' required='false' id='${id}_textInput' " +
- "name='textInput' intermediateChanges='true'/>",
- "</td></tr><tr><td>",
- "</td><td>",
- "</td></tr><tr><td colspan='2'>",
- "<button dojoType='dijit.form.Button' type='submit' id='${id}_setButton'>${set}</button>",
- "<button dojoType='dijit.form.Button' type='button' id='${id}_cancelButton'>${buttonCancel}</button>",
- "</td></tr></table>"
- ].join(""),
-
-
- htmlTemplate: "<img src=\"${urlInput}\" _djrealurl=\"${urlInput}\" alt=\"${textInput}\" />",
-
-
- tag: "img",
- _getCurrentValues: function(img){
-
-
-
-
-
-
- var url, text;
- if(img && img.tagName.toLowerCase() === this.tag){
- url = img.getAttribute('_djrealurl') || img.getAttribute('src');
- text = img.getAttribute('alt');
- dojo.withGlobal(this.editor.window,
- "selectElement", dijit._editor.selection, [img, true]);
- }else{
- text = dojo.withGlobal(this.editor.window, dijit._editor.selection.getSelectedText);
- }
- return {urlInput: url || '', textInput: text || ''};
- },
- _isValid: function(){
-
-
-
-
- return this._urlInput.isValid();
- },
- _connectTagEvents: function(){
-
-
- this.inherited(arguments);
- this.editor.onLoadDeferred.addCallback(dojo.hitch(this, function(){
-
-
- this.connect(this.editor.editNode, "onmousedown", this._selectTag);
- }));
- },
- _selectTag: function(e){
-
-
-
-
-
-
-
-
- if(e && e.target){
- var t = e.target;
- var tg = t.tagName? t.tagName.toLowerCase() : "";
- if(tg === this.tag){
- dojo.withGlobal(this.editor.window,
- "selectElement",
- dijit._editor.selection, [t]);
- }
- }
- },
- _checkValues: function(args){
-
-
-
-
-
-
-
- if(args && args.urlInput){
- args.urlInput = args.urlInput.replace(/"/g, """);
- }
- if(args && args.textInput){
- args.textInput = args.textInput.replace(/"/g, """);
- }
- return args;
- },
- _onDblClick: function(e){
-
-
-
-
-
-
-
-
- if(e && e.target){
- var t = e.target;
- var tg = t.tagName? t.tagName.toLowerCase() : "";
- if(tg === this.tag && dojo.attr(t,"src")){
- dojo.withGlobal(this.editor.window,
- "selectElement",
- dijit._editor.selection, [t]);
- this.editor.onDisplayChanged();
- setTimeout(dojo.hitch(this, function(){
-
-
- this.button.set("disabled", false);
- this.button.openDropDown();
- }), 10);
- }
- }
- }
- });
- dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
- if(o.plugin){ return; }
- switch(o.args.name){
- case "createLink":
- o.plugin = new dijit._editor.plugins.LinkDialog({command: o.args.name});
- break;
- case "insertImage":
- o.plugin = new dijit._editor.plugins.ImgLinkDialog({command: o.args.name});
- break;
- }
- });
- }
- if(!dojo._hasResource["dojo.colors"]){
- dojo._hasResource["dojo.colors"] = true;
- dojo.provide("dojo.colors");
- dojo.getObject("colors", true, dojo);
- (function(){
-
- var hue2rgb = function(m1, m2, h){
- if(h < 0){ ++h; }
- if(h > 1){ --h; }
- var h6 = 6 * h;
- if(h6 < 1){ return m1 + (m2 - m1) * h6; }
- if(2 * h < 1){ return m2; }
- if(3 * h < 2){ return m1 + (m2 - m1) * (2 / 3 - h) * 6; }
- return m1;
- };
-
- dojo.colorFromRgb = function(/*String*/ color, /*dojo.Color?*/ obj){
-
-
-
-
-
- var m = color.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);
- if(m){
- var c = m[2].split(/\s*,\s*/), l = c.length, t = m[1], a;
- if((t == "rgb" && l == 3) || (t == "rgba" && l == 4)){
- var r = c[0];
- if(r.charAt(r.length - 1) == "%"){
-
- a = dojo.map(c, function(x){
- return parseFloat(x) * 2.56;
- });
- if(l == 4){ a[3] = c[3]; }
- return dojo.colorFromArray(a, obj);
- }
- return dojo.colorFromArray(c, obj);
- }
- if((t == "hsl" && l == 3) || (t == "hsla" && l == 4)){
-
- var H = ((parseFloat(c[0]) % 360) + 360) % 360 / 360,
- S = parseFloat(c[1]) / 100,
- L = parseFloat(c[2]) / 100,
-
-
- m2 = L <= 0.5 ? L * (S + 1) : L + S - L * S,
- m1 = 2 * L - m2;
- a = [
- hue2rgb(m1, m2, H + 1 / 3) * 256,
- hue2rgb(m1, m2, H) * 256,
- hue2rgb(m1, m2, H - 1 / 3) * 256,
- 1
- ];
- if(l == 4){ a[3] = c[3]; }
- return dojo.colorFromArray(a, obj);
- }
- }
- return null;
- };
-
- var confine = function(c, low, high){
-
-
-
- c = Number(c);
- return isNaN(c) ? high : c < low ? low : c > high ? high : c;
- };
-
- dojo.Color.prototype.sanitize = function(){
-
- var t = this;
- t.r = Math.round(confine(t.r, 0, 255));
- t.g = Math.round(confine(t.g, 0, 255));
- t.b = Math.round(confine(t.b, 0, 255));
- t.a = confine(t.a, 0, 1);
- return this;
- };
- })();
- dojo.colors.makeGrey = function(/*Number*/ g, /*Number?*/ a){
-
- return dojo.colorFromArray([g, g, g, a]);
- };
- dojo.mixin(dojo.Color.named, {
- aliceblue: [240,248,255],
- antiquewhite: [250,235,215],
- aquamarine: [127,255,212],
- azure: [240,255,255],
- beige: [245,245,220],
- bisque: [255,228,196],
- blanchedalmond: [255,235,205],
- blueviolet: [138,43,226],
- brown: [165,42,42],
- burlywood: [222,184,135],
- cadetblue: [95,158,160],
- chartreuse: [127,255,0],
- chocolate: [210,105,30],
- coral: [255,127,80],
- cornflowerblue: [100,149,237],
- cornsilk: [255,248,220],
- crimson: [220,20,60],
- cyan: [0,255,255],
- darkblue: [0,0,139],
- darkcyan: [0,139,139],
- darkgoldenrod: [184,134,11],
- darkgray: [169,169,169],
- darkgreen: [0,100,0],
- darkgrey: [169,169,169],
- darkkhaki: [189,183,107],
- darkmagenta: [139,0,139],
- darkolivegreen: [85,107,47],
- darkorange: [255,140,0],
- darkorchid: [153,50,204],
- darkred: [139,0,0],
- darksalmon: [233,150,122],
- darkseagreen: [143,188,143],
- darkslateblue: [72,61,139],
- darkslategray: [47,79,79],
- darkslategrey: [47,79,79],
- darkturquoise: [0,206,209],
- darkviolet: [148,0,211],
- deeppink: [255,20,147],
- deepskyblue: [0,191,255],
- dimgray: [105,105,105],
- dimgrey: [105,105,105],
- dodgerblue: [30,144,255],
- firebrick: [178,34,34],
- floralwhite: [255,250,240],
- forestgreen: [34,139,34],
- gainsboro: [220,220,220],
- ghostwhite: [248,248,255],
- gold: [255,215,0],
- goldenrod: [218,165,32],
- greenyellow: [173,255,47],
- grey: [128,128,128],
- honeydew: [240,255,240],
- hotpink: [255,105,180],
- indianred: [205,92,92],
- indigo: [75,0,130],
- ivory: [255,255,240],
- khaki: [240,230,140],
- lavender: [230,230,250],
- lavenderblush: [255,240,245],
- lawngreen: [124,252,0],
- lemonchiffon: [255,250,205],
- lightblue: [173,216,230],
- lightcoral: [240,128,128],
- lightcyan: [224,255,255],
- lightgoldenrodyellow: [250,250,210],
- lightgray: [211,211,211],
- lightgreen: [144,238,144],
- lightgrey: [211,211,211],
- lightpink: [255,182,193],
- lightsalmon: [255,160,122],
- lightseagreen: [32,178,170],
- lightskyblue: [135,206,250],
- lightslategray: [119,136,153],
- lightslategrey: [119,136,153],
- lightsteelblue: [176,196,222],
- lightyellow: [255,255,224],
- limegreen: [50,205,50],
- linen: [250,240,230],
- magenta: [255,0,255],
- mediumaquamarine: [102,205,170],
- mediumblue: [0,0,205],
- mediumorchid: [186,85,211],
- mediumpurple: [147,112,219],
- mediumseagreen: [60,179,113],
- mediumslateblue: [123,104,238],
- mediumspringgreen: [0,250,154],
- mediumturquoise: [72,209,204],
- mediumvioletred: [199,21,133],
- midnightblue: [25,25,112],
- mintcream: [245,255,250],
- mistyrose: [255,228,225],
- moccasin: [255,228,181],
- navajowhite: [255,222,173],
- oldlace: [253,245,230],
- olivedrab: [107,142,35],
- orange: [255,165,0],
- orangered: [255,69,0],
- orchid: [218,112,214],
- palegoldenrod: [238,232,170],
- palegreen: [152,251,152],
- paleturquoise: [175,238,238],
- palevioletred: [219,112,147],
- papayawhip: [255,239,213],
- peachpuff: [255,218,185],
- peru: [205,133,63],
- pink: [255,192,203],
- plum: [221,160,221],
- powderblue: [176,224,230],
- rosybrown: [188,143,143],
- royalblue: [65,105,225],
- saddlebrown: [139,69,19],
- salmon: [250,128,114],
- sandybrown: [244,164,96],
- seagreen: [46,139,87],
- seashell: [255,245,238],
- sienna: [160,82,45],
- skyblue: [135,206,235],
- slateblue: [106,90,205],
- slategray: [112,128,144],
- slategrey: [112,128,144],
- snow: [255,250,250],
- springgreen: [0,255,127],
- steelblue: [70,130,180],
- tan: [210,180,140],
- thistle: [216,191,216],
- tomato: [255,99,71],
- transparent: [0, 0, 0, 0],
- turquoise: [64,224,208],
- violet: [238,130,238],
- wheat: [245,222,179],
- whitesmoke: [245,245,245],
- yellowgreen: [154,205,50]
- });
- }
- if(!dojo._hasResource["dijit._PaletteMixin"]){
- dojo._hasResource["dijit._PaletteMixin"] = true;
- dojo.provide("dijit._PaletteMixin");
- dojo.declare("dijit._PaletteMixin",
- [dijit._CssStateMixin],
- {
-
-
-
-
-
-
- defaultTimeout: 500,
-
-
-
-
- timeoutChangeRate: 0.90,
-
-
- value: null,
-
-
-
- _selectedCell: -1,
-
-
- tabIndex: "0",
-
-
- cellClass: "dijitPaletteCell",
-
-
-
- dyeClass: '',
- _preparePalette: function(choices, titles, dyeClassObj) {
-
-
-
-
-
-
-
-
-
- this._cells = [];
- var url = this._blankGif;
-
- dyeClassObj = dyeClassObj || dojo.getObject(this.dyeClass);
- for(var row=0; row < choices.length; row++){
- var rowNode = dojo.create("tr", {tabIndex: "-1"}, this.gridNode);
- for(var col=0; col < choices[row].length; col++){
- var value = choices[row][col];
- if(value){
- var cellObject = new dyeClassObj(value, row, col);
-
- var cellNode = dojo.create("td", {
- "class": this.cellClass,
- tabIndex: "-1",
- title: titles[value],
- role: "presentation"
- });
-
- cellObject.fillCell(cellNode, url);
- this.connect(cellNode, "ondijitclick", "_onCellClick");
- this._trackMouseState(cellNode, this.cellClass);
- dojo.place(cellNode, rowNode);
- cellNode.index = this._cells.length;
-
- this._cells.push({node:cellNode, dye:cellObject});
- }
- }
- }
- this._xDim = choices[0].length;
- this._yDim = choices.length;
-
-
-
-
-
- var keyIncrementMap = {
- UP_ARROW: -this._xDim,
-
- DOWN_ARROW: this._xDim,
-
- RIGHT_ARROW: this.isLeftToRight() ? 1 : -1,
- LEFT_ARROW: this.isLeftToRight() ? -1 : 1
- };
- for(var key in keyIncrementMap){
- this._connects.push(
- dijit.typematic.addKeyListener(
- this.domNode,
- {charOrCode:dojo.keys[key], ctrlKey:false, altKey:false, shiftKey:false},
- this,
- function(){
- var increment = keyIncrementMap[key];
- return function(count){ this._navigateByKey(increment, count); };
- }(),
- this.timeoutChangeRate,
- this.defaultTimeout
- )
- );
- }
- },
- postCreate: function(){
- this.inherited(arguments);
-
- this._setCurrent(this._cells[0].node);
- },
- focus: function(){
-
-
-
- dijit.focus(this._currentFocus);
- },
- _onCellClick: function(/*Event*/ evt){
-
-
-
-
-
-
- var target = evt.currentTarget,
- value = this._getDye(target).getValue();
-
-
-
-
-
- this._setCurrent(target);
- setTimeout(dojo.hitch(this, function(){
- dijit.focus(target);
- this._setValueAttr(value, true);
- }));
-
-
- dojo.removeClass(target, "dijitPaletteCellHover");
- dojo.stopEvent(evt);
- },
- _setCurrent: function(/*DomNode*/ node){
-
-
-
-
-
-
-
-
-
-
-
- if("_currentFocus" in this){
-
- dojo.attr(this._currentFocus, "tabIndex", "-1");
- }
-
- this._currentFocus = node;
- if(node){
- dojo.attr(node, "tabIndex", this.tabIndex);
- }
- },
- _setValueAttr: function(value, priorityChange){
-
-
-
-
-
-
-
-
-
-
- if(this._selectedCell >= 0){
- dojo.removeClass(this._cells[this._selectedCell].node, "dijitPaletteCellSelected");
- }
- this._selectedCell = -1;
-
- if(value){
- for(var i = 0; i < this._cells.length; i++){
- if(value == this._cells[i].dye.getValue()){
- this._selectedCell = i;
- dojo.addClass(this._cells[i].node, "dijitPaletteCellSelected");
- break;
- }
- }
- }
-
-
- this._set("value", this._selectedCell >= 0 ? value : null);
- if(priorityChange || priorityChange === undefined){
- this.onChange(value);
- }
- },
- onChange: function(value){
-
-
-
-
- },
- _navigateByKey: function(increment, typeCount){
-
-
-
-
-
-
-
-
-
-
- if(typeCount == -1){ return; }
- var newFocusIndex = this._currentFocus.index + increment;
- if(newFocusIndex < this._cells.length && newFocusIndex > -1){
- var focusNode = this._cells[newFocusIndex].node;
- this._setCurrent(focusNode);
-
-
- setTimeout(dojo.hitch(dijit, "focus", focusNode), 0);
- }
- },
- _getDye: function(/*DomNode*/ cell){
-
-
- return this._cells[cell.index].dye;
- }
- });
- }
- if(!dojo._hasResource["dijit.ColorPalette"]){
- dojo._hasResource["dijit.ColorPalette"] = true;
- dojo.provide("dijit.ColorPalette");
- dojo.declare("dijit.ColorPalette",
- [dijit._Widget, dijit._Templated, dijit._PaletteMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- palette: "7x10",
-
-
-
-
- _palettes: {
- "7x10": [["white", "seashell", "cornsilk", "lemonchiffon","lightyellow", "palegreen", "paleturquoise", "lightcyan", "lavender", "plum"],
- ["lightgray", "pink", "bisque", "moccasin", "khaki", "lightgreen", "lightseagreen", "lightskyblue", "cornflowerblue", "violet"],
- ["silver", "lightcoral", "sandybrown", "orange", "palegoldenrod", "chartreuse", "mediumturquoise", "skyblue", "mediumslateblue","orchid"],
- ["gray", "red", "orangered", "darkorange", "yellow", "limegreen", "darkseagreen", "royalblue", "slateblue", "mediumorchid"],
- ["dimgray", "crimson", "chocolate", "coral", "gold", "forestgreen", "seagreen", "blue", "blueviolet", "darkorchid"],
- ["darkslategray","firebrick","saddlebrown", "sienna", "olive", "green", "darkcyan", "mediumblue","darkslateblue", "darkmagenta" ],
- ["black", "darkred", "maroon", "brown", "darkolivegreen", "darkgreen", "midnightblue", "navy", "indigo", "purple"]],
- "3x4": [["white", "lime", "green", "blue"],
- ["silver", "yellow", "fuchsia", "navy"],
- ["gray", "red", "purple", "black"]]
- },
-
-
- templateString: dojo.cache("dijit", "templates/ColorPalette.html", "<div class=\"dijitInline dijitColorPalette\">\n\t<table class=\"dijitPaletteTable\" cellSpacing=\"0\" cellPadding=\"0\">\n\t\t<tbody dojoAttachPoint=\"gridNode\"></tbody>\n\t</table>\n</div>\n"),
- baseClass: "dijitColorPalette",
- buildRendering: function(){
-
-
- this.inherited(arguments);
-
-
- this._preparePalette(
- this._palettes[this.palette],
- dojo.i18n.getLocalization("dojo", "colors", this.lang),
- dojo.declare(dijit._Color, {
- hc: dojo.hasClass(dojo.body(), "dijit_a11y"),
- palette: this.palette
- })
- );
- }
- });
- dojo.declare("dijit._Color", dojo.Color, {
-
-
-
-
-
-
- template:
- "<span class='dijitInline dijitPaletteImg'>" +
- "<img src='${blankGif}' alt='${alt}' class='dijitColorPaletteSwatch' style='background-color: ${color}'/>" +
- "</span>",
-
-
- hcTemplate:
- "<span class='dijitInline dijitPaletteImg' style='position: relative; overflow: hidden; height: 12px; width: 14px;'>" +
- "<img src='${image}' alt='${alt}' style='position: absolute; left: ${left}px; top: ${top}px; ${size}'/>" +
- "</span>",
-
-
- _imagePaths: {
- "7x10": dojo.moduleUrl("dijit.themes", "a11y/colors7x10.png"),
- "3x4": dojo.moduleUrl("dijit.themes", "a11y/colors3x4.png")
- },
- constructor: function(/*String*/alias, /*Number*/ row, /*Number*/ col){
- this._alias = alias;
- this._row = row;
- this._col = col;
- this.setColor(dojo.Color.named[alias]);
- },
- getValue: function(){
-
-
-
- return this.toHex();
- },
- fillCell: function(/*DOMNode*/ cell, /*String*/ blankGif){
- var html = dojo.string.substitute(this.hc ? this.hcTemplate : this.template, {
-
- color: this.toHex(),
- blankGif: blankGif,
- alt: this._alias,
-
-
- image: this._imagePaths[this.palette].toString(),
- left: this._col * -20 - 5,
- top: this._row * -20 - 5,
- size: this.palette == "7x10" ? "height: 145px; width: 206px" : "height: 64px; width: 86px"
- });
- dojo.place(html, cell);
- }
- });
- }
- if(!dojo._hasResource["dijit._editor.plugins.TextColor"]){
- dojo._hasResource["dijit._editor.plugins.TextColor"] = true;
- dojo.provide("dijit._editor.plugins.TextColor");
- dojo.declare("dijit._editor.plugins.TextColor", dijit._editor._Plugin, {
-
-
-
-
-
-
-
-
-
- buttonClass: dijit.form.DropDownButton,
-
-
-
- useDefaultCommand: false,
- _initButton: function(){
- this.inherited(arguments);
-
-
- var self = this;
- this.button.loadDropDown = function(callback){
- this.dropDown = new dijit.ColorPalette({
- value: self.value,
- onChange: function(color){
- self.editor.execCommand(self.command, color);
- }
- });
- callback();
- };
- },
- updateState: function(){
-
-
-
-
-
-
- var _e = this.editor;
- var _c = this.command;
- if(!_e || !_e.isLoaded || !_c.length){
- return;
- }
-
- if(this.button){
- var disabled = this.get("disabled");
- this.button.set("disabled", disabled);
- if(disabled){ return; }
-
- var value;
- try{
- value = _e.queryCommandValue(_c)|| "";
- }catch(e){
-
- value = "";
- }
- }
-
- if(value == ""){
- value = "#000000";
- }
- if(value == "transparent"){
- value = "#ffffff";
- }
- if(typeof value == "string"){
-
- if(value.indexOf("rgb")> -1){
- value = dojo.colorFromRgb(value).toHex();
- }
- }else{
- value =((value & 0x0000ff)<< 16)|(value & 0x00ff00)|((value & 0xff0000)>>> 16);
- value = value.toString(16);
- value = "#000000".slice(0, 7 - value.length)+ value;
-
- }
-
- var dropDown = this.button.dropDown;
- if(dropDown && value !== dropDown.get('value')){
- dropDown.set('value', value, false);
- }
-
- }
- });
- dojo.subscribe(dijit._scopeName + ".Editor.getPlugin", null, function(o){
- if(o.plugin){
- return;
- }
- switch(o.args.name){
- case "foreColor":
- case "hiliteColor":
- o.plugin = new dijit._editor.plugins.TextColor({
- command: o.args.name
- });
- }
- });
- }
- if(!dojo._hasResource["dijit.tree._dndContainer"]){
- dojo._hasResource["dijit.tree._dndContainer"] = true;
- dojo.provide("dijit.tree._dndContainer");
- dojo.getObject("tree", true, dojo);
- dijit.tree._compareNodes = function(n1, n2){
- if(n1 === n2){
- return 0;
- }
-
- if('sourceIndex' in document.documentElement){
-
- return n1.sourceIndex - n2.sourceIndex;
- }else if('compareDocumentPosition' in document.documentElement){
- return n1.compareDocumentPosition(n2) & 2 ? 1: -1;
- }else if(document.createRange){
- var r1 = doc.createRange();
- r1.setStartBefore(n1);
- var r2 = doc.createRange();
- r2.setStartBefore(n2);
- return r1.compareBoundaryPoints(r1.END_TO_END, r2);
- }else{
- throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");
- }
- };
- dojo.declare("dijit.tree._dndContainer",
- null,
- {
-
-
-
-
-
-
- constructor: function(tree, params){
-
-
-
-
-
-
-
-
- this.tree = tree;
- this.node = tree.domNode;
- dojo.mixin(this, params);
-
- this.map = {};
- this.current = null;
-
- this.containerState = "";
- dojo.addClass(this.node, "dojoDndContainer");
-
- this.events = [
-
- dojo.connect(this.node, "onmouseenter", this, "onOverEvent"),
- dojo.connect(this.node, "onmouseleave", this, "onOutEvent"),
-
- dojo.connect(this.tree, "_onNodeMouseEnter", this, "onMouseOver"),
- dojo.connect(this.tree, "_onNodeMouseLeave", this, "onMouseOut"),
-
- dojo.connect(this.node, "ondragstart", dojo, "stopEvent"),
- dojo.connect(this.node, "onselectstart", dojo, "stopEvent")
- ];
- },
- getItem: function(/*String*/ key){
-
-
-
-
-
- var widget = this.selection[key],
- ret = {
- data: widget,
- type: ["treeNode"]
- };
- return ret;
- },
- destroy: function(){
-
-
- dojo.forEach(this.events, dojo.disconnect);
-
- this.node = this.parent = null;
- },
-
- onMouseOver: function(/*TreeNode*/ widget, /*Event*/ evt){
-
-
-
-
- this.current = widget;
- },
- onMouseOut: function(/*TreeNode*/ widget, /*Event*/ evt){
-
-
-
-
- this.current = null;
- },
- _changeState: function(type, newState){
-
-
-
-
-
-
- var prefix = "dojoDnd" + type;
- var state = type.toLowerCase() + "State";
-
- dojo.replaceClass(this.node, prefix + newState, prefix + this[state]);
- this[state] = newState;
- },
- _addItemClass: function(node, type){
-
-
-
-
-
-
- dojo.addClass(node, "dojoDndItem" + type);
- },
- _removeItemClass: function(node, type){
-
-
-
-
-
-
- dojo.removeClass(node, "dojoDndItem" + type);
- },
- onOverEvent: function(){
-
-
-
-
- this._changeState("Container", "Over");
- },
- onOutEvent: function(){
-
-
-
-
- this._changeState("Container", "");
- }
- });
- }
- if(!dojo._hasResource["dijit.tree._dndSelector"]){
- dojo._hasResource["dijit.tree._dndSelector"] = true;
- dojo.provide("dijit.tree._dndSelector");
- dojo.declare("dijit.tree._dndSelector",
- dijit.tree._dndContainer,
- {
-
-
-
-
-
-
- constructor: function(tree, params){
-
-
-
-
- this.selection={};
- this.anchor = null;
- dijit.setWaiState(this.tree.domNode, "multiselect", !this.singular);
- this.events.push(
- dojo.connect(this.tree.domNode, "onmousedown", this,"onMouseDown"),
- dojo.connect(this.tree.domNode, "onmouseup", this,"onMouseUp"),
- dojo.connect(this.tree.domNode, "onmousemove", this,"onMouseMove")
- );
- },
-
-
-
- singular: false,
-
- getSelectedTreeNodes: function(){
-
-
-
-
-
- var nodes=[], sel = this.selection;
- for(var i in sel){
- nodes.push(sel[i]);
- }
- return nodes;
- },
- selectNone: function(){
-
-
-
-
- this.setSelection([]);
- return this;
- },
- destroy: function(){
-
-
- this.inherited(arguments);
- this.selection = this.anchor = null;
- },
- addTreeNode: function(/*dijit._TreeNode*/node, /*Boolean?*/isAnchor){
-
-
-
-
-
-
- this.setSelection(this.getSelectedTreeNodes().concat( [node] ));
- if(isAnchor){ this.anchor = node; }
- return node;
- },
- removeTreeNode: function(/*dijit._TreeNode*/node){
-
-
-
-
- this.setSelection(this._setDifference(this.getSelectedTreeNodes(), [node]))
- return node;
- },
- isTreeNodeSelected: function(/*dijit._TreeNode*/node){
-
-
-
-
- return node.id && !!this.selection[node.id];
- },
- setSelection: function(/*dijit._treeNode[]*/ newSelection){
-
-
-
-
-
-
-
- var oldSelection = this.getSelectedTreeNodes();
- dojo.forEach(this._setDifference(oldSelection, newSelection), dojo.hitch(this, function(node){
- node.setSelected(false);
- if(this.anchor == node){
- delete this.anchor;
- }
- delete this.selection[node.id];
- }));
- dojo.forEach(this._setDifference(newSelection, oldSelection), dojo.hitch(this, function(node){
- node.setSelected(true);
- this.selection[node.id] = node;
- }));
- this._updateSelectionProperties();
- },
- _setDifference: function(xs,ys){
-
-
-
-
-
-
- dojo.forEach(ys, function(y){ y.__exclude__ = true; });
- var ret = dojo.filter(xs, function(x){ return !x.__exclude__; });
-
- dojo.forEach(ys, function(y){ delete y['__exclude__'] });
- return ret;
- },
- _updateSelectionProperties: function() {
-
-
-
-
- var selected = this.getSelectedTreeNodes();
- var paths = [], nodes = [];
- dojo.forEach(selected, function(node) {
- nodes.push(node);
- paths.push(node.getTreePath());
- });
- var items = dojo.map(nodes,function(node) { return node.item; });
- this.tree._set("paths", paths);
- this.tree._set("path", paths[0] || []);
- this.tree._set("selectedNodes", nodes);
- this.tree._set("selectedNode", nodes[0] || null);
- this.tree._set("selectedItems", items);
- this.tree._set("selectedItem", items[0] || null);
- },
-
- onMouseDown: function(e){
-
-
-
-
-
-
-
- if(!this.current || this.tree.isExpandoNode( e.target, this.current)){ return; }
- if(e.button == dojo.mouseButtons.RIGHT){ return; }
- dojo.stopEvent(e);
- var treeNode = this.current,
- copy = dojo.isCopyKey(e), id = treeNode.id;
-
-
-
- if(!this.singular && !e.shiftKey && this.selection[id]){
- this._doDeselect = true;
- return;
- }else{
- this._doDeselect = false;
- }
- this.userSelect(treeNode, copy, e.shiftKey);
- },
- onMouseUp: function(e){
-
-
-
-
-
-
-
-
-
-
-
- if(!this._doDeselect){ return; }
- this._doDeselect = false;
- this.userSelect(this.current, dojo.isCopyKey( e ), e.shiftKey);
- },
- onMouseMove: function(e){
-
-
-
-
- this._doDeselect = false;
- },
- userSelect: function(node, multi, range){
-
-
-
-
-
-
-
-
-
- if(this.singular){
- if(this.anchor == node && multi){
- this.selectNone();
- }else{
- this.setSelection([node]);
- this.anchor = node;
- }
- }else{
- if(range && this.anchor){
- var cr = dijit.tree._compareNodes(this.anchor.rowNode, node.rowNode),
- begin, end, anchor = this.anchor;
-
- if(cr < 0){
- begin = anchor;
- end = node;
- }else{
- begin = node;
- end = anchor;
- }
- nodes = [];
-
- while(begin != end) {
- nodes.push(begin)
- begin = this.tree._getNextNode(begin);
- }
- nodes.push(end)
- this.setSelection(nodes);
- }else{
- if( this.selection[ node.id ] && multi ) {
- this.removeTreeNode( node );
- } else if(multi) {
- this.addTreeNode(node, true);
- } else {
- this.setSelection([node]);
- this.anchor = node;
- }
- }
- }
- },
- forInSelectedItems: function(/*Function*/ f, /*Object?*/ o){
-
-
-
- o = o || dojo.global;
- for(var id in this.selection){
-
- f.call(o, this.getItem(id), id, this);
- }
- }
- });
- }
- if(!dojo._hasResource["dijit.tree.dndSource"]){
- dojo._hasResource["dijit.tree.dndSource"] = true;
- dojo.provide("dijit.tree.dndSource");
- dojo.declare("dijit.tree.dndSource", dijit.tree._dndSelector, {
-
-
-
-
- isSource: true,
-
-
-
- accept: ["text", "treeNode"],
-
-
- copyOnly: false,
-
-
- dragThreshold: 5,
-
-
- betweenThreshold: 0,
- constructor: function(/*dijit.Tree*/ tree, /*dijit.tree.__SourceArgs*/ params){
-
-
-
-
- if(!params){ params = {}; }
- dojo.mixin(this, params);
- this.isSource = typeof params.isSource == "undefined" ? true : params.isSource;
- var type = params.accept instanceof Array ? params.accept : ["text", "treeNode"];
- this.accept = null;
- if(type.length){
- this.accept = {};
- for(var i = 0; i < type.length; ++i){
- this.accept[type[i]] = 1;
- }
- }
-
- this.isDragging = false;
- this.mouseDown = false;
- this.targetAnchor = null;
- this.targetBox = null;
- this.dropPosition = "";
- this._lastX = 0;
- this._lastY = 0;
-
- this.sourceState = "";
- if(this.isSource){
- dojo.addClass(this.node, "dojoDndSource");
- }
- this.targetState = "";
- if(this.accept){
- dojo.addClass(this.node, "dojoDndTarget");
- }
-
- this.topics = [
- dojo.subscribe("/dnd/source/over", this, "onDndSourceOver"),
- dojo.subscribe("/dnd/start", this, "onDndStart"),
- dojo.subscribe("/dnd/drop", this, "onDndDrop"),
- dojo.subscribe("/dnd/cancel", this, "onDndCancel")
- ];
- },
-
- checkAcceptance: function(source, nodes){
-
-
-
-
-
-
-
-
-
- return true;
- },
- copyState: function(keyPressed){
-
-
-
-
-
-
-
- return this.copyOnly || keyPressed;
- },
- destroy: function(){
-
-
- this.inherited("destroy",arguments);
- dojo.forEach(this.topics, dojo.unsubscribe);
- this.targetAnchor = null;
- },
- _onDragMouse: function(e){
-
-
-
- var m = dojo.dnd.manager(),
- oldTarget = this.targetAnchor,
- newTarget = this.current,
- oldDropPosition = this.dropPosition;
-
-
- var newDropPosition = "Over";
- if(newTarget && this.betweenThreshold > 0){
-
- if(!this.targetBox || oldTarget != newTarget){
- this.targetBox = dojo.position(newTarget.rowNode, true);
- }
- if((e.pageY - this.targetBox.y) <= this.betweenThreshold){
- newDropPosition = "Before";
- }else if((e.pageY - this.targetBox.y) >= (this.targetBox.h - this.betweenThreshold)){
- newDropPosition = "After";
- }
- }
- if(newTarget != oldTarget || newDropPosition != oldDropPosition){
- if(oldTarget){
- this._removeItemClass(oldTarget.rowNode, oldDropPosition);
- }
- if(newTarget){
- this._addItemClass(newTarget.rowNode, newDropPosition);
- }
-
- if(!newTarget){
- m.canDrop(false);
- }else if(newTarget == this.tree.rootNode && newDropPosition != "Over"){
-
- m.canDrop(false);
- }else if(m.source == this && (newTarget.id in this.selection)){
-
- m.canDrop(false);
- }else if(this.checkItemAcceptance(newTarget.rowNode, m.source, newDropPosition.toLowerCase())
- && !this._isParentChildDrop(m.source, newTarget.rowNode)){
- m.canDrop(true);
- }else{
- m.canDrop(false);
- }
- this.targetAnchor = newTarget;
- this.dropPosition = newDropPosition;
- }
- },
- onMouseMove: function(e){
-
-
-
-
-
-
- if(this.isDragging && this.targetState == "Disabled"){ return; }
- this.inherited(arguments);
- var m = dojo.dnd.manager();
- if(this.isDragging){
- this._onDragMouse(e);
- }else{
- if(this.mouseDown && this.isSource &&
- (Math.abs(e.pageX-this._lastX)>=this.dragThreshold || Math.abs(e.pageY-this._lastY)>=this.dragThreshold)){
- var nodes = this.getSelectedTreeNodes();
- if(nodes.length){
- if(nodes.length > 1){
-
- var seen = this.selection, i = 0, r = [], n, p;
- nextitem: while((n = nodes[i++])){
- for(p = n.getParent(); p && p !== this.tree; p = p.getParent()){
- if(seen[p.id]){
- continue nextitem;
- }
- }
-
- r.push(n);
- }
- nodes = r;
- }
- nodes = dojo.map(nodes, function(n){return n.domNode});
- m.startDrag(this, nodes, this.copyState(dojo.isCopyKey(e)));
- }
- }
- }
- },
- onMouseDown: function(e){
-
-
-
-
-
-
- this.mouseDown = true;
- this.mouseButton = e.button;
- this._lastX = e.pageX;
- this._lastY = e.pageY;
- this.inherited(arguments);
- },
- onMouseUp: function(e){
-
-
-
-
-
-
- if(this.mouseDown){
- this.mouseDown = false;
- this.inherited(arguments);
- }
- },
- onMouseOut: function(){
-
-
-
-
- this.inherited(arguments);
- this._unmarkTargetAnchor();
- },
- checkItemAcceptance: function(target, source, position){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return true;
- },
-
- onDndSourceOver: function(source){
-
-
-
-
-
-
- if(this != source){
- this.mouseDown = false;
- this._unmarkTargetAnchor();
- }else if(this.isDragging){
- var m = dojo.dnd.manager();
- m.canDrop(false);
- }
- },
- onDndStart: function(source, nodes, copy){
-
-
-
-
-
-
-
-
-
-
- if(this.isSource){
- this._changeState("Source", this == source ? (copy ? "Copied" : "Moved") : "");
- }
- var accepted = this.checkAcceptance(source, nodes);
- this._changeState("Target", accepted ? "" : "Disabled");
- if(this == source){
- dojo.dnd.manager().overSource(this);
- }
- this.isDragging = true;
- },
- itemCreator: function(/*DomNode[]*/ nodes, target, /*dojo.dnd.Source*/ source){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return dojo.map(nodes, function(node){
- return {
- "id": node.id,
- "name": node.textContent || node.innerText || ""
- };
- });
- },
- onDndDrop: function(source, nodes, copy){
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(this.containerState == "Over"){
- var tree = this.tree,
- model = tree.model,
- target = this.targetAnchor,
- requeryRoot = false;
- this.isDragging = false;
-
- var targetWidget = target;
- var newParentItem;
- var insertIndex;
- newParentItem = (targetWidget && targetWidget.item) || tree.item;
- if(this.dropPosition == "Before" || this.dropPosition == "After"){
-
-
- newParentItem = (targetWidget.getParent() && targetWidget.getParent().item) || tree.item;
-
- insertIndex = targetWidget.getIndexInParent();
- if(this.dropPosition == "After"){
- insertIndex = targetWidget.getIndexInParent() + 1;
- }
- }else{
- newParentItem = (targetWidget && targetWidget.item) || tree.item;
- }
-
-
- var newItemsParams;
- dojo.forEach(nodes, function(node, idx){
-
-
-
- var sourceItem = source.getItem(node.id);
-
-
-
- if(dojo.indexOf(sourceItem.type, "treeNode") != -1){
- var childTreeNode = sourceItem.data,
- childItem = childTreeNode.item,
- oldParentItem = childTreeNode.getParent().item;
- }
- if(source == this){
-
-
-
-
- if(typeof insertIndex == "number"){
- if(newParentItem == oldParentItem && childTreeNode.getIndexInParent() < insertIndex){
- insertIndex -= 1;
- }
- }
- model.pasteItem(childItem, oldParentItem, newParentItem, copy, insertIndex);
- }else if(model.isItem(childItem)){
-
-
- model.pasteItem(childItem, oldParentItem, newParentItem, copy, insertIndex);
- }else{
-
-
- if(!newItemsParams){
- newItemsParams = this.itemCreator(nodes, target.rowNode, source);
- }
-
- model.newItem(newItemsParams[idx], newParentItem, insertIndex);
- }
- }, this);
-
-
- this.tree._expandNode(targetWidget);
- }
- this.onDndCancel();
- },
- onDndCancel: function(){
-
-
-
-
- this._unmarkTargetAnchor();
- this.isDragging = false;
- this.mouseDown = false;
- delete this.mouseButton;
- this._changeState("Source", "");
- this._changeState("Target", "");
- },
-
- onOverEvent: function(){
-
-
-
-
- this.inherited(arguments);
- dojo.dnd.manager().overSource(this);
- },
- onOutEvent: function(){
-
-
-
-
- this._unmarkTargetAnchor();
- var m = dojo.dnd.manager();
- if(this.isDragging){
- m.canDrop(false);
- }
- m.outSource(this);
- this.inherited(arguments);
- },
- _isParentChildDrop: function(source, targetRow){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!source.tree || source.tree != this.tree){
- return false;
- }
- var root = source.tree.domNode;
- var ids = source.selection;
- var node = targetRow.parentNode;
-
-
- while(node != root && !ids[node.id]){
- node = node.parentNode;
- }
- return node.id && ids[node.id];
- },
- _unmarkTargetAnchor: function(){
-
-
-
-
- if(!this.targetAnchor){ return; }
- this._removeItemClass(this.targetAnchor.rowNode, this.dropPosition);
- this.targetAnchor = null;
- this.targetBox = null;
- this.dropPosition = null;
- },
- _markDndStatus: function(copy){
-
-
- this._changeState("Source", copy ? "Copied" : "Moved");
- }
- });
- }
- if(!dojo._hasResource["dijit._tree.dndSource"]){
- dojo._hasResource["dijit._tree.dndSource"] = true;
- dojo.provide("dijit._tree.dndSource");
- dojo.deprecated("dijit._tree.dndSource has been moved to dijit.tree.dndSource, use that instead", "", "2.0");
- dijit._tree.dndSource = dijit.tree.dndSource;
- }
- if(!dojo._hasResource["dojo.dnd.TimedMoveable"]){
- dojo._hasResource["dojo.dnd.TimedMoveable"] = true;
- dojo.provide("dojo.dnd.TimedMoveable");
- (function(){
-
- var oldOnMove = dojo.dnd.Moveable.prototype.onMove;
-
- dojo.declare("dojo.dnd.TimedMoveable", dojo.dnd.Moveable, {
-
-
-
-
-
-
-
- timeout: 40,
-
- constructor: function(node, params){
-
-
-
-
-
-
-
-
- if(!params){ params = {}; }
- if(params.timeout && typeof params.timeout == "number" && params.timeout >= 0){
- this.timeout = params.timeout;
- }
- },
-
-
- markupFactory: function(params, node){
- return new dojo.dnd.TimedMoveable(node, params);
- },
-
- onMoveStop: function(/* dojo.dnd.Mover */ mover){
- if(mover._timer){
-
- clearTimeout(mover._timer)
-
- oldOnMove.call(this, mover, mover._leftTop)
- }
- dojo.dnd.Moveable.prototype.onMoveStop.apply(this, arguments);
- },
- onMove: function(/* dojo.dnd.Mover */ mover, /* Object */ leftTop){
- mover._leftTop = leftTop;
- if(!mover._timer){
- var _t = this;
- mover._timer = setTimeout(function(){
-
- mover._timer = null;
-
- oldOnMove.call(_t, mover, mover._leftTop);
- }, this.timeout);
- }
- }
- });
- })();
- }
- if(!dojo._hasResource["dijit.DialogUnderlay"]){
- dojo._hasResource["dijit.DialogUnderlay"] = true;
- dojo.provide("dijit.DialogUnderlay");
- dojo.declare(
- "dijit.DialogUnderlay",
- [dijit._Widget, dijit._Templated],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- templateString: "<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",
-
-
-
- dialogId: "",
-
-
- "class": "",
- attributeMap: { id: "domNode" },
- _setDialogIdAttr: function(id){
- dojo.attr(this.node, "id", id + "_underlay");
- this._set("dialogId", id);
- },
- _setClassAttr: function(clazz){
- this.node.className = "dijitDialogUnderlay " + clazz;
- this._set("class", clazz);
- },
- postCreate: function(){
-
-
- dojo.body().appendChild(this.domNode);
- },
- layout: function(){
-
-
-
-
-
-
-
-
-
- var is = this.node.style,
- os = this.domNode.style;
-
-
-
- os.display = "none";
-
- var viewport = dojo.window.getBox();
- os.top = viewport.t + "px";
- os.left = viewport.l + "px";
- is.width = viewport.w + "px";
- is.height = viewport.h + "px";
- os.display = "block";
- },
- show: function(){
-
-
- this.domNode.style.display = "block";
- this.layout();
- this.bgIframe = new dijit.BackgroundIframe(this.domNode);
- },
- hide: function(){
-
-
- this.bgIframe.destroy();
- delete this.bgIframe;
- this.domNode.style.display = "none";
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.Dialog"]){
- dojo._hasResource["dijit.Dialog"] = true;
- dojo.provide("dijit.Dialog");
- dojo.declare(
- "dijit._DialogBase",
- [dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin, dijit._CssStateMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- templateString: dojo.cache("dijit", "templates/Dialog.html", "<div class=\"dijitDialog\" role=\"dialog\" aria-labelledby=\"${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\"></span>\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dijitDialogCloseIcon\" dojoAttachEvent=\"ondijitclick: onCancel\" title=\"${buttonCancel}\" role=\"button\" tabIndex=\"-1\">\n\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\" title=\"${buttonCancel}\">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n"),
-
- baseClass: "dijitDialog",
-
- cssStateNodes: {
- closeButtonNode: "dijitDialogCloseIcon"
- },
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- title: [
- { node: "titleNode", type: "innerHTML" },
- { node: "titleBar", type: "attribute" }
- ],
- "aria-describedby":""
- }),
-
-
- open: false,
-
-
- duration: dijit.defaultDuration,
-
-
-
-
- refocus: true,
-
-
-
-
- autofocus: true,
-
-
-
- _firstFocusItem: null,
-
-
-
- _lastFocusItem: null,
-
-
-
-
-
- doLayout: false,
-
-
-
-
- draggable: true,
-
-
-
-
-
-
-
-
- "aria-describedby":"",
- postMixInProperties: function(){
- var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
- dojo.mixin(this, _nlsResources);
- this.inherited(arguments);
- },
- postCreate: function(){
- dojo.style(this.domNode, {
- display: "none",
- position:"absolute"
- });
- dojo.body().appendChild(this.domNode);
- this.inherited(arguments);
- this.connect(this, "onExecute", "hide");
- this.connect(this, "onCancel", "hide");
- this._modalconnects = [];
- },
- onLoad: function(){
-
-
-
-
-
-
-
-
- this._position();
- if(this.autofocus && dijit._DialogLevelManager.isTop(this)){
- this._getFocusItems(this.domNode);
- dijit.focus(this._firstFocusItem);
- }
- this.inherited(arguments);
- },
- _endDrag: function(){
-
-
-
-
-
- var nodePosition = dojo.position(this.domNode),
- viewport = dojo.window.getBox();
- nodePosition.y = Math.min(Math.max(nodePosition.y, 0), (viewport.h - nodePosition.h));
- nodePosition.x = Math.min(Math.max(nodePosition.x, 0), (viewport.w - nodePosition.w));
- this._relativePosition = nodePosition;
- this._position();
- },
- _setup: function(){
-
-
-
-
-
-
- var node = this.domNode;
- if(this.titleBar && this.draggable){
- this._moveable = (dojo.isIE == 6) ?
- new dojo.dnd.TimedMoveable(node, { handle: this.titleBar }) :
- new dojo.dnd.Moveable(node, { handle: this.titleBar, timeout: 0 });
- this.connect(this._moveable, "onMoveStop", "_endDrag");
- }else{
- dojo.addClass(node,"dijitDialogFixed");
- }
- this.underlayAttrs = {
- dialogId: this.id,
- "class": dojo.map(this["class"].split(/\s/), function(s){ return s+"_underlay"; }).join(" ")
- };
- },
- _size: function(){
-
-
-
-
- this._checkIfSingleChild();
-
-
-
- if(this._singleChild){
- if(this._singleChildOriginalStyle){
- this._singleChild.domNode.style.cssText = this._singleChildOriginalStyle;
- }
- delete this._singleChildOriginalStyle;
- }else{
- dojo.style(this.containerNode, {
- width:"auto",
- height:"auto"
- });
- }
- var mb = dojo._getMarginSize(this.domNode);
- var viewport = dojo.window.getBox();
- if(mb.w >= viewport.w || mb.h >= viewport.h){
-
- var w = Math.min(mb.w, Math.floor(viewport.w * 0.75)),
- h = Math.min(mb.h, Math.floor(viewport.h * 0.75));
- if(this._singleChild && this._singleChild.resize){
- this._singleChildOriginalStyle = this._singleChild.domNode.style.cssText;
- this._singleChild.resize({w: w, h: h});
- }else{
- dojo.style(this.containerNode, {
- width: w + "px",
- height: h + "px",
- overflow: "auto",
- position: "relative"
- });
- }
- }else{
- if(this._singleChild && this._singleChild.resize){
- this._singleChild.resize();
- }
- }
- },
- _position: function(){
-
-
-
-
-
-
-
- if(!dojo.hasClass(dojo.body(), "dojoMove")){
- var node = this.domNode,
- viewport = dojo.window.getBox(),
- p = this._relativePosition,
- bb = p ? null : dojo._getBorderBox(node),
- l = Math.floor(viewport.l + (p ? p.x : (viewport.w - bb.w) / 2)),
- t = Math.floor(viewport.t + (p ? p.y : (viewport.h - bb.h) / 2))
- ;
- dojo.style(node,{
- left: l + "px",
- top: t + "px"
- });
- }
- },
- _onKey: function(/*Event*/ evt){
-
-
-
-
- if(evt.charOrCode){
- var dk = dojo.keys;
- var node = evt.target;
- if(evt.charOrCode === dk.TAB){
- this._getFocusItems(this.domNode);
- }
- var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
-
- if(node == this._firstFocusItem && evt.shiftKey && evt.charOrCode === dk.TAB){
- if(!singleFocusItem){
- dijit.focus(this._lastFocusItem);
- }
- dojo.stopEvent(evt);
- }else if(node == this._lastFocusItem && evt.charOrCode === dk.TAB && !evt.shiftKey){
- if(!singleFocusItem){
- dijit.focus(this._firstFocusItem);
- }
- dojo.stopEvent(evt);
- }else{
-
- while(node){
- if(node == this.domNode || dojo.hasClass(node, "dijitPopup")){
- if(evt.charOrCode == dk.ESCAPE){
- this.onCancel();
- }else{
- return;
- }
- }
- node = node.parentNode;
- }
-
- if(evt.charOrCode !== dk.TAB){
- dojo.stopEvent(evt);
-
- }else if(!dojo.isOpera){
- try{
- this._firstFocusItem.focus();
- }catch(e){ }
- }
- }
- }
- },
- show: function(){
-
-
-
-
- if(this.open){ return; }
- if(!this._started){
- this.startup();
- }
-
- if(!this._alreadyInitialized){
- this._setup();
- this._alreadyInitialized=true;
- }
- if(this._fadeOutDeferred){
-
-
- this._fadeOutDeferred.cancel();
- dijit._DialogLevelManager.hide(this);
- }
- this._modalconnects.push(dojo.connect(window, "onscroll", this, "layout"));
- this._modalconnects.push(dojo.connect(window, "onresize", this, function(){
-
-
- var viewport = dojo.window.getBox();
- if(!this._oldViewport ||
- viewport.h != this._oldViewport.h ||
- viewport.w != this._oldViewport.w){
- this.layout();
- this._oldViewport = viewport;
- }
- }));
- this._modalconnects.push(dojo.connect(this.domNode, "onkeypress", this, "_onKey"));
- dojo.style(this.domNode, {
- opacity:0,
- display:""
- });
- this._set("open", true);
- this._onShow();
- this._size();
- this._position();
-
- var fadeIn;
- this._fadeInDeferred = new dojo.Deferred(dojo.hitch(this, function(){
- fadeIn.stop();
- delete this._fadeInDeferred;
- }));
- fadeIn = dojo.fadeIn({
- node: this.domNode,
- duration: this.duration,
- beforeBegin: dojo.hitch(this, function(){
- dijit._DialogLevelManager.show(this, this.underlayAttrs);
- }),
- onEnd: dojo.hitch(this, function(){
- if(this.autofocus && dijit._DialogLevelManager.isTop(this)){
-
-
- this._getFocusItems(this.domNode);
- dijit.focus(this._firstFocusItem);
- }
- this._fadeInDeferred.callback(true);
- delete this._fadeInDeferred;
- })
- }).play();
-
- return this._fadeInDeferred;
- },
- hide: function(){
-
-
-
-
-
-
- if(!this._alreadyInitialized || !this.open){
- return;
- }
- if(this._fadeInDeferred){
- this._fadeInDeferred.cancel();
- }
-
- var fadeOut;
- this._fadeOutDeferred = new dojo.Deferred(dojo.hitch(this, function(){
- fadeOut.stop();
- delete this._fadeOutDeferred;
- }));
- fadeOut = dojo.fadeOut({
- node: this.domNode,
- duration: this.duration,
- onEnd: dojo.hitch(this, function(){
- this.domNode.style.display = "none";
- dijit._DialogLevelManager.hide(this);
- this.onHide();
- this._fadeOutDeferred.callback(true);
- delete this._fadeOutDeferred;
- })
- }).play();
- if(this._scrollConnected){
- this._scrollConnected = false;
- }
- dojo.forEach(this._modalconnects, dojo.disconnect);
- this._modalconnects = [];
- if(this._relativePosition){
- delete this._relativePosition;
- }
- this._set("open", false);
- return this._fadeOutDeferred;
- },
- layout: function(){
-
-
-
-
- if(this.domNode.style.display != "none"){
- if(dijit._underlay){
- dijit._underlay.layout();
- }
- this._position();
- }
- },
- destroy: function(){
- if(this._fadeInDeferred){
- this._fadeInDeferred.cancel();
- }
- if(this._fadeOutDeferred){
- this._fadeOutDeferred.cancel();
- }
- if(this._moveable){
- this._moveable.destroy();
- }
- dojo.forEach(this._modalconnects, dojo.disconnect);
- dijit._DialogLevelManager.hide(this);
- this.inherited(arguments);
- }
- }
- );
- dojo.declare(
- "dijit.Dialog",
- [dijit.layout.ContentPane, dijit._DialogBase],
- {}
- );
- dijit._DialogLevelManager = {
-
-
-
-
- show: function(/*dijit._Widget*/ dialog, /*Object*/ underlayAttrs){
-
-
-
-
-
-
-
-
-
- var ds = dijit._dialogStack;
-
- ds[ds.length-1].focus = dijit.getFocus(dialog);
-
- var underlay = dijit._underlay;
- if(!underlay || underlay._destroyed){
- underlay = dijit._underlay = new dijit.DialogUnderlay(underlayAttrs);
- }else{
- underlay.set(dialog.underlayAttrs);
- }
-
- var zIndex = ds[ds.length-1].dialog ? ds[ds.length-1].zIndex + 2 : 950;
- if(ds.length == 1){
- underlay.show();
- }
- dojo.style(dijit._underlay.domNode, 'zIndex', zIndex - 1);
-
- dojo.style(dialog.domNode, 'zIndex', zIndex);
- ds.push({dialog: dialog, underlayAttrs: underlayAttrs, zIndex: zIndex});
- },
- hide: function(/*dijit._Widget*/ dialog){
-
-
-
-
-
-
-
- var ds = dijit._dialogStack;
- if(ds[ds.length-1].dialog == dialog){
-
-
- ds.pop();
- var pd = ds[ds.length-1];
-
- if(ds.length == 1){
-
-
-
- if(!dijit._underlay._destroyed){
- dijit._underlay.hide();
- }
- }else{
-
- dojo.style(dijit._underlay.domNode, 'zIndex', pd.zIndex - 1);
- dijit._underlay.set(pd.underlayAttrs);
- }
-
- if(dialog.refocus){
-
-
-
-
- var focus = pd.focus;
- if(!focus || (pd.dialog && !dojo.isDescendant(focus.node, pd.dialog.domNode))){
- pd.dialog._getFocusItems(pd.dialog.domNode);
- focus = pd.dialog._firstFocusItem;
- }
-
- try{
- dijit.focus(focus);
- }catch(e){
-
- }
- }
- }else{
-
-
- var idx = dojo.indexOf(dojo.map(ds, function(elem){return elem.dialog}), dialog);
- if(idx != -1){
- ds.splice(idx, 1);
- }
- }
- },
- isTop: function(/*dijit._Widget*/ dialog){
-
-
- var ds = dijit._dialogStack;
- return ds[ds.length-1].dialog == dialog;
- }
- };
- dijit._dialogStack = [
- {dialog: null, focus: null, underlayAttrs: null}
- ];
- }
- if(!dojo._hasResource["dijit.dijit"]){
- dojo._hasResource["dijit.dijit"] = true;
- dojo.provide("dijit.dijit");
- }
- if(!dojo._hasResource["dijit._editor.html"]){
- dojo._hasResource["dijit._editor.html"] = true;
- dojo.provide("dijit._editor.html");
- var exports = dojo.getObject("_editor", true, dijit);
- var escape = exports.escapeXml=function(/*String*/str, /*Boolean?*/noSingleQuotes){
-
-
-
- str = str.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, """);
- if(!noSingleQuotes){
- str = str.replace(/'/gm, "'");
- }
- return str;
- };
- exports.getNodeHtml = function(/*DomNode*/ node){
-
-
- var output = [];
- exports.getNodeHtmlHelper(node, output);
- return output.join("");
- };
- exports.getNodeHtmlHelper = function(/*DomNode*/ node, /*String[]*/ output){
-
-
- switch(node.nodeType){
- case 1:
- var lName = node.nodeName.toLowerCase();
- if(!lName || lName.charAt(0) == "/"){
-
-
-
-
-
- return "";
- }
- output.push('<', lName);
-
-
- var attrarray = [];
- var attr;
- if(dojo.isIE < 9){
- var clone = /^input$|^img$/i.test(node.nodeName) ? node : node.cloneNode(false);
- var s = clone.outerHTML;
- s = s.substr(0, s.indexOf('>'))
- .replace(/(['"])[^"']*\1/g, '');
- var reg = /(\b\w+)\s?=/g;
- var m, key;
- while((m = reg.exec(s))){
- key = m[1];
- if(key.substr(0,3) != '_dj'){
- if(key == 'src' || key == 'href'){
- if(node.getAttribute('_djrealurl')){
- attrarray.push([key,node.getAttribute('_djrealurl')]);
- continue;
- }
- }
- var val, match;
- switch(key){
- case 'style':
- val = node.style.cssText.toLowerCase();
- break;
- case 'class':
- val = node.className;
- break;
- case 'width':
- if(lName === "img"){
-
-
- match=/width=(\S+)/i.exec(s);
- if(match){
- val = match[1];
- }
- break;
- }
- case 'height':
- if(lName === "img"){
-
-
- match=/height=(\S+)/i.exec(s);
- if(match){
- val = match[1];
- }
- break;
- }
- default:
- val = node.getAttribute(key);
- }
- if(val != null){
- attrarray.push([key, val.toString()]);
- }
- }
- }
- }else{
- var i = 0;
- while((attr = node.attributes[i++])){
-
-
- var n = attr.name;
- if(n.substr(0,3) != '_dj'
- ){
- var v = attr.value;
- if(n == 'src' || n == 'href'){
- if(node.getAttribute('_djrealurl')){
- v = node.getAttribute('_djrealurl');
- }
- }
- attrarray.push([n,v]);
- }
- }
- }
- attrarray.sort(function(a,b){
- return a[0] < b[0] ? -1 : (a[0] == b[0] ? 0 : 1);
- });
- var j = 0;
- while((attr = attrarray[j++])){
- output.push(' ', attr[0], '="',
- (dojo.isString(attr[1]) ? escape(attr[1], true) : attr[1]), '"');
- }
- switch(lName){
- case 'br':
- case 'hr':
- case 'img':
- case 'input':
- case 'base':
- case 'meta':
- case 'area':
- case 'basefont':
-
- output.push(' />');
- break;
- case 'script':
-
-
-
-
-
- output.push('>', node.innerHTML, '</', lName, '>');
- break;
- default:
- output.push('>');
- if(node.hasChildNodes()){
- exports.getChildrenHtmlHelper(node, output);
- }
- output.push('</', lName, '>');
- }
- break;
- case 4:
- case 3:
-
- output.push(escape(node.nodeValue, true));
- break;
- case 8:
-
- output.push('<!--', escape(node.nodeValue, true), '-->');
- break;
- default:
- output.push("<!-- Element not recognized - Type: ", node.nodeType, " Name: ", node.nodeName, "-->");
- }
- };
- exports.getChildrenHtml = function(/*DomNode*/ node){
-
-
- var output = [];
- exports.getChildrenHtmlHelper(node, output);
- return output.join("");
- };
- exports.getChildrenHtmlHelper = function(/*DomNode*/ dom, /*String[]*/ output){
-
-
- if(!dom){ return; }
- var nodes = dom["childNodes"] || dom;
-
-
-
-
- var checkParent = !dojo.isIE || nodes !== dom;
- var node, i = 0;
- while((node = nodes[i++])){
-
-
-
-
-
- if(!checkParent || node.parentNode == dom){
- exports.getNodeHtmlHelper(node, output);
- }
- }
- };
- }
- if(!dojo._hasResource["dijit._editor.RichText"]){
- dojo._hasResource["dijit._editor.RichText"] = true;
- dojo.provide("dijit._editor.RichText");
- if(!dojo.config["useXDomain"] || dojo.config["allowXdRichTextSave"]){
- if(dojo._postLoad){
- (function(){
- var savetextarea = dojo.doc.createElement('textarea');
- savetextarea.id = dijit._scopeName + "._editor.RichText.value";
- dojo.style(savetextarea, {
- display:'none',
- position:'absolute',
- top:"-100px",
- height:"3px",
- width:"3px"
- });
- dojo.body().appendChild(savetextarea);
- })();
- }else{
-
- try{
- dojo.doc.write('<textarea id="' + dijit._scopeName + '._editor.RichText.value" ' +
- 'style="display:none;position:absolute;top:-100px;left:-100px;height:3px;width:3px;overflow:hidden;"></textarea>');
- }catch(e){ }
- }
- }
- dojo.declare("dijit._editor.RichText", [dijit._Widget, dijit._CssStateMixin], {
- constructor: function(params){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.contentPreFilters = [];
-
-
-
-
-
- this.contentPostFilters = [];
-
-
-
-
- this.contentDomPreFilters = [];
-
-
-
-
- this.contentDomPostFilters = [];
-
-
- this.editingAreaStyleSheets = [];
-
-
- this.events = [].concat(this.events);
- this._keyHandlers = {};
- if(params && dojo.isString(params.value)){
- this.value = params.value;
- }
- this.onLoadDeferred = new dojo.Deferred();
- },
- baseClass: "dijitEditor",
-
-
- inheritWidth: false,
-
-
- focusOnLoad: false,
-
-
-
-
- name: "",
-
-
- styleSheets: "",
-
-
-
-
-
-
- height: "300px",
-
-
- minHeight: "1em",
-
- isClosed: true,
-
- isLoaded: false,
-
-
-
- _SEPARATOR: "@@**%%__RICHTEXTBOUNDRY__%%**@@",
-
-
- _NAME_CONTENT_SEP: "@@**%%:%%**@@",
-
-
-
-
- onLoadDeferred: null,
-
-
-
- isTabIndent: false,
-
-
-
- disableSpellCheck: false,
- postCreate: function(){
- if("textarea" == this.domNode.tagName.toLowerCase()){
- console.warn("RichText should not be used with the TEXTAREA tag. See dijit._editor.RichText docs.");
- }
-
-
- this.contentPreFilters = [dojo.hitch(this, "_preFixUrlAttributes")].concat(this.contentPreFilters);
- if(dojo.isMoz){
- this.contentPreFilters = [this._normalizeFontStyle].concat(this.contentPreFilters);
- this.contentPostFilters = [this._removeMozBogus].concat(this.contentPostFilters);
- }
- if(dojo.isWebKit){
-
-
- this.contentPreFilters = [this._removeWebkitBogus].concat(this.contentPreFilters);
- this.contentPostFilters = [this._removeWebkitBogus].concat(this.contentPostFilters);
- }
- if(dojo.isIE){
-
- this.contentPostFilters = [this._normalizeFontStyle].concat(this.contentPostFilters);
- }
- this.inherited(arguments);
- dojo.publish(dijit._scopeName + "._editor.RichText::init", [this]);
- this.open();
- this.setupDefaultShortcuts();
- },
- setupDefaultShortcuts: function(){
-
-
-
-
-
-
-
-
-
- var exec = dojo.hitch(this, function(cmd, arg){
- return function(){
- return !this.execCommand(cmd,arg);
- };
- });
- var ctrlKeyHandlers = {
- b: exec("bold"),
- i: exec("italic"),
- u: exec("underline"),
- a: exec("selectall"),
- s: function(){ this.save(true); },
- m: function(){ this.isTabIndent = !this.isTabIndent; },
- "1": exec("formatblock", "h1"),
- "2": exec("formatblock", "h2"),
- "3": exec("formatblock", "h3"),
- "4": exec("formatblock", "h4"),
- "\\": exec("insertunorderedlist")
- };
- if(!dojo.isIE){
- ctrlKeyHandlers.Z = exec("redo");
- }
- for(var key in ctrlKeyHandlers){
- this.addKeyHandler(key, true, false, ctrlKeyHandlers[key]);
- }
- },
-
-
- events: ["onKeyPress", "onKeyDown", "onKeyUp"],
-
-
-
-
-
-
- captureEvents: [],
- _editorCommandsLocalized: false,
- _localizeEditorCommands: function(){
-
-
-
-
-
-
- if(dijit._editor._editorCommandsLocalized){
-
- this._local2NativeFormatNames = dijit._editor._local2NativeFormatNames;
- this._native2LocalFormatNames = dijit._editor._native2LocalFormatNames;
- return;
- }
- dijit._editor._editorCommandsLocalized = true;
- dijit._editor._local2NativeFormatNames = {};
- dijit._editor._native2LocalFormatNames = {};
- this._local2NativeFormatNames = dijit._editor._local2NativeFormatNames;
- this._native2LocalFormatNames = dijit._editor._native2LocalFormatNames;
-
-
-
-
-
- var formats = ['div', 'p', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'address'];
- var localhtml = "", format, i=0;
- while((format=formats[i++])){
-
- if(format.charAt(1) !== 'l'){
- localhtml += "<"+format+"><span>content</span></"+format+"><br/>";
- }else{
- localhtml += "<"+format+"><li>content</li></"+format+"><br/>";
- }
- }
-
-
- var style = { position: "absolute", top: "0px", zIndex: 10, opacity: 0.01 };
- var div = dojo.create('div', {style: style, innerHTML: localhtml});
- dojo.body().appendChild(div);
-
-
- var inject = dojo.hitch(this, function(){
- var node = div.firstChild;
- while(node){
- try{
- dijit._editor.selection.selectElement(node.firstChild);
- var nativename = node.tagName.toLowerCase();
- this._local2NativeFormatNames[nativename] = document.queryCommandValue("formatblock");
- this._native2LocalFormatNames[this._local2NativeFormatNames[nativename]] = nativename;
- node = node.nextSibling.nextSibling;
-
- }catch(e) { }
- }
- div.parentNode.removeChild(div);
- div.innerHTML = "";
- });
- setTimeout(inject, 0);
- },
- open: function(/*DomNode?*/ element){
-
-
-
-
-
-
-
-
- if(!this.onLoadDeferred || this.onLoadDeferred.fired >= 0){
- this.onLoadDeferred = new dojo.Deferred();
- }
- if(!this.isClosed){ this.close(); }
- dojo.publish(dijit._scopeName + "._editor.RichText::open", [ this ]);
- if(arguments.length == 1 && element.nodeName){
- this.domNode = element;
- }
- var dn = this.domNode;
-
-
- var html;
- if(dojo.isString(this.value)){
-
-
-
- html = this.value;
- delete this.value;
- dn.innerHTML = "";
- }else if(dn.nodeName && dn.nodeName.toLowerCase() == "textarea"){
-
-
- var ta = (this.textarea = dn);
- this.name = ta.name;
- html = ta.value;
- dn = this.domNode = dojo.doc.createElement("div");
- dn.setAttribute('widgetId', this.id);
- ta.removeAttribute('widgetId');
- dn.cssText = ta.cssText;
- dn.className += " " + ta.className;
- dojo.place(dn, ta, "before");
- var tmpFunc = dojo.hitch(this, function(){
-
-
- dojo.style(ta, {
- display: "block",
- position: "absolute",
- top: "-1000px"
- });
- if(dojo.isIE){
- var s = ta.style;
- this.__overflow = s.overflow;
- s.overflow = "hidden";
- }
- });
- if(dojo.isIE){
- setTimeout(tmpFunc, 10);
- }else{
- tmpFunc();
- }
- if(ta.form){
- var resetValue = ta.value;
- this.reset = function(){
- var current = this.getValue();
- if(current != resetValue){
- this.replaceValue(resetValue);
- }
- };
- dojo.connect(ta.form, "onsubmit", this, function(){
-
-
- dojo.attr(ta, 'disabled', this.disabled);
- ta.value = this.getValue();
- });
- }
- }else{
- html = dijit._editor.getChildrenHtml(dn);
- dn.innerHTML = "";
- }
- var content = dojo.contentBox(dn);
- this._oldHeight = content.h;
- this._oldWidth = content.w;
- this.value = html;
-
-
- if(dn.nodeName && dn.nodeName == "LI"){
- dn.innerHTML = " <br>";
- }
-
-
- this.header = dn.ownerDocument.createElement("div");
- dn.appendChild(this.header);
- this.editingArea = dn.ownerDocument.createElement("div");
- dn.appendChild(this.editingArea);
- this.footer = dn.ownerDocument.createElement("div");
- dn.appendChild(this.footer);
- if(!this.name){
- this.name = this.id + "_AUTOGEN";
- }
-
-
-
- if(this.name !== "" && (!dojo.config["useXDomain"] || dojo.config["allowXdRichTextSave"])){
- var saveTextarea = dojo.byId(dijit._scopeName + "._editor.RichText.value");
- if(saveTextarea && saveTextarea.value !== ""){
- var datas = saveTextarea.value.split(this._SEPARATOR), i=0, dat;
- while((dat=datas[i++])){
- var data = dat.split(this._NAME_CONTENT_SEP);
- if(data[0] == this.name){
- html = data[1];
- datas = datas.splice(i, 1);
- saveTextarea.value = datas.join(this._SEPARATOR);
- break;
- }
- }
- }
- if(!dijit._editor._globalSaveHandler){
- dijit._editor._globalSaveHandler = {};
- dojo.addOnUnload(function() {
- var id;
- for(id in dijit._editor._globalSaveHandler){
- var f = dijit._editor._globalSaveHandler[id];
- if(dojo.isFunction(f)){
- f();
- }
- }
- });
- }
- dijit._editor._globalSaveHandler[this.id] = dojo.hitch(this, "_saveContent");
- }
- this.isClosed = false;
- var ifr = (this.editorObject = this.iframe = dojo.doc.createElement('iframe'));
- ifr.id = this.id+"_iframe";
- this._iframeSrc = this._getIframeDocTxt();
- ifr.style.border = "none";
- ifr.style.width = "100%";
- if(this._layoutMode){
-
-
- ifr.style.height = "100%";
- }else{
- if(dojo.isIE >= 7){
- if(this.height){
- ifr.style.height = this.height;
- }
- if(this.minHeight){
- ifr.style.minHeight = this.minHeight;
- }
- }else{
- ifr.style.height = this.height ? this.height : this.minHeight;
- }
- }
- ifr.frameBorder = 0;
- ifr._loadFunc = dojo.hitch( this, function(win){
- this.window = win;
- this.document = this.window.document;
- if(dojo.isIE){
- this._localizeEditorCommands();
- }
-
-
- this.onLoad(html);
- });
-
- var s = 'javascript:parent.' + dijit._scopeName + '.byId("'+this.id+'")._iframeSrc';
- ifr.setAttribute('src', s);
- this.editingArea.appendChild(ifr);
- if(dojo.isSafari <= 4){
- var src = ifr.getAttribute("src");
- if(!src || src.indexOf("javascript") == -1){
-
-
- setTimeout(function(){ifr.setAttribute('src', s);},0);
- }
- }
-
- if(dn.nodeName == "LI"){
- dn.lastChild.style.marginTop = "-1.2em";
- }
- dojo.addClass(this.domNode, this.baseClass);
- },
-
- _local2NativeFormatNames: {},
- _native2LocalFormatNames: {},
- _getIframeDocTxt: function(){
-
-
-
-
-
- var _cs = dojo.getComputedStyle(this.domNode);
-
- var html = "";
- var setBodyId = true;
- if(dojo.isIE || dojo.isWebKit || (!this.height && !dojo.isMoz)){
-
-
- html = "<div id='dijitEditorBody'></div>";
- setBodyId = false;
- }else if(dojo.isMoz){
-
-
- this._cursorToStart = true;
- html = " ";
- }
- var font = [ _cs.fontWeight, _cs.fontSize, _cs.fontFamily ].join(" ");
-
-
- var lineHeight = _cs.lineHeight;
- if(lineHeight.indexOf("px") >= 0){
- lineHeight = parseFloat(lineHeight)/parseFloat(_cs.fontSize);
-
- }else if(lineHeight.indexOf("em")>=0){
- lineHeight = parseFloat(lineHeight);
- }else{
-
-
-
- lineHeight = "normal";
- }
- var userStyle = "";
- var self = this;
- this.style.replace(/(^|;)\s*(line-|font-?)[^;]+/ig, function(match){
- match = match.replace(/^;/ig,"") + ';';
- var s = match.split(":")[0];
- if(s){
- s = dojo.trim(s);
- s = s.toLowerCase();
- var i;
- var sC = "";
- for(i = 0; i < s.length; i++){
- var c = s.charAt(i);
- switch(c){
- case "-":
- i++;
- c = s.charAt(i).toUpperCase();
- default:
- sC += c;
- }
- }
- dojo.style(self.domNode, sC, "");
- }
- userStyle += match + ';';
- });
-
- var label=dojo.query('label[for="'+this.id+'"]');
- return [
- this.isLeftToRight() ? "<html>\n<head>\n" : "<html dir='rtl'>\n<head>\n",
- (dojo.isMoz && label.length ? "<title>" + label[0].innerHTML + "</title>\n" : ""),
- "<meta http-equiv='Content-Type' content='text/html'>\n",
- "<style>\n",
- "\tbody,html {\n",
- "\t\tbackground:transparent;\n",
- "\t\tpadding: 1px 0 0 0;\n",
- "\t\tmargin: -1px 0 0 0;\n",
-
-
-
- ((dojo.isWebKit)?"\t\twidth: 100%;\n":""),
- ((dojo.isWebKit)?"\t\theight: 100%;\n":""),
- "\t}\n",
-
-
-
- "\tbody{\n",
- "\t\ttop:0px;\n",
- "\t\tleft:0px;\n",
- "\t\tright:0px;\n",
- "\t\tfont:", font, ";\n",
- ((this.height||dojo.isOpera) ? "" : "\t\tposition: fixed;\n"),
-
- "\t\tmin-height:", this.minHeight, ";\n",
- "\t\tline-height:", lineHeight,";\n",
- "\t}\n",
- "\tp{ margin: 1em 0; }\n",
-
-
-
-
- (!setBodyId && !this.height ? "\tbody,html {overflow-y: hidden;}\n" : ""),
- "\t#dijitEditorBody{overflow-x: auto; overflow-y:" + (this.height ? "auto;" : "hidden;") + " outline: 0px;}\n",
- "\tli > ul:-moz-first-node, li > ol:-moz-first-node{ padding-top: 1.2em; }\n",
-
- (!dojo.isIE ? "\tli{ min-height:1.2em; }\n" : ""),
- "</style>\n",
- this._applyEditingAreaStyleSheets(),"\n",
- "</head>\n<body ",
- (setBodyId?"id='dijitEditorBody' ":""),
- "onload='frameElement._loadFunc(window,document)' style='"+userStyle+"'>", html, "</body>\n</html>"
- ].join("");
- },
- _applyEditingAreaStyleSheets: function(){
-
-
-
-
- var files = [];
- if(this.styleSheets){
- files = this.styleSheets.split(';');
- this.styleSheets = '';
- }
-
- files = files.concat(this.editingAreaStyleSheets);
- this.editingAreaStyleSheets = [];
- var text='', i=0, url;
- while((url=files[i++])){
- var abstring = (new dojo._Url(dojo.global.location, url)).toString();
- this.editingAreaStyleSheets.push(abstring);
- text += '<link rel="stylesheet" type="text/css" href="'+abstring+'"/>';
- }
- return text;
- },
- addStyleSheet: function(/*dojo._Url*/ uri){
-
-
-
-
- var url=uri.toString();
-
- if(url.charAt(0) == '.' || (url.charAt(0) != '/' && !uri.host)){
- url = (new dojo._Url(dojo.global.location, url)).toString();
- }
- if(dojo.indexOf(this.editingAreaStyleSheets, url) > -1){
- return;
- }
- this.editingAreaStyleSheets.push(url);
- this.onLoadDeferred.addCallback(dojo.hitch(this, function(){
- if(this.document.createStyleSheet){
- this.document.createStyleSheet(url);
- }else{
- var head = this.document.getElementsByTagName("head")[0];
- var stylesheet = this.document.createElement("link");
- stylesheet.rel="stylesheet";
- stylesheet.type="text/css";
- stylesheet.href=url;
- head.appendChild(stylesheet);
- }
- }));
- },
- removeStyleSheet: function(/*dojo._Url*/ uri){
-
-
- var url=uri.toString();
-
- if(url.charAt(0) == '.' || (url.charAt(0) != '/' && !uri.host)){
- url = (new dojo._Url(dojo.global.location, url)).toString();
- }
- var index = dojo.indexOf(this.editingAreaStyleSheets, url);
- if(index == -1){
- return;
- }
- delete this.editingAreaStyleSheets[index];
- dojo.withGlobal(this.window,'query', dojo, ['link:[href="'+url+'"]']).orphan();
- },
-
-
- disabled: false,
- _mozSettingProps: {'styleWithCSS':false},
- _setDisabledAttr: function(/*Boolean*/ value){
- value = !!value;
- this._set("disabled", value);
- if(!this.isLoaded){ return; }
- if(dojo.isIE || dojo.isWebKit || dojo.isOpera){
- var preventIEfocus = dojo.isIE && (this.isLoaded || !this.focusOnLoad);
- if(preventIEfocus){ this.editNode.unselectable = "on"; }
- this.editNode.contentEditable = !value;
- if(preventIEfocus){
- var _this = this;
- setTimeout(function(){ _this.editNode.unselectable = "off"; }, 0);
- }
- }else{
- try{
- this.document.designMode=(value?'off':'on');
- }catch(e){ return; }
- if(!value && this._mozSettingProps){
- var ps = this._mozSettingProps;
- for(var n in ps){
- if(ps.hasOwnProperty(n)){
- try{
- this.document.execCommand(n,false,ps[n]);
- }catch(e2){}
- }
- }
- }
- }
- this._disabledOK = true;
- },
- onLoad: function(/*String*/ html){
-
-
-
-
-
-
-
- if(!this.window.__registeredWindow){
- this.window.__registeredWindow = true;
- this._iframeRegHandle = dijit.registerIframe(this.iframe);
- }
- if(!dojo.isIE && !dojo.isWebKit && (this.height || dojo.isMoz)){
- this.editNode=this.document.body;
- }else{
-
- this.editNode=this.document.body.firstChild;
- var _this = this;
- if(dojo.isIE){
- this.tabStop = dojo.create('div', { tabIndex: -1 }, this.editingArea);
- this.iframe.onfocus = function(){ _this.editNode.setActive(); };
- }
- }
- this.focusNode = this.editNode;
- var events = this.events.concat(this.captureEvents);
- var ap = this.iframe ? this.document : this.editNode;
- dojo.forEach(events, function(item){
- this.connect(ap, item.toLowerCase(), item);
- }, this);
- this.connect(ap, "onmouseup", "onClick");
- if(dojo.isIE){
- this.connect(this.document, "onmousedown", "_onIEMouseDown");
-
-
-
-
- this.editNode.style.zoom = 1.0;
- }else{
- this.connect(this.document, "onmousedown", function(){
-
-
-
-
- delete this._cursorToStart;
- });
- }
-
- if(dojo.isWebKit){
-
-
-
-
- this._webkitListener = this.connect(this.document, "onmouseup", "onDisplayChanged");
- this.connect(this.document, "onmousedown", function(e){
- var t = e.target;
- if(t && (t === this.document.body || t === this.document)){
-
-
- setTimeout(dojo.hitch(this, "placeCursorAtEnd"), 0);
- }
- });
- }
-
- if(dojo.isIE){
-
-
- try{
- this.document.execCommand('RespectVisibilityInDesign', true, null);
- }catch(e){}
- }
- this.isLoaded = true;
- this.set('disabled', this.disabled);
-
-
-
-
- var setContent = dojo.hitch(this, function(){
- this.setValue(html);
- if(this.onLoadDeferred){
- this.onLoadDeferred.callback(true);
- }
- this.onDisplayChanged();
- if(this.focusOnLoad){
-
-
- dojo.addOnLoad(dojo.hitch(this, function(){ setTimeout(dojo.hitch(this, "focus"), this.updateInterval); }));
- }
-
- this.value = this.getValue(true);
- });
- if(this.setValueDeferred){
- this.setValueDeferred.addCallback(setContent);
- }else{
- setContent();
- }
- },
- onKeyDown: function(/* Event */ e){
-
-
-
-
-
-
-
- if(e.keyCode === dojo.keys.TAB && this.isTabIndent ){
- dojo.stopEvent(e);
-
-
-
- if(this.queryCommandEnabled((e.shiftKey ? "outdent" : "indent"))){
- this.execCommand((e.shiftKey ? "outdent" : "indent"));
- }
- }
- if(dojo.isIE){
- if(e.keyCode == dojo.keys.TAB && !this.isTabIndent){
- if(e.shiftKey && !e.ctrlKey && !e.altKey){
-
- this.iframe.focus();
- }else if(!e.shiftKey && !e.ctrlKey && !e.altKey){
-
- this.tabStop.focus();
- }
- }else if(e.keyCode === dojo.keys.BACKSPACE && this.document.selection.type === "Control"){
-
-
-
- dojo.stopEvent(e);
- this.execCommand("delete");
- }else if((65 <= e.keyCode && e.keyCode <= 90) ||
- (e.keyCode>=37 && e.keyCode<=40)
- ){
- e.charCode = e.keyCode;
- this.onKeyPress(e);
- }
- }
- return true;
- },
- onKeyUp: function(e){
-
-
-
-
- return;
- },
- setDisabled: function(/*Boolean*/ disabled){
-
-
-
-
- dojo.deprecated('dijit.Editor::setDisabled is deprecated','use dijit.Editor::attr("disabled",boolean) instead', 2.0);
- this.set('disabled',disabled);
- },
- _setValueAttr: function(/*String*/ value){
-
-
- this.setValue(value);
- },
- _setDisableSpellCheckAttr: function(/*Boolean*/ disabled){
- if(this.document){
- dojo.attr(this.document.body, "spellcheck", !disabled);
- }else{
-
- this.onLoadDeferred.addCallback(dojo.hitch(this, function(){
- dojo.attr(this.document.body, "spellcheck", !disabled);
- }));
- }
- this._set("disableSpellCheck", disabled);
- },
- onKeyPress: function(e){
-
-
-
-
- var c = (e.keyChar && e.keyChar.toLowerCase()) || e.keyCode,
- handlers = this._keyHandlers[c],
- args = arguments;
- if(handlers && !e.altKey){
- dojo.some(handlers, function(h){
-
- if(!(h.shift ^ e.shiftKey) && !(h.ctrl ^ (e.ctrlKey||e.metaKey))){
- if(!h.handler.apply(this, args)){
- e.preventDefault();
- }
- return true;
- }
- }, this);
- }
-
- if(!this._onKeyHitch){
- this._onKeyHitch = dojo.hitch(this, "onKeyPressed");
- }
- setTimeout(this._onKeyHitch, 1);
- return true;
- },
- addKeyHandler: function(/*String*/ key, /*Boolean*/ ctrl, /*Boolean*/ shift, /*Function*/ handler){
-
-
-
-
-
-
- if(!dojo.isArray(this._keyHandlers[key])){
- this._keyHandlers[key] = [];
- }
-
- this._keyHandlers[key].push({
- shift: shift || false,
- ctrl: ctrl || false,
- handler: handler
- });
- },
- onKeyPressed: function(){
-
-
-
-
-
- this.onDisplayChanged();
- },
- onClick: function(/*Event*/ e){
-
-
-
-
-
- this.onDisplayChanged(e);
- },
- _onIEMouseDown: function(/*Event*/ e){
-
-
-
-
- if(!this._focused && !this.disabled){
- this.focus();
- }
- },
- _onBlur: function(e){
-
-
-
-
-
- this.inherited(arguments);
- var newValue = this.getValue(true);
- if(newValue != this.value){
- this.onChange(newValue);
- }
- this._set("value", newValue);
- },
- _onFocus: function(/*Event*/ e){
-
-
-
-
-
- if(!this.disabled){
- if(!this._disabledOK){
- this.set('disabled', false);
- }
- this.inherited(arguments);
- }
- },
-
- blur: function(){
-
-
-
-
- if(!dojo.isIE && this.window.document.documentElement && this.window.document.documentElement.focus){
- this.window.document.documentElement.focus();
- }else if(dojo.doc.body.focus){
- dojo.doc.body.focus();
- }
- },
- focus: function(){
-
-
- if(!this.isLoaded){
- this.focusOnLoad = true;
- return;
- }
- if(this._cursorToStart){
- delete this._cursorToStart;
- if(this.editNode.childNodes){
- this.placeCursorAtStart();
- return;
- }
- }
- if(!dojo.isIE){
- dijit.focus(this.iframe);
- }else if(this.editNode && this.editNode.focus){
-
-
-
-
- this.iframe.fireEvent('onfocus', document.createEventObject());
-
-
-
- }
- },
-
- updateInterval: 200,
- _updateTimer: null,
- onDisplayChanged: function(/*Event*/ e){
-
-
-
-
-
-
-
-
-
- if(this._updateTimer){
- clearTimeout(this._updateTimer);
- }
- if(!this._updateHandler){
- this._updateHandler = dojo.hitch(this,"onNormalizedDisplayChanged");
- }
- this._updateTimer = setTimeout(this._updateHandler, this.updateInterval);
-
-
-
- },
- onNormalizedDisplayChanged: function(){
-
-
-
-
-
-
-
- delete this._updateTimer;
- },
- onChange: function(newContent){
-
-
-
- },
- _normalizeCommand: function(/*String*/ cmd, /*Anything?*/argument){
-
-
-
-
-
-
- var command = cmd.toLowerCase();
- if(command == "formatblock"){
- if(dojo.isSafari && argument === undefined){ command = "heading"; }
- }else if(command == "hilitecolor" && !dojo.isMoz){
- command = "backcolor";
- }
- return command;
- },
- _qcaCache: {},
- queryCommandAvailable: function(/*String*/ command){
-
-
-
-
-
-
-
-
-
- var ca = this._qcaCache[command];
- if(ca !== undefined){ return ca; }
- return (this._qcaCache[command] = this._queryCommandAvailable(command));
- },
- _queryCommandAvailable: function(/*String*/ command){
-
-
-
-
- var ie = 1;
- var mozilla = 1 << 1;
- var webkit = 1 << 2;
- var opera = 1 << 3;
- function isSupportedBy(browsers){
- return {
- ie: Boolean(browsers & ie),
- mozilla: Boolean(browsers & mozilla),
- webkit: Boolean(browsers & webkit),
- opera: Boolean(browsers & opera)
- };
- }
- var supportedBy = null;
- switch(command.toLowerCase()){
- case "bold": case "italic": case "underline":
- case "subscript": case "superscript":
- case "fontname": case "fontsize":
- case "forecolor": case "hilitecolor":
- case "justifycenter": case "justifyfull": case "justifyleft":
- case "justifyright": case "delete": case "selectall": case "toggledir":
- supportedBy = isSupportedBy(mozilla | ie | webkit | opera);
- break;
- case "createlink": case "unlink": case "removeformat":
- case "inserthorizontalrule": case "insertimage":
- case "insertorderedlist": case "insertunorderedlist":
- case "indent": case "outdent": case "formatblock":
- case "inserthtml": case "undo": case "redo": case "strikethrough": case "tabindent":
- supportedBy = isSupportedBy(mozilla | ie | opera | webkit);
- break;
- case "blockdirltr": case "blockdirrtl":
- case "dirltr": case "dirrtl":
- case "inlinedirltr": case "inlinedirrtl":
- supportedBy = isSupportedBy(ie);
- break;
- case "cut": case "copy": case "paste":
- supportedBy = isSupportedBy( ie | mozilla | webkit);
- break;
- case "inserttable":
- supportedBy = isSupportedBy(mozilla | ie);
- break;
- case "insertcell": case "insertcol": case "insertrow":
- case "deletecells": case "deletecols": case "deleterows":
- case "mergecells": case "splitcell":
- supportedBy = isSupportedBy(ie | mozilla);
- break;
- default: return false;
- }
- return (dojo.isIE && supportedBy.ie) ||
- (dojo.isMoz && supportedBy.mozilla) ||
- (dojo.isWebKit && supportedBy.webkit) ||
- (dojo.isOpera && supportedBy.opera);
- },
- execCommand: function(/*String*/ command, argument){
-
-
-
-
-
-
-
-
- var returnValue;
-
-
-
- this.focus();
- command = this._normalizeCommand(command, argument);
- if(argument !== undefined){
- if(command == "heading"){
- throw new Error("unimplemented");
- }else if((command == "formatblock") && dojo.isIE){
- argument = '<'+argument+'>';
- }
- }
-
-
-
- var implFunc = "_" + command + "Impl";
- if(this[implFunc]){
- returnValue = this[implFunc](argument);
- }else{
- argument = arguments.length > 1 ? argument : null;
- if(argument || command!="createlink"){
- returnValue = this.document.execCommand(command, false, argument);
- }
- }
- this.onDisplayChanged();
- return returnValue;
- },
- queryCommandEnabled: function(/*String*/ command){
-
-
-
-
- if(this.disabled || !this._disabledOK){ return false; }
- command = this._normalizeCommand(command);
- if(dojo.isMoz || dojo.isWebKit){
- if(command == "unlink"){
-
- return this._sCall("hasAncestorElement", ["a"]);
- }else if(command == "inserttable"){
- return true;
- }
- }
-
- if(dojo.isWebKit){
- if(command == "cut" || command == "copy") {
-
- var sel = this.window.getSelection();
- if(sel){ sel = sel.toString(); }
- return !!sel;
- }else if(command == "paste"){
- return true;
- }
- }
- var elem = dojo.isIE ? this.document.selection.createRange() : this.document;
- try{
- return elem.queryCommandEnabled(command);
- }catch(e){
-
- return false;
- }
- },
- queryCommandState: function(command){
-
-
-
-
- if(this.disabled || !this._disabledOK){ return false; }
- command = this._normalizeCommand(command);
- try{
- return this.document.queryCommandState(command);
- }catch(e){
-
- return false;
- }
- },
- queryCommandValue: function(command){
-
-
-
-
-
- if(this.disabled || !this._disabledOK){ return false; }
- var r;
- command = this._normalizeCommand(command);
- if(dojo.isIE && command == "formatblock"){
- r = this._native2LocalFormatNames[this.document.queryCommandValue(command)];
- }else if(dojo.isMoz && command === "hilitecolor"){
- var oldValue;
- try{
- oldValue = this.document.queryCommandValue("styleWithCSS");
- }catch(e){
- oldValue = false;
- }
- this.document.execCommand("styleWithCSS", false, true);
- r = this.document.queryCommandValue(command);
- this.document.execCommand("styleWithCSS", false, oldValue);
- }else{
- r = this.document.queryCommandValue(command);
- }
- return r;
- },
-
- _sCall: function(name, args){
-
-
-
-
-
- return dojo.withGlobal(this.window, name, dijit._editor.selection, args);
- },
-
- placeCursorAtStart: function(){
-
-
-
-
- this.focus();
-
- var isvalid=false;
- if(dojo.isMoz){
-
- var first=this.editNode.firstChild;
- while(first){
- if(first.nodeType == 3){
- if(first.nodeValue.replace(/^\s+|\s+$/g, "").length>0){
- isvalid=true;
- this._sCall("selectElement", [ first ]);
- break;
- }
- }else if(first.nodeType == 1){
- isvalid=true;
- var tg = first.tagName ? first.tagName.toLowerCase() : "";
-
- if(/br|input|img|base|meta|area|basefont|hr|link/.test(tg)){
- this._sCall("selectElement", [ first ]);
- }else{
-
- this._sCall("selectElementChildren", [ first ]);
- }
- break;
- }
- first = first.nextSibling;
- }
- }else{
- isvalid=true;
- this._sCall("selectElementChildren", [ this.editNode ]);
- }
- if(isvalid){
- this._sCall("collapse", [ true ]);
- }
- },
- placeCursorAtEnd: function(){
-
-
-
-
- this.focus();
-
-
-
-
- var isvalid=false;
- if(dojo.isMoz){
- var last=this.editNode.lastChild;
- while(last){
- if(last.nodeType == 3){
- if(last.nodeValue.replace(/^\s+|\s+$/g, "").length>0){
- isvalid=true;
- this._sCall("selectElement", [ last ]);
- break;
- }
- }else if(last.nodeType == 1){
- isvalid=true;
- if(last.lastChild){
- this._sCall("selectElement", [ last.lastChild ]);
- }else{
- this._sCall("selectElement", [ last ]);
- }
- break;
- }
- last = last.previousSibling;
- }
- }else{
- isvalid=true;
- this._sCall("selectElementChildren", [ this.editNode ]);
- }
- if(isvalid){
- this._sCall("collapse", [ false ]);
- }
- },
- getValue: function(/*Boolean?*/ nonDestructive){
-
-
-
-
-
-
-
-
-
-
- if(this.textarea){
- if(this.isClosed || !this.isLoaded){
- return this.textarea.value;
- }
- }
- return this._postFilterContent(null, nonDestructive);
- },
- _getValueAttr: function(){
-
-
- return this.getValue(true);
- },
- setValue: function(/*String*/ html){
-
-
-
-
-
-
- if(!this.isLoaded){
-
- this.onLoadDeferred.addCallback(dojo.hitch(this, function(){
- this.setValue(html);
- }));
- return;
- }
- this._cursorToStart = true;
- if(this.textarea && (this.isClosed || !this.isLoaded)){
- this.textarea.value=html;
- }else{
- html = this._preFilterContent(html);
- var node = this.isClosed ? this.domNode : this.editNode;
- if(html && dojo.isMoz && html.toLowerCase() == "<p></p>"){
- html = "<p> </p>";
- }
-
- if(!html && dojo.isWebKit){
- html = " ";
- }
- node.innerHTML = html;
- this._preDomFilterContent(node);
- }
- this.onDisplayChanged();
- this._set("value", this.getValue(true));
- },
- replaceValue: function(/*String*/ html){
-
-
-
-
-
-
- if(this.isClosed){
- this.setValue(html);
- }else if(this.window && this.window.getSelection && !dojo.isMoz){
-
- this.setValue(html);
- }else if(this.window && this.window.getSelection){
- html = this._preFilterContent(html);
- this.execCommand("selectall");
- if(!html){
- this._cursorToStart = true;
- html = " ";
- }
- this.execCommand("inserthtml", html);
- this._preDomFilterContent(this.editNode);
- }else if(this.document && this.document.selection){
-
-
-
-
- this.setValue(html);
- }
- this._set("value", this.getValue(true));
- },
- _preFilterContent: function(/*String*/ html){
-
-
-
-
-
-
-
- var ec = html;
- dojo.forEach(this.contentPreFilters, function(ef){ if(ef){ ec = ef(ec); } });
- return ec;
- },
- _preDomFilterContent: function(/*DomNode*/ dom){
-
-
-
-
-
-
- dom = dom || this.editNode;
- dojo.forEach(this.contentDomPreFilters, function(ef){
- if(ef && dojo.isFunction(ef)){
- ef(dom);
- }
- }, this);
- },
- _postFilterContent: function(
- /*DomNode|DomNode[]|String?*/ dom,
- /*Boolean?*/ nonDestructive){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var ec;
- if(!dojo.isString(dom)){
- dom = dom || this.editNode;
- if(this.contentDomPostFilters.length){
- if(nonDestructive){
- dom = dojo.clone(dom);
- }
- dojo.forEach(this.contentDomPostFilters, function(ef){
- dom = ef(dom);
- });
- }
- ec = dijit._editor.getChildrenHtml(dom);
- }else{
- ec = dom;
- }
- if(!dojo.trim(ec.replace(/^\xA0\xA0*/, '').replace(/\xA0\xA0*$/, '')).length){
- ec = "";
- }
-
-
-
-
- dojo.forEach(this.contentPostFilters, function(ef){
- ec = ef(ec);
- });
- return ec;
- },
- _saveContent: function(/*Event*/ e){
-
-
-
-
- var saveTextarea = dojo.byId(dijit._scopeName + "._editor.RichText.value");
- if(saveTextarea.value){
- saveTextarea.value += this._SEPARATOR;
- }
- saveTextarea.value += this.name + this._NAME_CONTENT_SEP + this.getValue(true);
- },
- escapeXml: function(/*String*/ str, /*Boolean*/ noSingleQuotes){
-
-
-
-
-
- str = str.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, """);
- if(!noSingleQuotes){
- str = str.replace(/'/gm, "'");
- }
- return str;
- },
- getNodeHtml: function(/* DomNode */ node){
-
-
-
-
- dojo.deprecated('dijit.Editor::getNodeHtml is deprecated','use dijit._editor.getNodeHtml instead', 2);
- return dijit._editor.getNodeHtml(node);
- },
- getNodeChildrenHtml: function(/* DomNode */ dom){
-
-
-
-
- dojo.deprecated('dijit.Editor::getNodeChildrenHtml is deprecated','use dijit._editor.getChildrenHtml instead', 2);
- return dijit._editor.getChildrenHtml(dom);
- },
- close: function(/*Boolean?*/ save){
-
-
-
-
-
-
-
- if(this.isClosed){ return; }
- if(!arguments.length){ save = true; }
- if(save){
- this._set("value", this.getValue(true));
- }
-
-
- if(this.interval){ clearInterval(this.interval); }
- if(this._webkitListener){
-
- this.disconnect(this._webkitListener);
- delete this._webkitListener;
- }
-
- if(dojo.isIE){
- this.iframe.onfocus = null;
- }
- this.iframe._loadFunc = null;
- if(this._iframeRegHandle){
- dijit.unregisterIframe(this._iframeRegHandle);
- delete this._iframeRegHandle;
- }
- if(this.textarea){
- var s = this.textarea.style;
- s.position = "";
- s.left = s.top = "";
- if(dojo.isIE){
- s.overflow = this.__overflow;
- this.__overflow = null;
- }
- this.textarea.value = this.value;
- dojo.destroy(this.domNode);
- this.domNode = this.textarea;
- }else{
-
- this.domNode.innerHTML = this.value;
- }
- delete this.iframe;
- dojo.removeClass(this.domNode, this.baseClass);
- this.isClosed = true;
- this.isLoaded = false;
- delete this.editNode;
- delete this.focusNode;
- if(this.window && this.window._frameElement){
- this.window._frameElement = null;
- }
- this.window = null;
- this.document = null;
- this.editingArea = null;
- this.editorObject = null;
- },
- destroy: function(){
- if(!this.isClosed){ this.close(false); }
- this.inherited(arguments);
- if(dijit._editor._globalSaveHandler){
- delete dijit._editor._globalSaveHandler[this.id];
- }
- },
- _removeMozBogus: function(/* String */ html){
-
-
-
-
- return html.replace(/\stype="_moz"/gi, '').replace(/\s_moz_dirty=""/gi, '').replace(/_moz_resizing="(true|false)"/gi,'');
- },
- _removeWebkitBogus: function(/* String */ html){
-
-
-
-
- html = html.replace(/\sclass="webkit-block-placeholder"/gi, '');
- html = html.replace(/\sclass="apple-style-span"/gi, '');
-
-
- html = html.replace(/<meta charset=\"utf-8\" \/>/gi, '');
- return html;
- },
- _normalizeFontStyle: function(/* String */ html){
-
-
-
-
-
-
-
-
-
- return html.replace(/<(\/)?strong([ \>])/gi, '<$1b$2')
- .replace(/<(\/)?em([ \>])/gi, '<$1i$2' );
- },
- _preFixUrlAttributes: function(/* String */ html){
-
-
-
-
- return html.replace(/(?:(<a(?=\s).*?\shref=)("|')(.*?)\2)|(?:(<a\s.*?href=)([^"'][^ >]+))/gi,
- '$1$4$2$3$5$2 _djrealurl=$2$3$5$2')
- .replace(/(?:(<img(?=\s).*?\ssrc=)("|')(.*?)\2)|(?:(<img\s.*?src=)([^"'][^ >]+))/gi,
- '$1$4$2$3$5$2 _djrealurl=$2$3$5$2');
- },
-
- _inserthorizontalruleImpl: function(argument){
-
-
-
-
-
-
-
-
- if(dojo.isIE){
- return this._inserthtmlImpl("<hr>");
- }
- return this.document.execCommand("inserthorizontalrule", false, argument);
- },
- _unlinkImpl: function(argument){
-
-
-
-
-
-
- if((this.queryCommandEnabled("unlink")) && (dojo.isMoz || dojo.isWebKit)){
- var a = this._sCall("getAncestorElement", [ "a" ]);
- this._sCall("selectElement", [ a ]);
- return this.document.execCommand("unlink", false, null);
- }
- return this.document.execCommand("unlink", false, argument);
- },
- _hilitecolorImpl: function(argument){
-
-
-
-
-
-
- var returnValue;
- if(dojo.isMoz){
-
-
- this.document.execCommand("styleWithCSS", false, true);
- returnValue = this.document.execCommand("hilitecolor", false, argument);
- this.document.execCommand("styleWithCSS", false, false);
- }else{
- returnValue = this.document.execCommand("hilitecolor", false, argument);
- }
- return returnValue;
- },
- _backcolorImpl: function(argument){
-
-
-
-
-
-
- if(dojo.isIE){
-
-
-
- argument = argument ? argument : null;
- }
- return this.document.execCommand("backcolor", false, argument);
- },
- _forecolorImpl: function(argument){
-
-
-
-
-
-
- if(dojo.isIE){
-
-
-
- argument = argument? argument : null;
- }
- return this.document.execCommand("forecolor", false, argument);
- },
- _inserthtmlImpl: function(argument){
-
-
-
-
-
-
-
- argument = this._preFilterContent(argument);
- var rv = true;
- if(dojo.isIE){
- var insertRange = this.document.selection.createRange();
- if(this.document.selection.type.toUpperCase() == 'CONTROL'){
- var n=insertRange.item(0);
- while(insertRange.length){
- insertRange.remove(insertRange.item(0));
- }
- n.outerHTML=argument;
- }else{
- insertRange.pasteHTML(argument);
- }
- insertRange.select();
-
- }else if(dojo.isMoz && !argument.length){
-
-
- this._sCall("remove");
- }else{
- rv = this.document.execCommand("inserthtml", false, argument);
- }
- return rv;
- },
- _boldImpl: function(argument){
-
-
-
-
-
-
- if(dojo.isIE){
- this._adaptIESelection()
- }
- return this.document.execCommand("bold", false, argument);
- },
-
- _italicImpl: function(argument){
-
-
-
-
-
-
- if(dojo.isIE){
- this._adaptIESelection()
- }
- return this.document.execCommand("italic", false, argument);
- },
- _underlineImpl: function(argument){
-
-
-
-
-
-
- if(dojo.isIE){
- this._adaptIESelection()
- }
- return this.document.execCommand("underline", false, argument);
- },
-
- _strikethroughImpl: function(argument){
-
-
-
-
-
-
- if(dojo.isIE){
- this._adaptIESelection()
- }
- return this.document.execCommand("strikethrough", false, argument);
- },
- getHeaderHeight: function(){
-
-
- return this._getNodeChildrenHeight(this.header);
- },
- getFooterHeight: function(){
-
-
- return this._getNodeChildrenHeight(this.footer);
- },
- _getNodeChildrenHeight: function(node){
-
-
-
-
- var h = 0;
- if(node && node.childNodes){
-
-
- var i;
- for(i = 0; i < node.childNodes.length; i++){
- var size = dojo.position(node.childNodes[i]);
- h += size.h;
- }
- }
- return h;
- },
-
- _isNodeEmpty: function(node, startOffset){
-
-
-
-
-
-
- if(node.nodeType == 1){
- if(node.childNodes.length > 0){
- return this._isNodeEmpty(node.childNodes[0], startOffset);
- }
- return true;
- }else if(node.nodeType == 3){
- return (node.nodeValue.substring(startOffset) == "");
- }
- return false;
- },
-
- _removeStartingRangeFromRange: function(node, range){
-
-
-
-
-
-
-
-
-
- if(node.nextSibling){
- range.setStart(node.nextSibling,0);
- }else{
- var parent = node.parentNode;
- while(parent && parent.nextSibling == null){
-
- parent = parent.parentNode;
- }
- if(parent){
- range.setStart(parent.nextSibling,0);
- }
- }
- return range;
- },
-
- _adaptIESelection: function(){
-
-
-
-
-
-
-
-
- var selection = dijit.range.getSelection(this.window);
- if(selection && selection.rangeCount && !selection.isCollapsed){
- var range = selection.getRangeAt(0);
- var firstNode = range.startContainer;
- var startOffset = range.startOffset;
- while(firstNode.nodeType == 3 && startOffset >= firstNode.length && firstNode.nextSibling){
-
- startOffset = startOffset - firstNode.length;
- firstNode = firstNode.nextSibling;
- }
-
- var lastNode=null;
- while(this._isNodeEmpty(firstNode, startOffset) && firstNode != lastNode){
- lastNode =firstNode;
- range = this._removeStartingRangeFromRange(firstNode, range);
- firstNode = range.startContainer;
- startOffset = 0;
- }
- selection.removeAllRanges();
- selection.addRange(range);
- }
- }
- });
- }
- if(!dojo._hasResource["dijit.ToolbarSeparator"]){
- dojo._hasResource["dijit.ToolbarSeparator"] = true;
- dojo.provide("dijit.ToolbarSeparator");
- dojo.declare("dijit.ToolbarSeparator",
- [ dijit._Widget, dijit._Templated ],
- {
-
-
- templateString: '<div class="dijitToolbarSeparator dijitInline" role="presentation"></div>',
- buildRendering: function(){
- this.inherited(arguments);
- dojo.setSelectable(this.domNode, false);
- },
- isFocusable: function(){
-
-
-
-
- return false;
- }
- });
- }
- if(!dojo._hasResource["dijit.Toolbar"]){
- dojo._hasResource["dijit.Toolbar"] = true;
- dojo.provide("dijit.Toolbar");
- dojo.declare("dijit.Toolbar",
- [dijit._Widget, dijit._Templated, dijit._KeyNavContainer],
- {
-
-
- templateString:
- '<div class="dijit" role="toolbar" tabIndex="${tabIndex}" dojoAttachPoint="containerNode">' +
-
-
-
- '</div>',
- baseClass: "dijitToolbar",
- postCreate: function(){
- this.inherited(arguments);
- this.connectKeyNavHandlers(
- this.isLeftToRight() ? [dojo.keys.LEFT_ARROW] : [dojo.keys.RIGHT_ARROW],
- this.isLeftToRight() ? [dojo.keys.RIGHT_ARROW] : [dojo.keys.LEFT_ARROW]
- );
- },
- startup: function(){
- if(this._started){ return; }
- this.startupKeyNavChildren();
- this.inherited(arguments);
- }
- }
- );
- }
- if(!dojo._hasResource["dijit._editor.plugins.EnterKeyHandling"]){
- dojo._hasResource["dijit._editor.plugins.EnterKeyHandling"] = true;
- dojo.provide("dijit._editor.plugins.EnterKeyHandling");
- dojo.declare("dijit._editor.plugins.EnterKeyHandling", dijit._editor._Plugin, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- blockNodeForEnter: 'BR',
- constructor: function(args){
- if(args){
- if("blockNodeForEnter" in args){
- args.blockNodeForEnter = args.blockNodeForEnter.toUpperCase();
- }
- dojo.mixin(this,args);
- }
- },
- setEditor: function(editor){
-
- if(this.editor === editor) { return; }
- this.editor = editor;
- if(this.blockNodeForEnter == 'BR'){
-
-
-
- this.editor.customUndo = true;
- editor.onLoadDeferred.addCallback(dojo.hitch(this,function(d){
- this.connect(editor.document, "onkeypress", function(e){
- if(e.charOrCode == dojo.keys.ENTER){
-
-
- var ne = dojo.mixin({},e);
- ne.shiftKey = true;
- if(!this.handleEnterKey(ne)){
- dojo.stopEvent(e);
- }
- }
- });
- if(dojo.isIE >= 9){
- this.connect(editor.document.body, "onpaste", function(e){
- setTimeout(dojo.hitch(this, function(){
-
-
- var r = this.editor.document.selection.createRange();
- r.move('character',-1);
- r.select();
- r.move('character',1);
- r.select();
- }),0);
- });
- }
- return d;
- }));
- }else if(this.blockNodeForEnter){
-
-
- var h = dojo.hitch(this,this.handleEnterKey);
- editor.addKeyHandler(13, 0, 0, h);
- editor.addKeyHandler(13, 0, 1, h);
- this.connect(this.editor,'onKeyPressed','onKeyPressed');
- }
- },
- onKeyPressed: function(e){
-
-
-
-
- if(this._checkListLater){
- if(dojo.withGlobal(this.editor.window, 'isCollapsed', dijit)){
- var liparent=dojo.withGlobal(this.editor.window, 'getAncestorElement', dijit._editor.selection, ['LI']);
- if(!liparent){
-
- dijit._editor.RichText.prototype.execCommand.call(this.editor, 'formatblock',this.blockNodeForEnter);
-
- var block = dojo.withGlobal(this.editor.window, 'getAncestorElement', dijit._editor.selection, [this.blockNodeForEnter]);
- if(block){
- block.innerHTML=this.bogusHtmlContent;
- if(dojo.isIE <= 9){
-
- var r = this.editor.document.selection.createRange();
- r.move('character',-1);
- r.select();
- }
- }else{
- console.error('onKeyPressed: Cannot find the new block node');
- }
- }else{
- if(dojo.isMoz){
- if(liparent.parentNode.parentNode.nodeName == 'LI'){
- liparent=liparent.parentNode.parentNode;
- }
- }
- var fc=liparent.firstChild;
- if(fc && fc.nodeType == 1 && (fc.nodeName == 'UL' || fc.nodeName == 'OL')){
- liparent.insertBefore(fc.ownerDocument.createTextNode('\xA0'),fc);
- var newrange = dijit.range.create(this.editor.window);
- newrange.setStart(liparent.firstChild,0);
- var selection = dijit.range.getSelection(this.editor.window, true);
- selection.removeAllRanges();
- selection.addRange(newrange);
- }
- }
- }
- this._checkListLater = false;
- }
- if(this._pressedEnterInBlock){
-
- if(this._pressedEnterInBlock.previousSibling){
- this.removeTrailingBr(this._pressedEnterInBlock.previousSibling);
- }
- delete this._pressedEnterInBlock;
- }
- },
-
-
- bogusHtmlContent: ' ',
-
-
- blockNodes: /^(?:P|H1|H2|H3|H4|H5|H6|LI)$/,
- handleEnterKey: function(e){
-
-
-
-
-
-
-
- var selection, range, newrange, startNode, endNode, brNode, doc=this.editor.document,br,rs,txt;
- if(e.shiftKey){
- var parent = dojo.withGlobal(this.editor.window, "getParentElement", dijit._editor.selection);
- var header = dijit.range.getAncestor(parent,this.blockNodes);
- if(header){
- if(header.tagName == 'LI'){
- return true;
- }
- selection = dijit.range.getSelection(this.editor.window);
- range = selection.getRangeAt(0);
- if(!range.collapsed){
- range.deleteContents();
- selection = dijit.range.getSelection(this.editor.window);
- range = selection.getRangeAt(0);
- }
- if(dijit.range.atBeginningOfContainer(header, range.startContainer, range.startOffset)){
- br=doc.createElement('br');
- newrange = dijit.range.create(this.editor.window);
- header.insertBefore(br,header.firstChild);
- newrange.setStartBefore(br.nextSibling);
- selection.removeAllRanges();
- selection.addRange(newrange);
- }else if(dijit.range.atEndOfContainer(header, range.startContainer, range.startOffset)){
- newrange = dijit.range.create(this.editor.window);
- br=doc.createElement('br');
- header.appendChild(br);
- header.appendChild(doc.createTextNode('\xA0'));
- newrange.setStart(header.lastChild,0);
- selection.removeAllRanges();
- selection.addRange(newrange);
- }else{
- rs = range.startContainer;
- if(rs && rs.nodeType == 3){
-
- txt = rs.nodeValue;
- dojo.withGlobal(this.editor.window, function(){
- startNode = doc.createTextNode(txt.substring(0, range.startOffset));
- endNode = doc.createTextNode(txt.substring(range.startOffset));
- brNode = doc.createElement("br");
-
- if(endNode.nodeValue == "" && dojo.isWebKit){
- endNode = doc.createTextNode('\xA0')
- }
- dojo.place(startNode, rs, "after");
- dojo.place(brNode, startNode, "after");
- dojo.place(endNode, brNode, "after");
- dojo.destroy(rs);
- newrange = dijit.range.create(dojo.gobal);
- newrange.setStart(endNode,0);
- selection.removeAllRanges();
- selection.addRange(newrange);
- });
- return false;
- }
- return true;
- }
- }else{
- selection = dijit.range.getSelection(this.editor.window);
- if(selection.rangeCount){
- range = selection.getRangeAt(0);
- if(range && range.startContainer){
- if(!range.collapsed){
- range.deleteContents();
- selection = dijit.range.getSelection(this.editor.window);
- range = selection.getRangeAt(0);
- }
- rs = range.startContainer;
- if(rs && rs.nodeType == 3){
-
- dojo.withGlobal(this.editor.window, dojo.hitch(this, function(){
- var endEmpty = false;
-
- var offset = range.startOffset;
- if(rs.length < offset){
-
- ret = this._adjustNodeAndOffset(rs, offset);
- rs = ret.node;
- offset = ret.offset;
- }
- txt = rs.nodeValue;
-
- startNode = doc.createTextNode(txt.substring(0, offset));
- endNode = doc.createTextNode(txt.substring(offset));
- brNode = doc.createElement("br");
-
- if(!endNode.length){
- endNode = doc.createTextNode('\xA0');
- endEmpty = true;
- }
-
- if(startNode.length){
- dojo.place(startNode, rs, "after");
- }else{
- startNode = rs;
- }
- dojo.place(brNode, startNode, "after");
- dojo.place(endNode, brNode, "after");
- dojo.destroy(rs);
- newrange = dijit.range.create(dojo.gobal);
- newrange.setStart(endNode,0);
- newrange.setEnd(endNode, endNode.length);
- selection.removeAllRanges();
- selection.addRange(newrange);
- if(endEmpty && !dojo.isWebKit){
- dijit._editor.selection.remove();
- }else{
- dijit._editor.selection.collapse(true);
- }
- }));
- }else{
- var targetNode;
- if(range.startOffset >= 0){
- targetNode = rs.childNodes[range.startOffset];
- }
- dojo.withGlobal(this.editor.window, dojo.hitch(this, function(){
- var brNode = doc.createElement("br");
- var endNode = doc.createTextNode('\xA0');
- if(!targetNode){
- rs.appendChild(brNode);
- rs.appendChild(endNode);
- }else{
- dojo.place(brNode, targetNode, "before");
- dojo.place(endNode, brNode, "after");
- }
- newrange = dijit.range.create(dojo.global);
- newrange.setStart(endNode,0);
- newrange.setEnd(endNode, endNode.length);
- selection.removeAllRanges();
- selection.addRange(newrange);
- dijit._editor.selection.collapse(true);
- }));
- }
- }
- }else{
-
- dijit._editor.RichText.prototype.execCommand.call(this.editor, 'inserthtml', '<br>');
- }
- }
- return false;
- }
- var _letBrowserHandle = true;
-
- selection = dijit.range.getSelection(this.editor.window);
- range = selection.getRangeAt(0);
- if(!range.collapsed){
- range.deleteContents();
- selection = dijit.range.getSelection(this.editor.window);
- range = selection.getRangeAt(0);
- }
- var block = dijit.range.getBlockAncestor(range.endContainer, null, this.editor.editNode);
- var blockNode = block.blockNode;
-
- if((this._checkListLater = (blockNode && (blockNode.nodeName == 'LI' || blockNode.parentNode.nodeName == 'LI')))){
- if(dojo.isMoz){
-
- this._pressedEnterInBlock = blockNode;
- }
-
- if(/^(\s| |\xA0|<span\b[^>]*\bclass=['"]Apple-style-span['"][^>]*>(\s| |\xA0)<\/span>)?(<br>)?$/.test(blockNode.innerHTML)){
-
- blockNode.innerHTML = '';
- if(dojo.isWebKit){
- newrange = dijit.range.create(this.editor.window);
- newrange.setStart(blockNode, 0);
- selection.removeAllRanges();
- selection.addRange(newrange);
- }
- this._checkListLater = false;
- }
- return true;
- }
-
- if(!block.blockNode || block.blockNode===this.editor.editNode){
- try{
- dijit._editor.RichText.prototype.execCommand.call(this.editor, 'formatblock',this.blockNodeForEnter);
- }catch(e2){ }
-
-
- block = {blockNode:dojo.withGlobal(this.editor.window, "getAncestorElement", dijit._editor.selection, [this.blockNodeForEnter]),
- blockContainer: this.editor.editNode};
- if(block.blockNode){
- if(block.blockNode != this.editor.editNode &&
- (!(block.blockNode.textContent || block.blockNode.innerHTML).replace(/^\s+|\s+$/g, "").length)){
- this.removeTrailingBr(block.blockNode);
- return false;
- }
- }else{
- block.blockNode = this.editor.editNode;
- }
- selection = dijit.range.getSelection(this.editor.window);
- range = selection.getRangeAt(0);
- }
- var newblock = doc.createElement(this.blockNodeForEnter);
- newblock.innerHTML=this.bogusHtmlContent;
- this.removeTrailingBr(block.blockNode);
- var endOffset = range.endOffset;
- var node = range.endContainer;
- if(node.length < endOffset){
-
- var ret = this._adjustNodeAndOffset(node, endOffset);
- node = ret.node;
- endOffset = ret.offset;
- }
- if(dijit.range.atEndOfContainer(block.blockNode, node, endOffset)){
- if(block.blockNode === block.blockContainer){
- block.blockNode.appendChild(newblock);
- }else{
- dojo.place(newblock, block.blockNode, "after");
- }
- _letBrowserHandle = false;
-
- newrange = dijit.range.create(this.editor.window);
- newrange.setStart(newblock, 0);
- selection.removeAllRanges();
- selection.addRange(newrange);
- if(this.editor.height){
- dojo.window.scrollIntoView(newblock);
- }
- }else if(dijit.range.atBeginningOfContainer(block.blockNode,
- range.startContainer, range.startOffset)){
- dojo.place(newblock, block.blockNode, block.blockNode === block.blockContainer ? "first" : "before");
- if(newblock.nextSibling && this.editor.height){
-
- newrange = dijit.range.create(this.editor.window);
- newrange.setStart(newblock.nextSibling, 0);
- selection.removeAllRanges();
- selection.addRange(newrange);
-
- dojo.window.scrollIntoView(newblock.nextSibling);
- }
- _letBrowserHandle = false;
- }else{
- if(block.blockNode === block.blockContainer){
- block.blockNode.appendChild(newblock);
- }else{
- dojo.place(newblock, block.blockNode, "after");
- }
- _letBrowserHandle = false;
-
- if(block.blockNode.style){
- if(newblock.style){
- if(block.blockNode.style.cssText){
- newblock.style.cssText = block.blockNode.style.cssText;
- }
- }
- }
-
-
- rs = range.startContainer;
- var firstNodeMoved;
- if(rs && rs.nodeType == 3){
-
- var nodeToMove, tNode;
- endOffset = range.endOffset;
- if(rs.length < endOffset){
-
- ret = this._adjustNodeAndOffset(rs, endOffset);
- rs = ret.node;
- endOffset = ret.offset;
- }
-
- txt = rs.nodeValue;
- startNode = doc.createTextNode(txt.substring(0, endOffset));
- endNode = doc.createTextNode(txt.substring(endOffset, txt.length));
-
- dojo.place(startNode, rs, "before");
- dojo.place(endNode, rs, "after");
- dojo.destroy(rs);
-
-
-
- var parentC = startNode.parentNode;
- while(parentC !== block.blockNode){
- var tg = parentC.tagName;
- var newTg = doc.createElement(tg);
-
- if(parentC.style){
- if(newTg.style){
- if(parentC.style.cssText){
- newTg.style.cssText = parentC.style.cssText;
- }
- }
- }
-
- if(parentC.tagName === "FONT"){
- if(parentC.color){
- newTg.color = parentC.color;
- }
- if(parentC.face){
- newTg.face = parentC.face;
- }
- if(parentC.size){
- newTg.size = parentC.size;
- }
- }
-
- nodeToMove = endNode;
- while(nodeToMove){
- tNode = nodeToMove.nextSibling;
- newTg.appendChild(nodeToMove);
- nodeToMove = tNode;
- }
- dojo.place(newTg, parentC, "after");
- startNode = parentC;
- endNode = newTg;
- parentC = parentC.parentNode;
- }
-
-
- nodeToMove = endNode;
- if(nodeToMove.nodeType == 1 || (nodeToMove.nodeType == 3 && nodeToMove.nodeValue)){
-
-
- newblock.innerHTML = "";
- }
- firstNodeMoved = nodeToMove;
- while(nodeToMove){
- tNode = nodeToMove.nextSibling;
- newblock.appendChild(nodeToMove);
- nodeToMove = tNode;
- }
- }
-
-
- newrange = dijit.range.create(this.editor.window);
- var nodeForCursor;
- var innerMostFirstNodeMoved = firstNodeMoved;
- if(this.blockNodeForEnter !== 'BR'){
- while(innerMostFirstNodeMoved){
- nodeForCursor = innerMostFirstNodeMoved;
- tNode = innerMostFirstNodeMoved.firstChild;
- innerMostFirstNodeMoved = tNode;
- }
- if(nodeForCursor && nodeForCursor.parentNode){
- newblock = nodeForCursor.parentNode;
- newrange.setStart(newblock, 0);
- selection.removeAllRanges();
- selection.addRange(newrange);
- if(this.editor.height){
- dijit.scrollIntoView(newblock);
- }
- if(dojo.isMoz){
-
- this._pressedEnterInBlock = block.blockNode;
- }
- }else{
- _letBrowserHandle = true;
- }
- }else{
- newrange.setStart(newblock, 0);
- selection.removeAllRanges();
- selection.addRange(newrange);
- if(this.editor.height){
- dijit.scrollIntoView(newblock);
- }
- if(dojo.isMoz){
-
- this._pressedEnterInBlock = block.blockNode;
- }
- }
- }
- return _letBrowserHandle;
- },
- _adjustNodeAndOffset: function(/*DomNode*/node, /*Int*/offset){
-
-
-
-
-
-
-
-
-
- while(node.length < offset && node.nextSibling && node.nextSibling.nodeType==3){
-
- offset = offset - node.length;
- node = node.nextSibling;
- }
- var ret = {"node": node, "offset": offset};
- return ret;
- },
- removeTrailingBr: function(container){
-
-
-
-
- var para = /P|DIV|LI/i.test(container.tagName) ?
- container : dijit._editor.selection.getParentOfType(container,['P','DIV','LI']);
- if(!para){ return; }
- if(para.lastChild){
- if((para.childNodes.length > 1 && para.lastChild.nodeType == 3 && /^[\s\xAD]*$/.test(para.lastChild.nodeValue)) ||
- para.lastChild.tagName=='BR'){
- dojo.destroy(para.lastChild);
- }
- }
- if(!para.childNodes.length){
- para.innerHTML=this.bogusHtmlContent;
- }
- }
- });
- }
- if(!dojo._hasResource["dijit.Editor"]){
- dojo._hasResource["dijit.Editor"] = true;
- dojo.provide("dijit.Editor");
- dojo.declare(
- "dijit.Editor",
- dijit._editor.RichText,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- plugins: null,
-
-
- extraPlugins: null,
- constructor: function(){
-
-
-
-
- if(!dojo.isArray(this.plugins)){
- this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|",
- "insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull",
- "dijit._editor.plugins.EnterKeyHandling" ];
- }
- this._plugins=[];
- this._editInterval = this.editActionInterval * 1000;
-
-
-
-
-
-
-
-
-
-
- if(dojo.isIE){
- this.events.push("onBeforeDeactivate");
- this.events.push("onBeforeActivate");
- }
- },
- postMixInProperties: function() {
-
-
-
-
-
-
- this.setValueDeferred = new dojo.Deferred();
- this.inherited(arguments);
- },
-
- postCreate: function(){
-
- this._steps=this._steps.slice(0);
- this._undoedSteps=this._undoedSteps.slice(0);
- if(dojo.isArray(this.extraPlugins)){
- this.plugins=this.plugins.concat(this.extraPlugins);
- }
- this.inherited(arguments);
- this.commands = dojo.i18n.getLocalization("dijit._editor", "commands", this.lang);
- if(!this.toolbar){
-
- this.toolbar = new dijit.Toolbar({
- dir: this.dir,
- lang: this.lang
- });
- this.header.appendChild(this.toolbar.domNode);
- }
- dojo.forEach(this.plugins, this.addPlugin, this);
-
- this.setValueDeferred.callback(true);
- dojo.addClass(this.iframe.parentNode, "dijitEditorIFrameContainer");
- dojo.addClass(this.iframe, "dijitEditorIFrame");
- dojo.attr(this.iframe, "allowTransparency", true);
- if(dojo.isWebKit){
-
-
-
- dojo.style(this.domNode, "KhtmlUserSelect", "none");
- }
- this.toolbar.startup();
- this.onNormalizedDisplayChanged();
- },
- destroy: function(){
- dojo.forEach(this._plugins, function(p){
- if(p && p.destroy){
- p.destroy();
- }
- });
- this._plugins=[];
- this.toolbar.destroyRecursive();
- delete this.toolbar;
- this.inherited(arguments);
- },
- addPlugin: function(/*String||Object*/plugin, /*Integer?*/index){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var args=dojo.isString(plugin)?{name:plugin}:plugin;
- if(!args.setEditor){
- var o={"args":args,"plugin":null,"editor":this};
- dojo.publish(dijit._scopeName + ".Editor.getPlugin",[o]);
- if(!o.plugin){
- var pc = dojo.getObject(args.name);
- if(pc){
- o.plugin=new pc(args);
- }
- }
- if(!o.plugin){
- console.warn('Cannot find plugin',plugin);
- return;
- }
- plugin=o.plugin;
- }
- if(arguments.length > 1){
- this._plugins[index] = plugin;
- }else{
- this._plugins.push(plugin);
- }
- plugin.setEditor(this);
- if(dojo.isFunction(plugin.setToolbar)){
- plugin.setToolbar(this.toolbar);
- }
- },
-
- startup: function(){
-
-
-
-
-
-
- },
- resize: function(size){
-
-
- if(size){
-
-
- dijit.layout._LayoutWidget.prototype.resize.apply(this, arguments);
- }
-
- },
- layout: function(){
-
-
-
-
-
-
-
-
- var areaHeight = (this._contentBox.h -
- (this.getHeaderHeight() + this.getFooterHeight() +
- dojo._getPadBorderExtents(this.iframe.parentNode).h +
- dojo._getMarginExtents(this.iframe.parentNode).h));
- this.editingArea.style.height = areaHeight + "px";
- if(this.iframe){
- this.iframe.style.height="100%";
- }
- this._layoutMode = true;
- },
- _onIEMouseDown: function(/*Event*/ e){
-
-
-
-
- var outsideClientArea;
-
-
-
- var b = this.document.body;
- var clientWidth = b.clientWidth;
- var clientHeight = b.clientHeight;
- var clientLeft = b.clientLeft;
- var offsetWidth = b.offsetWidth;
- var offsetHeight = b.offsetHeight;
- var offsetLeft = b.offsetLeft;
-
- bodyDir = b.dir ? b.dir.toLowerCase() : "";
- if(bodyDir != "rtl"){
- if(clientWidth < offsetWidth && e.x > clientWidth && e.x < offsetWidth){
-
- outsideClientArea = true;
- }
- }else{
-
- if(e.x < clientLeft && e.x > offsetLeft){
-
- outsideClientArea = true;
- }
- }
- if(!outsideClientArea){
-
- if(clientHeight < offsetHeight && e.y > clientHeight && e.y < offsetHeight){
-
- outsideClientArea = true;
- }
- }
- if(!outsideClientArea){
- delete this._cursorToStart;
- delete this._savedSelection;
- if(e.target.tagName == "BODY"){
- setTimeout(dojo.hitch(this, "placeCursorAtEnd"), 0);
- }
- this.inherited(arguments);
- }
- },
- onBeforeActivate: function(e){
- this._restoreSelection();
- },
- onBeforeDeactivate: function(e){
-
-
-
-
- if(this.customUndo){
- this.endEditing(true);
- }
-
-
- if(e.target.tagName != "BODY"){
- this._saveSelection();
- }
-
- },
-
-
-
-
-
-
-
- customUndo: true,
-
-
-
-
-
-
-
- editActionInterval: 3,
- beginEditing: function(cmd){
-
-
-
-
-
- if(!this._inEditing){
- this._inEditing=true;
- this._beginEditing(cmd);
- }
- if(this.editActionInterval>0){
- if(this._editTimer){
- clearTimeout(this._editTimer);
- }
- this._editTimer = setTimeout(dojo.hitch(this, this.endEditing), this._editInterval);
- }
- },
-
- _steps:[],
- _undoedSteps:[],
- execCommand: function(cmd){
-
-
-
-
-
- if(this.customUndo && (cmd == 'undo' || cmd == 'redo')){
- return this[cmd]();
- }else{
- if(this.customUndo){
- this.endEditing();
- this._beginEditing();
- }
- var r;
- var isClipboard = /copy|cut|paste/.test(cmd);
- try{
- r = this.inherited(arguments);
- if(dojo.isWebKit && isClipboard && !r){
- throw { code: 1011 };
- }
- }catch(e){
-
- if(e.code == 1011 && isClipboard){
-
- var sub = dojo.string.substitute,
- accel = {cut:'X', copy:'C', paste:'V'};
- alert(sub(this.commands.systemShortcut,
- [this.commands[cmd], sub(this.commands[dojo.isMac ? 'appleKey' : 'ctrlKey'], [accel[cmd]])]));
- }
- r = false;
- }
- if(this.customUndo){
- this._endEditing();
- }
- return r;
- }
- },
- queryCommandEnabled: function(cmd){
-
-
-
-
-
- if(this.customUndo && (cmd == 'undo' || cmd == 'redo')){
- return cmd == 'undo' ? (this._steps.length > 1) : (this._undoedSteps.length > 0);
- }else{
- return this.inherited(arguments);
- }
- },
- _moveToBookmark: function(b){
-
-
-
-
- var bookmark = b.mark;
- var mark = b.mark;
- var col = b.isCollapsed;
- var r, sNode, eNode, sel;
- if(mark){
- if(dojo.isIE < 9){
- if(dojo.isArray(mark)){
-
- bookmark = [];
- dojo.forEach(mark,function(n){
- bookmark.push(dijit.range.getNode(n,this.editNode));
- },this);
- dojo.withGlobal(this.window,'moveToBookmark',dijit,[{mark: bookmark, isCollapsed: col}]);
- }else{
- if(mark.startContainer && mark.endContainer){
-
-
- sel = dijit.range.getSelection(this.window);
- if(sel && sel.removeAllRanges){
- sel.removeAllRanges();
- r = dijit.range.create(this.window);
- sNode = dijit.range.getNode(mark.startContainer,this.editNode);
- eNode = dijit.range.getNode(mark.endContainer,this.editNode);
- if(sNode && eNode){
-
-
-
-
- r.setStart(sNode,mark.startOffset);
- r.setEnd(eNode,mark.endOffset);
- sel.addRange(r);
- }
- }
- }
- }
- }else{
- sel = dijit.range.getSelection(this.window);
- if(sel && sel.removeAllRanges){
- sel.removeAllRanges();
- r = dijit.range.create(this.window);
- sNode = dijit.range.getNode(mark.startContainer,this.editNode);
- eNode = dijit.range.getNode(mark.endContainer,this.editNode);
- if(sNode && eNode){
-
-
-
- r.setStart(sNode,mark.startOffset);
- r.setEnd(eNode,mark.endOffset);
- sel.addRange(r);
- }
- }
- }
- }
- },
- _changeToStep: function(from, to){
-
-
-
-
- this.setValue(to.text);
- var b=to.bookmark;
- if(!b){ return; }
- this._moveToBookmark(b);
- },
- undo: function(){
-
-
-
-
-
- var ret = false;
- if(!this._undoRedoActive){
- this._undoRedoActive = true;
- this.endEditing(true);
- var s=this._steps.pop();
- if(s && this._steps.length>0){
- this.focus();
- this._changeToStep(s,this._steps[this._steps.length-1]);
- this._undoedSteps.push(s);
- this.onDisplayChanged();
- delete this._undoRedoActive;
- ret = true;
- }
- delete this._undoRedoActive;
- }
- return ret;
- },
- redo: function(){
-
-
-
-
-
- var ret = false;
- if(!this._undoRedoActive){
- this._undoRedoActive = true;
- this.endEditing(true);
- var s=this._undoedSteps.pop();
- if(s && this._steps.length>0){
- this.focus();
- this._changeToStep(this._steps[this._steps.length-1],s);
- this._steps.push(s);
- this.onDisplayChanged();
- ret = true;
- }
- delete this._undoRedoActive;
- }
- return ret;
- },
- endEditing: function(ignore_caret){
-
-
-
-
-
- if(this._editTimer){
- clearTimeout(this._editTimer);
- }
- if(this._inEditing){
- this._endEditing(ignore_caret);
- this._inEditing=false;
- }
- },
- _getBookmark: function(){
-
-
-
-
- var b=dojo.withGlobal(this.window,dijit.getBookmark);
- var tmp=[];
- if(b && b.mark){
- var mark = b.mark;
- if(dojo.isIE < 9){
-
- var sel = dijit.range.getSelection(this.window);
- if(!dojo.isArray(mark)){
- if(sel){
- var range;
- if(sel.rangeCount){
- range = sel.getRangeAt(0);
- }
- if(range){
- b.mark = range.cloneRange();
- }else{
- b.mark = dojo.withGlobal(this.window,dijit.getBookmark);
- }
- }
- }else{
-
- dojo.forEach(b.mark,function(n){
- tmp.push(dijit.range.getIndex(n,this.editNode).o);
- },this);
- b.mark = tmp;
- }
- }
- try{
- if(b.mark && b.mark.startContainer){
- tmp=dijit.range.getIndex(b.mark.startContainer,this.editNode).o;
- b.mark={startContainer:tmp,
- startOffset:b.mark.startOffset,
- endContainer:b.mark.endContainer===b.mark.startContainer?tmp:dijit.range.getIndex(b.mark.endContainer,this.editNode).o,
- endOffset:b.mark.endOffset};
- }
- }catch(e){
- b.mark = null;
- }
- }
- return b;
- },
- _beginEditing: function(cmd){
-
-
-
-
-
- if(this._steps.length === 0){
-
-
-
-
- this._steps.push({'text':dijit._editor.getChildrenHtml(this.editNode),'bookmark':this._getBookmark()});
- }
- },
- _endEditing: function(ignore_caret){
-
-
-
-
-
-
- var v = dijit._editor.getChildrenHtml(this.editNode);
- this._undoedSteps=[];
- this._steps.push({text: v, bookmark: this._getBookmark()});
- },
- onKeyDown: function(e){
-
-
-
-
-
-
- if(!dojo.isIE && !this.iframe && e.keyCode == dojo.keys.TAB && !this.tabIndent){
- this._saveSelection();
- }
- if(!this.customUndo){
- this.inherited(arguments);
- return;
- }
- var k = e.keyCode, ks = dojo.keys;
- if(e.ctrlKey && !e.altKey){
- if(k == 90 || k == 122){
- dojo.stopEvent(e);
- this.undo();
- return;
- }else if(k == 89 || k == 121){
- dojo.stopEvent(e);
- this.redo();
- return;
- }
- }
- this.inherited(arguments);
- switch(k){
- case ks.ENTER:
- case ks.BACKSPACE:
- case ks.DELETE:
- this.beginEditing();
- break;
- case 88:
- case 86:
- if(e.ctrlKey && !e.altKey && !e.metaKey){
- this.endEditing();
- if(e.keyCode == 88){
- this.beginEditing('cut');
-
- setTimeout(dojo.hitch(this, this.endEditing), 1);
- }else{
- this.beginEditing('paste');
-
- setTimeout(dojo.hitch(this, this.endEditing), 1);
- }
- break;
- }
-
- default:
- if(!e.ctrlKey && !e.altKey && !e.metaKey && (e.keyCode<dojo.keys.F1 || e.keyCode>dojo.keys.F15)){
- this.beginEditing();
- break;
- }
-
- case ks.ALT:
- this.endEditing();
- break;
- case ks.UP_ARROW:
- case ks.DOWN_ARROW:
- case ks.LEFT_ARROW:
- case ks.RIGHT_ARROW:
- case ks.HOME:
- case ks.END:
- case ks.PAGE_UP:
- case ks.PAGE_DOWN:
- this.endEditing(true);
- break;
-
- case ks.CTRL:
- case ks.SHIFT:
- case ks.TAB:
- break;
- }
- },
- _onBlur: function(){
-
-
-
-
-
- this.inherited(arguments);
- this.endEditing(true);
- },
- _saveSelection: function(){
-
-
-
-
- try{
- this._savedSelection=this._getBookmark();
- }catch(e){ }
- },
- _restoreSelection: function(){
-
-
-
-
-
- if(this._savedSelection){
-
- delete this._cursorToStart;
-
-
-
- if(dojo.withGlobal(this.window,'isCollapsed',dijit)){
- this._moveToBookmark(this._savedSelection);
- }
- delete this._savedSelection;
- }
- },
- onClick: function(){
-
-
-
-
- this.endEditing(true);
- this.inherited(arguments);
- },
- replaceValue: function(/*String*/ html){
-
-
-
-
- if(!this.customUndo){
- this.inherited(arguments);
- }else{
- if(this.isClosed){
- this.setValue(html);
- }else{
- this.beginEditing();
- if(!html){
- html = " "
- }
- this.setValue(html);
- this.endEditing();
- }
- }
- },
-
- _setDisabledAttr: function(/*Boolean*/ value){
- var disableFunc = dojo.hitch(this, function(){
- if((!this.disabled && value) || (!this._buttonEnabledPlugins && value)){
-
- dojo.forEach(this._plugins, function(p){
- p.set("disabled", true);
- });
- }else if(this.disabled && !value){
-
- dojo.forEach(this._plugins, function(p){
- p.set("disabled", false);
- });
- }
- });
- this.setValueDeferred.addCallback(disableFunc);
- this.inherited(arguments);
- },
-
- _setStateClass: function(){
- try{
- this.inherited(arguments);
-
-
-
-
- if(this.document && this.document.body){
- dojo.style(this.document.body, "color", dojo.style(this.iframe, "color"));
- }
- }catch(e){ }
- }
- }
- );
- dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
- if(o.plugin){ return; }
- var args = o.args, p;
- var _p = dijit._editor._Plugin;
- var name = args.name;
- switch(name){
- case "undo": case "redo": case "cut": case "copy": case "paste": case "insertOrderedList":
- case "insertUnorderedList": case "indent": case "outdent": case "justifyCenter":
- case "justifyFull": case "justifyLeft": case "justifyRight": case "delete":
- case "selectAll": case "removeFormat": case "unlink":
- case "insertHorizontalRule":
- p = new _p({ command: name });
- break;
- case "bold": case "italic": case "underline": case "strikethrough":
- case "subscript": case "superscript":
- p = new _p({ buttonClass: dijit.form.ToggleButton, command: name });
- break;
- case "|":
- p = new _p({ button: new dijit.ToolbarSeparator(), setEditor: function(editor) {this.editor = editor;} });
- }
- o.plugin=p;
- });
- }
- if(!dojo._hasResource["dijit.form.ToggleButton"]){
- dojo._hasResource["dijit.form.ToggleButton"] = true;
- dojo.provide("dijit.form.ToggleButton");
- }
- if(!dojo._hasResource["dijit.form.CheckBox"]){
- dojo._hasResource["dijit.form.CheckBox"] = true;
- dojo.provide("dijit.form.CheckBox");
- dojo.declare(
- "dijit.form.CheckBox",
- dijit.form.ToggleButton,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- templateString: dojo.cache("dijit.form", "templates/CheckBox.html", "<div class=\"dijit dijitReset dijitInline\" role=\"presentation\"\n\t><input\n\t \t${!nameAttrSetting} type=\"${type}\" ${checkedAttrSetting}\n\t\tclass=\"dijitReset dijitCheckBoxInput\"\n\t\tdojoAttachPoint=\"focusNode\"\n\t \tdojoAttachEvent=\"onclick:_onClick\"\n/></div>\n"),
- baseClass: "dijitCheckBox",
-
-
-
- type: "checkbox",
-
-
-
-
-
-
-
-
-
-
-
- value: "on",
-
-
-
-
- readOnly: false,
-
-
-
- attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
- readOnly: "focusNode"
- }),
- _setReadOnlyAttr: function(/*Boolean*/ value){
- this._set("readOnly", value);
- dojo.attr(this.focusNode, 'readOnly', value);
- dijit.setWaiState(this.focusNode, "readonly", value);
- },
- _setValueAttr: function(/*String|Boolean*/ newValue, /*Boolean*/ priorityChange){
-
-
-
-
-
-
-
-
-
-
-
- if(typeof newValue == "string"){
- this._set("value", newValue);
- dojo.attr(this.focusNode, 'value', newValue);
- newValue = true;
- }
- if(this._created){
- this.set('checked', newValue, priorityChange);
- }
- },
- _getValueAttr: function(){
-
-
-
-
-
- return (this.checked ? this.value : false);
- },
-
-
- _setLabelAttr: undefined,
- postMixInProperties: function(){
- if(this.value == ""){
- this.value = "on";
- }
-
-
-
- this.checkedAttrSetting = this.checked ? "checked" : "";
- this.inherited(arguments);
- },
- _fillContent: function(/*DomNode*/ source){
-
-
- },
- reset: function(){
-
- this._hasBeenBlurred = false;
- this.set('checked', this.params.checked || false);
-
- this._set("value", this.params.value || "on");
- dojo.attr(this.focusNode, 'value', this.value);
- },
- _onFocus: function(){
- if(this.id){
- dojo.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");
- }
- this.inherited(arguments);
- },
- _onBlur: function(){
- if(this.id){
- dojo.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");
- }
- this.inherited(arguments);
- },
- _onClick: function(/*Event*/ e){
-
-
-
- if(this.readOnly){
- dojo.stopEvent(e);
- return false;
- }
- return this.inherited(arguments);
- }
- }
- );
- dojo.declare(
- "dijit.form.RadioButton",
- dijit.form.CheckBox,
- {
-
-
- type: "radio",
- baseClass: "dijitRadio",
- _setCheckedAttr: function(/*Boolean*/ value){
-
- this.inherited(arguments);
- if(!this._created){ return; }
- if(value){
- var _this = this;
-
- dojo.query("INPUT[type=radio]", this.focusNode.form || dojo.doc).forEach(
- function(inputNode){
- if(inputNode.name == _this.name && inputNode != _this.focusNode && inputNode.form == _this.focusNode.form){
- var widget = dijit.getEnclosingWidget(inputNode);
- if(widget && widget.checked){
- widget.set('checked', false);
- }
- }
- }
- );
- }
- },
- _clicked: function(/*Event*/ e){
- if(!this.checked){
- this.set('checked', true);
- }
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.Calendar"]){
- dojo._hasResource["dijit.Calendar"] = true;
- dojo.provide("dijit.Calendar");
- dojo.declare(
- "dijit.Calendar",
- [dijit._Widget, dijit._Templated, dijit._CssStateMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- templateString: dojo.cache("dijit", "templates/Calendar.html", "<table cellspacing=\"0\" cellpadding=\"0\" class=\"dijitCalendarContainer\" role=\"grid\" dojoAttachEvent=\"onkeypress: _onKeyPress\" aria-labelledby=\"${id}_year\">\n\t<thead>\n\t\t<tr class=\"dijitReset dijitCalendarMonthContainer\" valign=\"top\">\n\t\t\t<th class='dijitReset dijitCalendarArrow' dojoAttachPoint=\"decrementMonth\">\n\t\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitCalendarIncrementControl dijitCalendarDecrease\" role=\"presentation\"/>\n\t\t\t\t<span dojoAttachPoint=\"decreaseArrowNode\" class=\"dijitA11ySideArrow\">-</span>\n\t\t\t</th>\n\t\t\t<th class='dijitReset' colspan=\"5\">\n\t\t\t\t<div dojoType=\"dijit.form.DropDownButton\" dojoAttachPoint=\"monthDropDownButton\"\n\t\t\t\t\tid=\"${id}_mddb\" tabIndex=\"-1\">\n\t\t\t\t</div>\n\t\t\t</th>\n\t\t\t<th class='dijitReset dijitCalendarArrow' dojoAttachPoint=\"incrementMonth\">\n\t\t\t\t<img src=\"${_blankGif}\" alt=\"\" class=\"dijitCalendarIncrementControl dijitCalendarIncrease\" role=\"presentation\"/>\n\t\t\t\t<span dojoAttachPoint=\"increaseArrowNode\" class=\"dijitA11ySideArrow\">+</span>\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th class=\"dijitReset dijitCalendarDayLabelTemplate\" role=\"columnheader\"><span class=\"dijitCalendarDayLabel\"></span></th>\n\t\t</tr>\n\t</thead>\n\t<tbody dojoAttachEvent=\"onclick: _onDayClick, onmouseover: _onDayMouseOver, onmouseout: _onDayMouseOut, onmousedown: _onDayMouseDown, onmouseup: _onDayMouseUp\" class=\"dijitReset dijitCalendarBodyContainer\">\n\t\t<tr class=\"dijitReset dijitCalendarWeekTemplate\" role=\"row\">\n\t\t\t<td class=\"dijitReset dijitCalendarDateTemplate\" role=\"gridcell\"><span class=\"dijitCalendarDateLabel\"></span></td>\n\t\t</tr>\n\t</tbody>\n\t<tfoot class=\"dijitReset dijitCalendarYearContainer\">\n\t\t<tr>\n\t\t\t<td class='dijitReset' valign=\"top\" colspan=\"7\">\n\t\t\t\t<h3 class=\"dijitCalendarYearLabel\">\n\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\" class=\"dijitInline dijitCalendarPreviousYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"currentYearLabelNode\" class=\"dijitInline dijitCalendarSelectedYear\" id=\"${id}_year\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" class=\"dijitInline dijitCalendarNextYear\"></span>\n\t\t\t\t</h3>\n\t\t\t</td>\n\t\t</tr>\n\t</tfoot>\n</table>\n"),
- widgetsInTemplate: true,
-
-
- value: new Date(""),
-
-
-
-
- datePackage: "dojo.date",
-
-
- dayWidth: "narrow",
-
-
- tabIndex: "0",
-
-
-
-
-
- currentFocus: new Date(),
- baseClass:"dijitCalendar",
-
- cssStateNodes: {
- "decrementMonth": "dijitCalendarArrow",
- "incrementMonth": "dijitCalendarArrow",
- "previousYearLabelNode": "dijitCalendarPreviousYear",
- "nextYearLabelNode": "dijitCalendarNextYear"
- },
- _isValidDate: function(/*Date*/ value){
-
-
-
-
-
- return value && !isNaN(value) && typeof value == "object" &&
- value.toString() != this.constructor.prototype.value.toString();
- },
- setValue: function(/*Date*/ value){
-
-
-
-
- dojo.deprecated("dijit.Calendar:setValue() is deprecated. Use set('value', ...) instead.", "", "2.0");
- this.set('value', value);
- },
- _getValueAttr: function(){
-
-
-
- var value = new this.dateClassObj(this.value);
- value.setHours(0, 0, 0, 0);
-
-
- if(value.getDate() < this.value.getDate()){
- value = this.dateFuncObj.add(value, "hour", 1);
- }
- return value;
- },
- _setValueAttr: function(/*Date|Number*/ value, /*Boolean*/ priorityChange){
-
-
-
-
-
-
-
-
-
- if(value){
-
-
- value = new this.dateClassObj(value);
- }
- if(this._isValidDate(value)){
- if(!this._isValidDate(this.value) || this.dateFuncObj.compare(value, this.value)){
- value.setHours(1, 0, 0, 0);
-
- if(!this.isDisabledDate(value, this.lang)){
- this._set("value", value);
-
-
-
-
- this.set("currentFocus", value);
-
- if(priorityChange || typeof priorityChange == "undefined"){
- this.onChange(this.get('value'));
- this.onValueSelected(this.get('value'));
- }
- }
- }
- }else{
-
- this._set("value", null);
- this.set("currentFocus", this.currentFocus);
- }
- },
- _setText: function(node, text){
-
-
-
-
-
- while(node.firstChild){
- node.removeChild(node.firstChild);
- }
- node.appendChild(dojo.doc.createTextNode(text));
- },
- _populateGrid: function(){
-
-
-
-
- var month = new this.dateClassObj(this.currentFocus);
- month.setDate(1);
- var firstDay = month.getDay(),
- daysInMonth = this.dateFuncObj.getDaysInMonth(month),
- daysInPreviousMonth = this.dateFuncObj.getDaysInMonth(this.dateFuncObj.add(month, "month", -1)),
- today = new this.dateClassObj(),
- dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
- if(dayOffset > firstDay){ dayOffset -= 7; }
-
- dojo.query(".dijitCalendarDateTemplate", this.domNode).forEach(function(template, i){
- i += dayOffset;
- var date = new this.dateClassObj(month),
- number, clazz = "dijitCalendar", adj = 0;
- if(i < firstDay){
- number = daysInPreviousMonth - firstDay + i + 1;
- adj = -1;
- clazz += "Previous";
- }else if(i >= (firstDay + daysInMonth)){
- number = i - firstDay - daysInMonth + 1;
- adj = 1;
- clazz += "Next";
- }else{
- number = i - firstDay + 1;
- clazz += "Current";
- }
- if(adj){
- date = this.dateFuncObj.add(date, "month", adj);
- }
- date.setDate(number);
- if(!this.dateFuncObj.compare(date, today, "date")){
- clazz = "dijitCalendarCurrentDate " + clazz;
- }
- if(this._isSelectedDate(date, this.lang)){
- clazz = "dijitCalendarSelectedDate " + clazz;
- }
- if(this.isDisabledDate(date, this.lang)){
- clazz = "dijitCalendarDisabledDate " + clazz;
- }
- var clazz2 = this.getClassForDate(date, this.lang);
- if(clazz2){
- clazz = clazz2 + " " + clazz;
- }
- template.className = clazz + "Month dijitCalendarDateTemplate";
- template.dijitDateValue = date.valueOf();
- dojo.attr(template, "dijitDateValue", date.valueOf());
- var label = dojo.query(".dijitCalendarDateLabel", template)[0],
- text = date.getDateLocalized ? date.getDateLocalized(this.lang) : date.getDate();
- this._setText(label, text);
- }, this);
-
-
- var monthNames = this.dateLocaleModule.getNames('months', 'wide', 'standAlone', this.lang, month);
- this.monthDropDownButton.dropDown.set("months", monthNames);
-
-
-
- this.monthDropDownButton.containerNode.innerHTML =
- (dojo.isIE == 6 ? "" : "<div class='dijitSpacer'>" + this.monthDropDownButton.dropDown.domNode.innerHTML + "</div>") +
- "<div class='dijitCalendarMonthLabel dijitCalendarCurrentMonthLabel'>" + monthNames[month.getMonth()] + "</div>";
-
- var y = month.getFullYear() - 1;
- var d = new this.dateClassObj();
- dojo.forEach(["previous", "current", "next"], function(name){
- d.setFullYear(y++);
- this._setText(this[name+"YearLabelNode"],
- this.dateLocaleModule.format(d, {selector:'year', locale:this.lang}));
- }, this);
- },
- goToToday: function(){
-
-
- this.set('value', new this.dateClassObj());
- },
- constructor: function(/*Object*/args){
- var dateClass = (args.datePackage && (args.datePackage != "dojo.date"))? args.datePackage + ".Date" : "Date";
- this.dateClassObj = dojo.getObject(dateClass, false);
- this.datePackage = args.datePackage || this.datePackage;
- this.dateFuncObj = dojo.getObject(this.datePackage, false);
- this.dateLocaleModule = dojo.getObject(this.datePackage + ".locale", false);
- },
- postMixInProperties: function(){
-
-
- if(isNaN(this.value)){ delete this.value; }
- this.inherited(arguments);
- },
- buildRendering: function(){
- this.inherited(arguments);
- dojo.setSelectable(this.domNode, false);
- var cloneClass = dojo.hitch(this, function(clazz, n){
- var template = dojo.query(clazz, this.domNode)[0];
- for(var i=0; i<n; i++){
- template.parentNode.appendChild(template.cloneNode(true));
- }
- });
-
- cloneClass(".dijitCalendarDayLabelTemplate", 6);
- cloneClass(".dijitCalendarDateTemplate", 6);
-
- cloneClass(".dijitCalendarWeekTemplate", 5);
-
- var dayNames = this.dateLocaleModule.getNames('days', this.dayWidth, 'standAlone', this.lang);
- var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
- dojo.query(".dijitCalendarDayLabel", this.domNode).forEach(function(label, i){
- this._setText(label, dayNames[(i + dayOffset) % 7]);
- }, this);
- var dateObj = new this.dateClassObj(this.currentFocus);
- this.monthDropDownButton.dropDown = new dijit.Calendar._MonthDropDown({
- id: this.id + "_mdd",
- onChange: dojo.hitch(this, "_onMonthSelect")
- });
- this.set('currentFocus', dateObj, false);
-
- var _this = this;
- var typematic = function(nodeProp, dateProp, adj){
- _this._connects.push(
- dijit.typematic.addMouseListener(_this[nodeProp], _this, function(count){
- if(count >= 0){ _this._adjustDisplay(dateProp, adj); }
- }, 0.8, 500)
- );
- };
- typematic("incrementMonth", "month", 1);
- typematic("decrementMonth", "month", -1);
- typematic("nextYearLabelNode", "year", 1);
- typematic("previousYearLabelNode", "year", -1);
- },
- _adjustDisplay: function(/*String*/ part, /*int*/ amount){
-
-
-
-
-
-
-
-
- this._setCurrentFocusAttr(this.dateFuncObj.add(this.currentFocus, part, amount));
- },
- _setCurrentFocusAttr: function(/*Date*/ date, /*Boolean*/ forceFocus){
-
-
-
-
-
-
-
- var oldFocus = this.currentFocus,
- oldCell = oldFocus ? dojo.query("[dijitDateValue=" + oldFocus.valueOf() + "]", this.domNode)[0] : null;
-
- date = new this.dateClassObj(date);
- date.setHours(1, 0, 0, 0);
- this._set("currentFocus", date);
-
- this._populateGrid();
-
- var newCell = dojo.query("[dijitDateValue=" + date.valueOf() + "]", this.domNode)[0];
- newCell.setAttribute("tabIndex", this.tabIndex);
- if(this._focused || forceFocus){
- newCell.focus();
- }
-
- if(oldCell && oldCell != newCell){
- if(dojo.isWebKit){
- oldCell.setAttribute("tabIndex", "-1");
- }else{
- oldCell.removeAttribute("tabIndex");
- }
- }
- },
- focus: function(){
-
-
- this._setCurrentFocusAttr(this.currentFocus, true);
- },
- _onMonthSelect: function(/*Number*/ newMonth){
-
-
-
-
-
-
- this.currentFocus = this.dateFuncObj.add(this.currentFocus, "month",
- newMonth - this.currentFocus.getMonth());
- this._populateGrid();
- },
- _onDayClick: function(/*Event*/ evt){
-
-
-
-
- dojo.stopEvent(evt);
- for(var node = evt.target; node && !node.dijitDateValue; node = node.parentNode);
- if(node && !dojo.hasClass(node, "dijitCalendarDisabledDate")){
- this.set('value', node.dijitDateValue);
- }
- },
- _onDayMouseOver: function(/*Event*/ evt){
-
-
-
-
-
-
- var node =
- dojo.hasClass(evt.target, "dijitCalendarDateLabel") ?
- evt.target.parentNode :
- evt.target;
- if(node && (node.dijitDateValue || node == this.previousYearLabelNode || node == this.nextYearLabelNode) ){
- dojo.addClass(node, "dijitCalendarHoveredDate");
- this._currentNode = node;
- }
- },
- _onDayMouseOut: function(/*Event*/ evt){
-
-
-
-
-
- if(!this._currentNode){ return; }
-
-
- if(evt.relatedTarget && evt.relatedTarget.parentNode == this._currentNode){ return; }
- var cls = "dijitCalendarHoveredDate";
- if(dojo.hasClass(this._currentNode, "dijitCalendarActiveDate")) {
- cls += " dijitCalendarActiveDate";
- }
- dojo.removeClass(this._currentNode, cls);
- this._currentNode = null;
- },
-
- _onDayMouseDown: function(/*Event*/ evt){
- var node = evt.target.parentNode;
- if(node && node.dijitDateValue){
- dojo.addClass(node, "dijitCalendarActiveDate");
- this._currentNode = node;
- }
- },
-
- _onDayMouseUp: function(/*Event*/ evt){
- var node = evt.target.parentNode;
- if(node && node.dijitDateValue){
- dojo.removeClass(node, "dijitCalendarActiveDate");
- }
- },
- handleKey: function(/*Event*/ evt){
-
-
-
-
-
-
-
-
-
-
-
- var dk = dojo.keys,
- increment = -1,
- interval,
- newValue = this.currentFocus;
- switch(evt.keyCode){
- case dk.RIGHT_ARROW:
- increment = 1;
-
- case dk.LEFT_ARROW:
- interval = "day";
- if(!this.isLeftToRight()){ increment *= -1; }
- break;
- case dk.DOWN_ARROW:
- increment = 1;
-
- case dk.UP_ARROW:
- interval = "week";
- break;
- case dk.PAGE_DOWN:
- increment = 1;
-
- case dk.PAGE_UP:
- interval = evt.ctrlKey || evt.altKey ? "year" : "month";
- break;
- case dk.END:
-
- newValue = this.dateFuncObj.add(newValue, "month", 1);
-
- interval = "day";
-
- case dk.HOME:
- newValue = new this.dateClassObj(newValue);
- newValue.setDate(1);
- break;
- case dk.ENTER:
- case dk.SPACE:
- this.set("value", this.currentFocus);
- break;
- default:
- return true;
- }
- if(interval){
- newValue = this.dateFuncObj.add(newValue, interval, increment);
- }
- this._setCurrentFocusAttr(newValue);
- return false;
- },
- _onKeyPress: function(/*Event*/ evt){
-
-
- if(!this.handleKey(evt)){
- dojo.stopEvent(evt);
- }
- },
- onValueSelected: function(/*Date*/ date){
-
-
-
-
-
-
-
- },
- onChange: function(/*Date*/ date){
-
-
- },
- _isSelectedDate: function(/*Date*/ dateObject, /*String?*/ locale){
-
-
-
-
-
- return this._isValidDate(this.value) && !this.dateFuncObj.compare(dateObject, this.value, "date")
- },
- isDisabledDate: function(/*Date*/ dateObject, /*String?*/ locale){
-
-
-
-
- },
- getClassForDate: function(/*Date*/ dateObject, /*String?*/ locale){
-
-
-
-
-
- }
- }
- );
- dojo.declare("dijit.Calendar._MonthDropDown", [dijit._Widget, dijit._Templated], {
-
-
-
-
-
- months: [],
- templateString: "<div class='dijitCalendarMonthMenu dijitMenu' " +
- "dojoAttachEvent='onclick:_onClick,onmouseover:_onMenuHover,onmouseout:_onMenuHover'></div>",
- _setMonthsAttr: function(/*String[]*/ months){
- this.domNode.innerHTML = dojo.map(months, function(month, idx){
- return month ? "<div class='dijitCalendarMonthLabel' month='" + idx +"'>" + month + "</div>" : "";
- }).join("");
- },
- _onClick: function(/*Event*/ evt){
- this.onChange(dojo.attr(evt.target, "month"));
- },
- onChange: function(/*Number*/ month){
-
-
- },
- _onMenuHover: function(evt){
- dojo.toggleClass(evt.target, "dijitCalendarMonthLabelHover", evt.type == "mouseover");
- }
- });
- }
- if(!dojo._hasResource["dijit.form._DateTimeTextBox"]){
- dojo._hasResource["dijit.form._DateTimeTextBox"] = true;
- dojo.provide("dijit.form._DateTimeTextBox");
- new Date("X");
- dojo.declare(
- "dijit.form._DateTimeTextBox",
- [ dijit.form.RangeBoundTextBox, dijit._HasDropDown ],
- {
-
-
- templateString: dojo.cache("dijit.form", "templates/DropDownBox.html", "<div class=\"dijit dijitReset dijitInlineTable dijitLeft\"\n\tid=\"widget_${id}\"\n\trole=\"combobox\"\n\t><div class='dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer'\n\t\tdojoAttachPoint=\"_buttonNode, _popupStateNode\" role=\"presentation\"\n\t\t><input class=\"dijitReset dijitInputField dijitArrowButtonInner\" value=\"▼ \" type=\"text\" tabIndex=\"-1\" readonly=\"readonly\" role=\"presentation\"\n\t\t\t${_buttonInputDisabled}\n\t/></div\n\t><div class='dijitReset dijitValidationContainer'\n\t\t><input class=\"dijitReset dijitInputField dijitValidationIcon dijitValidationInner\" value=\"Χ \" type=\"text\" tabIndex=\"-1\" readonly=\"readonly\" role=\"presentation\"\n\t/></div\n\t><div class=\"dijitReset dijitInputField dijitInputContainer\"\n\t\t><input class='dijitReset dijitInputInner' ${!nameAttrSetting} type=\"text\" autocomplete=\"off\"\n\t\t\tdojoAttachPoint=\"textbox,focusNode\" role=\"textbox\" aria-haspopup=\"true\"\n\t/></div\n></div>\n"),
-
-
- hasDownArrow: true,
-
-
- openOnClick: true,
-
-
-
- regExpGen: dojo.date.locale.regexp,
-
-
-
- datePackage: "dojo.date",
-
- compare: function(/*Date*/ val1, /*Date*/ val2){
- var isInvalid1 = this._isInvalidDate(val1);
- var isInvalid2 = this._isInvalidDate(val2);
- return isInvalid1 ? (isInvalid2 ? 0 : -1) : (isInvalid2 ? 1 : dojo.date.compare(val1, val2, this._selector));
- },
-
- forceWidth: true,
- format: function(/*Date*/ value, /*dojo.date.locale.__FormatOptions*/ constraints){
-
-
-
-
- if(!value){ return ''; }
- return this.dateLocaleModule.format(value, constraints);
- },
- "parse": function(/*String*/ value, /*dojo.date.locale.__FormatOptions*/ constraints){
-
-
-
-
- return this.dateLocaleModule.parse(value, constraints) || (this._isEmpty(value) ? null : undefined);
- },
-
- serialize: function(/*anything*/ val, /*Object?*/ options){
- if(val.toGregorian){
- val = val.toGregorian();
- }
- return dojo.date.stamp.toISOString(val, options);
- },
-
-
- dropDownDefaultValue : new Date(),
-
-
-
- value: new Date(""),
- _blankValue: null,
-
-
-
- popupClass: "",
-
-
-
-
- _selector: "",
- constructor: function(/*Object*/ args){
- var dateClass = args.datePackage ? args.datePackage + ".Date" : "Date";
- this.dateClassObj = dojo.getObject(dateClass, false);
- this.value = new this.dateClassObj("");
- this.datePackage = args.datePackage || this.datePackage;
- this.dateLocaleModule = dojo.getObject(this.datePackage + ".locale", false);
- this.regExpGen = this.dateLocaleModule.regexp;
- this._invalidDate = dijit.form._DateTimeTextBox.prototype.value.toString();
- },
- buildRendering: function(){
- this.inherited(arguments);
- if(!this.hasDownArrow){
- this._buttonNode.style.display = "none";
- }
-
-
-
- if(this.openOnClick || !this.hasDownArrow){
- this._buttonNode = this.domNode;
- this.baseClass += " dijitComboBoxOpenOnClick";
- }
- },
- _setConstraintsAttr: function(/*Object*/ constraints){
- constraints.selector = this._selector;
- constraints.fullYear = true;
- var fromISO = dojo.date.stamp.fromISOString;
- if(typeof constraints.min == "string"){ constraints.min = fromISO(constraints.min); }
- if(typeof constraints.max == "string"){ constraints.max = fromISO(constraints.max); }
- this.inherited(arguments);
- },
- _isInvalidDate: function(/*Date*/ value){
-
-
-
-
- return !value || isNaN(value) || typeof value != "object" || value.toString() == this._invalidDate;
- },
- _setValueAttr: function(/*Date|String*/ value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){
-
-
- if(value !== undefined){
- if(typeof value == "string"){
- value = dojo.date.stamp.fromISOString(value);
- }
- if(this._isInvalidDate(value)){
- value = null;
- }
- if(value instanceof Date && !(this.dateClassObj instanceof Date)){
- value = new this.dateClassObj(value);
- }
- }
- this.inherited(arguments);
- if(this.value instanceof Date){
- this.filterString = "";
- }
- if(this.dropDown){
- this.dropDown.set('value', value, false);
- }
- },
- _set: function(attr, value){
-
- if(attr == "value" && this.value instanceof Date && this.compare(value, this.value) == 0){
- return;
- }
- this.inherited(arguments);
- },
- _setDropDownDefaultValueAttr: function(/*Date*/ val){
- if(this._isInvalidDate(val)){
-
- val = new this.dateClassObj();
- }
- this.dropDownDefaultValue = val;
- },
- openDropDown: function(/*Function*/ callback){
-
- if(this.dropDown){
- this.dropDown.destroy();
- }
- var PopupProto = dojo.getObject(this.popupClass, false),
- textBox = this,
- value = this.get("value");
- this.dropDown = new PopupProto({
- onChange: function(value){
-
- textBox.set('value', value, true);
- },
- id: this.id + "_popup",
- dir: textBox.dir,
- lang: textBox.lang,
- value: value,
- currentFocus: !this._isInvalidDate(value) ? value : this.dropDownDefaultValue,
- constraints: textBox.constraints,
- filterString: textBox.filterString,
- datePackage: textBox.datePackage,
- isDisabledDate: function(/*Date*/ date){
-
-
- return !textBox.rangeCheck(date, textBox.constraints);
- }
- });
- this.inherited(arguments);
- },
- _getDisplayedValueAttr: function(){
- return this.textbox.value;
- },
- _setDisplayedValueAttr: function(/*String*/ value, /*Boolean?*/ priorityChange){
- this._setValueAttr(this.parse(value, this.constraints), priorityChange, value);
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.form.DateTextBox"]){
- dojo._hasResource["dijit.form.DateTextBox"] = true;
- dojo.provide("dijit.form.DateTextBox");
- dojo.declare(
- "dijit.form.DateTextBox",
- dijit.form._DateTimeTextBox,
- {
-
-
-
-
-
-
-
-
- baseClass: "dijitTextBox dijitComboBox dijitDateTextBox",
- popupClass: "dijit.Calendar",
- _selector: "date",
-
-
-
-
- value: new Date("")
- }
- );
- }
- if(!dojo._hasResource["dijit.form.Form"]){
- dojo._hasResource["dijit.form.Form"] = true;
- dojo.provide("dijit.form.Form");
- dojo.declare(
- "dijit.form.Form",
- [dijit._Widget, dijit._Templated, dijit.form._FormMixin, dijit.layout._ContentPaneResizeMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- name: "",
-
-
- action: "",
-
-
- method: "",
-
-
- encType: "",
-
-
- "accept-charset": "",
-
-
- accept: "",
-
-
- target: "",
- templateString: "<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- action: "",
- method: "",
- encType: "",
- "accept-charset": "",
- accept: "",
- target: ""
- }),
- postMixInProperties: function(){
-
-
- this.nameAttrSetting = this.name ? ("name='" + this.name + "'") : "";
- this.inherited(arguments);
- },
- execute: function(/*Object*/ formContents){
-
-
-
-
- },
- onExecute: function(){
-
-
-
-
- },
- _setEncTypeAttr: function(/*String*/ value){
- this.encType = value;
- dojo.attr(this.domNode, "encType", value);
- if(dojo.isIE){ this.domNode.encoding = value; }
- },
- postCreate: function(){
-
-
- if(dojo.isIE && this.srcNodeRef && this.srcNodeRef.attributes){
- var item = this.srcNodeRef.attributes.getNamedItem('encType');
- if(item && !item.specified && (typeof item.value == "string")){
- this.set('encType', item.value);
- }
- }
- this.inherited(arguments);
- },
- reset: function(/*Event?*/ e){
-
-
-
-
- var faux = {
- returnValue: true,
- preventDefault: function(){
- this.returnValue = false;
- },
- stopPropagation: function(){},
- currentTarget: e ? e.target : this.domNode,
- target: e ? e.target : this.domNode
- };
-
- if(!(this.onReset(faux) === false) && faux.returnValue){
- this.inherited(arguments, []);
- }
- },
- onReset: function(/*Event?*/ e){
-
-
-
-
-
-
-
- return true;
- },
- _onReset: function(e){
- this.reset(e);
- dojo.stopEvent(e);
- return false;
- },
- _onSubmit: function(e){
- var fp = dijit.form.Form.prototype;
-
- if(this.execute != fp.execute || this.onExecute != fp.onExecute){
- dojo.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.", "", "2.0");
- this.onExecute();
- this.execute(this.getValues());
- }
- if(this.onSubmit(e) === false){
- dojo.stopEvent(e);
- }
- },
- onSubmit: function(/*Event?*/ e){
-
-
-
-
-
-
-
-
-
-
- return this.isValid();
- },
- submit: function(){
-
-
- if(!(this.onSubmit() === false)){
- this.containerNode.submit();
- }
- }
- }
- );
- }
- if(!dojo._hasResource["dijit.form.NumberTextBox"]){
- dojo._hasResource["dijit.form.NumberTextBox"] = true;
- dojo.provide("dijit.form.NumberTextBox");
- dojo.declare("dijit.form.NumberTextBoxMixin",
- null,
- {
-
-
-
-
-
-
- regExpGen: dojo.number.regexp,
-
-
-
-
-
-
-
-
-
- value: NaN,
-
-
-
-
- editOptions: { pattern: '#.######' },
-
- _formatter: dojo.number.format,
- _setConstraintsAttr: function(/*Object*/ constraints){
- var places = typeof constraints.places == "number"? constraints.places : 0;
- if(places){ places++; }
- if(typeof constraints.max != "number"){
- constraints.max = 9 * Math.pow(10, 15-places);
- }
- if(typeof constraints.min != "number"){
- constraints.min = -9 * Math.pow(10, 15-places);
- }
- this.inherited(arguments, [ constraints ]);
- if(this.focusNode && this.focusNode.value && !isNaN(this.value)){
- this.set('value', this.value);
- }
- },
- _onFocus: function(){
- if(this.disabled){ return; }
- var val = this.get('value');
- if(typeof val == "number" && !isNaN(val)){
- var formattedValue = this.format(val, this.constraints);
- if(formattedValue !== undefined){
- this.textbox.value = formattedValue;
- }
- }
- this.inherited(arguments);
- },
- format: function(/*Number*/ value, /*dojo.number.__FormatOptions*/ constraints){
-
-
-
-
- var formattedValue = String(value);
- if(typeof value != "number"){ return formattedValue; }
- if(isNaN(value)){ return ""; }
-
- if(!("rangeCheck" in this && this.rangeCheck(value, constraints)) && constraints.exponent !== false && /\de[-+]?\d/i.test(formattedValue)){
- return formattedValue;
- }
- if(this.editOptions && this._focused){
- constraints = dojo.mixin({}, constraints, this.editOptions);
- }
- return this._formatter(value, constraints);
- },
-
- _parser: dojo.number.parse,
- parse: function(/*String*/ value, /*dojo.number.__FormatOptions*/ constraints){
-
-
-
-
- var v = this._parser(value, dojo.mixin({}, constraints, (this.editOptions && this._focused) ? this.editOptions : {}));
- if(this.editOptions && this._focused && isNaN(v)){
- v = this._parser(value, constraints);
- }
- return v;
- },
- _getDisplayedValueAttr: function(){
- var v = this.inherited(arguments);
- return isNaN(v) ? this.textbox.value : v;
- },
- filter: function(/*Number*/ value){
-
-
-
-
-
-
- return (value === null || value === '' || value === undefined) ? NaN : this.inherited(arguments);
- },
- serialize: function(/*Number*/ value, /*Object?*/ options){
-
-
-
-
- return (typeof value != "number" || isNaN(value)) ? '' : this.inherited(arguments);
- },
- _setBlurValue: function(){
- var val = dojo.hitch(dojo.mixin({}, this, { _focused: true }), "get")('value');
- this._setValueAttr(val, true);
- },
- _setValueAttr: function(/*Number*/ value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){
-
-
- if(value !== undefined && formattedValue === undefined){
- formattedValue = String(value);
- if(typeof value == "number"){
- if(isNaN(value)){ formattedValue = '' }
-
- else if(("rangeCheck" in this && this.rangeCheck(value, this.constraints)) || this.constraints.exponent === false || !/\de[-+]?\d/i.test(formattedValue)){
- formattedValue = undefined;
- }
- }else if(!value){
- formattedValue = '';
- value = NaN;
- }else{
- value = undefined;
- }
- }
- this.inherited(arguments, [value, priorityChange, formattedValue]);
- },
- _getValueAttr: function(){
-
-
-
- var v = this.inherited(arguments);
-
-
-
-
- if(isNaN(v) && this.textbox.value !== ''){
- if(this.constraints.exponent !== false && /\de[-+]?\d/i.test(this.textbox.value) && (new RegExp("^"+dojo.number._realNumberRegexp(dojo.mixin({}, this.constraints))+"$").test(this.textbox.value))){
- var n = Number(this.textbox.value);
- return isNaN(n) ? undefined : n;
- }else{
- return undefined;
- }
- }else{
- return v;
- }
- },
- isValid: function(/*Boolean*/ isFocused){
-
-
- if(!this._focused || this._isEmpty(this.textbox.value)){
- return this.inherited(arguments);
- }else{
- var v = this.get('value');
- if(!isNaN(v) && this.rangeCheck(v, this.constraints)){
- if(this.constraints.exponent !== false && /\de[-+]?\d/i.test(this.textbox.value)){
- return true;
- }else{
- return this.inherited(arguments);
- }
- }else{
- return false;
- }
- }
- }
- }
- );
- dojo.declare("dijit.form.NumberTextBox",
- [dijit.form.RangeBoundTextBox,dijit.form.NumberTextBoxMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- baseClass: "dijitTextBox dijitNumberTextBox"
- }
- );
- }
- if(!dojo._hasResource["dijit.form.RadioButton"]){
- dojo._hasResource["dijit.form.RadioButton"] = true;
- dojo.provide("dijit.form.RadioButton");
- }
- if(!dojo._hasResource["dijit.form.HorizontalSlider"]){
- dojo._hasResource["dijit.form.HorizontalSlider"] = true;
- dojo.provide("dijit.form.HorizontalSlider");
- dojo.declare(
- "dijit.form.HorizontalSlider",
- [dijit.form._FormValueWidget, dijit._Container],
- {
-
-
- templateString: dojo.cache("dijit.form", "templates/HorizontalSlider.html", "<table class=\"dijit dijitReset dijitSlider dijitSliderH\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\" dojoAttachEvent=\"onkeypress:_onKeyPress,onkeyup:_onKeyUp\"\n\trole=\"presentation\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"topDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationT dijitSliderDecorationH\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\"\n\t\t\t><div class=\"dijitSliderDecrementIconH\" style=\"display:none\" dojoAttachPoint=\"decrementButton\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderLeftBumper\" dojoAttachEvent=\"onmousedown:_onClkDecBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" ${!nameAttrSetting}\n\t\t\t/><div class=\"dijitReset dijitSliderBarContainerH\" role=\"presentation\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"progressBar\" class=\"dijitSliderBar dijitSliderBarH dijitSliderProgressBar dijitSliderProgressBarH\" dojoAttachEvent=\"onmousedown:_onBarClick\"\n\t\t\t\t\t><div class=\"dijitSliderMoveable dijitSliderMoveableH\"\n\t\t\t\t\t\t><div dojoAttachPoint=\"sliderHandle,focusNode\" class=\"dijitSliderImageHandle dijitSliderImageHandleH\" dojoAttachEvent=\"onmousedown:_onHandleClick\" role=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"></div\n\t\t\t\t\t></div\n\t\t\t\t></div\n\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarH dijitSliderRemainingBar dijitSliderRemainingBarH\" dojoAttachEvent=\"onmousedown:_onBarClick\"></div\n\t\t\t></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderRightBumper\" dojoAttachEvent=\"onmousedown:_onClkIncBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\"\n\t\t\t><div class=\"dijitSliderIncrementIconH\" style=\"display:none\" dojoAttachPoint=\"incrementButton\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"containerNode,bottomDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationB dijitSliderDecorationH\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n></table>\n"),
-
- value: 0,
-
-
- showButtons: true,
-
-
- minimum: 0,
-
-
- maximum: 100,
-
-
-
-
-
-
-
-
-
-
-
-
- discreteValues: Infinity,
-
-
-
-
- pageIncrement: 2,
-
-
- clickSelect: true,
-
-
-
- slideDuration: dijit.defaultDuration,
-
- widgetsInTemplate: true,
- attributeMap: dojo.delegate(dijit.form._FormWidget.prototype.attributeMap, {
- id: ""
- }),
- baseClass: "dijitSlider",
-
- cssStateNodes: {
- incrementButton: "dijitSliderIncrementButton",
- decrementButton: "dijitSliderDecrementButton",
- focusNode: "dijitSliderThumb"
- },
- _mousePixelCoord: "pageX",
- _pixelCount: "w",
- _startingPixelCoord: "x",
- _startingPixelCount: "l",
- _handleOffsetCoord: "left",
- _progressPixelSize: "width",
- _onKeyUp: function(/*Event*/ e){
- if(this.disabled || this.readOnly || e.altKey || e.ctrlKey || e.metaKey){ return; }
- this._setValueAttr(this.value, true);
- },
- _onKeyPress: function(/*Event*/ e){
- if(this.disabled || this.readOnly || e.altKey || e.ctrlKey || e.metaKey){ return; }
- switch(e.charOrCode){
- case dojo.keys.HOME:
- this._setValueAttr(this.minimum, false);
- break;
- case dojo.keys.END:
- this._setValueAttr(this.maximum, false);
- break;
-
-
- case ((this._descending || this.isLeftToRight()) ? dojo.keys.RIGHT_ARROW : dojo.keys.LEFT_ARROW):
- case (this._descending === false ? dojo.keys.DOWN_ARROW : dojo.keys.UP_ARROW):
- case (this._descending === false ? dojo.keys.PAGE_DOWN : dojo.keys.PAGE_UP):
- this.increment(e);
- break;
- case ((this._descending || this.isLeftToRight()) ? dojo.keys.LEFT_ARROW : dojo.keys.RIGHT_ARROW):
- case (this._descending === false ? dojo.keys.UP_ARROW : dojo.keys.DOWN_ARROW):
- case (this._descending === false ? dojo.keys.PAGE_UP : dojo.keys.PAGE_DOWN):
- this.decrement(e);
- break;
- default:
- return;
- }
- dojo.stopEvent(e);
- },
- _onHandleClick: function(e){
- if(this.disabled || this.readOnly){ return; }
- if(!dojo.isIE){
-
-
- dijit.focus(this.sliderHandle);
- }
- dojo.stopEvent(e);
- },
- _isReversed: function(){
-
-
-
-
- return !this.isLeftToRight();
- },
- _onBarClick: function(e){
- if(this.disabled || this.readOnly || !this.clickSelect){ return; }
- dijit.focus(this.sliderHandle);
- dojo.stopEvent(e);
- var abspos = dojo.position(this.sliderBarContainer, true);
- var pixelValue = e[this._mousePixelCoord] - abspos[this._startingPixelCoord];
- this._setPixelValue(this._isReversed() ? (abspos[this._pixelCount] - pixelValue) : pixelValue, abspos[this._pixelCount], true);
- this._movable.onMouseDown(e);
- },
- _setPixelValue: function(/*Number*/ pixelValue, /*Number*/ maxPixels, /*Boolean?*/ priorityChange){
- if(this.disabled || this.readOnly){ return; }
- pixelValue = pixelValue < 0 ? 0 : maxPixels < pixelValue ? maxPixels : pixelValue;
- var count = this.discreteValues;
- if(count <= 1 || count == Infinity){ count = maxPixels; }
- count--;
- var pixelsPerValue = maxPixels / count;
- var wholeIncrements = Math.round(pixelValue / pixelsPerValue);
- this._setValueAttr((this.maximum-this.minimum)*wholeIncrements/count + this.minimum, priorityChange);
- },
- _setValueAttr: function(/*Number*/ value, /*Boolean?*/ priorityChange){
-
-
- this._set("value", value);
- this.valueNode.value = value;
- dijit.setWaiState(this.focusNode, "valuenow", value);
- this.inherited(arguments);
- var percent = (value - this.minimum) / (this.maximum - this.minimum);
- var progressBar = (this._descending === false) ? this.remainingBar : this.progressBar;
- var remainingBar = (this._descending === false) ? this.progressBar : this.remainingBar;
- if(this._inProgressAnim && this._inProgressAnim.status != "stopped"){
- this._inProgressAnim.stop(true);
- }
- if(priorityChange && this.slideDuration > 0 && progressBar.style[this._progressPixelSize]){
-
- var _this = this;
- var props = {};
- var start = parseFloat(progressBar.style[this._progressPixelSize]);
- var duration = this.slideDuration * (percent-start/100);
- if(duration == 0){ return; }
- if(duration < 0){ duration = 0 - duration; }
- props[this._progressPixelSize] = { start: start, end: percent*100, units:"%" };
- this._inProgressAnim = dojo.animateProperty({ node: progressBar, duration: duration,
- onAnimate: function(v){ remainingBar.style[_this._progressPixelSize] = (100-parseFloat(v[_this._progressPixelSize])) + "%"; },
- onEnd: function(){ delete _this._inProgressAnim; },
- properties: props
- })
- this._inProgressAnim.play();
- }else{
- progressBar.style[this._progressPixelSize] = (percent*100) + "%";
- remainingBar.style[this._progressPixelSize] = ((1-percent)*100) + "%";
- }
- },
- _bumpValue: function(signedChange, /*Boolean?*/ priorityChange){
- if(this.disabled || this.readOnly){ return; }
- var s = dojo.getComputedStyle(this.sliderBarContainer);
- var c = dojo._getContentBox(this.sliderBarContainer, s);
- var count = this.discreteValues;
- if(count <= 1 || count == Infinity){ count = c[this._pixelCount]; }
- count--;
- var value = (this.value - this.minimum) * count / (this.maximum - this.minimum) + signedChange;
- if(value < 0){ value = 0; }
- if(value > count){ value = count; }
- value = value * (this.maximum - this.minimum) / count + this.minimum;
- this._setValueAttr(value, priorityChange);
- },
- _onClkBumper: function(val){
- if(this.disabled || this.readOnly || !this.clickSelect){ return; }
- this._setValueAttr(val, true);
- },
- _onClkIncBumper: function(){
- this._onClkBumper(this._descending === false ? this.minimum : this.maximum);
- },
- _onClkDecBumper: function(){
- this._onClkBumper(this._descending === false ? this.maximum : this.minimum);
- },
- decrement: function(/*Event*/ e){
-
-
-
-
- this._bumpValue(e.charOrCode == dojo.keys.PAGE_DOWN ? -this.pageIncrement : -1);
- },
- increment: function(/*Event*/ e){
-
-
-
-
- this._bumpValue(e.charOrCode == dojo.keys.PAGE_UP ? this.pageIncrement : 1);
- },
- _mouseWheeled: function(/*Event*/ evt){
-
-
- dojo.stopEvent(evt);
- var janky = !dojo.isMozilla;
- var scroll = evt[(janky ? "wheelDelta" : "detail")] * (janky ? 1 : -1);
- this._bumpValue(scroll < 0 ? -1 : 1, true);
- },
- startup: function(){
- if(this._started){ return; }
- dojo.forEach(this.getChildren(), function(child){
- if(this[child.container] != this.containerNode){
- this[child.container].appendChild(child.domNode);
- }
- }, this);
- this.inherited(arguments);
- },
- _typematicCallback: function(/*Number*/ count, /*Object*/ button, /*Event*/ e){
- if(count == -1){
- this._setValueAttr(this.value, true);
- }else{
- this[(button == (this._descending? this.incrementButton : this.decrementButton)) ? "decrement" : "increment"](e);
- }
- },
- buildRendering: function(){
- this.inherited(arguments);
- if(this.showButtons){
- this.incrementButton.style.display="";
- this.decrementButton.style.display="";
- }
-
- var label = dojo.query('label[for="'+this.id+'"]');
- if(label.length){
- label[0].id = (this.id+"_label");
- dijit.setWaiState(this.focusNode, "labelledby", label[0].id);
- }
- dijit.setWaiState(this.focusNode, "valuemin", this.minimum);
- dijit.setWaiState(this.focusNode, "valuemax", this.maximum);
- },
- postCreate: function(){
- this.inherited(arguments);
- if(this.showButtons){
- this._connects.push(dijit.typematic.addMouseListener(
- this.decrementButton, this, "_typematicCallback", 25, 500));
- this._connects.push(dijit.typematic.addMouseListener(
- this.incrementButton, this, "_typematicCallback", 25, 500));
- }
- this.connect(this.domNode, !dojo.isMozilla ? "onmousewheel" : "DOMMouseScroll", "_mouseWheeled");
-
- var mover = dojo.declare(dijit.form._SliderMover, {
- widget: this
- });
- this._movable = new dojo.dnd.Moveable(this.sliderHandle, {mover: mover});
- this._layoutHackIE7();
- },
- destroy: function(){
- this._movable.destroy();
- if(this._inProgressAnim && this._inProgressAnim.status != "stopped"){
- this._inProgressAnim.stop(true);
- }
- this._supportingWidgets = dijit.findWidgets(this.domNode);
- this.inherited(arguments);
- }
- });
- dojo.declare("dijit.form._SliderMover",
- dojo.dnd.Mover,
- {
- onMouseMove: function(e){
- var widget = this.widget;
- var abspos = widget._abspos;
- if(!abspos){
- abspos = widget._abspos = dojo.position(widget.sliderBarContainer, true);
- widget._setPixelValue_ = dojo.hitch(widget, "_setPixelValue");
- widget._isReversed_ = widget._isReversed();
- }
- var coordEvent = e.touches ? e.touches[0] : e,
- pixelValue = coordEvent[widget._mousePixelCoord] - abspos[widget._startingPixelCoord];
- widget._setPixelValue_(widget._isReversed_ ? (abspos[widget._pixelCount]-pixelValue) : pixelValue, abspos[widget._pixelCount], false);
- },
- destroy: function(e){
- dojo.dnd.Mover.prototype.destroy.apply(this, arguments);
- var widget = this.widget;
- widget._abspos = null;
- widget._setValueAttr(widget.value, true);
- }
- });
- }
- if(!dojo._hasResource["dijit.form.VerticalSlider"]){
- dojo._hasResource["dijit.form.VerticalSlider"] = true;
- dojo.provide("dijit.form.VerticalSlider");
- dojo.declare(
- "dijit.form.VerticalSlider",
- dijit.form.HorizontalSlider,
- {
-
-
- templateString: dojo.cache("dijit.form", "templates/VerticalSlider.html", "<table class=\"dijit dijitReset dijitSlider dijitSliderV\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\" dojoAttachEvent=\"onkeypress:_onKeyPress,onkeyup:_onKeyUp\"\n\trole=\"presentation\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderIncrementIconV\" style=\"display:none\" dojoAttachPoint=\"decrementButton\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderTopBumper\" dojoAttachEvent=\"onmousedown:_onClkIncBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td dojoAttachPoint=\"leftDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationL dijitSliderDecorationV\"></td\n\t\t><td class=\"dijitReset dijitSliderDecorationC\" style=\"height:100%;\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" ${!nameAttrSetting}\n\t\t\t/><center class=\"dijitReset dijitSliderBarContainerV\" role=\"presentation\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarV dijitSliderRemainingBar dijitSliderRemainingBarV\" dojoAttachEvent=\"onmousedown:_onBarClick\"><!--#5629--></div\n\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"progressBar\" class=\"dijitSliderBar dijitSliderBarV dijitSliderProgressBar dijitSliderProgressBarV\" dojoAttachEvent=\"onmousedown:_onBarClick\"\n\t\t\t\t\t><div class=\"dijitSliderMoveable dijitSliderMoveableV\" style=\"vertical-align:top;\"\n\t\t\t\t\t\t><div dojoAttachPoint=\"sliderHandle,focusNode\" class=\"dijitSliderImageHandle dijitSliderImageHandleV\" dojoAttachEvent=\"onmousedown:_onHandleClick\" role=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"></div\n\t\t\t\t\t></div\n\t\t\t\t></div\n\t\t\t></center\n\t\t></td\n\t\t><td dojoAttachPoint=\"containerNode,rightDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationR dijitSliderDecorationV\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderBottomBumper\" dojoAttachEvent=\"onmousedown:_onClkDecBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderDecrementIconV\" style=\"display:none\" dojoAttachPoint=\"incrementButton\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n></table>\n"),
- _mousePixelCoord: "pageY",
- _pixelCount: "h",
- _startingPixelCoord: "y",
- _startingPixelCount: "t",
- _handleOffsetCoord: "top",
- _progressPixelSize: "height",
-
-
-
- _descending: true,
- _isReversed: function(){
-
-
-
- return this._descending;
- }
- });
- }
- if(!dojo._hasResource["dijit.form.HorizontalRule"]){
- dojo._hasResource["dijit.form.HorizontalRule"] = true;
- dojo.provide("dijit.form.HorizontalRule");
- dojo.declare("dijit.form.HorizontalRule", [dijit._Widget, dijit._Templated],
- {
-
-
- templateString: '<div class="dijitRuleContainer dijitRuleContainerH"></div>',
-
-
- count: 3,
-
-
-
- container: "containerNode",
-
-
- ruleStyle: "",
- _positionPrefix: '<div class="dijitRuleMark dijitRuleMarkH" style="left:',
- _positionSuffix: '%;',
- _suffix: '"></div>',
- _genHTML: function(pos, ndx){
- return this._positionPrefix + pos + this._positionSuffix + this.ruleStyle + this._suffix;
- },
-
-
- _isHorizontal: true,
- buildRendering: function(){
- this.inherited(arguments);
- var innerHTML;
- if(this.count == 1){
- innerHTML = this._genHTML(50, 0);
- }else{
- var i;
- var interval = 100 / (this.count-1);
- if(!this._isHorizontal || this.isLeftToRight()){
- innerHTML = this._genHTML(0, 0);
- for(i=1; i < this.count-1; i++){
- innerHTML += this._genHTML(interval*i, i);
- }
- innerHTML += this._genHTML(100, this.count-1);
- }else{
- innerHTML = this._genHTML(100, 0);
- for(i=1; i < this.count-1; i++){
- innerHTML += this._genHTML(100-interval*i, i);
- }
- innerHTML += this._genHTML(0, this.count-1);
- }
- }
- this.domNode.innerHTML = innerHTML;
- }
- });
- }
- if(!dojo._hasResource["dijit.form.VerticalRule"]){
- dojo._hasResource["dijit.form.VerticalRule"] = true;
- dojo.provide("dijit.form.VerticalRule");
- dojo.declare("dijit.form.VerticalRule", dijit.form.HorizontalRule,
- {
-
-
- templateString: '<div class="dijitRuleContainer dijitRuleContainerV"></div>',
- _positionPrefix: '<div class="dijitRuleMark dijitRuleMarkV" style="top:',
-
- _isHorizontal: false
- });
- }
- if(!dojo._hasResource["dijit.form.HorizontalRuleLabels"]){
- dojo._hasResource["dijit.form.HorizontalRuleLabels"] = true;
- dojo.provide("dijit.form.HorizontalRuleLabels");
- dojo.declare("dijit.form.HorizontalRuleLabels", dijit.form.HorizontalRule,
- {
-
-
- templateString: '<div class="dijitRuleContainer dijitRuleContainerH dijitRuleLabelsContainer dijitRuleLabelsContainerH"></div>',
-
-
- labelStyle: "",
-
-
-
- labels: [],
-
-
- numericMargin: 0,
-
-
- minimum: 0,
-
-
- maximum: 1,
-
-
- constraints: {pattern:"#%"},
- _positionPrefix: '<div class="dijitRuleLabelContainer dijitRuleLabelContainerH" style="left:',
- _labelPrefix: '"><div class="dijitRuleLabel dijitRuleLabelH">',
- _suffix: '</div></div>',
- _calcPosition: function(pos){
-
-
-
-
- return pos;
- },
- _genHTML: function(pos, ndx){
- return this._positionPrefix + this._calcPosition(pos) + this._positionSuffix + this.labelStyle + this._labelPrefix + this.labels[ndx] + this._suffix;
- },
- getLabels: function(){
-
-
-
-
-
-
- var labels = this.labels;
- if(!labels.length){
-
- labels = dojo.query("> li", this.srcNodeRef).map(function(node){
- return String(node.innerHTML);
- });
- }
- this.srcNodeRef.innerHTML = '';
-
- if(!labels.length && this.count > 1){
- var start = this.minimum;
- var inc = (this.maximum - start) / (this.count-1);
- for(var i=0; i < this.count; i++){
- labels.push((i < this.numericMargin || i >= (this.count-this.numericMargin)) ? '' : dojo.number.format(start, this.constraints));
- start += inc;
- }
- }
- return labels;
- },
- postMixInProperties: function(){
- this.inherited(arguments);
- this.labels = this.getLabels();
- this.count = this.labels.length;
- }
- });
- }
- if(!dojo._hasResource["dijit.form.VerticalRuleLabels"]){
- dojo._hasResource["dijit.form.VerticalRuleLabels"] = true;
- dojo.provide("dijit.form.VerticalRuleLabels");
- dojo.declare("dijit.form.VerticalRuleLabels", dijit.form.HorizontalRuleLabels,
- {
-
-
- templateString: '<div class="dijitRuleContainer dijitRuleContainerV dijitRuleLabelsContainer dijitRuleLabelsContainerV"></div>',
- _positionPrefix: '<div class="dijitRuleLabelContainer dijitRuleLabelContainerV" style="top:',
- _labelPrefix: '"><span class="dijitRuleLabel dijitRuleLabelV">',
- _calcPosition: function(pos){
-
- return 100-pos;
- },
-
- _isHorizontal: false
- });
- }
- if(!dojo._hasResource["dijit.form.Slider"]){
- dojo._hasResource["dijit.form.Slider"] = true;
- dojo.provide("dijit.form.Slider");
- dojo.deprecated("Call require() for HorizontalSlider / VerticalRule, explicitly rather than 'dijit.form.Slider' itself", "", "2.0");
- }
- if(!dojo._hasResource["dijit.form.SimpleTextarea"]){
- dojo._hasResource["dijit.form.SimpleTextarea"] = true;
- dojo.provide("dijit.form.SimpleTextarea");
- dojo.declare("dijit.form.SimpleTextarea",
- dijit.form.TextBox,
- {
-
-
-
-
-
-
-
-
-
-
- baseClass: "dijitTextBox dijitTextArea",
- attributeMap: dojo.delegate(dijit.form._FormValueWidget.prototype.attributeMap, {
- rows:"textbox", cols: "textbox"
- }),
-
-
- rows: "3",
-
-
- cols: "20",
- templateString: "<textarea ${!nameAttrSetting} dojoAttachPoint='focusNode,containerNode,textbox' autocomplete='off'></textarea>",
- postMixInProperties: function(){
-
-
- if(!this.value && this.srcNodeRef){
- this.value = this.srcNodeRef.value;
- }
- this.inherited(arguments);
- },
- buildRendering: function(){
- this.inherited(arguments);
- if(dojo.isIE && this.cols){
- dojo.addClass(this.textbox, "dijitTextAreaCols");
- }
- },
- filter: function(/*String*/ value){
-
-
- if(value){
- value = value.replace(/\r/g,"");
- }
- return this.inherited(arguments);
- },
- _previousValue: "",
- _onInput: function(/*Event?*/ e){
-
- if(this.maxLength){
- var maxLength = parseInt(this.maxLength);
- var value = this.textbox.value.replace(/\r/g,'');
- var overflow = value.length - maxLength;
- if(overflow > 0){
- if(e){ dojo.stopEvent(e); }
- var textarea = this.textbox;
- if(textarea.selectionStart){
- var pos = textarea.selectionStart;
- var cr = 0;
- if(dojo.isOpera){
- cr = (this.textbox.value.substring(0,pos).match(/\r/g) || []).length;
- }
- this.textbox.value = value.substring(0,pos-overflow-cr)+value.substring(pos-cr);
- textarea.setSelectionRange(pos-overflow, pos-overflow);
- }else if(dojo.doc.selection){
- textarea.focus();
- var range = dojo.doc.selection.createRange();
-
- range.moveStart("character", -overflow);
- range.text = '';
-
- range.select();
- }
- }
- this._previousValue = this.textbox.value;
- }
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit.form._ExpandingTextAreaMixin"]){
- dojo._hasResource["dijit.form._ExpandingTextAreaMixin"] = true;
- dojo.provide("dijit.form._ExpandingTextAreaMixin");
-
-
-
-
-
- var needsHelpShrinking;
- dojo.declare("dijit.form._ExpandingTextAreaMixin", null, {
-
-
- _setValueAttr: function(){
- this.inherited(arguments);
- this.resize();
- },
- postCreate: function(){
- this.inherited(arguments);
- var textarea = this.textbox;
- if(needsHelpShrinking == undefined){
- var te = dojo.create('textarea', {rows:"5", cols:"20", value: ' ', style: {zoom:1, fontSize:"12px", height:"96px", overflow:'hidden', visibility:'hidden', position:'absolute', border:"5px solid white", margin:"0", padding:"0", boxSizing: 'border-box', MsBoxSizing: 'border-box', WebkitBoxSizing: 'border-box', MozBoxSizing: 'border-box' }}, dojo.body(), "last");
- needsHelpShrinking = te.scrollHeight >= te.clientHeight;
- dojo.body().removeChild(te);
- }
- this.connect(textarea, "onresize", "_resizeLater");
- this.connect(textarea, "onfocus", "_resizeLater");
- textarea.style.overflowY = "hidden";
- },
- startup: function(){
- this.inherited(arguments);
- this._resizeLater();
- },
- _onInput: function(e){
- this.inherited(arguments);
- this.resize();
- },
- _estimateHeight: function(){
-
-
-
-
-
- var textarea = this.textbox;
-
- textarea.rows = (textarea.value.match(/\n/g) || []).length + 1;
- },
- _resizeLater: function(){
- this.defer("resize");
- },
- resize: function(){
-
-
- var textarea = this.textbox;
- function textareaScrollHeight(){
- var empty = false;
- if(textarea.value === ''){
- textarea.value = ' ';
- empty = true;
- }
- var sh = textarea.scrollHeight;
- if(empty){ textarea.value = ''; }
- return sh;
- }
- if(textarea.style.overflowY == "hidden"){ textarea.scrollTop = 0; }
- if(this.busyResizing){ return; }
- this.busyResizing = true;
- if(textareaScrollHeight() || textarea.offsetHeight){
- var newH = textareaScrollHeight() + Math.max(textarea.offsetHeight - textarea.clientHeight, 0);
- var newHpx = newH + "px";
- if(newHpx != textarea.style.height){
- textarea.style.height = newHpx;
- textarea.rows = 1;
- }
- if(needsHelpShrinking){
- var origScrollHeight = textareaScrollHeight(),
- newScrollHeight = origScrollHeight,
- origMinHeight = textarea.style.minHeight,
- decrement = 4,
- thisScrollHeight,
- origScrollTop = textarea.scrollTop;
- textarea.style.minHeight = newHpx;
- textarea.style.height = "auto";
- while(newH > 0){
- textarea.style.minHeight = Math.max(newH - decrement, 4) + "px";
- thisScrollHeight = textareaScrollHeight();
- var change = newScrollHeight - thisScrollHeight;
- newH -= change;
- if(change < decrement){
- break;
- }
- newScrollHeight = thisScrollHeight;
- decrement <<= 1;
- }
- textarea.style.height = newH + "px";
- textarea.style.minHeight = origMinHeight;
- textarea.scrollTop = origScrollTop;
- }
- textarea.style.overflowY = textareaScrollHeight() > textarea.clientHeight ? "auto" : "hidden";
- if(textarea.style.overflowY == "hidden"){ textarea.scrollTop = 0; }
- }else{
-
- this._estimateHeight();
- }
- this.busyResizing = false;
- }
- });
- }
- if(!dojo._hasResource["dijit.form.Textarea"]){
- dojo._hasResource["dijit.form.Textarea"] = true;
- dojo.provide("dijit.form.Textarea");
-
-
- dojo.declare("dijit.form.Textarea", [dijit.form.SimpleTextarea, dijit.form._ExpandingTextAreaMixin], {
-
-
-
-
-
-
-
-
-
-
-
-
-
- baseClass: "dijitTextBox dijitTextArea dijitExpandingTextArea",
-
- cols: "",
- buildRendering: function(){
- this.inherited(arguments);
-
- dojo.style(this.textbox, { overflowY: 'hidden', overflowX: 'auto', boxSizing: 'border-box', MsBoxSizing: 'border-box', WebkitBoxSizing: 'border-box', MozBoxSizing: 'border-box' });
- }
- });
- }
- if(!dojo._hasResource["dijit.layout.BorderContainer"]){
- dojo._hasResource["dijit.layout.BorderContainer"] = true;
- dojo.provide("dijit.layout.BorderContainer");
- dojo.declare(
- "dijit.layout.BorderContainer",
- dijit.layout._LayoutWidget,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- design: "headline",
-
-
-
-
- gutters: true,
-
-
- liveSplitters: true,
-
-
- persist: false,
- baseClass: "dijitBorderContainer",
-
-
- _splitterClass: "dijit.layout._Splitter",
- postMixInProperties: function(){
-
-
- if(!this.gutters){
- this.baseClass += "NoGutter";
- }
- this.inherited(arguments);
- },
- startup: function(){
- if(this._started){ return; }
- dojo.forEach(this.getChildren(), this._setupChild, this);
- this.inherited(arguments);
- },
- _setupChild: function(/*dijit._Widget*/ child){
-
- var region = child.region;
- if(region){
- this.inherited(arguments);
- dojo.addClass(child.domNode, this.baseClass+"Pane");
- var ltr = this.isLeftToRight();
- if(region == "leading"){ region = ltr ? "left" : "right"; }
- if(region == "trailing"){ region = ltr ? "right" : "left"; }
-
-
-
- if(region != "center" && (child.splitter || this.gutters) && !child._splitterWidget){
- var _Splitter = dojo.getObject(child.splitter ? this._splitterClass : "dijit.layout._Gutter");
- var splitter = new _Splitter({
- id: child.id + "_splitter",
- container: this,
- child: child,
- region: region,
- live: this.liveSplitters
- });
- splitter.isSplitter = true;
- child._splitterWidget = splitter;
- dojo.place(splitter.domNode, child.domNode, "after");
-
- splitter.startup();
- }
- child.region = region;
- }
- },
- layout: function(){
-
- this._layoutChildren();
- },
- addChild: function(/*dijit._Widget*/ child, /*Integer?*/ insertIndex){
-
- this.inherited(arguments);
- if(this._started){
- this.layout();
- }
- },
- removeChild: function(/*dijit._Widget*/ child){
-
- var region = child.region;
- var splitter = child._splitterWidget
- if(splitter){
- splitter.destroy();
- delete child._splitterWidget;
- }
- this.inherited(arguments);
-
- if(this._started){
- this._layoutChildren();
- }
-
-
- dojo.removeClass(child.domNode, this.baseClass+"Pane");
- dojo.style(child.domNode, {
- top: "auto",
- bottom: "auto",
- left: "auto",
- right: "auto",
- position: "static"
- });
- dojo.style(child.domNode, region == "top" || region == "bottom" ? "width" : "height", "auto");
- },
- getChildren: function(){
-
- return dojo.filter(this.inherited(arguments), function(widget){
- return !widget.isSplitter;
- });
- },
-
- getSplitter: function(/*String*/region){
-
-
-
-
- return dojo.filter(this.getChildren(), function(child){
- return child.region == region;
- })[0]._splitterWidget;
- },
- resize: function(newSize, currentSize){
-
-
-
- if(!this.cs || !this.pe){
- var node = this.domNode;
- this.cs = dojo.getComputedStyle(node);
- this.pe = dojo._getPadExtents(node, this.cs);
- this.pe.r = dojo._toPixelValue(node, this.cs.paddingRight);
- this.pe.b = dojo._toPixelValue(node, this.cs.paddingBottom);
- dojo.style(node, "padding", "0px");
- }
- this.inherited(arguments);
- },
- _layoutChildren: function(/*String?*/ changedChildId, /*Number?*/ changedChildSize){
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!this._borderBox || !this._borderBox.h){
-
-
- return;
- }
-
-
- var wrappers = dojo.map(this.getChildren(), function(child, idx){
- return {
- pane: child,
- weight: [
- child.region == "center" ? Infinity : 0,
- child.layoutPriority,
- (this.design == "sidebar" ? 1 : -1) * (/top|bottom/.test(child.region) ? 1 : -1),
- idx
- ]
- };
- }, this);
- wrappers.sort(function(a, b){
- var aw = a.weight, bw = b.weight;
- for(var i=0; i<aw.length; i++){
- if(aw[i] != bw[i]){
- return aw[i] - bw[i];
- }
- }
- return 0;
- });
-
- var childrenAndSplitters = [];
- dojo.forEach(wrappers, function(wrapper){
- var pane = wrapper.pane;
- childrenAndSplitters.push(pane);
- if(pane._splitterWidget){
- childrenAndSplitters.push(pane._splitterWidget);
- }
- });
-
- var dim = {
- l: this.pe.l,
- t: this.pe.t,
- w: this._borderBox.w - this.pe.w,
- h: this._borderBox.h - this.pe.h
- };
-
- dijit.layout.layoutChildren(this.domNode, dim, childrenAndSplitters,
- changedChildId, changedChildSize);
- },
- destroyRecursive: function(){
-
- dojo.forEach(this.getChildren(), function(child){
- var splitter = child._splitterWidget;
- if(splitter){
- splitter.destroy();
- }
- delete child._splitterWidget;
- });
-
- this.inherited(arguments);
- }
- });
- dojo.extend(dijit._Widget, {
-
-
-
-
- region: '',
-
-
-
-
- layoutPriority: 0,
-
-
-
-
- splitter: false,
-
-
-
- minSize: 0,
-
-
-
- maxSize: Infinity
- });
- dojo.declare("dijit.layout._Splitter", [ dijit._Widget, dijit._Templated ],
- {
-
-
-
-
-
-
-
-
-
-
- live: true,
- templateString: '<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
- postMixInProperties: function(){
- this.inherited(arguments);
- this.horizontal = /top|bottom/.test(this.region);
- this._factor = /top|left/.test(this.region) ? 1 : -1;
- this._cookieName = this.container.id + "_" + this.region;
- },
- buildRendering: function(){
- this.inherited(arguments);
- dojo.addClass(this.domNode, "dijitSplitter" + (this.horizontal ? "H" : "V"));
- if(this.container.persist){
-
- var persistSize = dojo.cookie(this._cookieName);
- if(persistSize){
- this.child.domNode.style[this.horizontal ? "height" : "width"] = persistSize;
- }
- }
- },
- _computeMaxSize: function(){
-
-
- var dim = this.horizontal ? 'h' : 'w',
- childSize = dojo.marginBox(this.child.domNode)[dim],
- center = dojo.filter(this.container.getChildren(), function(child){ return child.region == "center";})[0],
- spaceAvailable = dojo.marginBox(center.domNode)[dim];
- return Math.min(this.child.maxSize, childSize + spaceAvailable);
- },
- _startDrag: function(e){
- if(!this.cover){
- this.cover = dojo.doc.createElement('div');
- dojo.addClass(this.cover, "dijitSplitterCover");
- dojo.place(this.cover, this.child.domNode, "after");
- }
- dojo.addClass(this.cover, "dijitSplitterCoverActive");
-
- if(this.fake){ dojo.destroy(this.fake); }
- if(!(this._resize = this.live)){
-
- (this.fake = this.domNode.cloneNode(true)).removeAttribute("id");
- dojo.addClass(this.domNode, "dijitSplitterShadow");
- dojo.place(this.fake, this.domNode, "after");
- }
- dojo.addClass(this.domNode, "dijitSplitterActive dijitSplitter" + (this.horizontal ? "H" : "V") + "Active");
- if(this.fake){
- dojo.removeClass(this.fake, "dijitSplitterHover dijitSplitter" + (this.horizontal ? "H" : "V") + "Hover");
- }
-
- var factor = this._factor,
- isHorizontal = this.horizontal,
- axis = isHorizontal ? "pageY" : "pageX",
- pageStart = e[axis],
- splitterStyle = this.domNode.style,
- dim = isHorizontal ? 'h' : 'w',
- childStart = dojo.marginBox(this.child.domNode)[dim],
- max = this._computeMaxSize(),
- min = this.child.minSize || 20,
- region = this.region,
- splitterAttr = region == "top" || region == "bottom" ? "top" : "left",
- splitterStart = parseInt(splitterStyle[splitterAttr], 10),
- resize = this._resize,
- layoutFunc = dojo.hitch(this.container, "_layoutChildren", this.child.id),
- de = dojo.doc;
- this._handlers = (this._handlers || []).concat([
- dojo.connect(de, "onmousemove", this._drag = function(e, forceResize){
- var delta = e[axis] - pageStart,
- childSize = factor * delta + childStart,
- boundChildSize = Math.max(Math.min(childSize, max), min);
- if(resize || forceResize){
- layoutFunc(boundChildSize);
- }
-
- splitterStyle[splitterAttr] = delta + splitterStart + factor*(boundChildSize - childSize) + "px";
- }),
- dojo.connect(de, "ondragstart", dojo.stopEvent),
- dojo.connect(dojo.body(), "onselectstart", dojo.stopEvent),
- dojo.connect(de, "onmouseup", this, "_stopDrag")
- ]);
- dojo.stopEvent(e);
- },
- _onMouse: function(e){
- var o = (e.type == "mouseover" || e.type == "mouseenter");
- dojo.toggleClass(this.domNode, "dijitSplitterHover", o);
- dojo.toggleClass(this.domNode, "dijitSplitter" + (this.horizontal ? "H" : "V") + "Hover", o);
- },
- _stopDrag: function(e){
- try{
- if(this.cover){
- dojo.removeClass(this.cover, "dijitSplitterCoverActive");
- }
- if(this.fake){ dojo.destroy(this.fake); }
- dojo.removeClass(this.domNode, "dijitSplitterActive dijitSplitter"
- + (this.horizontal ? "H" : "V") + "Active dijitSplitterShadow");
- this._drag(e);
- this._drag(e, true);
- }finally{
- this._cleanupHandlers();
- delete this._drag;
- }
- if(this.container.persist){
- dojo.cookie(this._cookieName, this.child.domNode.style[this.horizontal ? "height" : "width"], {expires:365});
- }
- },
- _cleanupHandlers: function(){
- dojo.forEach(this._handlers, dojo.disconnect);
- delete this._handlers;
- },
- _onKeyPress: function(/*Event*/ e){
-
- this._resize = true;
- var horizontal = this.horizontal;
- var tick = 1;
- var dk = dojo.keys;
- switch(e.charOrCode){
- case horizontal ? dk.UP_ARROW : dk.LEFT_ARROW:
- tick *= -1;
- case horizontal ? dk.DOWN_ARROW : dk.RIGHT_ARROW:
- break;
- default:
- return;
- }
- var childSize = dojo._getMarginSize(this.child.domNode)[ horizontal ? 'h' : 'w' ] + this._factor * tick;
- this.container._layoutChildren(this.child.id, Math.max(Math.min(childSize, this._computeMaxSize()), this.child.minSize));
- dojo.stopEvent(e);
- },
- destroy: function(){
- this._cleanupHandlers();
- delete this.child;
- delete this.container;
- delete this.cover;
- delete this.fake;
- this.inherited(arguments);
- }
- });
- dojo.declare("dijit.layout._Gutter", [dijit._Widget, dijit._Templated],
- {
-
-
-
-
-
-
-
-
- templateString: '<div class="dijitGutter" role="presentation"></div>',
- postMixInProperties: function(){
- this.inherited(arguments);
- this.horizontal = /top|bottom/.test(this.region);
- },
- buildRendering: function(){
- this.inherited(arguments);
- dojo.addClass(this.domNode, "dijitGutter" + (this.horizontal ? "H" : "V"));
- }
- });
- }
- if(!dojo._hasResource["dijit.layout.StackController"]){
- dojo._hasResource["dijit.layout.StackController"] = true;
- dojo.provide("dijit.layout.StackController");
- dojo.declare(
- "dijit.layout.StackController",
- [dijit._Widget, dijit._Templated, dijit._Container],
- {
-
-
-
-
-
- templateString: "<span role='tablist' dojoAttachEvent='onkeypress' class='dijitStackController'></span>",
-
-
- containerId: "",
-
-
- buttonWidget: "dijit.layout._StackButton",
- constructor: function(){
- this.pane2button = {};
- this.pane2connects = {};
- this.pane2watches = {};
- },
- buildRendering: function(){
- this.inherited(arguments);
- dijit.setWaiRole(this.domNode, "tablist");
- },
- postCreate: function(){
- this.inherited(arguments);
-
- this.subscribe(this.containerId+"-startup", "onStartup");
- this.subscribe(this.containerId+"-addChild", "onAddChild");
- this.subscribe(this.containerId+"-removeChild", "onRemoveChild");
- this.subscribe(this.containerId+"-selectChild", "onSelectChild");
- this.subscribe(this.containerId+"-containerKeyPress", "onContainerKeyPress");
- },
- onStartup: function(/*Object*/ info){
-
-
-
-
- dojo.forEach(info.children, this.onAddChild, this);
- if(info.selected){
-
-
- this.onSelectChild(info.selected);
- }
- },
- destroy: function(){
- for(var pane in this.pane2button){
- this.onRemoveChild(dijit.byId(pane));
- }
- this.inherited(arguments);
- },
- onAddChild: function(/*dijit._Widget*/ page, /*Integer?*/ insertIndex){
-
-
-
-
-
-
- var cls = dojo.getObject(this.buttonWidget);
- var button = new cls({
- id: this.id + "_" + page.id,
- label: page.title,
- dir: page.dir,
- lang: page.lang,
- showLabel: page.showTitle,
- iconClass: page.iconClass,
- closeButton: page.closable,
- title: page.tooltip
- });
- dijit.setWaiState(button.focusNode,"selected", "false");
-
- var pageAttrList = ["title", "showTitle", "iconClass", "closable", "tooltip"],
- buttonAttrList = ["label", "showLabel", "iconClass", "closeButton", "title"];
-
- this.pane2watches[page.id] = dojo.map(pageAttrList, function(pageAttr, idx){
- return page.watch(pageAttr, function(name, oldVal, newVal){
- button.set(buttonAttrList[idx], newVal);
- });
- });
-
-
- this.pane2connects[page.id] = [
- this.connect(button, 'onClick', dojo.hitch(this,"onButtonClick", page)),
- this.connect(button, 'onClickCloseButton', dojo.hitch(this,"onCloseButtonClick", page))
- ];
- this.addChild(button, insertIndex);
- this.pane2button[page.id] = button;
- page.controlButton = button;
- if(!this._currentChild){
- button.focusNode.setAttribute("tabIndex", "0");
- dijit.setWaiState(button.focusNode, "selected", "true");
- this._currentChild = page;
- }
-
- if(!this.isLeftToRight() && dojo.isIE && this._rectifyRtlTabList){
- this._rectifyRtlTabList();
- }
- },
- onRemoveChild: function(/*dijit._Widget*/ page){
-
-
-
-
-
- if(this._currentChild === page){ this._currentChild = null; }
-
- dojo.forEach(this.pane2connects[page.id], dojo.hitch(this, "disconnect"));
- delete this.pane2connects[page.id];
- dojo.forEach(this.pane2watches[page.id], function(w){ w.unwatch(); });
- delete this.pane2watches[page.id];
- var button = this.pane2button[page.id];
- if(button){
- this.removeChild(button);
- delete this.pane2button[page.id];
- button.destroy();
- }
- delete page.controlButton;
- },
- onSelectChild: function(/*dijit._Widget*/ page){
-
-
-
-
- if(!page){ return; }
- if(this._currentChild){
- var oldButton=this.pane2button[this._currentChild.id];
- oldButton.set('checked', false);
- dijit.setWaiState(oldButton.focusNode, "selected", "false");
- oldButton.focusNode.setAttribute("tabIndex", "-1");
- }
- var newButton=this.pane2button[page.id];
- newButton.set('checked', true);
- dijit.setWaiState(newButton.focusNode, "selected", "true");
- this._currentChild = page;
- newButton.focusNode.setAttribute("tabIndex", "0");
- var container = dijit.byId(this.containerId);
- dijit.setWaiState(container.containerNode, "labelledby", newButton.id);
- },
- onButtonClick: function(/*dijit._Widget*/ page){
-
-
-
-
- var container = dijit.byId(this.containerId);
- container.selectChild(page);
- },
- onCloseButtonClick: function(/*dijit._Widget*/ page){
-
-
-
-
- var container = dijit.byId(this.containerId);
- container.closeChild(page);
- if(this._currentChild){
- var b = this.pane2button[this._currentChild.id];
- if(b){
- dijit.focus(b.focusNode || b.domNode);
- }
- }
- },
-
- adjacent: function(/*Boolean*/ forward){
-
-
-
-
- if(!this.isLeftToRight() && (!this.tabPosition || /top|bottom/.test(this.tabPosition))){ forward = !forward; }
-
- var children = this.getChildren();
- var current = dojo.indexOf(children, this.pane2button[this._currentChild.id]);
-
- var offset = forward ? 1 : children.length - 1;
- return children[ (current + offset) % children.length ];
- },
- onkeypress: function(/*Event*/ e){
-
-
-
-
-
- if(this.disabled || e.altKey ){ return; }
- var forward = null;
- if(e.ctrlKey || !e._djpage){
- var k = dojo.keys;
- switch(e.charOrCode){
- case k.LEFT_ARROW:
- case k.UP_ARROW:
- if(!e._djpage){ forward = false; }
- break;
- case k.PAGE_UP:
- if(e.ctrlKey){ forward = false; }
- break;
- case k.RIGHT_ARROW:
- case k.DOWN_ARROW:
- if(!e._djpage){ forward = true; }
- break;
- case k.PAGE_DOWN:
- if(e.ctrlKey){ forward = true; }
- break;
- case k.HOME:
- case k.END:
- var children = this.getChildren();
- if(children && children.length){
- children[e.charOrCode == k.HOME ? 0 : children.length-1].onClick();
- }
- dojo.stopEvent(e);
- break;
- case k.DELETE:
- if(this._currentChild.closable){
- this.onCloseButtonClick(this._currentChild);
- }
- dojo.stopEvent(e);
- break;
- default:
- if(e.ctrlKey){
- if(e.charOrCode === k.TAB){
- this.adjacent(!e.shiftKey).onClick();
- dojo.stopEvent(e);
- }else if(e.charOrCode == "w"){
- if(this._currentChild.closable){
- this.onCloseButtonClick(this._currentChild);
- }
- dojo.stopEvent(e);
- }
- }
- }
-
- if(forward !== null){
- this.adjacent(forward).onClick();
- dojo.stopEvent(e);
- }
- }
- },
- onContainerKeyPress: function(/*Object*/ info){
-
-
-
-
- info.e._djpage = info.page;
- this.onkeypress(info.e);
- }
- });
- dojo.declare("dijit.layout._StackButton",
- dijit.form.ToggleButton,
- {
-
-
-
-
-
-
-
-
-
- tabIndex: "-1",
- buildRendering: function(/*Event*/ evt){
- this.inherited(arguments);
- dijit.setWaiRole((this.focusNode || this.domNode), "tab");
- },
- onClick: function(/*Event*/ evt){
-
-
-
-
- dijit.focus(this.focusNode);
-
- },
- onClickCloseButton: function(/*Event*/ evt){
-
-
-
-
- evt.stopPropagation();
- }
- });
- }
- if(!dojo._hasResource["dijit.layout.StackContainer"]){
- dojo._hasResource["dijit.layout.StackContainer"] = true;
- dojo.provide("dijit.layout.StackContainer");
- dojo.declare(
- "dijit.layout.StackContainer",
- dijit.layout._LayoutWidget,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
- doLayout: true,
-
-
- persist: false,
- baseClass: "dijitStackContainer",
- buildRendering: function(){
- this.inherited(arguments);
- dojo.addClass(this.domNode, "dijitLayoutContainer");
- dijit.setWaiRole(this.containerNode, "tabpanel");
- },
- postCreate: function(){
- this.inherited(arguments);
- this.connect(this.domNode, "onkeypress", this._onKeyPress);
- },
- startup: function(){
- if(this._started){ return; }
- var children = this.getChildren();
-
- dojo.forEach(children, this._setupChild, this);
-
- if(this.persist){
- this.selectedChildWidget = dijit.byId(dojo.cookie(this.id + "_selectedChild"));
- }else{
- dojo.some(children, function(child){
- if(child.selected){
- this.selectedChildWidget = child;
- }
- return child.selected;
- }, this);
- }
- var selected = this.selectedChildWidget;
- if(!selected && children[0]){
- selected = this.selectedChildWidget = children[0];
- selected.selected = true;
- }
-
-
-
- dojo.publish(this.id+"-startup", [{children: children, selected: selected}]);
-
-
- this.inherited(arguments);
- },
- resize: function(){
-
-
-
- if(!this._hasBeenShown){
- this._hasBeenShown = true;
- var selected = this.selectedChildWidget;
- if(selected){
- this._showChild(selected);
- }
- }
- this.inherited(arguments);
- },
- _setupChild: function(/*dijit._Widget*/ child){
-
- this.inherited(arguments);
- dojo.replaceClass(child.domNode, "dijitHidden", "dijitVisible");
-
-
- child.domNode.title = "";
- },
- addChild: function(/*dijit._Widget*/ child, /*Integer?*/ insertIndex){
-
- this.inherited(arguments);
- if(this._started){
- dojo.publish(this.id+"-addChild", [child, insertIndex]);
-
-
-
-
-
- this.layout();
-
- if(!this.selectedChildWidget){
- this.selectChild(child);
- }
- }
- },
- removeChild: function(/*dijit._Widget*/ page){
-
- this.inherited(arguments);
- if(this._started){
-
- dojo.publish(this.id + "-removeChild", [page]);
- }
-
-
- if(this._beingDestroyed){ return; }
-
-
- if(this.selectedChildWidget === page){
- this.selectedChildWidget = undefined;
- if(this._started){
- var children = this.getChildren();
- if(children.length){
- this.selectChild(children[0]);
- }
- }
- }
- if(this._started){
-
-
-
- this.layout();
- }
- },
- selectChild: function(/*dijit._Widget|String*/ page, /*Boolean*/ animate){
-
-
-
-
- page = dijit.byId(page);
- if(this.selectedChildWidget != page){
-
- var d = this._transition(page, this.selectedChildWidget, animate);
- this._set("selectedChildWidget", page);
- dojo.publish(this.id+"-selectChild", [page]);
- if(this.persist){
- dojo.cookie(this.id + "_selectedChild", this.selectedChildWidget.id);
- }
- }
- return d;
- },
- _transition: function(/*dijit._Widget*/ newWidget, /*dijit._Widget*/ oldWidget, /*Boolean*/ animate){
-
-
-
-
-
- if(oldWidget){
- this._hideChild(oldWidget);
- }
- var d = this._showChild(newWidget);
-
-
-
- if(newWidget.resize){
- if(this.doLayout){
- newWidget.resize(this._containerContentBox || this._contentBox);
- }else{
-
-
- newWidget.resize();
- }
- }
- return d;
- },
- _adjacent: function(/*Boolean*/ forward){
-
-
- var children = this.getChildren();
- var index = dojo.indexOf(children, this.selectedChildWidget);
- index += forward ? 1 : children.length - 1;
- return children[ index % children.length ];
- },
- forward: function(){
-
-
- return this.selectChild(this._adjacent(true), true);
- },
- back: function(){
-
-
- return this.selectChild(this._adjacent(false), true);
- },
- _onKeyPress: function(e){
- dojo.publish(this.id+"-containerKeyPress", [{ e: e, page: this}]);
- },
- layout: function(){
-
- if(this.doLayout && this.selectedChildWidget && this.selectedChildWidget.resize){
- this.selectedChildWidget.resize(this._containerContentBox || this._contentBox);
- }
- },
- _showChild: function(/*dijit._Widget*/ page){
-
-
-
-
-
- var children = this.getChildren();
- page.isFirstChild = (page == children[0]);
- page.isLastChild = (page == children[children.length-1]);
- page._set("selected", true);
- dojo.replaceClass(page.domNode, "dijitVisible", "dijitHidden");
- return page._onShow() || true;
- },
- _hideChild: function(/*dijit._Widget*/ page){
-
-
-
- page._set("selected", false);
- dojo.replaceClass(page.domNode, "dijitHidden", "dijitVisible");
- page.onHide();
- },
- closeChild: function(/*dijit._Widget*/ page){
-
-
-
-
-
- var remove = page.onClose(this, page);
- if(remove){
- this.removeChild(page);
-
- page.destroyRecursive();
- }
- },
- destroyDescendants: function(/*Boolean*/ preserveDom){
- dojo.forEach(this.getChildren(), function(child){
- this.removeChild(child);
- child.destroyRecursive(preserveDom);
- }, this);
- }
- });
- dojo.extend(dijit._Widget, {
-
-
-
-
- selected: false,
-
-
-
- closable: false,
-
-
-
- iconClass: "",
-
-
-
-
- showTitle: true
- });
- }
- if(!dojo._hasResource["dijit.layout._TabContainerBase"]){
- dojo._hasResource["dijit.layout._TabContainerBase"] = true;
- dojo.provide("dijit.layout._TabContainerBase");
- dojo.declare("dijit.layout._TabContainerBase",
- [dijit.layout.StackContainer, dijit._Templated],
- {
-
-
-
-
-
-
-
-
-
-
- tabPosition: "top",
- baseClass: "dijitTabContainer",
-
-
-
- tabStrip: false,
-
-
-
-
- nested: false,
- templateString: dojo.cache("dijit.layout", "templates/TabContainer.html", "<div class=\"dijitTabContainer\">\n\t<div class=\"dijitTabListWrapper\" dojoAttachPoint=\"tablistNode\"></div>\n\t<div dojoAttachPoint=\"tablistSpacer\" class=\"dijitTabSpacer ${baseClass}-spacer\"></div>\n\t<div class=\"dijitTabPaneWrapper ${baseClass}-container\" dojoAttachPoint=\"containerNode\"></div>\n</div>\n"),
- postMixInProperties: function(){
-
- this.baseClass += this.tabPosition.charAt(0).toUpperCase() + this.tabPosition.substr(1).replace(/-.*/, "");
- this.srcNodeRef && dojo.style(this.srcNodeRef, "visibility", "hidden");
- this.inherited(arguments);
- },
- buildRendering: function(){
- this.inherited(arguments);
-
- this.tablist = this._makeController(this.tablistNode);
- if(!this.doLayout){ dojo.addClass(this.domNode, "dijitTabContainerNoLayout"); }
- if(this.nested){
-
- dojo.addClass(this.domNode, "dijitTabContainerNested");
- dojo.addClass(this.tablist.containerNode, "dijitTabContainerTabListNested");
- dojo.addClass(this.tablistSpacer, "dijitTabContainerSpacerNested");
- dojo.addClass(this.containerNode, "dijitTabPaneWrapperNested");
- }else{
- dojo.addClass(this.domNode, "tabStrip-" + (this.tabStrip ? "enabled" : "disabled"));
- }
- },
- _setupChild: function(/*dijit._Widget*/ tab){
-
- dojo.addClass(tab.domNode, "dijitTabPane");
- this.inherited(arguments);
- },
- startup: function(){
- if(this._started){ return; }
-
- this.tablist.startup();
- this.inherited(arguments);
- },
- layout: function(){
-
-
- if(!this._contentBox || typeof(this._contentBox.l) == "undefined"){return;}
- var sc = this.selectedChildWidget;
- if(this.doLayout){
-
- var titleAlign = this.tabPosition.replace(/-h/, "");
- this.tablist.layoutAlign = titleAlign;
- var children = [this.tablist, {
- domNode: this.tablistSpacer,
- layoutAlign: titleAlign
- }, {
- domNode: this.containerNode,
- layoutAlign: "client"
- }];
- dijit.layout.layoutChildren(this.domNode, this._contentBox, children);
-
-
- this._containerContentBox = dijit.layout.marginBox2contentBox(this.containerNode, children[2]);
- if(sc && sc.resize){
- sc.resize(this._containerContentBox);
- }
- }else{
-
- if(this.tablist.resize){
-
- var s = this.tablist.domNode.style;
- s.width="0";
- var width = dojo.contentBox(this.domNode).w;
- s.width="";
- this.tablist.resize({w: width});
- }
-
- if(sc && sc.resize){
- sc.resize();
- }
- }
- },
- destroy: function(){
- if(this.tablist){
- this.tablist.destroy();
- }
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit.layout.TabController"]){
- dojo._hasResource["dijit.layout.TabController"] = true;
- dojo.provide("dijit.layout.TabController");
- dojo.declare("dijit.layout.TabController",
- dijit.layout.StackController,
- {
-
-
-
-
-
-
-
-
-
- templateString: "<div role='tablist' dojoAttachEvent='onkeypress:onkeypress'></div>",
-
-
-
- tabPosition: "top",
-
-
- buttonWidget: "dijit.layout._TabButton",
- _rectifyRtlTabList: function(){
-
-
- if(0 >= this.tabPosition.indexOf('-h')){ return; }
- if(!this.pane2button){ return; }
- var maxWidth = 0;
- for(var pane in this.pane2button){
- var ow = this.pane2button[pane].innerDiv.scrollWidth;
- maxWidth = Math.max(maxWidth, ow);
- }
-
- for(pane in this.pane2button){
- this.pane2button[pane].innerDiv.style.width = maxWidth + 'px';
- }
- }
- });
- dojo.declare("dijit.layout._TabButton",
- dijit.layout._StackButton,
- {
-
-
-
-
-
-
-
-
-
- baseClass: "dijitTab",
-
- cssStateNodes: {
- closeNode: "dijitTabCloseButton"
- },
- templateString: dojo.cache("dijit.layout", "templates/_TabButton.html", "<div role=\"presentation\" dojoAttachPoint=\"titleNode\" dojoAttachEvent='onclick:onClick'>\n <div role=\"presentation\" class='dijitTabInnerDiv' dojoAttachPoint='innerDiv'>\n <div role=\"presentation\" class='dijitTabContent' dojoAttachPoint='tabContent'>\n \t<div role=\"presentation\" dojoAttachPoint='focusNode'>\n\t\t <img src=\"${_blankGif}\" alt=\"\" class=\"dijitIcon dijitTabButtonIcon\" dojoAttachPoint='iconNode' />\n\t\t <span dojoAttachPoint='containerNode' class='tabLabel'></span>\n\t\t <span class=\"dijitInline dijitTabCloseButton dijitTabCloseIcon\" dojoAttachPoint='closeNode'\n\t\t \t\tdojoAttachEvent='onclick: onClickCloseButton' role=\"presentation\">\n\t\t <span dojoAttachPoint='closeText' class='dijitTabCloseText'>[x]</span\n\t\t ></span>\n\t\t\t</div>\n </div>\n </div>\n</div>\n"),
-
-
- scrollOnFocus: false,
- buildRendering: function(){
- this.inherited(arguments);
- dojo.setSelectable(this.containerNode, false);
- },
- startup: function(){
- this.inherited(arguments);
- var n = this.domNode;
-
-
- setTimeout(function(){
- n.className = n.className;
- }, 1);
- },
- _setCloseButtonAttr: function(/*Boolean*/ disp){
-
-
- this._set("closeButton", disp);
- dojo.toggleClass(this.innerDiv, "dijitClosable", disp);
- this.closeNode.style.display = disp ? "" : "none";
- if(disp){
- var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
- if(this.closeNode){
- dojo.attr(this.closeNode,"title", _nlsResources.itemClose);
- }
-
- var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
- this._closeMenu = new dijit.Menu({
- id: this.id+"_Menu",
- dir: this.dir,
- lang: this.lang,
- targetNodeIds: [this.domNode]
- });
- this._closeMenu.addChild(new dijit.MenuItem({
- label: _nlsResources.itemClose,
- dir: this.dir,
- lang: this.lang,
- onClick: dojo.hitch(this, "onClickCloseButton")
- }));
- }else{
- if(this._closeMenu){
- this._closeMenu.destroyRecursive();
- delete this._closeMenu;
- }
- }
- },
- _setLabelAttr: function(/*String*/ content){
-
-
-
-
-
-
- this.inherited(arguments);
- if(this.showLabel == false && !this.params.title){
- this.iconNode.alt = dojo.trim(this.containerNode.innerText || this.containerNode.textContent || '');
- }
- },
- destroy: function(){
- if(this._closeMenu){
- this._closeMenu.destroyRecursive();
- delete this._closeMenu;
- }
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit.layout.ScrollingTabController"]){
- dojo._hasResource["dijit.layout.ScrollingTabController"] = true;
- dojo.provide("dijit.layout.ScrollingTabController");
- dojo.declare("dijit.layout.ScrollingTabController",
- dijit.layout.TabController,
- {
-
-
-
-
-
-
-
- templateString: dojo.cache("dijit.layout", "templates/ScrollingTabController.html", "<div class=\"dijitTabListContainer-${tabPosition}\" style=\"visibility:hidden\">\n\t<div dojoType=\"dijit.layout._ScrollingTabControllerMenuButton\"\n\t\t\tclass=\"tabStripButton-${tabPosition}\"\n\t\t\tid=\"${id}_menuBtn\" containerId=\"${containerId}\" iconClass=\"dijitTabStripMenuIcon\"\n\t\t\tdropDownPosition=\"below-alt, above-alt\"\n\t\t\tdojoAttachPoint=\"_menuBtn\" showLabel=\"false\">▼</div>\n\t<div dojoType=\"dijit.layout._ScrollingTabControllerButton\"\n\t\t\tclass=\"tabStripButton-${tabPosition}\"\n\t\t\tid=\"${id}_leftBtn\" iconClass=\"dijitTabStripSlideLeftIcon\"\n\t\t\tdojoAttachPoint=\"_leftBtn\" dojoAttachEvent=\"onClick: doSlideLeft\" showLabel=\"false\">◀</div>\n\t<div dojoType=\"dijit.layout._ScrollingTabControllerButton\"\n\t\t\tclass=\"tabStripButton-${tabPosition}\"\n\t\t\tid=\"${id}_rightBtn\" iconClass=\"dijitTabStripSlideRightIcon\"\n\t\t\tdojoAttachPoint=\"_rightBtn\" dojoAttachEvent=\"onClick: doSlideRight\" showLabel=\"false\">▶</div>\n\t<div class='dijitTabListWrapper' dojoAttachPoint='tablistWrapper'>\n\t\t<div role='tablist' dojoAttachEvent='onkeypress:onkeypress'\n\t\t\t\tdojoAttachPoint='containerNode' class='nowrapTabStrip'></div>\n\t</div>\n</div>\n"),
-
-
-
- useMenu: true,
-
-
-
- useSlider: true,
-
-
- tabStripClass: "",
- widgetsInTemplate: true,
-
-
-
-
- _minScroll: 5,
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- "class": "containerNode"
- }),
- buildRendering: function(){
- this.inherited(arguments);
- var n = this.domNode;
- this.scrollNode = this.tablistWrapper;
- this._initButtons();
- if(!this.tabStripClass){
- this.tabStripClass = "dijitTabContainer" +
- this.tabPosition.charAt(0).toUpperCase() +
- this.tabPosition.substr(1).replace(/-.*/, "") +
- "None";
- dojo.addClass(n, "tabStrip-disabled")
- }
- dojo.addClass(this.tablistWrapper, this.tabStripClass);
- },
- onStartup: function(){
- this.inherited(arguments);
-
-
-
- dojo.style(this.domNode, "visibility", "visible");
- this._postStartup = true;
- },
- onAddChild: function(page, insertIndex){
- this.inherited(arguments);
-
-
- dojo.forEach(["label", "iconClass"], function(attr){
- this.pane2watches[page.id].push(
- this.pane2button[page.id].watch(attr, dojo.hitch(this, function(name, oldValue, newValue){
- if(this._postStartup && this._dim){
- this.resize(this._dim);
- }
- }))
- );
- }, this);
-
-
-
-
- dojo.style(this.containerNode, "width",
- (dojo.style(this.containerNode, "width") + 200) + "px");
- },
- onRemoveChild: function(page, insertIndex){
-
- var button = this.pane2button[page.id];
- if(this._selectedTab === button.domNode){
- this._selectedTab = null;
- }
- this.inherited(arguments);
- },
- _initButtons: function(){
-
-
-
-
-
-
- this._btnWidth = 0;
- this._buttons = dojo.query("> .tabStripButton", this.domNode).filter(function(btn){
- if((this.useMenu && btn == this._menuBtn.domNode) ||
- (this.useSlider && (btn == this._rightBtn.domNode || btn == this._leftBtn.domNode))){
- this._btnWidth += dojo._getMarginSize(btn).w;
- return true;
- }else{
- dojo.style(btn, "display", "none");
- return false;
- }
- }, this);
- },
- _getTabsWidth: function(){
- var children = this.getChildren();
- if(children.length){
- var leftTab = children[this.isLeftToRight() ? 0 : children.length - 1].domNode,
- rightTab = children[this.isLeftToRight() ? children.length - 1 : 0].domNode;
- return rightTab.offsetLeft + dojo.style(rightTab, "width") - leftTab.offsetLeft;
- }else{
- return 0;
- }
- },
- _enableBtn: function(width){
-
-
-
- var tabsWidth = this._getTabsWidth();
- width = width || dojo.style(this.scrollNode, "width");
- return tabsWidth > 0 && width < tabsWidth;
- },
- resize: function(dim){
-
-
-
- if(this.domNode.offsetWidth == 0){
- return;
- }
-
- this._dim = dim;
-
-
-
-
- this.scrollNode.style.height = "auto";
- this._contentBox = dijit.layout.marginBox2contentBox(this.domNode, {h: 0, w: dim.w});
- this._contentBox.h = this.scrollNode.offsetHeight;
- dojo.contentBox(this.domNode, this._contentBox);
-
-
- var enable = this._enableBtn(this._contentBox.w);
- this._buttons.style("display", enable ? "" : "none");
-
- this._leftBtn.layoutAlign = "left";
- this._rightBtn.layoutAlign = "right";
- this._menuBtn.layoutAlign = this.isLeftToRight() ? "right" : "left";
- dijit.layout.layoutChildren(this.domNode, this._contentBox,
- [this._menuBtn, this._leftBtn, this._rightBtn, {domNode: this.scrollNode, layoutAlign: "client"}]);
-
- if(this._selectedTab){
- if(this._anim && this._anim.status() == "playing"){
- this._anim.stop();
- }
- var w = this.scrollNode,
- sl = this._convertToScrollLeft(this._getScrollForSelectedTab());
- w.scrollLeft = sl;
- }
-
- this._setButtonClass(this._getScroll());
-
- this._postResize = true;
-
-
- return {h: this._contentBox.h, w: dim.w};
- },
- _getScroll: function(){
-
-
-
-
- var sl = (this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit) ? this.scrollNode.scrollLeft :
- dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width")
- + (dojo.isIE == 8 ? -1 : 1) * this.scrollNode.scrollLeft;
- return sl;
- },
- _convertToScrollLeft: function(val){
-
-
-
-
-
-
-
- if(this.isLeftToRight() || dojo.isIE < 8 || (dojo.isIE && dojo.isQuirks) || dojo.isWebKit){
- return val;
- }else{
- var maxScroll = dojo.style(this.containerNode, "width") - dojo.style(this.scrollNode, "width");
- return (dojo.isIE == 8 ? -1 : 1) * (val - maxScroll);
- }
- },
- onSelectChild: function(/*dijit._Widget*/ page){
-
-
- var tab = this.pane2button[page.id];
- if(!tab || !page){return;}
-
- var node = tab.domNode;
- if(this._postResize && node != this._selectedTab){
- this._selectedTab = node;
- var sl = this._getScroll();
- if(sl > node.offsetLeft ||
- sl + dojo.style(this.scrollNode, "width") <
- node.offsetLeft + dojo.style(node, "width")){
- this.createSmoothScroll().play();
- }
- }
- this.inherited(arguments);
- },
- _getScrollBounds: function(){
-
-
-
- var children = this.getChildren(),
- scrollNodeWidth = dojo.style(this.scrollNode, "width"),
- containerWidth = dojo.style(this.containerNode, "width"),
- maxPossibleScroll = containerWidth - scrollNodeWidth,
- tabsWidth = this._getTabsWidth();
- if(children.length && tabsWidth > scrollNodeWidth){
-
- return {
- min: this.isLeftToRight() ? 0 : children[children.length-1].domNode.offsetLeft,
- max: this.isLeftToRight() ?
- (children[children.length-1].domNode.offsetLeft + dojo.style(children[children.length-1].domNode, "width")) - scrollNodeWidth :
- maxPossibleScroll
- };
- }else{
-
- var onlyScrollPosition = this.isLeftToRight() ? 0 : maxPossibleScroll;
- return {
- min: onlyScrollPosition,
- max: onlyScrollPosition
- };
- }
- },
- _getScrollForSelectedTab: function(){
-
-
-
- var w = this.scrollNode,
- n = this._selectedTab,
- scrollNodeWidth = dojo.style(this.scrollNode, "width"),
- scrollBounds = this._getScrollBounds();
-
-
- var pos = (n.offsetLeft + dojo.style(n, "width")/2) - scrollNodeWidth/2;
- pos = Math.min(Math.max(pos, scrollBounds.min), scrollBounds.max);
-
-
-
-
- return pos;
- },
- createSmoothScroll: function(x){
-
-
-
-
-
-
-
-
-
-
- if(arguments.length > 0){
-
- var scrollBounds = this._getScrollBounds();
- x = Math.min(Math.max(x, scrollBounds.min), scrollBounds.max);
- }else{
-
- x = this._getScrollForSelectedTab();
- }
- if(this._anim && this._anim.status() == "playing"){
- this._anim.stop();
- }
- var self = this,
- w = this.scrollNode,
- anim = new dojo._Animation({
- beforeBegin: function(){
- if(this.curve){ delete this.curve; }
- var oldS = w.scrollLeft,
- newS = self._convertToScrollLeft(x);
- anim.curve = new dojo._Line(oldS, newS);
- },
- onAnimate: function(val){
- w.scrollLeft = val;
- }
- });
- this._anim = anim;
-
- this._setButtonClass(x);
- return anim;
- },
- _getBtnNode: function(/*Event*/ e){
-
-
-
-
- var n = e.target;
- while(n && !dojo.hasClass(n, "tabStripButton")){
- n = n.parentNode;
- }
- return n;
- },
- doSlideRight: function(/*Event*/ e){
-
-
-
-
- this.doSlide(1, this._getBtnNode(e));
- },
- doSlideLeft: function(/*Event*/ e){
-
-
-
-
- this.doSlide(-1,this._getBtnNode(e));
- },
- doSlide: function(/*Number*/ direction, /*DomNode*/ node){
-
-
-
-
-
- if(node && dojo.hasClass(node, "dijitTabDisabled")){return;}
- var sWidth = dojo.style(this.scrollNode, "width");
- var d = (sWidth * 0.75) * direction;
- var to = this._getScroll() + d;
- this._setButtonClass(to);
- this.createSmoothScroll(to).play();
- },
- _setButtonClass: function(/*Number*/ scroll){
-
-
-
-
-
- var scrollBounds = this._getScrollBounds();
- this._leftBtn.set("disabled", scroll <= scrollBounds.min);
- this._rightBtn.set("disabled", scroll >= scrollBounds.max);
- }
- });
- dojo.declare("dijit.layout._ScrollingTabControllerButtonMixin", null, {
- baseClass: "dijitTab tabStripButton",
- templateString: dojo.cache("dijit.layout", "templates/_ScrollingTabControllerButton.html", "<div dojoAttachEvent=\"onclick:_onButtonClick\">\n\t<div role=\"presentation\" class=\"dijitTabInnerDiv\" dojoattachpoint=\"innerDiv,focusNode\">\n\t\t<div role=\"presentation\" class=\"dijitTabContent dijitButtonContents\" dojoattachpoint=\"tabContent\">\n\t\t\t<img role=\"presentation\" alt=\"\" src=\"${_blankGif}\" class=\"dijitTabStripIcon\" dojoAttachPoint=\"iconNode\"/>\n\t\t\t<span dojoAttachPoint=\"containerNode,titleNode\" class=\"dijitButtonText\"></span>\n\t\t</div>\n\t</div>\n</div>\n"),
-
-
- tabIndex: "",
-
-
- isFocusable: function(){ return false; }
- });
- dojo.declare("dijit.layout._ScrollingTabControllerButton",
- [dijit.form.Button, dijit.layout._ScrollingTabControllerButtonMixin]);
- dojo.declare(
- "dijit.layout._ScrollingTabControllerMenuButton",
- [dijit.form.Button, dijit._HasDropDown, dijit.layout._ScrollingTabControllerButtonMixin],
- {
-
- containerId: "",
-
-
- tabIndex: "-1",
- isLoaded: function(){
-
- return false;
- },
- loadDropDown: function(callback){
- this.dropDown = new dijit.Menu({
- id: this.containerId + "_menu",
- dir: this.dir,
- lang: this.lang
- });
- var container = dijit.byId(this.containerId);
- dojo.forEach(container.getChildren(), function(page){
- var menuItem = new dijit.MenuItem({
- id: page.id + "_stcMi",
- label: page.title,
- iconClass: page.iconClass,
- dir: page.dir,
- lang: page.lang,
- onClick: function(){
- container.selectChild(page);
- }
- });
- this.dropDown.addChild(menuItem);
- }, this);
- callback();
- },
- closeDropDown: function(/*Boolean*/ focus){
- this.inherited(arguments);
- if(this.dropDown){
- this.dropDown.destroyRecursive();
- delete this.dropDown;
- }
- }
- });
- }
- if(!dojo._hasResource["dijit.layout.TabContainer"]){
- dojo._hasResource["dijit.layout.TabContainer"] = true;
- dojo.provide("dijit.layout.TabContainer");
- dojo.declare("dijit.layout.TabContainer",
- dijit.layout._TabContainerBase,
- {
-
-
-
-
-
-
-
-
-
- useMenu: true,
-
-
-
- useSlider: true,
-
-
- controllerWidget: "",
- _makeController: function(/*DomNode*/ srcNode){
-
-
-
-
-
- var cls = this.baseClass + "-tabs" + (this.doLayout ? "" : " dijitTabNoLayout"),
- TabController = dojo.getObject(this.controllerWidget);
- return new TabController({
- id: this.id + "_tablist",
- dir: this.dir,
- lang: this.lang,
- tabPosition: this.tabPosition,
- doLayout: this.doLayout,
- containerId: this.id,
- "class": cls,
- nested: this.nested,
- useMenu: this.useMenu,
- useSlider: this.useSlider,
- tabStripClass: this.tabStrip ? this.baseClass + (this.tabStrip ? "":"No") + "Strip": null
- }, srcNode);
- },
- postMixInProperties: function(){
- this.inherited(arguments);
-
- if(!this.controllerWidget){
- this.controllerWidget = (this.tabPosition == "top" || this.tabPosition == "bottom") && !this.nested ?
- "dijit.layout.ScrollingTabController" : "dijit.layout.TabController";
- }
- }
- });
- }
- if(!dojo._hasResource["dijit.TitlePane"]){
- dojo._hasResource["dijit.TitlePane"] = true;
- dojo.provide("dijit.TitlePane");
- dojo.declare(
- "dijit.TitlePane",
- [dijit.layout.ContentPane, dijit._Templated, dijit._CssStateMixin],
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- title: "",
-
-
- open: true,
-
-
- toggleable: true,
-
-
-
- tabIndex: "0",
-
-
- duration: dijit.defaultDuration,
-
-
- baseClass: "dijitTitlePane",
- templateString: dojo.cache("dijit", "templates/TitlePane.html", "<div>\n\t<div dojoAttachEvent=\"onclick:_onTitleClick, onkeypress:_onTitleKey\"\n\t\t\tclass=\"dijitTitlePaneTitle\" dojoAttachPoint=\"titleBarNode\">\n\t\t<div class=\"dijitTitlePaneTitleFocus\" dojoAttachPoint=\"focusNode\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" dojoAttachPoint=\"arrowNode\" class=\"dijitArrowNode\" role=\"presentation\"\n\t\t\t/><span dojoAttachPoint=\"arrowNodeInner\" class=\"dijitArrowNodeInner\"></span\n\t\t\t><span dojoAttachPoint=\"titleNode\" class=\"dijitTitlePaneTextNode\"></span>\n\t\t</div>\n\t</div>\n\t<div class=\"dijitTitlePaneContentOuter\" dojoAttachPoint=\"hideNode\" role=\"presentation\">\n\t\t<div class=\"dijitReset\" dojoAttachPoint=\"wipeNode\" role=\"presentation\">\n\t\t\t<div class=\"dijitTitlePaneContentInner\" dojoAttachPoint=\"containerNode\" role=\"region\" id=\"${id}_pane\">\n\t\t\t\t<!-- nested divs because wipeIn()/wipeOut() doesn't work right on node w/padding etc. Put padding on inner div. -->\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n"),
- attributeMap: dojo.delegate(dijit.layout.ContentPane.prototype.attributeMap, {
- title: { node: "titleNode", type: "innerHTML" },
- tooltip: {node: "focusNode", type: "attribute", attribute: "title"},
- id:""
- }),
- buildRendering: function(){
- this.inherited(arguments);
- dojo.setSelectable(this.titleNode, false);
- },
- postCreate: function(){
- this.inherited(arguments);
-
-
-
-
- if(this.toggleable){
- this._trackMouseState(this.titleBarNode, "dijitTitlePaneTitle");
- }
-
- var hideNode = this.hideNode, wipeNode = this.wipeNode;
- this._wipeIn = dojo.fx.wipeIn({
- node: this.wipeNode,
- duration: this.duration,
- beforeBegin: function(){
- hideNode.style.display="";
- }
- });
- this._wipeOut = dojo.fx.wipeOut({
- node: this.wipeNode,
- duration: this.duration,
- onEnd: function(){
- hideNode.style.display="none";
- }
- });
- },
- _setOpenAttr: function(/*Boolean*/ open, /*Boolean*/ animate){
-
-
-
-
- dojo.forEach([this._wipeIn, this._wipeOut], function(animation){
- if(animation && animation.status() == "playing"){
- animation.stop();
- }
- });
- if(animate){
- var anim = this[open ? "_wipeIn" : "_wipeOut"];
- anim.play();
- }else{
- this.hideNode.style.display = this.wipeNode.style.display = open ? "" : "none";
- }
-
-
- if(this._started){
- if(open){
- this._onShow();
- }else{
- this.onHide();
- }
- }
- this.arrowNodeInner.innerHTML = open ? "-" : "+";
- dijit.setWaiState(this.containerNode,"hidden", open ? "false" : "true");
- dijit.setWaiState(this.focusNode, "pressed", open ? "true" : "false");
- this._set("open", open);
- this._setCss();
- },
- _setToggleableAttr: function(/*Boolean*/ canToggle){
-
-
-
-
- dijit.setWaiRole(this.focusNode, canToggle ? "button" : "heading");
- if(canToggle){
-
- dijit.setWaiState(this.focusNode, "controls", this.id+"_pane");
- dojo.attr(this.focusNode, "tabIndex", this.tabIndex);
- }else{
- dojo.removeAttr(this.focusNode, "tabIndex");
- }
- this._set("toggleable", canToggle);
- this._setCss();
- },
- _setContentAttr: function(/*String|DomNode|Nodelist*/ content){
-
-
-
- if(!this.open || !this._wipeOut || this._wipeOut.status() == "playing"){
-
- this.inherited(arguments);
- }else{
- if(this._wipeIn && this._wipeIn.status() == "playing"){
- this._wipeIn.stop();
- }
-
- dojo.marginBox(this.wipeNode, { h: dojo.marginBox(this.wipeNode).h });
-
- this.inherited(arguments);
-
- if(this._wipeIn){
- this._wipeIn.play();
- }else{
- this.hideNode.style.display = "";
- }
- }
- },
- toggle: function(){
-
-
-
-
- this._setOpenAttr(!this.open, true);
- },
- _setCss: function(){
-
-
-
-
- var node = this.titleBarNode || this.focusNode;
- var oldCls = this._titleBarClass;
- this._titleBarClass = "dijit" + (this.toggleable ? "" : "Fixed") + (this.open ? "Open" : "Closed");
- dojo.replaceClass(node, this._titleBarClass, oldCls || "");
- this.arrowNodeInner.innerHTML = this.open ? "-" : "+";
- },
- _onTitleKey: function(/*Event*/ e){
-
-
-
-
- if(e.charOrCode == dojo.keys.ENTER || e.charOrCode == ' '){
- if(this.toggleable){
- this.toggle();
- }
- dojo.stopEvent(e);
- }else if(e.charOrCode == dojo.keys.DOWN_ARROW && this.open){
- this.containerNode.focus();
- e.preventDefault();
- }
- },
- _onTitleClick: function(){
-
-
-
-
- if(this.toggleable){
- this.toggle();
- }
- },
- setTitle: function(/*String*/ title){
-
-
-
-
- dojo.deprecated("dijit.TitlePane.setTitle() is deprecated. Use set('title', ...) instead.", "", "2.0");
- this.set("title", title);
- }
- });
- }
- if(!dojo._hasResource["dojo.DeferredList"]){
- dojo._hasResource["dojo.DeferredList"] = true;
- dojo.provide("dojo.DeferredList");
- dojo.DeferredList = function(/*Array*/ list, /*Boolean?*/ fireOnOneCallback, /*Boolean?*/ fireOnOneErrback, /*Boolean?*/ consumeErrors, /*Function?*/ canceller){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var resultList = [];
- dojo.Deferred.call(this);
- var self = this;
- if(list.length === 0 && !fireOnOneCallback){
- this.resolve([0, []]);
- }
- var finished = 0;
- dojo.forEach(list, function(item, i){
- item.then(function(result){
- if(fireOnOneCallback){
- self.resolve([i, result]);
- }else{
- addResult(true, result);
- }
- },function(error){
- if(fireOnOneErrback){
- self.reject(error);
- }else{
- addResult(false, error);
- }
- if(consumeErrors){
- return null;
- }
- throw error;
- });
- function addResult(succeeded, result){
- resultList[i] = [succeeded, result];
- finished++;
- if(finished === list.length){
- self.resolve(resultList);
- }
-
- }
- });
- };
- dojo.DeferredList.prototype = new dojo.Deferred();
- dojo.DeferredList.prototype.gatherResults= function(deferredList){
-
-
-
- var d = new dojo.DeferredList(deferredList, false, true, false);
- d.addCallback(function(results){
- var ret = [];
- dojo.forEach(results, function(result){
- ret.push(result[1]);
- });
- return ret;
- });
- return d;
- };
- }
- if(!dojo._hasResource["dijit.tree.TreeStoreModel"]){
- dojo._hasResource["dijit.tree.TreeStoreModel"] = true;
- dojo.provide("dijit.tree.TreeStoreModel");
- dojo.declare(
- "dijit.tree.TreeStoreModel",
- null,
- {
-
-
-
-
-
-
- store: null,
-
-
- childrenAttrs: ["children"],
-
-
-
-
-
-
-
-
- newItemIdAttr: "id",
-
-
-
- labelAttr: "",
-
-
- root: null,
-
-
-
-
-
-
- query: null,
-
-
-
-
-
-
-
- deferItemLoadingUntilExpand: false,
- constructor: function(/* Object */ args){
-
-
-
-
- dojo.mixin(this, args);
- this.connects = [];
- var store = this.store;
- if(!store.getFeatures()['dojo.data.api.Identity']){
- throw new Error("dijit.Tree: store must support dojo.data.Identity");
- }
-
- if(store.getFeatures()['dojo.data.api.Notification']){
- this.connects = this.connects.concat([
- dojo.connect(store, "onNew", this, "onNewItem"),
- dojo.connect(store, "onDelete", this, "onDeleteItem"),
- dojo.connect(store, "onSet", this, "onSetItem")
- ]);
- }
- },
- destroy: function(){
- dojo.forEach(this.connects, dojo.disconnect);
-
- },
-
-
- getRoot: function(onItem, onError){
-
-
-
- if(this.root){
- onItem(this.root);
- }else{
- this.store.fetch({
- query: this.query,
- onComplete: dojo.hitch(this, function(items){
- if(items.length != 1){
- throw new Error(this.declaredClass + ": query " + dojo.toJson(this.query) + " returned " + items.length +
- " items, but must return exactly one item");
- }
- this.root = items[0];
- onItem(this.root);
- }),
- onError: onError
- });
- }
- },
- mayHaveChildren: function(/*dojo.data.Item*/ item){
-
-
-
-
-
- return dojo.some(this.childrenAttrs, function(attr){
- return this.store.hasAttribute(item, attr);
- }, this);
- },
- getChildren: function(/*dojo.data.Item*/ parentItem, /*function(items)*/ onComplete, /*function*/ onError){
-
-
- var store = this.store;
- if(!store.isItemLoaded(parentItem)){
-
-
-
- var getChildren = dojo.hitch(this, arguments.callee);
- store.loadItem({
- item: parentItem,
- onItem: function(parentItem){
- getChildren(parentItem, onComplete, onError);
- },
- onError: onError
- });
- return;
- }
-
- var childItems = [];
- for(var i=0; i<this.childrenAttrs.length; i++){
- var vals = store.getValues(parentItem, this.childrenAttrs[i]);
- childItems = childItems.concat(vals);
- }
-
- var _waitCount = 0;
- if(!this.deferItemLoadingUntilExpand){
- dojo.forEach(childItems, function(item){ if(!store.isItemLoaded(item)){ _waitCount++; } });
- }
- if(_waitCount == 0){
-
- onComplete(childItems);
- }else{
-
- dojo.forEach(childItems, function(item, idx){
- if(!store.isItemLoaded(item)){
- store.loadItem({
- item: item,
- onItem: function(item){
- childItems[idx] = item;
- if(--_waitCount == 0){
-
- onComplete(childItems);
- }
- },
- onError: onError
- });
- }
- });
- }
- },
-
-
- isItem: function(/* anything */ something){
- return this.store.isItem(something);
- },
- fetchItemByIdentity: function(/* object */ keywordArgs){
- this.store.fetchItemByIdentity(keywordArgs);
- },
- getIdentity: function(/* item */ item){
- return this.store.getIdentity(item);
- },
- getLabel: function(/*dojo.data.Item*/ item){
-
-
- if(this.labelAttr){
- return this.store.getValue(item,this.labelAttr);
- }else{
- return this.store.getLabel(item);
- }
- },
-
-
- newItem: function(/* dojo.dnd.Item */ args, /*Item*/ parent, /*int?*/ insertIndex){
-
-
-
-
-
-
-
- var pInfo = {parent: parent, attribute: this.childrenAttrs[0]}, LnewItem;
- if(this.newItemIdAttr && args[this.newItemIdAttr]){
-
- this.fetchItemByIdentity({identity: args[this.newItemIdAttr], scope: this, onItem: function(item){
- if(item){
-
- this.pasteItem(item, null, parent, true, insertIndex);
- }else{
-
- LnewItem=this.store.newItem(args, pInfo);
- if (LnewItem && (insertIndex!=undefined)){
-
- this.pasteItem(LnewItem, parent, parent, false, insertIndex);
- }
- }
- }});
- }else{
-
- LnewItem=this.store.newItem(args, pInfo);
- if (LnewItem && (insertIndex!=undefined)){
-
- this.pasteItem(LnewItem, parent, parent, false, insertIndex);
- }
- }
- },
- pasteItem: function(/*Item*/ childItem, /*Item*/ oldParentItem, /*Item*/ newParentItem, /*Boolean*/ bCopy, /*int?*/ insertIndex){
-
-
-
- var store = this.store,
- parentAttr = this.childrenAttrs[0];
-
- if(oldParentItem){
- dojo.forEach(this.childrenAttrs, function(attr){
- if(store.containsValue(oldParentItem, attr, childItem)){
- if(!bCopy){
- var values = dojo.filter(store.getValues(oldParentItem, attr), function(x){
- return x != childItem;
- });
- store.setValues(oldParentItem, attr, values);
- }
- parentAttr = attr;
- }
- });
- }
-
- if(newParentItem){
- if(typeof insertIndex == "number"){
-
- var childItems = store.getValues(newParentItem, parentAttr).slice();
- childItems.splice(insertIndex, 0, childItem);
- store.setValues(newParentItem, parentAttr, childItems);
- }else{
- store.setValues(newParentItem, parentAttr,
- store.getValues(newParentItem, parentAttr).concat(childItem));
- }
- }
- },
-
-
- onChange: function(/*dojo.data.Item*/ item){
-
-
-
-
-
-
-
- },
- onChildrenChange: function(/*dojo.data.Item*/ parent, /*dojo.data.Item[]*/ newChildrenList){
-
-
-
-
- },
- onDelete: function(/*dojo.data.Item*/ parent, /*dojo.data.Item[]*/ newChildrenList){
-
-
-
-
-
-
-
- },
-
-
- onNewItem: function(/* dojo.data.Item */ item, /* Object */ parentInfo){
-
-
-
-
-
-
-
-
-
-
-
-
- if(!parentInfo){
- return;
- }
-
-
-
-
-
- this.getChildren(parentInfo.item, dojo.hitch(this, function(children){
- this.onChildrenChange(parentInfo.item, children);
- }));
- },
- onDeleteItem: function(/*Object*/ item){
-
-
- this.onDelete(item);
- },
- onSetItem: function(/* item */ item,
- /* attribute-name-string */ attribute,
- /* object | array */ oldValue,
- /* object | array */ newValue){
-
-
-
-
-
-
-
-
-
- if(dojo.indexOf(this.childrenAttrs, attribute) != -1){
-
- this.getChildren(item, dojo.hitch(this, function(children){
-
- this.onChildrenChange(item, children);
- }));
- }else{
-
- this.onChange(item);
- }
- }
- });
- }
- if(!dojo._hasResource["dijit.tree.ForestStoreModel"]){
- dojo._hasResource["dijit.tree.ForestStoreModel"] = true;
- dojo.provide("dijit.tree.ForestStoreModel");
- dojo.declare("dijit.tree.ForestStoreModel", dijit.tree.TreeStoreModel, {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- rootId: "$root$",
-
-
- rootLabel: "ROOT",
-
-
-
-
- query: null,
-
- constructor: function(params){
-
-
-
-
-
- this.root = {
- store: this,
- root: true,
- id: params.rootId,
- label: params.rootLabel,
- children: params.rootChildren
- };
- },
-
-
- mayHaveChildren: function(/*dojo.data.Item*/ item){
-
-
-
-
-
-
-
- return item === this.root || this.inherited(arguments);
- },
- getChildren: function(/*dojo.data.Item*/ parentItem, /*function(items)*/ callback, /*function*/ onError){
-
-
- if(parentItem === this.root){
- if(this.root.children){
-
- callback(this.root.children);
- }else{
- this.store.fetch({
- query: this.query,
- onComplete: dojo.hitch(this, function(items){
- this.root.children = items;
- callback(items);
- }),
- onError: onError
- });
- }
- }else{
- this.inherited(arguments);
- }
- },
-
-
- isItem: function(/* anything */ something){
- return (something === this.root) ? true : this.inherited(arguments);
- },
- fetchItemByIdentity: function(/* object */ keywordArgs){
- if(keywordArgs.identity == this.root.id){
- var scope = keywordArgs.scope?keywordArgs.scope:dojo.global;
- if(keywordArgs.onItem){
- keywordArgs.onItem.call(scope, this.root);
- }
- }else{
- this.inherited(arguments);
- }
- },
- getIdentity: function(/* item */ item){
- return (item === this.root) ? this.root.id : this.inherited(arguments);
- },
- getLabel: function(/* item */ item){
- return (item === this.root) ? this.root.label : this.inherited(arguments);
- },
-
-
- newItem: function(/* dojo.dnd.Item */ args, /*Item*/ parent, /*int?*/ insertIndex){
-
-
-
- if(parent === this.root){
- this.onNewRootItem(args);
- return this.store.newItem(args);
- }else{
- return this.inherited(arguments);
- }
- },
- onNewRootItem: function(args){
-
-
-
- },
- pasteItem: function(/*Item*/ childItem, /*Item*/ oldParentItem, /*Item*/ newParentItem, /*Boolean*/ bCopy, /*int?*/ insertIndex){
-
-
-
- if(oldParentItem === this.root){
- if(!bCopy){
-
-
-
- this.onLeaveRoot(childItem);
- }
- }
- dijit.tree.TreeStoreModel.prototype.pasteItem.call(this, childItem,
- oldParentItem === this.root ? null : oldParentItem,
- newParentItem === this.root ? null : newParentItem,
- bCopy,
- insertIndex
- );
- if(newParentItem === this.root){
-
-
-
- this.onAddToRoot(childItem);
- }
- },
-
-
- onAddToRoot: function(/* item */ item){
-
-
-
-
-
-
-
- console.log(this, ": item ", item, " added to root");
- },
- onLeaveRoot: function(/* item */ item){
-
-
-
-
-
-
-
- console.log(this, ": item ", item, " removed from root");
- },
-
-
- _requeryTop: function(){
-
-
- var oldChildren = this.root.children || [];
- this.store.fetch({
- query: this.query,
- onComplete: dojo.hitch(this, function(newChildren){
- this.root.children = newChildren;
-
- if(oldChildren.length != newChildren.length ||
- dojo.some(oldChildren, function(item, idx){ return newChildren[idx] != item;})){
- this.onChildrenChange(this.root, newChildren);
- }
- })
- });
- },
- onNewItem: function(/* dojo.data.Item */ item, /* Object */ parentInfo){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this._requeryTop();
- this.inherited(arguments);
- },
- onDeleteItem: function(/*Object*/ item){
-
-
-
-
- if(dojo.indexOf(this.root.children, item) != -1){
- this._requeryTop();
- }
- this.inherited(arguments);
- },
- onSetItem: function(/* item */ item,
- /* attribute-name-string */ attribute,
- /* object | array */ oldValue,
- /* object | array */ newValue){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this._requeryTop();
- this.inherited(arguments);
- }
- });
- }
- if(!dojo._hasResource["dijit.Tree"]){
- dojo._hasResource["dijit.Tree"] = true;
- dojo.provide("dijit.Tree");
- dojo.declare(
- "dijit._TreeNode",
- [dijit._Widget, dijit._Templated, dijit._Container, dijit._Contained, dijit._CssStateMixin],
- {
-
-
-
-
-
-
-
- item: null,
-
-
-
- isTreeNode: true,
-
-
- label: "",
-
-
- isExpandable: null,
-
-
- isExpanded: false,
-
-
-
-
- state: "UNCHECKED",
- templateString: dojo.cache("dijit", "templates/TreeNode.html", "<div class=\"dijitTreeNode\" role=\"presentation\"\n\t><div dojoAttachPoint=\"rowNode\" class=\"dijitTreeRow\" role=\"presentation\" dojoAttachEvent=\"onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick\"\n\t\t><img src=\"${_blankGif}\" alt=\"\" dojoAttachPoint=\"expandoNode\" class=\"dijitTreeExpando\" role=\"presentation\"\n\t\t/><span dojoAttachPoint=\"expandoNodeText\" class=\"dijitExpandoText\" role=\"presentation\"\n\t\t></span\n\t\t><span dojoAttachPoint=\"contentNode\"\n\t\t\tclass=\"dijitTreeContent\" role=\"presentation\">\n\t\t\t<img src=\"${_blankGif}\" alt=\"\" dojoAttachPoint=\"iconNode\" class=\"dijitIcon dijitTreeIcon\" role=\"presentation\"\n\t\t\t/><span dojoAttachPoint=\"labelNode\" class=\"dijitTreeLabel\" role=\"treeitem\" tabindex=\"-1\" aria-selected=\"false\" dojoAttachEvent=\"onfocus:_onLabelFocus\"></span>\n\t\t</span\n\t></div>\n\t<div dojoAttachPoint=\"containerNode\" class=\"dijitTreeContainer\" role=\"presentation\" style=\"display: none;\"></div>\n</div>\n"),
- baseClass: "dijitTreeNode",
-
- cssStateNodes: {
- rowNode: "dijitTreeRow",
- labelNode: "dijitTreeLabel"
- },
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- label: {node: "labelNode", type: "innerText"},
- tooltip: {node: "rowNode", type: "attribute", attribute: "title"}
- }),
- buildRendering: function(){
- this.inherited(arguments);
-
- this._setExpando();
-
- this._updateItemClasses(this.item);
- if(this.isExpandable){
- dijit.setWaiState(this.labelNode, "expanded", this.isExpanded);
- }
-
- this.setSelected(false);
- },
- _setIndentAttr: function(indent){
-
-
-
-
-
-
- var pixels = (Math.max(indent, 0) * this.tree._nodePixelIndent) + "px";
- dojo.style(this.domNode, "backgroundPosition", pixels + " 0px");
- dojo.style(this.rowNode, this.isLeftToRight() ? "paddingLeft" : "paddingRight", pixels);
- dojo.forEach(this.getChildren(), function(child){
- child.set("indent", indent+1);
- });
-
- this._set("indent", indent);
- },
- markProcessing: function(){
-
-
-
-
- this.state = "LOADING";
- this._setExpando(true);
- },
- unmarkProcessing: function(){
-
-
-
-
- this._setExpando(false);
- },
- _updateItemClasses: function(item){
-
-
-
-
-
- var tree = this.tree, model = tree.model;
- if(tree._v10Compat && item === model.root){
-
- item = null;
- }
- this._applyClassAndStyle(item, "icon", "Icon");
- this._applyClassAndStyle(item, "label", "Label");
- this._applyClassAndStyle(item, "row", "Row");
- },
- _applyClassAndStyle: function(item, lower, upper){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var clsName = "_" + lower + "Class";
- var nodeName = lower + "Node";
- var oldCls = this[clsName];
- this[clsName] = this.tree["get" + upper + "Class"](item, this.isExpanded);
- dojo.replaceClass(this[nodeName], this[clsName] || "", oldCls || "");
-
- dojo.style(this[nodeName], this.tree["get" + upper + "Style"](item, this.isExpanded) || {});
- },
- _updateLayout: function(){
-
-
-
-
- var parent = this.getParent();
- if(!parent || parent.rowNode.style.display == "none"){
-
- dojo.addClass(this.domNode, "dijitTreeIsRoot");
- }else{
- dojo.toggleClass(this.domNode, "dijitTreeIsLast", !this.getNextSibling());
- }
- },
- _setExpando: function(/*Boolean*/ processing){
-
-
-
-
- var styles = ["dijitTreeExpandoLoading", "dijitTreeExpandoOpened",
- "dijitTreeExpandoClosed", "dijitTreeExpandoLeaf"],
- _a11yStates = ["*","-","+","*"],
- idx = processing ? 0 : (this.isExpandable ? (this.isExpanded ? 1 : 2) : 3);
-
- dojo.replaceClass(this.expandoNode, styles[idx], styles);
-
- this.expandoNodeText.innerHTML = _a11yStates[idx];
- },
- expand: function(){
-
-
-
-
-
- if(this._expandDeferred){
- return this._expandDeferred;
- }
-
- this._wipeOut && this._wipeOut.stop();
-
-
- this.isExpanded = true;
- dijit.setWaiState(this.labelNode, "expanded", "true");
- if(this.tree.showRoot || this !== this.tree.rootNode){
- dijit.setWaiRole(this.containerNode, "group");
- }
- dojo.addClass(this.contentNode,'dijitTreeContentExpanded');
- this._setExpando();
- this._updateItemClasses(this.item);
- if(this == this.tree.rootNode){
- dijit.setWaiState(this.tree.domNode, "expanded", "true");
- }
- var def,
- wipeIn = dojo.fx.wipeIn({
- node: this.containerNode, duration: dijit.defaultDuration,
- onEnd: function(){
- def.callback(true);
- }
- });
-
- def = (this._expandDeferred = new dojo.Deferred(function(){
-
- wipeIn.stop();
- }));
- wipeIn.play();
- return def;
- },
- collapse: function(){
-
-
- if(!this.isExpanded){ return; }
-
- if(this._expandDeferred){
- this._expandDeferred.cancel();
- delete this._expandDeferred;
- }
- this.isExpanded = false;
- dijit.setWaiState(this.labelNode, "expanded", "false");
- if(this == this.tree.rootNode){
- dijit.setWaiState(this.tree.domNode, "expanded", "false");
- }
- dojo.removeClass(this.contentNode,'dijitTreeContentExpanded');
- this._setExpando();
- this._updateItemClasses(this.item);
- if(!this._wipeOut){
- this._wipeOut = dojo.fx.wipeOut({
- node: this.containerNode, duration: dijit.defaultDuration
- });
- }
- this._wipeOut.play();
- },
-
-
- indent: 0,
- setChildItems: function(/* Object[] */ items){
-
-
-
-
-
-
-
-
- var tree = this.tree,
- model = tree.model,
- defs = [];
-
-
-
- dojo.forEach(this.getChildren(), function(child){
- dijit._Container.prototype.removeChild.call(this, child);
- }, this);
- this.state = "LOADED";
- if(items && items.length > 0){
- this.isExpandable = true;
-
-
-
- dojo.forEach(items, function(item){
- var id = model.getIdentity(item),
- existingNodes = tree._itemNodesMap[id],
- node;
- if(existingNodes){
- for(var i=0;i<existingNodes.length;i++){
- if(existingNodes[i] && !existingNodes[i].getParent()){
- node = existingNodes[i];
- node.set('indent', this.indent+1);
- break;
- }
- }
- }
- if(!node){
- node = this.tree._createTreeNode({
- item: item,
- tree: tree,
- isExpandable: model.mayHaveChildren(item),
- label: tree.getLabel(item),
- tooltip: tree.getTooltip(item),
- dir: tree.dir,
- lang: tree.lang,
- indent: this.indent + 1
- });
- if(existingNodes){
- existingNodes.push(node);
- }else{
- tree._itemNodesMap[id] = [node];
- }
- }
- this.addChild(node);
-
-
- if(this.tree.autoExpand || this.tree._state(item)){
- defs.push(tree._expandNode(node));
- }
- }, this);
-
-
- dojo.forEach(this.getChildren(), function(child, idx){
- child._updateLayout();
- });
- }else{
- this.isExpandable=false;
- }
- if(this._setExpando){
-
- this._setExpando(false);
- }
-
- this._updateItemClasses(this.item);
-
-
- if(this == tree.rootNode){
- var fc = this.tree.showRoot ? this : this.getChildren()[0];
- if(fc){
- fc.setFocusable(true);
- tree.lastFocused = fc;
- }else{
-
- tree.domNode.setAttribute("tabIndex", "0");
- }
- }
- return new dojo.DeferredList(defs);
- },
- getTreePath: function(){
- var node = this;
- var path = [];
- while(node && node !== this.tree.rootNode){
- path.unshift(node.item);
- node = node.getParent();
- }
- path.unshift(this.tree.rootNode.item);
- return path;
- },
- getIdentity: function() {
- return this.tree.model.getIdentity(this.item);
- },
- removeChild: function(/* treeNode */ node){
- this.inherited(arguments);
- var children = this.getChildren();
- if(children.length == 0){
- this.isExpandable = false;
- this.collapse();
- }
- dojo.forEach(children, function(child){
- child._updateLayout();
- });
- },
- makeExpandable: function(){
-
-
-
-
- this.isExpandable = true;
- this._setExpando(false);
- },
- _onLabelFocus: function(evt){
-
-
-
-
-
-
- this.tree._onNodeFocus(this);
- },
- setSelected: function(/*Boolean*/ selected){
-
-
-
-
-
-
- dijit.setWaiState(this.labelNode, "selected", selected);
- dojo.toggleClass(this.rowNode, "dijitTreeRowSelected", selected);
- },
- setFocusable: function(/*Boolean*/ selected){
-
-
-
-
-
-
- this.labelNode.setAttribute("tabIndex", selected ? "0" : "-1");
- },
- _onClick: function(evt){
-
-
-
-
- this.tree._onClick(this, evt);
- },
- _onDblClick: function(evt){
-
-
-
-
- this.tree._onDblClick(this, evt);
- },
- _onMouseEnter: function(evt){
-
-
-
-
- this.tree._onNodeMouseEnter(this, evt);
- },
- _onMouseLeave: function(evt){
-
-
-
-
- this.tree._onNodeMouseLeave(this, evt);
- }
- });
- dojo.declare(
- "dijit.Tree",
- [dijit._Widget, dijit._Templated],
- {
-
-
-
-
-
- store: null,
-
-
-
- model: null,
-
-
-
- query: null,
-
-
-
-
-
- label: "",
-
-
- showRoot: true,
-
-
-
- childrenAttr: ["children"],
-
-
-
-
- paths: [],
-
-
-
- path: [],
-
-
-
-
-
- selectedItems: null,
-
-
- selectedItem: null,
-
-
- openOnClick: false,
-
-
- openOnDblClick: false,
- templateString: dojo.cache("dijit", "templates/Tree.html", "<div class=\"dijitTree dijitTreeContainer\" role=\"tree\"\n\tdojoAttachEvent=\"onkeypress:_onKeyPress\">\n\t<div class=\"dijitInline dijitTreeIndent\" style=\"position: absolute; top: -9999px\" dojoAttachPoint=\"indentDetector\"></div>\n</div>\n"),
-
-
- persist: true,
-
-
- autoExpand: false,
-
-
-
-
- dndController: "dijit.tree._dndSelector",
-
- dndParams: ["onDndDrop","itemCreator","onDndCancel","checkAcceptance", "checkItemAcceptance", "dragThreshold", "betweenThreshold"],
-
-
-
-
- onDndDrop: null,
-
- itemCreator: null,
-
-
-
- onDndCancel: null,
- checkAcceptance: null,
- checkItemAcceptance: null,
-
-
- dragThreshold: 5,
-
-
-
-
-
-
-
-
-
-
- betweenThreshold: 0,
-
-
-
-
- _nodePixelIndent: 19,
- _publish: function(/*String*/ topicName, /*Object*/ message){
-
-
- dojo.publish(this.id, [dojo.mixin({tree: this, event: topicName}, message || {})]);
- },
- postMixInProperties: function(){
- this.tree = this;
- if(this.autoExpand){
-
-
- this.persist = false;
- }
- this._itemNodesMap={};
- if(!this.cookieName){
- this.cookieName = this.id + "SaveStateCookie";
- }
- this._loadDeferred = new dojo.Deferred();
- this.inherited(arguments);
- },
- postCreate: function(){
- this._initState();
-
- if(!this.model){
- this._store2model();
- }
-
- this.connect(this.model, "onChange", "_onItemChange");
- this.connect(this.model, "onChildrenChange", "_onItemChildrenChange");
- this.connect(this.model, "onDelete", "_onItemDelete");
- this._load();
- this.inherited(arguments);
- if(this.dndController){
- if(dojo.isString(this.dndController)){
- this.dndController = dojo.getObject(this.dndController);
- }
- var params={};
- for(var i=0; i<this.dndParams.length;i++){
- if(this[this.dndParams[i]]){
- params[this.dndParams[i]] = this[this.dndParams[i]];
- }
- }
- this.dndController = new this.dndController(this, params);
- }
- },
- _store2model: function(){
-
-
- this._v10Compat = true;
- dojo.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");
- var modelParams = {
- id: this.id + "_ForestStoreModel",
- store: this.store,
- query: this.query,
- childrenAttrs: this.childrenAttr
- };
-
- if(this.params.mayHaveChildren){
- modelParams.mayHaveChildren = dojo.hitch(this, "mayHaveChildren");
- }
- if(this.params.getItemChildren){
- modelParams.getChildren = dojo.hitch(this, function(item, onComplete, onError){
- this.getItemChildren((this._v10Compat && item === this.model.root) ? null : item, onComplete, onError);
- });
- }
- this.model = new dijit.tree.ForestStoreModel(modelParams);
-
-
- this.showRoot = Boolean(this.label);
- },
- onLoad: function(){
-
-
-
-
-
-
-
- },
- _load: function(){
-
-
-
- this.model.getRoot(
- dojo.hitch(this, function(item){
- var rn = (this.rootNode = this.tree._createTreeNode({
- item: item,
- tree: this,
- isExpandable: true,
- label: this.label || this.getLabel(item),
- indent: this.showRoot ? 0 : -1
- }));
- if(!this.showRoot){
- rn.rowNode.style.display="none";
-
-
- dijit.setWaiRole(this.domNode, 'presentation');
-
- dijit.setWaiRole(rn.labelNode, 'presentation');
- dijit.setWaiRole(rn.containerNode, 'tree');
- }
- this.domNode.appendChild(rn.domNode);
- var identity = this.model.getIdentity(item);
- if(this._itemNodesMap[identity]){
- this._itemNodesMap[identity].push(rn);
- }else{
- this._itemNodesMap[identity] = [rn];
- }
- rn._updateLayout();
-
- this._expandNode(rn).addCallback(dojo.hitch(this, function(){
- this._loadDeferred.callback(true);
- this.onLoad();
- }));
- }),
- function(err){
- console.error(this, ": error loading root: ", err);
- }
- );
- },
- getNodesByItem: function(/*dojo.data.Item or id*/ item){
-
-
-
-
- if(!item){ return []; }
- var identity = dojo.isString(item) ? item : this.model.getIdentity(item);
-
- return [].concat(this._itemNodesMap[identity]);
- },
- _setSelectedItemAttr: function(/*dojo.data.Item or id*/ item){
- this.set('selectedItems', [item]);
- },
- _setSelectedItemsAttr: function(/*dojo.data.Items or ids*/ items){
-
-
-
-
- var tree = this;
- this._loadDeferred.addCallback( dojo.hitch(this, function(){
- var identities = dojo.map(items, function(item){
- return (!item || dojo.isString(item)) ? item : tree.model.getIdentity(item);
- });
- var nodes = [];
- dojo.forEach(identities, function(id){
- nodes = nodes.concat(tree._itemNodesMap[id] || []);
- });
- this.set('selectedNodes', nodes);
- }));
- },
- _setPathAttr: function(/*Item[] || String[]*/ path){
-
-
- if(path.length) {
- return this.set("paths", [path]);
- } else {
-
- return this.set("paths", []);
- }
- },
-
- _setPathsAttr: function(/*Item[][] || String[][]*/ paths){
-
-
-
-
-
-
- var tree = this;
-
-
-
- return new dojo.DeferredList(dojo.map(paths, function(path){
- var d = new dojo.Deferred();
-
-
- path = dojo.map(path, function(item){
- return dojo.isString(item) ? item : tree.model.getIdentity(item);
- });
- if(path.length){
-
- tree._loadDeferred.addCallback(function(){ selectPath(path, [tree.rootNode], d); });
- }else{
- d.errback("Empty path");
- }
- return d;
- })).addCallback(setNodes);
- function selectPath(path, nodes, def){
-
- var nextPath = path.shift();
- var nextNode = dojo.filter(nodes, function(node){
- return node.getIdentity() == nextPath;
- })[0];
- if(!!nextNode){
- if(path.length){
- tree._expandNode(nextNode).addCallback(function(){ selectPath(path, nextNode.getChildren(), def); });
- }else{
-
- def.callback(nextNode);
- }
- } else {
- def.errback("Could not expand path at " + nextPath);
- }
- }
-
- function setNodes(newNodes){
-
-
- tree.set("selectedNodes", dojo.map(
- dojo.filter(newNodes,function(x){return x[0];}),
- function(x){return x[1];}));
- }
- },
- _setSelectedNodeAttr: function(node){
- this.set('selectedNodes', [node]);
- },
- _setSelectedNodesAttr: function(nodes){
- this._loadDeferred.addCallback( dojo.hitch(this, function(){
- this.dndController.setSelection(nodes);
- }));
- },
-
-
- mayHaveChildren: function(/*dojo.data.Item*/ item){
-
-
-
-
-
-
-
-
-
- },
- getItemChildren: function(/*dojo.data.Item*/ parentItem, /*function(items)*/ onComplete){
-
-
-
-
-
-
-
- },
-
-
- getLabel: function(/*dojo.data.Item*/ item){
-
-
-
-
- return this.model.getLabel(item);
- },
- getIconClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
-
-
-
-
- return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "dijitLeaf"
- },
- getLabelClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
-
-
-
-
- },
- getRowClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
-
-
-
-
- },
- getIconStyle: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
-
-
-
-
-
-
- },
- getLabelStyle: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
-
-
-
-
-
-
- },
- getRowStyle: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
-
-
-
-
-
-
- },
- getTooltip: function(/*dojo.data.Item*/ item){
-
-
-
-
- return "";
- },
-
- _onKeyPress: function(/*Event*/ e){
-
-
- if(e.altKey){ return; }
- var dk = dojo.keys;
- var treeNode = dijit.getEnclosingWidget(e.target);
- if(!treeNode){ return; }
- var key = e.charOrCode;
- if(typeof key == "string" && key != " "){
-
- if(!e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey){
- this._onLetterKeyNav( { node: treeNode, key: key.toLowerCase() } );
- dojo.stopEvent(e);
- }
- }else{
-
-
- if(this._curSearch){
- clearTimeout(this._curSearch.timer);
- delete this._curSearch;
- }
- var map = this._keyHandlerMap;
- if(!map){
-
- map = {};
- map[dk.ENTER]="_onEnterKey";
-
-
-
-
- map[dk.SPACE]= map[" "] = "_onEnterKey";
- map[this.isLeftToRight() ? dk.LEFT_ARROW : dk.RIGHT_ARROW]="_onLeftArrow";
- map[this.isLeftToRight() ? dk.RIGHT_ARROW : dk.LEFT_ARROW]="_onRightArrow";
- map[dk.UP_ARROW]="_onUpArrow";
- map[dk.DOWN_ARROW]="_onDownArrow";
- map[dk.HOME]="_onHomeKey";
- map[dk.END]="_onEndKey";
- this._keyHandlerMap = map;
- }
- if(this._keyHandlerMap[key]){
- this[this._keyHandlerMap[key]]( { node: treeNode, item: treeNode.item, evt: e } );
- dojo.stopEvent(e);
- }
- }
- },
- _onEnterKey: function(/*Object*/ message){
- this._publish("execute", { item: message.item, node: message.node } );
- this.dndController.userSelect(message.node, dojo.isCopyKey( message.evt ), message.evt.shiftKey);
- this.onClick(message.item, message.node, message.evt);
- },
- _onDownArrow: function(/*Object*/ message){
-
-
- var node = this._getNextNode(message.node);
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- },
- _onUpArrow: function(/*Object*/ message){
-
-
- var node = message.node;
-
- var previousSibling = node.getPreviousSibling();
- if(previousSibling){
- node = previousSibling;
-
- while(node.isExpandable && node.isExpanded && node.hasChildren()){
-
- var children = node.getChildren();
- node = children[children.length-1];
- }
- }else{
-
-
- var parent = node.getParent();
- if(!(!this.showRoot && parent === this.rootNode)){
- node = parent;
- }
- }
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- },
- _onRightArrow: function(/*Object*/ message){
-
-
- var node = message.node;
-
- if(node.isExpandable && !node.isExpanded){
- this._expandNode(node);
- }else if(node.hasChildren()){
- node = node.getChildren()[0];
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- }
- },
- _onLeftArrow: function(/*Object*/ message){
-
-
-
- var node = message.node;
- if(node.isExpandable && node.isExpanded){
- this._collapseNode(node);
- }else{
- var parent = node.getParent();
- if(parent && parent.isTreeNode && !(!this.showRoot && parent === this.rootNode)){
- this.focusNode(parent);
- }
- }
- },
- _onHomeKey: function(){
-
-
- var node = this._getRootOrFirstNode();
- if(node){
- this.focusNode(node);
- }
- },
- _onEndKey: function(/*Object*/ message){
-
-
- var node = this.rootNode;
- while(node.isExpanded){
- var c = node.getChildren();
- node = c[c.length - 1];
- }
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- },
-
-
-
-
-
-
-
- multiCharSearchDuration: 250,
- _onLetterKeyNav: function(message){
-
-
-
-
-
- var cs = this._curSearch;
- if(cs){
-
-
- cs.pattern = cs.pattern + message.key;
- clearTimeout(cs.timer);
- }else{
-
- cs = this._curSearch = {
- pattern: message.key,
- startNode: message.node
- };
- }
-
- var self = this;
- cs.timer = setTimeout(function(){
- delete self._curSearch;
- }, this.multiCharSearchDuration);
-
- var node = cs.startNode;
- do{
- node = this._getNextNode(node);
-
- if(!node){
- node = this._getRootOrFirstNode();
- }
- }while(node !== cs.startNode && (node.label.toLowerCase().substr(0, cs.pattern.length) != cs.pattern));
- if(node && node.isTreeNode){
-
- if(node !== cs.startNode){
- this.focusNode(node);
- }
- }
- },
- isExpandoNode: function(node, widget){
-
-
- return dojo.isDescendant(node, widget.expandoNode);
- },
- _onClick: function(/*TreeNode*/ nodeWidget, /*Event*/ e){
-
-
- var domElement = e.target,
- isExpandoClick = this.isExpandoNode(domElement, nodeWidget);
- if( (this.openOnClick && nodeWidget.isExpandable) || isExpandoClick ){
-
- if(nodeWidget.isExpandable){
- this._onExpandoClick({node:nodeWidget});
- }
- }else{
- this._publish("execute", { item: nodeWidget.item, node: nodeWidget, evt: e } );
- this.onClick(nodeWidget.item, nodeWidget, e);
- this.focusNode(nodeWidget);
- }
- dojo.stopEvent(e);
- },
- _onDblClick: function(/*TreeNode*/ nodeWidget, /*Event*/ e){
-
-
- var domElement = e.target,
- isExpandoClick = (domElement == nodeWidget.expandoNode || domElement == nodeWidget.expandoNodeText);
- if( (this.openOnDblClick && nodeWidget.isExpandable) ||isExpandoClick ){
-
- if(nodeWidget.isExpandable){
- this._onExpandoClick({node:nodeWidget});
- }
- }else{
- this._publish("execute", { item: nodeWidget.item, node: nodeWidget, evt: e } );
- this.onDblClick(nodeWidget.item, nodeWidget, e);
- this.focusNode(nodeWidget);
- }
- dojo.stopEvent(e);
- },
- _onExpandoClick: function(/*Object*/ message){
-
-
- var node = message.node;
-
-
-
- this.focusNode(node);
- if(node.isExpanded){
- this._collapseNode(node);
- }else{
- this._expandNode(node);
- }
- },
- onClick: function(/* dojo.data */ item, /*TreeNode*/ node, /*Event*/ evt){
-
-
-
-
- },
- onDblClick: function(/* dojo.data */ item, /*TreeNode*/ node, /*Event*/ evt){
-
-
-
-
- },
- onOpen: function(/* dojo.data */ item, /*TreeNode*/ node){
-
-
-
-
- },
- onClose: function(/* dojo.data */ item, /*TreeNode*/ node){
-
-
-
-
- },
- _getNextNode: function(node){
-
-
- if(node.isExpandable && node.isExpanded && node.hasChildren()){
-
- return node.getChildren()[0];
- }else{
-
- while(node && node.isTreeNode){
- var returnNode = node.getNextSibling();
- if(returnNode){
- return returnNode;
- }
- node = node.getParent();
- }
- return null;
- }
- },
- _getRootOrFirstNode: function(){
-
-
- return this.showRoot ? this.rootNode : this.rootNode.getChildren()[0];
- },
- _collapseNode: function(/*_TreeNode*/ node){
-
-
- if(node._expandNodeDeferred){
- delete node._expandNodeDeferred;
- }
- if(node.isExpandable){
- if(node.state == "LOADING"){
-
- return;
- }
- node.collapse();
- this.onClose(node.item, node);
- if(node.item){
- this._state(node.item,false);
- this._saveState();
- }
- }
- },
- _expandNode: function(/*_TreeNode*/ node, /*Boolean?*/ recursive){
-
-
-
-
-
-
-
- if(node._expandNodeDeferred && !recursive){
-
- return node._expandNodeDeferred;
- }
- var model = this.model,
- item = node.item,
- _this = this;
- switch(node.state){
- case "UNCHECKED":
-
- node.markProcessing();
-
-
- var def = (node._expandNodeDeferred = new dojo.Deferred());
-
- model.getChildren(
- item,
- function(items){
- node.unmarkProcessing();
-
-
- var scid = node.setChildItems(items);
-
-
-
- var ed = _this._expandNode(node, true);
-
-
- scid.addCallback(function(){
- ed.addCallback(function(){
- def.callback();
- })
- });
- },
- function(err){
- console.error(_this, ": error loading root children: ", err);
- }
- );
- break;
- default:
-
- def = (node._expandNodeDeferred = node.expand());
- this.onOpen(node.item, node);
- if(item){
- this._state(item, true);
- this._saveState();
- }
- }
- return def;
- },
-
- focusNode: function(/* _tree.Node */ node){
-
-
-
-
-
- dijit.focus(node.labelNode);
- },
- _onNodeFocus: function(/*dijit._Widget*/ node){
-
-
-
-
-
-
- if(node && node != this.lastFocused){
- if(this.lastFocused && !this.lastFocused._destroyed){
-
- this.lastFocused.setFocusable(false);
- }
-
- node.setFocusable(true);
- this.lastFocused = node;
- }
- },
- _onNodeMouseEnter: function(/*dijit._Widget*/ node){
-
-
-
- },
- _onNodeMouseLeave: function(/*dijit._Widget*/ node){
-
-
-
- },
-
- _onItemChange: function(/*Item*/ item){
-
-
- var model = this.model,
- identity = model.getIdentity(item),
- nodes = this._itemNodesMap[identity];
- if(nodes){
- var label = this.getLabel(item),
- tooltip = this.getTooltip(item);
- dojo.forEach(nodes, function(node){
- node.set({
- item: item,
- label: label,
- tooltip: tooltip
- });
- node._updateItemClasses(item);
- });
- }
- },
- _onItemChildrenChange: function(/*dojo.data.Item*/ parent, /*dojo.data.Item[]*/ newChildrenList){
-
-
- var model = this.model,
- identity = model.getIdentity(parent),
- parentNodes = this._itemNodesMap[identity];
- if(parentNodes){
- dojo.forEach(parentNodes,function(parentNode){
- parentNode.setChildItems(newChildrenList);
- });
- }
- },
- _onItemDelete: function(/*Item*/ item){
-
-
- var model = this.model,
- identity = model.getIdentity(item),
- nodes = this._itemNodesMap[identity];
- if(nodes){
- dojo.forEach(nodes,function(node){
-
- this.dndController.removeTreeNode(node);
- var parent = node.getParent();
- if(parent){
-
- parent.removeChild(node);
- }
- node.destroyRecursive();
- }, this);
- delete this._itemNodesMap[identity];
- }
- },
-
- _initState: function(){
-
-
- if(this.persist){
- var cookie = dojo.cookie(this.cookieName);
- this._openedItemIds = {};
- if(cookie){
- dojo.forEach(cookie.split(','), function(item){
- this._openedItemIds[item] = true;
- }, this);
- }
- }
- },
- _state: function(item,expanded){
-
-
- if(!this.persist){
- return false;
- }
- var id=this.model.getIdentity(item);
- if(arguments.length === 1){
- return this._openedItemIds[id];
- }
- if(expanded){
- this._openedItemIds[id] = true;
- }else{
- delete this._openedItemIds[id];
- }
- },
- _saveState: function(){
-
-
- if(!this.persist){
- return;
- }
- var ary = [];
- for(var id in this._openedItemIds){
- ary.push(id);
- }
- dojo.cookie(this.cookieName, ary.join(","), {expires:365});
- },
- destroy: function(){
- if(this._curSearch){
- clearTimeout(this._curSearch.timer);
- delete this._curSearch;
- }
- if(this.rootNode){
- this.rootNode.destroyRecursive();
- }
- if(this.dndController && !dojo.isString(this.dndController)){
- this.dndController.destroy();
- }
- this.rootNode = null;
- this.inherited(arguments);
- },
- destroyRecursive: function(){
-
-
- this.destroy();
- },
- resize: function(changeSize){
- if(changeSize){
- dojo.marginBox(this.domNode, changeSize);
- }
-
-
-
- this._nodePixelIndent = dojo._getMarginSize(this.tree.indentDetector).w;
- if(this.tree.rootNode){
-
- this.tree.rootNode.set('indent', this.showRoot ? 0 : -1);
- }
- },
- _createTreeNode: function(/*Object*/ args){
-
-
-
-
-
-
-
- return new dijit._TreeNode(args);
- }
- });
- }
- if(!dojo._hasResource["dojox.xml.parser"]){
- dojo._hasResource["dojox.xml.parser"] = true;
- dojo.provide("dojox.xml.parser");
- dojox.xml.parser.parse = function(/*String?*/ str, /*String?*/ mimetype){
-
-
-
-
-
-
-
-
- var _document = dojo.doc;
- var doc;
- mimetype = mimetype || "text/xml";
- if(str && dojo.trim(str) && "DOMParser" in dojo.global){
-
- var parser = new DOMParser();
- doc = parser.parseFromString(str, mimetype);
- var de = doc.documentElement;
- var errorNS = "http://www.mozilla.org/newlayout/xml/parsererror.xml";
- if(de.nodeName == "parsererror" && de.namespaceURI == errorNS){
- var sourceText = de.getElementsByTagNameNS(errorNS, 'sourcetext')[0];
- if(sourceText){
- sourceText = sourceText.firstChild.data;
- }
- throw new Error("Error parsing text " + de.firstChild.data + " \n" + sourceText);
- }
- return doc;
- }else if("ActiveXObject" in dojo.global){
-
- var ms = function(n){ return "MSXML" + n + ".DOMDocument"; };
- var dp = ["Microsoft.XMLDOM", ms(6), ms(4), ms(3), ms(2)];
- dojo.some(dp, function(p){
- try{
- doc = new ActiveXObject(p);
- }catch(e){ return false; }
- return true;
- });
- if(str && doc){
- doc.async = false;
- doc.loadXML(str);
- var pe = doc.parseError;
- if(pe.errorCode !== 0){
- throw new Error("Line: " + pe.line + "\n" +
- "Col: " + pe.linepos + "\n" +
- "Reason: " + pe.reason + "\n" +
- "Error Code: " + pe.errorCode + "\n" +
- "Source: " + pe.srcText);
- }
- }
- if(doc){
- return doc;
- }
- }else if(_document.implementation && _document.implementation.createDocument){
- if(str && dojo.trim(str) && _document.createElement){
-
-
- var tmp = _document.createElement("xml");
- tmp.innerHTML = str;
- var xmlDoc = _document.implementation.createDocument("foo", "", null);
- dojo.forEach(tmp.childNodes, function(child){
- xmlDoc.importNode(child, true);
- });
- return xmlDoc;
- }else{
- return _document.implementation.createDocument("", "", null);
- }
- }
- return null;
- }
- dojox.xml.parser.textContent = function(/*Node*/node, /*String?*/text){
-
-
-
-
-
-
-
-
-
-
- if(arguments.length>1){
- var _document = node.ownerDocument || dojo.doc;
- dojox.xml.parser.replaceChildren(node, _document.createTextNode(text));
- return text;
- }else{
- if(node.textContent !== undefined){
- return node.textContent;
- }
- var _result = "";
- if(node){
- dojo.forEach(node.childNodes, function(child){
- switch(child.nodeType){
- case 1:
- case 5:
- _result += dojox.xml.parser.textContent(child);
- break;
- case 3:
- case 2:
- case 4:
- _result += child.nodeValue;
- }
- });
- }
- return _result;
- }
- }
- dojox.xml.parser.replaceChildren = function(/*Element*/node, /*Node || Array*/ newChildren){
-
-
-
-
-
-
-
-
-
-
-
- var nodes = [];
- if(dojo.isIE){
- dojo.forEach(node.childNodes, function(child){
- nodes.push(child);
- });
- }
- dojox.xml.parser.removeChildren(node);
- dojo.forEach(nodes, dojo.destroy);
- if(!dojo.isArray(newChildren)){
- node.appendChild(newChildren);
- }else{
- dojo.forEach(newChildren, function(child){
- node.appendChild(child);
- });
- }
- }
- dojox.xml.parser.removeChildren = function(/*Element*/node){
-
-
-
-
-
-
- var count = node.childNodes.length;
- while(node.hasChildNodes()){
- node.removeChild(node.firstChild);
- }
- return count;
- }
- dojox.xml.parser.innerXML = function(/*Node*/node){
-
-
-
-
- if(node.innerXML){
- return node.innerXML;
- }else if(node.xml){
- return node.xml;
- }else if(typeof XMLSerializer != "undefined"){
- return (new XMLSerializer()).serializeToString(node);
- }
- return null;
- }
- }
- if(!dojo._hasResource["dojox.xml.DomParser"]){
- dojo._hasResource["dojox.xml.DomParser"] = true;
- dojo.provide("dojox.xml.DomParser");
- dojox.xml.DomParser=new (function(){
-
-
- var nodeTypes={ ELEMENT:1, ATTRIBUTE:2, TEXT:3, CDATA_SECTION:4, PROCESSING_INSTRUCTION:7, COMMENT:8, DOCUMENT:9 };
-
- var reTags=/<([^>\/\s+]*)([^>]*)>([^<]*)/g;
- var reAttr=/([^=]*)=(("([^"]*)")|('([^']*)'))/g;
- var reEntity=/<!ENTITY\s+([^"]*)\s+"([^"]*)">/g;
- var reCData=/<!\[CDATA\[([\u0001-\uFFFF]*?)\]\]>/g;
- var reComments=/<!--([\u0001-\uFFFF]*?)-->/g;
- var trim=/^\s+|\s+$/g;
- var normalize=/\s+/g;
- var egt=/\>/g;
- var elt=/\</g;
- var equot=/\"/g;
- var eapos=/\'/g;
- var eamp=/\&/g;
- var dNs="_def_";
-
- function _doc(){
- return new (function(){
- var all={};
- this.nodeType=nodeTypes.DOCUMENT;
- this.nodeName="#document";
- this.namespaces={};
- this._nsPaths={};
- this.childNodes=[];
- this.documentElement=null;
-
- this._add=function(obj){
- if(typeof(obj.id)!="undefined"){ all[obj.id]=obj; }
- };
- this._remove=function(id){
- if(all[id]){ delete all[id]; }
- };
- this.byId=this.getElementById=function(id){ return all[id]; };
- this.byName=this.getElementsByTagName=byName;
- this.byNameNS=this.getElementsByTagNameNS=byNameNS;
- this.childrenByName=childrenByName;
- this.childrenByNameNS=childrenByNameNS;
- })();
- }
-
- function byName(name){
-
- function __(node, name, arr){
- dojo.forEach(node.childNodes, function(c){
- if(c.nodeType==nodeTypes.ELEMENT){
- if(name=="*"){ arr.push(c); }
- else if(c.nodeName==name){ arr.push(c); }
- __(c, name, arr);
- }
- });
- }
- var a=[];
- __(this, name, a);
- return a;
- }
- function byNameNS(name, ns){
-
- function __(node, name, ns, arr){
- dojo.forEach(node.childNodes, function(c){
- if(c.nodeType==nodeTypes.ELEMENT){
- if(name=="*"&&c.ownerDocument._nsPaths[ns]==c.namespace){ arr.push(c); }
- else if(c.localName==name&&c.ownerDocument._nsPaths[ns]==c.namespace){ arr.push(c); }
- __(c, name, ns, arr);
- }
- });
- }
- if(!ns){ ns=dNs; }
- var a=[];
- __(this, name, ns, a);
- return a;
- }
-
- function childrenByName(name){
- var a=[];
- dojo.forEach(this.childNodes, function(c){
- if(c.nodeType==nodeTypes.ELEMENT){
- if(name=="*"){ a.push(c); }
- else if(c.nodeName==name){ a.push(c); }
- }
- });
- return a;
- }
- function childrenByNameNS(name, ns){
- var a=[];
- dojo.forEach(this.childNodes, function(c){
- if(c.nodeType==nodeTypes.ELEMENT){
- if(name=="*"&&c.ownerDocument._nsPaths[ns]==c.namespace){ a.push(c); }
- else if(c.localName==name&&c.ownerDocument._nsPaths[ns]==c.namespace){ a.push(c); }
- }
- });
- return a;
- }
- function _createTextNode(v){
- return {
- nodeType:nodeTypes.TEXT,
- nodeName:"#text",
- nodeValue:v.replace(normalize," ").replace(egt,">").replace(elt,"<").replace(eapos,"'").replace(equot,'"').replace(eamp,"&")
- };
- }
-
- function getAttr(name){
- for(var i=0; i<this.attributes.length; i++){
- if(this.attributes[i].nodeName==name){
- return this.attributes[i].nodeValue;
- }
- }
- return null;
- }
- function getAttrNS(name, ns){
- for(var i=0; i<this.attributes.length; i++){
- if(this.ownerDocument._nsPaths[ns]==this.attributes[i].namespace
- &&this.attributes[i].localName==name
- ){
- return this.attributes[i].nodeValue;
- }
- }
- return null;
- }
-
- function setAttr(name, val){
- var old=null;
- for(var i=0; i<this.attributes.length; i++){
- if(this.attributes[i].nodeName==name){
- old=this.attributes[i].nodeValue;
- this.attributes[i].nodeValue=val;
- break;
- }
- }
- if(name=="id"){
- if(old!=null){ this.ownerDocument._remove(old); }
- this.ownerDocument._add(this);
- }
- }
- function setAttrNS(name, val, ns){
- for(var i=0; i<this.attributes.length; i++){
- if(this.ownerDocument._nsPaths[ns]==this.attributes[i].namespace
- &&this.attributes[i].localName==name
- ){
- this.attributes[i].nodeValue=val;
- return;
- }
- }
- }
-
- function prev(){
- var p=this.parentNode;
- if(p){
- for(var i=0;i<p.childNodes.length;i++){
- if(p.childNodes[i]==this&&i>0){
- return p.childNodes[i-1];
- }
- }
- }
- return null;
- }
- function next(){
- var p=this.parentNode;
- if(p){
- for(var i=0;i<p.childNodes.length;i++){
- if(p.childNodes[i]==this&&(i+1)<p.childNodes.length){
- return p.childNodes[i+1];
- }
- }
- }
- return null;
- }
-
- this.parse=function(/* String */str){
- var root=_doc();
- if(str==null){ return root; }
- if(str.length==0){ return root; }
-
- if(str.indexOf("<!ENTITY")>0){
- var entity, eRe=[];
- if(reEntity.test(str)){
- reEntity.lastIndex=0;
-
- while((entity=reEntity.exec(str))!=null){
- eRe.push({
- entity:"&"+entity[1].replace(trim,"")+";",
- expression:entity[2]
- });
- }
-
- for(var i=0; i<eRe.length; i++){
- str=str.replace(new RegExp(eRe[i].entity, "g"), eRe[i].expression);
- }
- }
- }
-
- var cdSections=[], cdata;
- while((cdata=reCData.exec(str))!=null){ cdSections.push(cdata[1]); }
- for(var i=0; i<cdSections.length; i++){ str=str.replace(cdSections[i], i); }
-
-
- var comments=[], comment;
- while((comment=reComments.exec(str))!=null){ comments.push(comment[1]); }
- for(i=0; i<comments.length; i++){ str=str.replace(comments[i], i); }
-
- var res, obj=root;
- while((res=reTags.exec(str))!=null){
-
- if(res[2].charAt(0)=="/" && res[2].replace(trim, "").length>1){
- if(obj.parentNode){
- obj=obj.parentNode;
- }
- var text=(res[3]||"").replace(trim, "");
- if(text.length>0) {
- obj.childNodes.push(_createTextNode(text));
- }
- }
-
- else if(res[1].length>0){
-
- if(res[1].charAt(0)=="?"){
-
- var name=res[1].substr(1);
- var target=res[2].substr(0,res[2].length-2);
- obj.childNodes.push({
- nodeType:nodeTypes.PROCESSING_INSTRUCTION,
- nodeName:name,
- nodeValue:target
- });
- }
- else if(res[1].charAt(0)=="!"){
-
- if(res[1].indexOf("![CDATA[")==0){
- var val=parseInt(res[1].replace("![CDATA[","").replace("]]",""));
- obj.childNodes.push({
- nodeType:nodeTypes.CDATA_SECTION,
- nodeName:"#cdata-section",
- nodeValue:cdSections[val]
- });
- }
-
- else if(res[1].substr(0,3)=="!--"){
- var val=parseInt(res[1].replace("!--","").replace("--",""));
- obj.childNodes.push({
- nodeType:nodeTypes.COMMENT,
- nodeName:"#comment",
- nodeValue:comments[val]
- });
- }
- }
- else {
-
- var name=res[1].replace(trim,"");
- var o={
- nodeType:nodeTypes.ELEMENT,
- nodeName:name,
- localName:name,
- namespace:dNs,
- ownerDocument:root,
- attributes:[],
- parentNode:null,
- childNodes:[]
- };
-
- if(name.indexOf(":")>-1){
- var t=name.split(":");
- o.namespace=t[0];
- o.localName=t[1];
- }
-
- o.byName=o.getElementsByTagName=byName;
- o.byNameNS=o.getElementsByTagNameNS=byNameNS;
- o.childrenByName=childrenByName;
- o.childrenByNameNS=childrenByNameNS;
- o.getAttribute=getAttr;
- o.getAttributeNS=getAttrNS;
- o.setAttribute=setAttr;
- o.setAttributeNS=setAttrNS;
- o.previous=o.previousSibling=prev;
- o.next=o.nextSibling=next;
-
- var attr;
- while((attr=reAttr.exec(res[2]))!=null){
- if(attr.length>0){
- var name=attr[1].replace(trim,"");
- var val=(attr[4]||attr[6]||"").replace(normalize," ")
- .replace(egt,">")
- .replace(elt,"<")
- .replace(eapos,"'")
- .replace(equot,'"')
- .replace(eamp,"&");
- if(name.indexOf("xmlns")==0){
- if(name.indexOf(":")>0){
- var ns=name.split(":");
- root.namespaces[ns[1]]=val;
- root._nsPaths[val]=ns[1];
- } else {
- root.namespaces[dNs]=val;
- root._nsPaths[val]=dNs;
- }
- } else {
- var ln=name;
- var ns=dNs;
- if(name.indexOf(":")>0){
- var t=name.split(":");
- ln=t[1];
- ns=t[0];
- }
- o.attributes.push({
- nodeType:nodeTypes.ATTRIBUTE,
- nodeName:name,
- localName:ln,
- namespace:ns,
- nodeValue:val
- });
-
- if(ln=="id"){ o.id=val; }
- }
- }
- }
- root._add(o);
- if(obj){
- obj.childNodes.push(o);
- o.parentNode=obj;
-
- if(res[2].charAt(res[2].length-1)!="/"){
- obj=o;
- }
- }
- var text=res[3];
- if(text.length>0){
- obj.childNodes.push(_createTextNode(text));
- }
- }
- }
- }
-
- for(var i=0; i<root.childNodes.length; i++){
- var e=root.childNodes[i];
- if(e.nodeType==nodeTypes.ELEMENT){
- root.documentElement=e;
- break;
- }
- }
- return root;
- };
- })();
- }
- if(!dojo._hasResource["dojox.collections._base"]){
- dojo._hasResource["dojox.collections._base"] = true;
- dojo.provide("dojox.collections._base");
- dojox.collections.DictionaryEntry=function(/* string */k, /* object */v){
-
-
- this.key=k;
- this.value=v;
- this.valueOf=function(){
- return this.value;
- };
- this.toString=function(){
- return String(this.value);
- };
- }
- dojox.collections.Iterator=function(/* array */arr){
-
-
- var a=arr;
- var position=0;
- this.element=a[position]||null;
- this.atEnd=function(){
-
-
- return (position>=a.length);
- };
- this.get=function(){
-
-
- if(this.atEnd()){
- return null;
- }
- this.element=a[position++];
- return this.element;
- };
- this.map=function(/* function */fn, /* object? */scope){
-
-
- return dojo.map(a, fn, scope);
- };
- this.reset=function(){
-
-
- position=0;
- this.element=a[position];
- };
- }
- dojox.collections.DictionaryIterator=function(/* object */obj){
-
-
- var a=[];
- var testObject={};
- for(var p in obj){
- if(!testObject[p]){
- a.push(obj[p]);
- }
- }
- var position=0;
- this.element=a[position]||null;
- this.atEnd=function(){
-
-
- return (position>=a.length);
- };
- this.get=function(){
-
-
- if(this.atEnd()){
- return null;
- }
- this.element=a[position++];
- return this.element;
- };
- this.map=function(/* function */fn, /* object? */scope){
-
-
- return dojo.map(a, fn, scope);
- };
- this.reset=function() {
-
-
- position=0;
- this.element=a[position];
- };
- };
- }
- if(!dojo._hasResource["dojox.collections.Dictionary"]){
- dojo._hasResource["dojox.collections.Dictionary"] = true;
- dojo.provide("dojox.collections.Dictionary");
- dojox.collections.Dictionary=function(/* dojox.collections.Dictionary? */dictionary){
-
-
- var items={};
- this.count=0;
-
- var testObject={};
- this.add=function(/* string */k, /* object */v){
-
-
- var b=(k in items);
- items[k]=new dojox.collections.DictionaryEntry(k,v);
- if(!b){
- this.count++;
- }
- };
- this.clear=function(){
-
-
- items={};
- this.count=0;
- };
- this.clone=function(){
-
-
- return new dojox.collections.Dictionary(this);
- };
- this.contains=this.containsKey=function(/* string */k){
-
-
- if(testObject[k]){
- return false;
- }
- return (items[k]!=null);
- };
- this.containsValue=function(/* object */v){
-
-
- var e=this.getIterator();
- while(e.get()){
- if(e.element.value==v){
- return true;
- }
- }
- return false;
- };
- this.entry=function(/* string */k){
-
-
- return items[k];
- };
- this.forEach=function(/* function */ fn, /* object? */ scope){
-
-
- var a=[];
- for(var p in items) {
- if(!testObject[p]){
- a.push(items[p]);
- }
- }
- dojo.forEach(a, fn, scope);
- };
- this.getKeyList=function(){
-
-
- return (this.getIterator()).map(function(entry){
- return entry.key;
- });
- };
- this.getValueList=function(){
-
-
- return (this.getIterator()).map(function(entry){
- return entry.value;
- });
- };
- this.item=function(/* string */k){
-
-
- if(k in items){
- return items[k].valueOf();
- }
- return undefined;
- };
- this.getIterator=function(){
-
-
- return new dojox.collections.DictionaryIterator(items);
- };
- this.remove=function(/* string */k){
-
-
- if(k in items && !testObject[k]){
- delete items[k];
- this.count--;
- return true;
- }
- return false;
- };
- if (dictionary){
- var e=dictionary.getIterator();
- while(e.get()) {
- this.add(e.element.key, e.element.value);
- }
- }
- };
- }
- if(!dojo._hasResource["dojox.data.QueryReadStore"]){
- dojo._hasResource["dojox.data.QueryReadStore"] = true;
- dojo.provide("dojox.data.QueryReadStore");
- dojo.declare("dojox.data.QueryReadStore",
- null,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- url:"",
- requestMethod:"get",
-
-
-
- _className:"dojox.data.QueryReadStore",
-
-
-
-
-
-
-
-
- _items:[],
-
-
-
-
- _lastServerQuery:null,
-
-
- _numRows:-1,
-
-
-
-
- lastRequestHash:null,
-
-
-
- doClientPaging:false,
-
-
-
-
- doClientSorting:false,
-
-
- _itemsByIdentity:null,
-
-
- _identifier:null,
-
- _features: {'dojo.data.api.Read':true, 'dojo.data.api.Identity':true},
-
- _labelAttr: "label",
-
- constructor: function(/* Object */ params){
- dojo.mixin(this,params);
- },
-
- getValue: function(/* item */ item, /* attribute-name-string */ attribute, /* value? */ defaultValue){
-
-
- this._assertIsItem(item);
- if(!dojo.isString(attribute)){
- throw new Error(this._className+".getValue(): Invalid attribute, string expected!");
- }
- if(!this.hasAttribute(item, attribute)){
-
-
- if(defaultValue){
- return defaultValue;
- }
- }
- return item.i[attribute];
- },
-
- getValues: function(/* item */ item, /* attribute-name-string */ attribute){
- this._assertIsItem(item);
- var ret = [];
- if(this.hasAttribute(item, attribute)){
- ret.push(item.i[attribute]);
- }
- return ret;
- },
-
- getAttributes: function(/* item */ item){
- this._assertIsItem(item);
- var ret = [];
- for(var i in item.i){
- ret.push(i);
- }
- return ret;
- },
-
- hasAttribute: function(/* item */ item, /* attribute-name-string */ attribute){
-
-
- return this.isItem(item) && typeof item.i[attribute]!="undefined";
- },
-
- containsValue: function(/* item */ item, /* attribute-name-string */ attribute, /* anything */ value){
- var values = this.getValues(item, attribute);
- var len = values.length;
- for(var i=0; i<len; i++){
- if(values[i] == value){
- return true;
- }
- }
- return false;
- },
-
- isItem: function(/* anything */ something){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(something){
- return typeof something.r != "undefined" && something.r == this;
- }
- return false;
- },
-
- isItemLoaded: function(/* anything */ something){
-
-
-
- return this.isItem(something);
- },
-
- loadItem: function(/* object */ args){
- if(this.isItemLoaded(args.item)){
- return;
- }
-
- },
-
- fetch:function(/* Object? */ request){
-
-
-
-
-
-
- request = request || {};
- if(!request.store){
- request.store = this;
- }
- var self = this;
-
- var _errorHandler = function(errorData, requestObject){
- if(requestObject.onError){
- var scope = requestObject.scope || dojo.global;
- requestObject.onError.call(scope, errorData, requestObject);
- }
- };
-
- var _fetchHandler = function(items, requestObject, numRows){
- var oldAbortFunction = requestObject.abort || null;
- var aborted = false;
-
- var startIndex = requestObject.start?requestObject.start:0;
- if(self.doClientPaging == false){
-
- startIndex = 0;
- }
- var endIndex = requestObject.count?(startIndex + requestObject.count):items.length;
-
- requestObject.abort = function(){
- aborted = true;
- if(oldAbortFunction){
- oldAbortFunction.call(requestObject);
- }
- };
-
- var scope = requestObject.scope || dojo.global;
- if(!requestObject.store){
- requestObject.store = self;
- }
- if(requestObject.onBegin){
- requestObject.onBegin.call(scope, numRows, requestObject);
- }
- if(requestObject.sort && self.doClientSorting){
- items.sort(dojo.data.util.sorter.createSortFunction(requestObject.sort, self));
- }
- if(requestObject.onItem){
- for(var i = startIndex; (i < items.length) && (i < endIndex); ++i){
- var item = items[i];
- if(!aborted){
- requestObject.onItem.call(scope, item, requestObject);
- }
- }
- }
- if(requestObject.onComplete && !aborted){
- var subset = null;
- if(!requestObject.onItem){
- subset = items.slice(startIndex, endIndex);
- }
- requestObject.onComplete.call(scope, subset, requestObject);
- }
- };
- this._fetchItems(request, _fetchHandler, _errorHandler);
- return request;
- },
-
- getFeatures: function(){
- return this._features;
- },
-
- close: function(/*dojo.data.api.Request || keywordArgs || null */ request){
-
- },
-
- getLabel: function(/* item */ item){
-
-
- if(this._labelAttr && this.isItem(item)){
- return this.getValue(item, this._labelAttr);
- }
- return undefined;
- },
-
- getLabelAttributes: function(/* item */ item){
-
-
- if(this._labelAttr){
- return [this._labelAttr];
- }
- return null;
- },
-
- _xhrFetchHandler: function(data, request, fetchHandler, errorHandler){
- data = this._filterResponse(data);
- if(data.label){
- this._labelAttr = data.label;
- }
- var numRows = data.numRows || -1;
- this._items = [];
-
-
-
- dojo.forEach(data.items,function(e){
- this._items.push({i:e, r:this});
- },this);
-
- var identifier = data.identifier;
- this._itemsByIdentity = {};
- if(identifier){
- this._identifier = identifier;
- var i;
- for(i = 0; i < this._items.length; ++i){
- var item = this._items[i].i;
- var identity = item[identifier];
- if(!this._itemsByIdentity[identity]){
- this._itemsByIdentity[identity] = item;
- }else{
- throw new Error(this._className+": The json data as specified by: [" + this.url + "] is malformed. Items within the list have identifier: [" + identifier + "]. Value collided: [" + identity + "]");
- }
- }
- }else{
- this._identifier = Number;
- for(i = 0; i < this._items.length; ++i){
- this._items[i].n = i;
- }
- }
-
-
-
- numRows = this._numRows = (numRows === -1) ? this._items.length : numRows;
- fetchHandler(this._items, request, numRows);
- this._numRows = numRows;
- },
-
- _fetchItems: function(request, fetchHandler, errorHandler){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var serverQuery = request.serverQuery || request.query || {};
-
- if(!this.doClientPaging){
- serverQuery.start = request.start || 0;
-
- if(request.count){
- serverQuery.count = request.count;
- }
- }
- if(!this.doClientSorting && request.sort){
- var sortInfo = [];
- dojo.forEach(request.sort, function(sort){
- if(sort && sort.attribute){
- sortInfo.push((sort.descending ? "-" : "") + sort.attribute);
- }
- });
- serverQuery.sort = sortInfo.join(',');
- }
-
-
- if(this.doClientPaging && this._lastServerQuery !== null &&
- dojo.toJson(serverQuery) == dojo.toJson(this._lastServerQuery)
- ){
- this._numRows = (this._numRows === -1) ? this._items.length : this._numRows;
- fetchHandler(this._items, request, this._numRows);
- }else{
- var xhrFunc = this.requestMethod.toLowerCase() == "post" ? dojo.xhrPost : dojo.xhrGet;
- var xhrHandler = xhrFunc({url:this.url, handleAs:"json-comment-optional", content:serverQuery, failOk: true});
- request.abort = function(){
- xhrHandler.cancel();
- };
- xhrHandler.addCallback(dojo.hitch(this, function(data){
- this._xhrFetchHandler(data, request, fetchHandler, errorHandler);
- }));
- xhrHandler.addErrback(function(error){
- errorHandler(error, request);
- });
-
-
-
- this.lastRequestHash = new Date().getTime()+"-"+String(Math.random()).substring(2);
- this._lastServerQuery = dojo.mixin({}, serverQuery);
- }
- },
-
- _filterResponse: function(data){
-
-
-
-
-
-
- return data;
- },
-
- _assertIsItem: function(/* item */ item){
-
-
-
-
-
- if(!this.isItem(item)){
- throw new Error(this._className+": Invalid item argument.");
- }
- },
-
- _assertIsAttribute: function(/* attribute-name-string */ attribute){
-
-
-
-
- if(typeof attribute !== "string"){
- throw new Error(this._className+": Invalid attribute argument ('"+attribute+"').");
- }
- },
-
- fetchItemByIdentity: function(/* Object */ keywordArgs){
-
-
-
-
-
-
- if(this._itemsByIdentity){
- var item = this._itemsByIdentity[keywordArgs.identity];
- if(!(item === undefined)){
- if(keywordArgs.onItem){
- var scope = keywordArgs.scope ? keywordArgs.scope : dojo.global;
- keywordArgs.onItem.call(scope, {i:item, r:this});
- }
- return;
- }
- }
-
-
-
- var _errorHandler = function(errorData, requestObject){
- var scope = keywordArgs.scope ? keywordArgs.scope : dojo.global;
- if(keywordArgs.onError){
- keywordArgs.onError.call(scope, errorData);
- }
- };
-
-
- var _fetchHandler = function(items, requestObject){
- var scope = keywordArgs.scope ? keywordArgs.scope : dojo.global;
- try{
-
- var item = null;
- if(items && items.length == 1){
- item = items[0];
- }
-
-
-
- if(keywordArgs.onItem){
- keywordArgs.onItem.call(scope, item);
- }
- }catch(error){
- if(keywordArgs.onError){
- keywordArgs.onError.call(scope, error);
- }
- }
- };
-
-
- var request = {serverQuery:{id:keywordArgs.identity}};
-
-
- this._fetchItems(request, _fetchHandler, _errorHandler);
- },
-
- getIdentity: function(/* item */ item){
-
-
- var identifier = null;
- if(this._identifier === Number){
- identifier = item.n;
- }else{
- identifier = item.i[this._identifier];
- }
- return identifier;
- },
-
- getIdentityAttributes: function(/* item */ item){
-
-
- return [this._identifier];
- }
- }
- );
- }
- if(!dojo._hasResource["dojox.string.Builder"]){
- dojo._hasResource["dojox.string.Builder"] = true;
- dojo.provide("dojox.string.Builder");
- dojox.string.Builder = function(/*String?*/str){
-
-
-
-
-
-
-
- var b = "";
- this.length = 0;
-
- this.append = function(/* String... */s){
-
- if(arguments.length>1){
-
- var tmp="", l=arguments.length;
- switch(l){
- case 9: tmp=""+arguments[8]+tmp;
- case 8: tmp=""+arguments[7]+tmp;
- case 7: tmp=""+arguments[6]+tmp;
- case 6: tmp=""+arguments[5]+tmp;
- case 5: tmp=""+arguments[4]+tmp;
- case 4: tmp=""+arguments[3]+tmp;
- case 3: tmp=""+arguments[2]+tmp;
- case 2: {
- b+=""+arguments[0]+arguments[1]+tmp;
- break;
- }
- default: {
- var i=0;
- while(i<arguments.length){
- tmp += arguments[i++];
- }
- b += tmp;
- }
- }
- } else {
- b += s;
- }
- this.length = b.length;
- return this;
- };
-
- this.concat = function(/*String...*/s){
-
-
- return this.append.apply(this, arguments);
- };
-
- this.appendArray = function(/*Array*/strings) {
-
-
-
- return this.append.apply(this, strings);
- };
-
- this.clear = function(){
-
-
- b = "";
- this.length = 0;
- return this;
- };
-
- this.replace = function(/* String */oldStr, /* String */ newStr){
-
-
- b = b.replace(oldStr,newStr);
- this.length = b.length;
- return this;
- };
-
- this.remove = function(/* Number */start, /* Number? */len){
-
-
-
- if(len===undefined){ len = b.length; }
- if(len == 0){ return this; }
- b = b.substr(0, start) + b.substr(start+len);
- this.length = b.length;
- return this;
- };
-
- this.insert = function(/* Number */index, /* String */str){
-
-
- if(index == 0){
- b = str + b;
- }else{
- b = b.slice(0, index) + str + b.slice(index);
- }
- this.length = b.length;
- return this;
- };
-
- this.toString = function(){
-
-
- return b;
- };
-
- if(str){ this.append(str); }
- };
- }
- if(!dojo._hasResource["dojox.string.tokenize"]){
- dojo._hasResource["dojox.string.tokenize"] = true;
- dojo.provide("dojox.string.tokenize");
- dojox.string.tokenize = function(/*String*/ str, /*RegExp*/ re, /*Function?*/ parseDelim, /*Object?*/ instance){
-
-
-
-
-
-
-
- var tokens = [];
- var match, content, lastIndex = 0;
- while(match = re.exec(str)){
- content = str.slice(lastIndex, re.lastIndex - match[0].length);
- if(content.length){
- tokens.push(content);
- }
- if(parseDelim){
- if(dojo.isOpera){
- var copy = match.slice(0);
- while(copy.length < match.length){
- copy.push(null);
- }
- match = copy;
- }
- var parsed = parseDelim.apply(instance, match.slice(1).concat(tokens.length));
- if(typeof parsed != "undefined"){
- tokens.push(parsed);
- }
- }
- lastIndex = re.lastIndex;
- }
- content = str.slice(lastIndex);
- if(content.length){
- tokens.push(content);
- }
- return tokens;
- }
- }
- if(!dojo._hasResource["dojox.dtl._base"]){
- dojo._hasResource["dojox.dtl._base"] = true;
- dojo.provide("dojox.dtl._base");
- dojo.experimental("dojox.dtl");
- (function(){
- var dd = dojox.dtl;
- dd.TOKEN_BLOCK = -1;
- dd.TOKEN_VAR = -2;
- dd.TOKEN_COMMENT = -3;
- dd.TOKEN_TEXT = 3;
- dd._Context = dojo.extend(function(dict){
-
- if(dict){
- dojo._mixin(this, dict);
- if(dict.get){
-
- this._getter = dict.get;
- delete this.get;
- }
- }
- },
- {
- push: function(){
- var last = this;
- var context = dojo.delegate(this);
- context.pop = function(){ return last; }
- return context;
- },
- pop: function(){
- throw new Error("pop() called on empty Context");
- },
- get: function(key, otherwise){
- var n = this._normalize;
- if(this._getter){
- var got = this._getter(key);
- if(typeof got != "undefined"){
- return n(got);
- }
- }
- if(typeof this[key] != "undefined"){
- return n(this[key]);
- }
- return otherwise;
- },
- _normalize: function(value){
- if(value instanceof Date){
- value.year = value.getFullYear();
- value.month = value.getMonth() + 1;
- value.day = value.getDate();
- value.date = value.year + "-" + ("0" + value.month).slice(-2) + "-" + ("0" + value.day).slice(-2);
- value.hour = value.getHours();
- value.minute = value.getMinutes();
- value.second = value.getSeconds();
- value.microsecond = value.getMilliseconds();
- }
- return value;
- },
- update: function(dict){
- var context = this.push();
- if(dict){
- dojo._mixin(this, dict);
- }
- return context;
- }
- });
- var smart_split_re = /("(?:[^"\\]*(?:\\.[^"\\]*)*)"|'(?:[^'\\]*(?:\\.[^'\\]*)*)'|[^\s]+)/g;
- var split_re = /\s+/g;
- var split = function(/*String|RegExp?*/ splitter, /*Integer?*/ limit){
- splitter = splitter || split_re;
- if(!(splitter instanceof RegExp)){
- splitter = new RegExp(splitter, "g");
- }
- if(!splitter.global){
- throw new Error("You must use a globally flagged RegExp with split " + splitter);
- }
- splitter.exec("");
- var part, parts = [], lastIndex = 0, i = 0;
- while(part = splitter.exec(this)){
- parts.push(this.slice(lastIndex, splitter.lastIndex - part[0].length));
- lastIndex = splitter.lastIndex;
- if(limit && (++i > limit - 1)){
- break;
- }
- }
- parts.push(this.slice(lastIndex));
- return parts;
- }
- dd.Token = function(token_type, contents){
- this.token_type = token_type;
- this.contents = new String(dojo.trim(contents));
- this.contents.split = split;
- this.split = function(){
- return String.prototype.split.apply(this.contents, arguments);
- }
- }
- dd.Token.prototype.split_contents = function(/*Integer?*/ limit){
- var bit, bits = [], i = 0;
- limit = limit || 999;
- while(i++ < limit && (bit = smart_split_re.exec(this.contents))){
- bit = bit[0];
- if(bit.charAt(0) == '"' && bit.slice(-1) == '"'){
- bits.push('"' + bit.slice(1, -1).replace('\\"', '"').replace('\\\\', '\\') + '"');
- }else if(bit.charAt(0) == "'" && bit.slice(-1) == "'"){
- bits.push("'" + bit.slice(1, -1).replace("\\'", "'").replace('\\\\', '\\') + "'");
- }else{
- bits.push(bit);
- }
- }
- return bits;
- }
- var ddt = dd.text = {
- _get: function(module, name, errorless){
-
- var params = dd.register.get(module, name.toLowerCase(), errorless);
- if(!params){
- if(!errorless){
- throw new Error("No tag found for " + name);
- }
- return null;
- }
- var fn = params[1];
- var require = params[2];
- var parts;
- if(fn.indexOf(":") != -1){
- parts = fn.split(":");
- fn = parts.pop();
- }
- dojo["require"](require);
- var parent = dojo.getObject(require);
- return parent[fn || name] || parent[name + "_"] || parent[fn + "_"];
- },
- getTag: function(name, errorless){
- return ddt._get("tag", name, errorless);
- },
- getFilter: function(name, errorless){
- return ddt._get("filter", name, errorless);
- },
- getTemplate: function(file){
- return new dd.Template(ddt.getTemplateString(file));
- },
- getTemplateString: function(file){
- return dojo._getText(file.toString()) || "";
- },
- _resolveLazy: function(location, sync, json){
- if(sync){
- if(json){
- return dojo.fromJson(dojo._getText(location)) || {};
- }else{
- return dd.text.getTemplateString(location);
- }
- }else{
- return dojo.xhrGet({
- handleAs: (json) ? "json" : "text",
- url: location
- });
- }
- },
- _resolveTemplateArg: function(arg, sync){
- if(ddt._isTemplate(arg)){
- if(!sync){
- var d = new dojo.Deferred();
- d.callback(arg);
- return d;
- }
- return arg;
- }
- return ddt._resolveLazy(arg, sync);
- },
- _isTemplate: function(arg){
- return (typeof arg == "undefined") || (typeof arg == "string" && (arg.match(/^\s*[<{]/) || arg.indexOf(" ") != -1));
- },
- _resolveContextArg: function(arg, sync){
- if(arg.constructor == Object){
- if(!sync){
- var d = new dojo.Deferred;
- d.callback(arg);
- return d;
- }
- return arg;
- }
- return ddt._resolveLazy(arg, sync, true);
- },
- _re: /(?:\{\{\s*(.+?)\s*\}\}|\{%\s*(load\s*)?(.+?)\s*%\})/g,
- tokenize: function(str){
- return dojox.string.tokenize(str, ddt._re, ddt._parseDelims);
- },
- _parseDelims: function(varr, load, tag){
- if(varr){
- return [dd.TOKEN_VAR, varr];
- }else if(load){
- var parts = dojo.trim(tag).split(/\s+/g);
- for(var i = 0, part; part = parts[i]; i++){
- dojo["require"](part);
- }
- }else{
- return [dd.TOKEN_BLOCK, tag];
- }
- }
- }
- dd.Template = dojo.extend(function(/*String|dojo._Url*/ template, /*Boolean*/ isString){
-
-
-
- var str = isString ? template : ddt._resolveTemplateArg(template, true) || "";
- var tokens = ddt.tokenize(str);
- var parser = new dd._Parser(tokens);
- this.nodelist = parser.parse();
- },
- {
- update: function(node, context){
-
-
-
-
- return ddt._resolveContextArg(context).addCallback(this, function(contextObject){
- var content = this.render(new dd._Context(contextObject));
- if(node.forEach){
- node.forEach(function(item){
- item.innerHTML = content;
- });
- }else{
- dojo.byId(node).innerHTML = content;
- }
- return this;
- });
- },
- render: function(context, /*concatenatable?*/ buffer){
- buffer = buffer || this.getBuffer();
- context = context || new dd._Context({});
- return this.nodelist.render(context, buffer) + "";
- },
- getBuffer: function(){
-
- return new dojox.string.Builder();
- }
- });
- var qfRe = /\{\{\s*(.+?)\s*\}\}/g;
- dd.quickFilter = function(str){
- if(!str){
- return new dd._NodeList();
- }
- if(str.indexOf("{%") == -1){
- return new dd._QuickNodeList(dojox.string.tokenize(str, qfRe, function(token){
- return new dd._Filter(token);
- }));
- }
- }
- dd._QuickNodeList = dojo.extend(function(contents){
- this.contents = contents;
- },
- {
- render: function(context, buffer){
- for(var i=0, l=this.contents.length; i<l; i++){
- if(this.contents[i].resolve){
- buffer = buffer.concat(this.contents[i].resolve(context));
- }else{
- buffer = buffer.concat(this.contents[i]);
- }
- }
- return buffer;
- },
- dummyRender: function(context){ return this.render(context, dd.Template.prototype.getBuffer()).toString(); },
- clone: function(buffer){ return this; }
- });
- dd._Filter = dojo.extend(function(token){
-
- if(!token) throw new Error("Filter must be called with variable name");
- this.contents = token;
- var cache = this._cache[token];
- if(cache){
- this.key = cache[0];
- this.filters = cache[1];
- }else{
- this.filters = [];
- dojox.string.tokenize(token, this._re, this._tokenize, this);
- this._cache[token] = [this.key, this.filters];
- }
- },
- {
- _cache: {},
- _re: /(?:^_\("([^\\"]*(?:\\.[^\\"])*)"\)|^"([^\\"]*(?:\\.[^\\"]*)*)"|^([a-zA-Z0-9_.]+)|\|(\w+)(?::(?:_\("([^\\"]*(?:\\.[^\\"])*)"\)|"([^\\"]*(?:\\.[^\\"]*)*)"|([a-zA-Z0-9_.]+)|'([^\\']*(?:\\.[^\\']*)*)'))?|^'([^\\']*(?:\\.[^\\']*)*)')/g,
- _values: {
- 0: '"',
- 1: '"',
- 2: "",
- 8: '"'
- },
- _args: {
- 4: '"',
- 5: '"',
- 6: "",
- 7: "'"
- },
- _tokenize: function(){
- var pos, arg;
- for(var i = 0, has = []; i < arguments.length; i++){
- has[i] = (typeof arguments[i] != "undefined" && typeof arguments[i] == "string" && arguments[i]);
- }
- if(!this.key){
- for(pos in this._values){
- if(has[pos]){
- this.key = this._values[pos] + arguments[pos] + this._values[pos];
- break;
- }
- }
- }else{
- for(pos in this._args){
- if(has[pos]){
- var value = arguments[pos];
- if(this._args[pos] == "'"){
- value = value.replace(/\\'/g, "'");
- }else if(this._args[pos] == '"'){
- value = value.replace(/\\"/g, '"');
- }
- arg = [!this._args[pos], value];
- break;
- }
- }
-
- var fn = ddt.getFilter(arguments[3]);
- if(!dojo.isFunction(fn)) throw new Error(arguments[3] + " is not registered as a filter");
- this.filters.push([fn, arg]);
- }
- },
- getExpression: function(){
- return this.contents;
- },
- resolve: function(context){
- if(typeof this.key == "undefined"){
- return "";
- }
- var str = this.resolvePath(this.key, context);
- for(var i = 0, filter; filter = this.filters[i]; i++){
-
-
- if(filter[1]){
- if(filter[1][0]){
- str = filter[0](str, this.resolvePath(filter[1][1], context));
- }else{
- str = filter[0](str, filter[1][1]);
- }
- }else{
- str = filter[0](str);
- }
- }
- return str;
- },
- resolvePath: function(path, context){
- var current, parts;
- var first = path.charAt(0);
- var last = path.slice(-1);
- if(!isNaN(parseInt(first))){
- current = (path.indexOf(".") == -1) ? parseInt(path) : parseFloat(path);
- }else if(first == '"' && first == last){
- current = path.slice(1, -1);
- }else{
- if(path == "true"){ return true; }
- if(path == "false"){ return false; }
- if(path == "null" || path == "None"){ return null; }
- parts = path.split(".");
- current = context.get(parts[0]);
- if(dojo.isFunction(current)){
- var self = context.getThis && context.getThis();
- if(current.alters_data){
- current = "";
- }else if(self){
- current = current.call(self);
- }else{
- current = "";
- }
- }
- for(var i = 1; i < parts.length; i++){
- var part = parts[i];
- if(current){
- var base = current;
- if(dojo.isObject(current) && part == "items" && typeof current[part] == "undefined"){
- var items = [];
- for(var key in current){
- items.push([key, current[key]]);
- }
- current = items;
- continue;
- }
- if(current.get && dojo.isFunction(current.get) && current.get.safe){
- current = current.get(part);
- }else if(typeof current[part] == "undefined"){
- current = current[part];
- break;
- }else{
- current = current[part];
- }
- if(dojo.isFunction(current)){
- if(current.alters_data){
- current = "";
- }else{
- current = current.call(base);
- }
- }else if(current instanceof Date){
- current = dd._Context.prototype._normalize(current);
- }
- }else{
- return "";
- }
- }
- }
- return current;
- }
- });
- dd._TextNode = dd._Node = dojo.extend(function(/*Object*/ obj){
-
- this.contents = obj;
- },
- {
- set: function(data){
- this.contents = data;
- return this;
- },
- render: function(context, buffer){
-
- return buffer.concat(this.contents);
- },
- isEmpty: function(){
- return !dojo.trim(this.contents);
- },
- clone: function(){ return this; }
- });
- dd._NodeList = dojo.extend(function(/*Node[]*/ nodes){
-
- this.contents = nodes || [];
- this.last = "";
- },
- {
- push: function(node){
-
- this.contents.push(node);
- return this;
- },
- concat: function(nodes){
- this.contents = this.contents.concat(nodes);
- return this;
- },
- render: function(context, buffer){
-
- for(var i = 0; i < this.contents.length; i++){
- buffer = this.contents[i].render(context, buffer);
- if(!buffer) throw new Error("Template must return buffer");
- }
- return buffer;
- },
- dummyRender: function(context){
- return this.render(context, dd.Template.prototype.getBuffer()).toString();
- },
- unrender: function(){ return arguments[1]; },
- clone: function(){ return this; },
- rtrim: function(){
- while(1){
- i = this.contents.length - 1;
- if(this.contents[i] instanceof dd._TextNode && this.contents[i].isEmpty()){
- this.contents.pop();
- }else{
- break;
- }
- }
- return this;
- }
- });
- dd._VarNode = dojo.extend(function(str){
-
- this.contents = new dd._Filter(str);
- },
- {
- render: function(context, buffer){
- var str = this.contents.resolve(context);
- if(!str.safe){
- str = dd._base.escape("" + str);
- }
- return buffer.concat(str);
- }
- });
- dd._noOpNode = new function(){
-
- this.render = this.unrender = function(){ return arguments[1]; }
- this.clone = function(){ return this; }
- }
- dd._Parser = dojo.extend(function(tokens){
-
- this.contents = tokens;
- },
- {
- i: 0,
- parse: function(/*Array?*/ stop_at){
-
-
-
-
- var terminators = {}, token;
- stop_at = stop_at || [];
- for(var i = 0; i < stop_at.length; i++){
- terminators[stop_at[i]] = true;
- }
- var nodelist = new dd._NodeList();
- while(this.i < this.contents.length){
- token = this.contents[this.i++];
- if(typeof token == "string"){
- nodelist.push(new dd._TextNode(token));
- }else{
- var type = token[0];
- var text = token[1];
- if(type == dd.TOKEN_VAR){
- nodelist.push(new dd._VarNode(text));
- }else if(type == dd.TOKEN_BLOCK){
- if(terminators[text]){
- --this.i;
- return nodelist;
- }
- var cmd = text.split(/\s+/g);
- if(cmd.length){
- cmd = cmd[0];
- var fn = ddt.getTag(cmd);
- if(fn){
- nodelist.push(fn(this, new dd.Token(type, text)));
- }
- }
- }
- }
- }
- if(stop_at.length){
- throw new Error("Could not find closing tag(s): " + stop_at.toString());
- }
- this.contents.length = 0;
- return nodelist;
- },
- next_token: function(){
-
- var token = this.contents[this.i++];
- return new dd.Token(token[0], token[1]);
- },
- delete_first_token: function(){
- this.i++;
- },
- skip_past: function(endtag){
- while(this.i < this.contents.length){
- var token = this.contents[this.i++];
- if(token[0] == dd.TOKEN_BLOCK && token[1] == endtag){
- return;
- }
- }
- throw new Error("Unclosed tag found when looking for " + endtag);
- },
- create_variable_node: function(expr){
- return new dd._VarNode(expr);
- },
- create_text_node: function(expr){
- return new dd._TextNode(expr || "");
- },
- getTemplate: function(file){
- return new dd.Template(file);
- }
- });
- dd.register = {
- _registry: {
- attributes: [],
- tags: [],
- filters: []
- },
- get: function(/*String*/ module, /*String*/ name){
- var registry = dd.register._registry[module + "s"];
- for(var i = 0, entry; entry = registry[i]; i++){
- if(typeof entry[0] == "string"){
- if(entry[0] == name){
- return entry;
- }
- }else if(name.match(entry[0])){
- return entry;
- }
- }
- },
- getAttributeTags: function(){
- var tags = [];
- var registry = dd.register._registry.attributes;
- for(var i = 0, entry; entry = registry[i]; i++){
- if(entry.length == 3){
- tags.push(entry);
- }else{
- var fn = dojo.getObject(entry[1]);
- if(fn && dojo.isFunction(fn)){
- entry.push(fn);
- tags.push(entry);
- }
- }
- }
- return tags;
- },
- _any: function(type, base, locations){
- for(var path in locations){
- for(var i = 0, fn; fn = locations[path][i]; i++){
- var key = fn;
- if(dojo.isArray(fn)){
- key = fn[0];
- fn = fn[1];
- }
- if(typeof key == "string"){
- if(key.substr(0, 5) == "attr:"){
- var attr = fn;
- if(attr.substr(0, 5) == "attr:"){
- attr = attr.slice(5);
- }
- dd.register._registry.attributes.push([attr.toLowerCase(), base + "." + path + "." + attr]);
- }
- key = key.toLowerCase()
- }
- dd.register._registry[type].push([
- key,
- fn,
- base + "." + path
- ]);
- }
- }
- },
- tags: function(/*String*/ base, /*Object*/ locations){
- dd.register._any("tags", base, locations);
- },
- filters: function(/*String*/ base, /*Object*/ locations){
- dd.register._any("filters", base, locations);
- }
- }
- var escapeamp = /&/g;
- var escapelt = /</g;
- var escapegt = />/g;
- var escapeqt = /'/g;
- var escapedblqt = /"/g;
- dd._base.escape = function(value){
-
- return dd.mark_safe(value.replace(escapeamp, '&').replace(escapelt, '<').replace(escapegt, '>').replace(escapedblqt, '"').replace(escapeqt, '''));
- }
- dd._base.safe = function(value){
- if(typeof value == "string"){
- value = new String(value);
- }
- if(typeof value == "object"){
- value.safe = true;
- }
- return value;
- }
- dd.mark_safe = dd._base.safe;
- dd.register.tags("dojox.dtl.tag", {
- "date": ["now"],
- "logic": ["if", "for", "ifequal", "ifnotequal"],
- "loader": ["extends", "block", "include", "load", "ssi"],
- "misc": ["comment", "debug", "filter", "firstof", "spaceless", "templatetag", "widthratio", "with"],
- "loop": ["cycle", "ifchanged", "regroup"]
- });
- dd.register.filters("dojox.dtl.filter", {
- "dates": ["date", "time", "timesince", "timeuntil"],
- "htmlstrings": ["linebreaks", "linebreaksbr", "removetags", "striptags"],
- "integers": ["add", "get_digit"],
- "lists": ["dictsort", "dictsortreversed", "first", "join", "length", "length_is", "random", "slice", "unordered_list"],
- "logic": ["default", "default_if_none", "divisibleby", "yesno"],
- "misc": ["filesizeformat", "pluralize", "phone2numeric", "pprint"],
- "strings": ["addslashes", "capfirst", "center", "cut", "fix_ampersands", "floatformat", "iriencode", "linenumbers", "ljust", "lower", "make_list", "rjust", "slugify", "stringformat", "title", "truncatewords", "truncatewords_html", "upper", "urlencode", "urlize", "urlizetrunc", "wordcount", "wordwrap"]
- });
- dd.register.filters("dojox.dtl", {
- "_base": ["escape", "safe"]
- });
- })();
- }
- if(!dojo._hasResource["dojox.dtl.filter.htmlstrings"]){
- dojo._hasResource["dojox.dtl.filter.htmlstrings"] = true;
- dojo.provide("dojox.dtl.filter.htmlstrings");
- dojo.mixin(dojox.dtl.filter.htmlstrings, {
- _linebreaksrn: /(\r\n|\n\r)/g,
- _linebreaksn: /\n{2,}/g,
- _linebreakss: /(^\s+|\s+$)/g,
- _linebreaksbr: /\n/g,
- _removetagsfind: /[a-z0-9]+/g,
- _striptags: /<[^>]*?>/g,
- linebreaks: function(value){
-
- var output = [];
- var dh = dojox.dtl.filter.htmlstrings;
- value = value.replace(dh._linebreaksrn, "\n");
- var parts = value.split(dh._linebreaksn);
- for(var i = 0; i < parts.length; i++){
- var part = parts[i].replace(dh._linebreakss, "").replace(dh._linebreaksbr, "<br />");
- output.push("<p>" + part + "</p>");
- }
- return output.join("\n\n");
- },
- linebreaksbr: function(value){
-
- var dh = dojox.dtl.filter.htmlstrings;
- return value.replace(dh._linebreaksrn, "\n").replace(dh._linebreaksbr, "<br />");
- },
- removetags: function(value, arg){
-
- var dh = dojox.dtl.filter.htmlstrings;
- var tags = [];
- var group;
- while(group = dh._removetagsfind.exec(arg)){
- tags.push(group[0]);
- }
- tags = "(" + tags.join("|") + ")";
- return value.replace(new RegExp("</?\s*" + tags + "\s*[^>]*>", "gi"), "");
- },
- striptags: function(value){
-
- return value.replace(dojox.dtl.filter.htmlstrings._striptags, "");
- }
- });
- }
- if(!dojo._hasResource["dojox.string.sprintf"]){
- dojo._hasResource["dojox.string.sprintf"] = true;
- dojo.provide("dojox.string.sprintf");
- dojox.string.sprintf = function(/*String*/ format, /*mixed...*/ filler){
- for(var args = [], i = 1; i < arguments.length; i++){
- args.push(arguments[i]);
- }
- var formatter = new dojox.string.sprintf.Formatter(format);
- return formatter.format.apply(formatter, args);
- }
- dojox.string.sprintf.Formatter = function(/*String*/ format){
- var tokens = [];
- this._mapped = false;
- this._format = format;
- this._tokens = dojox.string.tokenize(format, this._re, this._parseDelim, this);
- }
- dojo.extend(dojox.string.sprintf.Formatter, {
- _re: /\%(?:\(([\w_]+)\)|([1-9]\d*)\$)?([0 +\-\#]*)(\*|\d+)?(\.)?(\*|\d+)?[hlL]?([\%scdeEfFgGiouxX])/g,
- _parseDelim: function(mapping, intmapping, flags, minWidth, period, precision, specifier){
- if(mapping){
- this._mapped = true;
- }
- return {
- mapping: mapping,
- intmapping: intmapping,
- flags: flags,
- _minWidth: minWidth,
- period: period,
- _precision: precision,
- specifier: specifier
- };
- },
- _specifiers: {
- b: {
- base: 2,
- isInt: true
- },
- o: {
- base: 8,
- isInt: true
- },
- x: {
- base: 16,
- isInt: true
- },
- X: {
- extend: ["x"],
- toUpper: true
- },
- d: {
- base: 10,
- isInt: true
- },
- i: {
- extend: ["d"]
- },
- u: {
- extend: ["d"],
- isUnsigned: true
- },
- c: {
- setArg: function(token){
- if(!isNaN(token.arg)){
- var num = parseInt(token.arg);
- if(num < 0 || num > 127){
- throw new Error("invalid character code passed to %c in sprintf");
- }
- token.arg = isNaN(num) ? "" + num : String.fromCharCode(num);
- }
- }
- },
- s: {
- setMaxWidth: function(token){
- token.maxWidth = (token.period == ".") ? token.precision : -1;
- }
- },
- e: {
- isDouble: true,
- doubleNotation: "e"
- },
- E: {
- extend: ["e"],
- toUpper: true
- },
- f: {
- isDouble: true,
- doubleNotation: "f"
- },
- F: {
- extend: ["f"]
- },
- g: {
- isDouble: true,
- doubleNotation: "g"
- },
- G: {
- extend: ["g"],
- toUpper: true
- }
- },
- format: function(/*mixed...*/ filler){
- if(this._mapped && typeof filler != "object"){
- throw new Error("format requires a mapping");
- }
- var str = "";
- var position = 0;
- for(var i = 0, token; i < this._tokens.length; i++){
- token = this._tokens[i];
- if(typeof token == "string"){
- str += token;
- }else{
- if(this._mapped){
- if(typeof filler[token.mapping] == "undefined"){
- throw new Error("missing key " + token.mapping);
- }
- token.arg = filler[token.mapping];
- }else{
- if(token.intmapping){
- var position = parseInt(token.intmapping) - 1;
- }
- if(position >= arguments.length){
- throw new Error("got " + arguments.length + " printf arguments, insufficient for '" + this._format + "'");
- }
- token.arg = arguments[position++];
- }
- if(!token.compiled){
- token.compiled = true;
- token.sign = "";
- token.zeroPad = false;
- token.rightJustify = false;
- token.alternative = false;
- var flags = {};
- for(var fi = token.flags.length; fi--;){
- var flag = token.flags.charAt(fi);
- flags[flag] = true;
- switch(flag){
- case " ":
- token.sign = " ";
- break;
- case "+":
- token.sign = "+";
- break;
- case "0":
- token.zeroPad = (flags["-"]) ? false : true;
- break;
- case "-":
- token.rightJustify = true;
- token.zeroPad = false;
- break;
- case "\#":
- token.alternative = true;
- break;
- default:
- throw Error("bad formatting flag '" + token.flags.charAt(fi) + "'");
- }
- }
- token.minWidth = (token._minWidth) ? parseInt(token._minWidth) : 0;
- token.maxWidth = -1;
- token.toUpper = false;
- token.isUnsigned = false;
- token.isInt = false;
- token.isDouble = false;
- token.precision = 1;
- if(token.period == '.'){
- if(token._precision){
- token.precision = parseInt(token._precision);
- }else{
- token.precision = 0;
- }
- }
- var mixins = this._specifiers[token.specifier];
- if(typeof mixins == "undefined"){
- throw new Error("unexpected specifier '" + token.specifier + "'");
- }
- if(mixins.extend){
- dojo.mixin(mixins, this._specifiers[mixins.extend]);
- delete mixins.extend;
- }
- dojo.mixin(token, mixins);
- }
- if(typeof token.setArg == "function"){
- token.setArg(token);
- }
- if(typeof token.setMaxWidth == "function"){
- token.setMaxWidth(token);
- }
- if(token._minWidth == "*"){
- if(this._mapped){
- throw new Error("* width not supported in mapped formats");
- }
- token.minWidth = parseInt(arguments[position++]);
- if(isNaN(token.minWidth)){
- throw new Error("the argument for * width at position " + position + " is not a number in " + this._format);
- }
-
- if (token.minWidth < 0) {
- token.rightJustify = true;
- token.minWidth = -token.minWidth;
- }
- }
- if(token._precision == "*" && token.period == "."){
- if(this._mapped){
- throw new Error("* precision not supported in mapped formats");
- }
- token.precision = parseInt(arguments[position++]);
- if(isNaN(token.precision)){
- throw Error("the argument for * precision at position " + position + " is not a number in " + this._format);
- }
-
- if (token.precision < 0) {
- token.precision = 1;
- token.period = '';
- }
- }
- if(token.isInt){
-
- if(token.period == '.'){
- token.zeroPad = false;
- }
- this.formatInt(token);
- }else if(token.isDouble){
- if(token.period != '.'){
- token.precision = 6;
- }
- this.formatDouble(token);
- }
- this.fitField(token);
- str += "" + token.arg;
- }
- }
- return str;
- },
- _zeros10: '0000000000',
- _spaces10: ' ',
- formatInt: function(token) {
- var i = parseInt(token.arg);
- if(!isFinite(i)){
-
- if(typeof token.arg != "number"){
- throw new Error("format argument '" + token.arg + "' not an integer; parseInt returned " + i);
- }
-
- i = 0;
- }
-
-
- if(i < 0 && (token.isUnsigned || token.base != 10)){
- i = 0xffffffff + i + 1;
- }
- if(i < 0){
- token.arg = (- i).toString(token.base);
- this.zeroPad(token);
- token.arg = "-" + token.arg;
- }else{
- token.arg = i.toString(token.base);
-
- if(!i && !token.precision){
- token.arg = "";
- }else{
- this.zeroPad(token);
- }
- if(token.sign){
- token.arg = token.sign + token.arg;
- }
- }
- if(token.base == 16){
- if(token.alternative){
- token.arg = '0x' + token.arg;
- }
- token.arg = token.toUpper ? token.arg.toUpperCase() : token.arg.toLowerCase();
- }
- if(token.base == 8){
- if(token.alternative && token.arg.charAt(0) != '0'){
- token.arg = '0' + token.arg;
- }
- }
- },
- formatDouble: function(token) {
- var f = parseFloat(token.arg);
- if(!isFinite(f)){
-
- if(typeof token.arg != "number"){
- throw new Error("format argument '" + token.arg + "' not a float; parseFloat returned " + f);
- }
-
-
-
-
-
- f = 0;
- }
- switch(token.doubleNotation) {
- case 'e': {
- token.arg = f.toExponential(token.precision);
- break;
- }
- case 'f': {
- token.arg = f.toFixed(token.precision);
- break;
- }
- case 'g': {
-
-
-
- if(Math.abs(f) < 0.0001){
-
- token.arg = f.toExponential(token.precision > 0 ? token.precision - 1 : token.precision);
- }else{
- token.arg = f.toPrecision(token.precision);
- }
-
-
- if(!token.alternative){
-
- token.arg = token.arg.replace(/(\..*[^0])0*/, "$1");
-
- token.arg = token.arg.replace(/\.0*e/, 'e').replace(/\.0$/,'');
- }
- break;
- }
- default: throw new Error("unexpected double notation '" + token.doubleNotation + "'");
- }
-
-
-
-
- token.arg = token.arg.replace(/e\+(\d)$/, "e+0$1").replace(/e\-(\d)$/, "e-0$1");
-
-
- if(dojo.isOpera){
- token.arg = token.arg.replace(/^\./, '0.');
- }
-
- if(token.alternative){
- token.arg = token.arg.replace(/^(\d+)$/,"$1.");
- token.arg = token.arg.replace(/^(\d+)e/,"$1.e");
- }
- if(f >= 0 && token.sign){
- token.arg = token.sign + token.arg;
- }
- token.arg = token.toUpper ? token.arg.toUpperCase() : token.arg.toLowerCase();
- },
- zeroPad: function(token, /*Int*/ length) {
- length = (arguments.length == 2) ? length : token.precision;
- if(typeof token.arg != "string"){
- token.arg = "" + token.arg;
- }
- var tenless = length - 10;
- while(token.arg.length < tenless){
- token.arg = (token.rightJustify) ? token.arg + this._zeros10 : this._zeros10 + token.arg;
- }
- var pad = length - token.arg.length;
- token.arg = (token.rightJustify) ? token.arg + this._zeros10.substring(0, pad) : this._zeros10.substring(0, pad) + token.arg;
- },
- fitField: function(token) {
- if(token.maxWidth >= 0 && token.arg.length > token.maxWidth){
- return token.arg.substring(0, token.maxWidth);
- }
- if(token.zeroPad){
- this.zeroPad(token, token.minWidth);
- return;
- }
- this.spacePad(token);
- },
- spacePad: function(token, /*Int*/ length) {
- length = (arguments.length == 2) ? length : token.minWidth;
- if(typeof token.arg != 'string'){
- token.arg = '' + token.arg;
- }
- var tenless = length - 10;
- while(token.arg.length < tenless){
- token.arg = (token.rightJustify) ? token.arg + this._spaces10 : this._spaces10 + token.arg;
- }
- var pad = length - token.arg.length;
- token.arg = (token.rightJustify) ? token.arg + this._spaces10.substring(0, pad) : this._spaces10.substring(0, pad) + token.arg;
- }
- });
- }
- if(!dojo._hasResource["dojox.dtl.filter.strings"]){
- dojo._hasResource["dojox.dtl.filter.strings"] = true;
- dojo.provide("dojox.dtl.filter.strings");
- dojo.mixin(dojox.dtl.filter.strings, {
- _urlquote: function(/*String*/ url, /*String?*/ safe){
- if(!safe){
- safe = "/";
- }
- return dojox.string.tokenize(url, /([^\w-_.])/g, function(token){
- if(safe.indexOf(token) == -1){
- if(token == " "){
- return "+";
- }else{
- return "%" + token.charCodeAt(0).toString(16).toUpperCase();
- }
- }
- return token;
- }).join("");
- },
- addslashes: function(value){
-
- return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/'/g, "\\'");
- },
- capfirst: function(value){
-
- value = "" + value;
- return value.charAt(0).toUpperCase() + value.substring(1);
- },
- center: function(value, arg){
-
- arg = arg || value.length;
- value = value + "";
- var diff = arg - value.length;
- if(diff % 2){
- value = value + " ";
- diff -= 1;
- }
- for(var i = 0; i < diff; i += 2){
- value = " " + value + " ";
- }
- return value;
- },
- cut: function(value, arg){
-
- arg = arg + "" || "";
- value = value + "";
- return value.replace(new RegExp(arg, "g"), "");
- },
- _fix_ampersands: /&(?!(\w+|#\d+);)/g,
- fix_ampersands: function(value){
-
- return value.replace(dojox.dtl.filter.strings._fix_ampersands, "&");
- },
- floatformat: function(value, arg){
-
-
-
-
-
-
-
-
- arg = parseInt(arg || -1, 10);
- value = parseFloat(value);
- var m = value - value.toFixed(0);
- if(!m && arg < 0){
- return value.toFixed();
- }
- value = value.toFixed(Math.abs(arg));
- return (arg < 0) ? parseFloat(value) + "" : value;
- },
- iriencode: function(value){
- return dojox.dtl.filter.strings._urlquote(value, "/#%[]=:;$&()+,!");
- },
- linenumbers: function(value){
-
- var df = dojox.dtl.filter;
- var lines = value.split("\n");
- var output = [];
- var width = (lines.length + "").length;
- for(var i = 0, line; i < lines.length; i++){
- line = lines[i];
- output.push(df.strings.ljust(i + 1, width) + ". " + dojox.dtl._base.escape(line));
- }
- return output.join("\n");
- },
- ljust: function(value, arg){
- value = value + "";
- arg = parseInt(arg, 10);
- while(value.length < arg){
- value = value + " ";
- }
- return value;
- },
- lower: function(value){
-
- return (value + "").toLowerCase();
- },
- make_list: function(value){
-
-
-
- var output = [];
- if(typeof value == "number"){
- value = value + "";
- }
- if(value.charAt){
- for(var i = 0; i < value.length; i++){
- output.push(value.charAt(i));
- }
- return output;
- }
- if(typeof value == "object"){
- for(var key in value){
- output.push(value[key]);
- }
- return output;
- }
- return [];
- },
- rjust: function(value, arg){
- value = value + "";
- arg = parseInt(arg, 10);
- while(value.length < arg){
- value = " " + value;
- }
- return value;
- },
- slugify: function(value){
-
-
- value = value.replace(/[^\w\s-]/g, "").toLowerCase();
- return value.replace(/[\-\s]+/g, "-");
- },
- _strings: {},
- stringformat: function(value, arg){
-
-
-
-
- arg = "" + arg;
- var strings = dojox.dtl.filter.strings._strings;
- if(!strings[arg]){
- strings[arg] = new dojox.string.sprintf.Formatter("%" + arg);
- }
- return strings[arg].format(value);
- },
- title: function(value){
-
- var last, title = "";
- for(var i = 0, current; i < value.length; i++){
- current = value.charAt(i);
- if(last == " " || last == "\n" || last == "\t" || !last){
- title += current.toUpperCase();
- }else{
- title += current.toLowerCase();
- }
- last = current;
- }
- return title;
- },
- _truncatewords: /[ \n\r\t]/,
- truncatewords: function(value, arg){
-
-
-
- arg = parseInt(arg, 10);
- if(!arg){
- return value;
- }
- for(var i = 0, j = value.length, count = 0, current, last; i < value.length; i++){
- current = value.charAt(i);
- if(dojox.dtl.filter.strings._truncatewords.test(last)){
- if(!dojox.dtl.filter.strings._truncatewords.test(current)){
- ++count;
- if(count == arg){
- return value.substring(0, j + 1);
- }
- }
- }else if(!dojox.dtl.filter.strings._truncatewords.test(current)){
- j = i;
- }
- last = current;
- }
- return value;
- },
- _truncate_words: /(&.*?;|<.*?>|(\w[\w\-]*))/g,
- _truncate_tag: /<(\/)?([^ ]+?)(?: (\/)| .*?)?>/,
- _truncate_singlets: { br: true, col: true, link: true, base: true, img: true, param: true, area: true, hr: true, input: true },
- truncatewords_html: function(value, arg){
- arg = parseInt(arg, 10);
- if(arg <= 0){
- return "";
- }
- var strings = dojox.dtl.filter.strings;
- var words = 0;
- var open = [];
- var output = dojox.string.tokenize(value, strings._truncate_words, function(all, word){
- if(word){
-
- ++words;
- if(words < arg){
- return word;
- }else if(words == arg){
- return word + " ...";
- }
- }
-
- var tag = all.match(strings._truncate_tag);
- if(!tag || words >= arg){
-
- return;
- }
- var closing = tag[1];
- var tagname = tag[2].toLowerCase();
- var selfclosing = tag[3];
- if(closing || strings._truncate_singlets[tagname]){
- }else if(closing){
- var i = dojo.indexOf(open, tagname);
- if(i != -1){
- open = open.slice(i + 1);
- }
- }else{
- open.unshift(tagname);
- }
- return all;
- }).join("");
- output = output.replace(/\s+$/g, "");
- for(var i = 0, tag; tag = open[i]; i++){
- output += "</" + tag + ">";
- }
- return output;
- },
- upper: function(value){
- return value.toUpperCase();
- },
- urlencode: function(value){
- return dojox.dtl.filter.strings._urlquote(value);
- },
- _urlize: /^((?:[(>]|<)*)(.*?)((?:[.,)>\n]|>)*)$/,
- _urlize2: /^\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+$/,
- urlize: function(value){
- return dojox.dtl.filter.strings.urlizetrunc(value);
- },
- urlizetrunc: function(value, arg){
- arg = parseInt(arg);
- return dojox.string.tokenize(value, /(\S+)/g, function(word){
- var matches = dojox.dtl.filter.strings._urlize.exec(word);
- if(!matches){
- return word;
- }
- var lead = matches[1];
- var middle = matches[2];
- var trail = matches[3];
- var startsWww = middle.indexOf("www.") == 0;
- var hasAt = middle.indexOf("@") != -1;
- var hasColon = middle.indexOf(":") != -1;
- var startsHttp = middle.indexOf("http://") == 0;
- var startsHttps = middle.indexOf("https://") == 0;
- var firstAlpha = /[a-zA-Z0-9]/.test(middle.charAt(0));
- var last4 = middle.substring(middle.length - 4);
- var trimmed = middle;
- if(arg > 3){
- trimmed = trimmed.substring(0, arg - 3) + "...";
- }
- if(startsWww || (!hasAt && !startsHttp && middle.length && firstAlpha && (last4 == ".org" || last4 == ".net" || last4 == ".com"))){
- return '<a href="http://' + middle + '" rel="nofollow">' + trimmed + '</a>';
- }else if(startsHttp || startsHttps){
- return '<a href="' + middle + '" rel="nofollow">' + trimmed + '</a>';
- }else if(hasAt && !startsWww && !hasColon && dojox.dtl.filter.strings._urlize2.test(middle)){
- return '<a href="mailto:' + middle + '">' + middle + '</a>';
- }
- return word;
- }).join("");
- },
- wordcount: function(value){
- value = dojo.trim(value);
- if(!value){ return 0; }
- return value.split(/\s+/g).length;
- },
- wordwrap: function(value, arg){
- arg = parseInt(arg);
-
- var output = [];
- var parts = value.split(/\s+/g);
- if(parts.length){
- var word = parts.shift();
- output.push(word);
- var pos = word.length - word.lastIndexOf("\n") - 1;
- for(var i = 0; i < parts.length; i++){
- word = parts[i];
- if(word.indexOf("\n") != -1){
- var lines = word.split(/\n/g);
- }else{
- var lines = [word];
- }
- pos += lines[0].length + 1;
- if(arg && pos > arg){
- output.push("\n");
- pos = lines[lines.length - 1].length;
- }else{
- output.push(" ");
- if(lines.length > 1){
- pos = lines[lines.length - 1].length;
- }
- }
- output.push(word);
- }
- }
- return output.join("");
- }
- });
- }
- if(!dojo._hasResource["dojox.fx._base"]){
- dojo._hasResource["dojox.fx._base"] = true;
- dojo.provide("dojox.fx._base");
- dojo.mixin(dojox.fx, {
-
-
- anim: dojo.anim,
-
-
- animateProperty: dojo.animateProperty,
-
-
-
-
- fadeTo: dojo._fade,
-
-
- fadeIn: dojo.fadeIn,
-
-
-
- fadeOut: dojo.fadeOut,
-
-
- combine: dojo.fx.combine,
-
-
- chain: dojo.fx.chain,
-
-
- slideTo: dojo.fx.slideTo,
-
-
- wipeIn: dojo.fx.wipeIn,
-
-
- wipeOut: dojo.fx.wipeOut
- });
- dojox.fx.sizeTo = function(/* Object */args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var node = args.node = dojo.byId(args.node),
- abs = "absolute";
- var method = args.method || "chain";
- if(!args.duration){ args.duration = 500; }
- if(method == "chain"){ args.duration = Math.floor(args.duration / 2); }
-
- var top, newTop, left, newLeft, width, height = null;
- var init = (function(n){
- return function(){
- var cs = dojo.getComputedStyle(n),
- pos = cs.position,
- w = cs.width,
- h = cs.height
- ;
-
- top = (pos == abs ? n.offsetTop : parseInt(cs.top) || 0);
- left = (pos == abs ? n.offsetLeft : parseInt(cs.left) || 0);
- width = (w == "auto" ? 0 : parseInt(w));
- height = (h == "auto" ? 0 : parseInt(h));
-
- newLeft = left - Math.floor((args.width - width) / 2);
- newTop = top - Math.floor((args.height - height) / 2);
- if(pos != abs && pos != 'relative'){
- var ret = dojo.coords(n, true);
- top = ret.y;
- left = ret.x;
- n.style.position = abs;
- n.style.top = top + "px";
- n.style.left = left + "px";
- }
- }
- })(node);
- var anim1 = dojo.animateProperty(dojo.mixin({
- properties: {
- height: function(){
- init();
- return { end: args.height || 0, start: height };
- },
- top: function(){
- return { start: top, end: newTop };
- }
- }
- }, args));
- var anim2 = dojo.animateProperty(dojo.mixin({
- properties: {
- width: function(){
- return { start: width, end: args.width || 0 }
- },
- left: function(){
- return { start: left, end: newLeft }
- }
- }
- }, args));
- var anim = dojo.fx[(args.method == "combine" ? "combine" : "chain")]([anim1, anim2]);
- return anim;
- };
- dojox.fx.slideBy = function(/* Object */args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var node = args.node = dojo.byId(args.node),
- top, left;
- var init = (function(n){
- return function(){
- var cs = dojo.getComputedStyle(n);
- var pos = cs.position;
- top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
- left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
- if(pos != 'absolute' && pos != 'relative'){
- var ret = dojo.coords(n, true);
- top = ret.y;
- left = ret.x;
- n.style.position = "absolute";
- n.style.top = top + "px";
- n.style.left = left + "px";
- }
- }
- })(node);
- init();
-
- var _anim = dojo.animateProperty(dojo.mixin({
- properties: {
-
-
-
- top: top + (args.top || 0),
- left: left + (args.left || 0)
- }
- }, args));
- dojo.connect(_anim, "beforeBegin", _anim, init);
- return _anim;
- };
- dojox.fx.crossFade = function(/* Object */args){
-
-
-
-
-
-
-
-
-
- var node1 = args.nodes[0] = dojo.byId(args.nodes[0]),
- op1 = dojo.style(node1,"opacity"),
- node2 = args.nodes[1] = dojo.byId(args.nodes[1]),
- op2 = dojo.style(node2, "opacity")
- ;
-
- var _anim = dojo.fx.combine([
- dojo[(op1 == 0 ? "fadeIn" : "fadeOut")](dojo.mixin({
- node: node1
- },args)),
- dojo[(op1 == 0 ? "fadeOut" : "fadeIn")](dojo.mixin({
- node: node2
- },args))
- ]);
- return _anim;
- };
- dojox.fx.highlight = function(/*Object*/ args){
-
-
-
-
-
-
-
-
-
- var node = args.node = dojo.byId(args.node);
- args.duration = args.duration || 400;
-
-
- var startColor = args.color || '#ffff99',
- endColor = dojo.style(node, "backgroundColor")
- ;
-
-
-
-
-
-
- if(endColor == "rgba(0, 0, 0, 0)"){
- endColor = "transparent";
- }
- var anim = dojo.animateProperty(dojo.mixin({
- properties: {
- backgroundColor: { start: startColor, end: endColor }
- }
- }, args));
- if(endColor == "transparent"){
- dojo.connect(anim, "onEnd", anim, function(){
- node.style.backgroundColor = endColor;
- });
- }
- return anim;
- };
-
- dojox.fx.wipeTo = function(/*Object*/ args){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- args.node = dojo.byId(args.node);
- var node = args.node, s = node.style;
- var dir = (args.width ? "width" : "height"),
- endVal = args[dir],
- props = {}
- ;
- props[dir] = {
-
- start: function(){
-
-
- s.overflow = "hidden";
- if(s.visibility == "hidden" || s.display == "none"){
- s[dir] = "1px";
- s.display = "";
- s.visibility = "";
- return 1;
- }else{
- var now = dojo.style(node,dir);
- return Math.max(now, 1);
- }
- },
- end: endVal
- };
- var anim = dojo.animateProperty(dojo.mixin({ properties: props }, args));
- return anim;
- };
- }
- if(!dojo._hasResource["dojox.fx"]){
- dojo._hasResource["dojox.fx"] = true;
- dojo.provide("dojox.fx");
- }
- if(!dojo._hasResource["dojox.form.RangeSlider"]){
- dojo._hasResource["dojox.form.RangeSlider"] = true;
- dojo.provide("dojox.form.RangeSlider");
- (function(){
-
- var sortReversed = function(a, b){ return b - a; },
- sortForward = function(a, b){ return a - b; }
- ;
- dojo.declare("dojox.form._RangeSliderMixin", null, {
- value: [0,100],
- postMixInProperties: function(){
- this.inherited(arguments);
- this.value = dojo.map(this.value, function(i){ return parseInt(i, 10); });
- },
-
- postCreate: function(){
- this.inherited(arguments);
-
-
- this.value.sort(this._isReversed() ? sortReversed : sortForward);
-
- var _self = this;
- var mover = dojo.declare(dijit.form._SliderMoverMax, {
- constructor: function(){
- this.widget = _self;
- }
- });
- this._movableMax = new dojo.dnd.Moveable(this.sliderHandleMax,{ mover: mover });
- dijit.setWaiState(this.focusNodeMax, "valuemin", this.minimum);
- dijit.setWaiState(this.focusNodeMax, "valuemax", this.maximum);
-
-
- var barMover = dojo.declare(dijit.form._SliderBarMover, {
- constructor: function(){
- this.widget = _self;
- }
- });
- this._movableBar = new dojo.dnd.Moveable(this.progressBar,{ mover: barMover });
- },
-
- destroy: function(){
- this.inherited(arguments);
- this._movableMax.destroy();
- this._movableBar.destroy();
- },
-
- _onKeyPress: function(/*Event*/ e){
- if(this.disabled || this.readOnly || e.altKey || e.ctrlKey){ return; }
-
- var useMaxValue = e.target === this.sliderHandleMax;
- var barFocus = e.target === this.progressBar;
- var k = dojo.delegate(dojo.keys, this.isLeftToRight() ? {PREV_ARROW: dojo.keys.LEFT_ARROW, NEXT_ARROW: dojo.keys.RIGHT_ARROW}
- : {PREV_ARROW: dojo.keys.RIGHT_ARROW, NEXT_ARROW: dojo.keys.LEFT_ARROW});
- var delta = 0;
- var down = false;
- switch(e.keyCode){
- case k.HOME : this._setValueAttr(this.minimum, true, useMaxValue);dojo.stopEvent(e);return;
- case k.END : this._setValueAttr(this.maximum, true, useMaxValue);dojo.stopEvent(e);return;
- case k.PREV_ARROW :
- case k.DOWN_ARROW : down = true;
- case k.NEXT_ARROW :
- case k.UP_ARROW : delta = 1; break;
- case k.PAGE_DOWN : down = true;
- case k.PAGE_UP : delta = this.pageIncrement; break;
- default : this.inherited(arguments);return;
- }
-
- if(down){delta = -delta;}
- if(delta){
- if(barFocus){
- this._bumpValue([
- { change: delta, useMaxValue: false },
- { change: delta, useMaxValue: true }
- ]);
- }else{
- this._bumpValue(delta, useMaxValue);
- }
- dojo.stopEvent(e);
- }
- },
-
- _onHandleClickMax: function(e){
- if(this.disabled || this.readOnly){ return; }
- if(!dojo.isIE){
-
-
- dijit.focus(this.sliderHandleMax);
- }
- dojo.stopEvent(e);
- },
-
- _onClkIncBumper: function(){
- this._setValueAttr(this._descending === false ? this.minimum : this.maximum, true, true);
- },
-
- _bumpValue: function(signedChange, useMaxValue){
-
- var value = dojo.isArray(signedChange) ? [
- this._getBumpValue(signedChange[0].change, signedChange[0].useMaxValue),
- this._getBumpValue(signedChange[1].change, signedChange[1].useMaxValue)
- ]
- : this._getBumpValue(signedChange, useMaxValue)
- this._setValueAttr(value, true, useMaxValue);
- },
-
- _getBumpValue: function(signedChange, useMaxValue){
-
- var idx = useMaxValue ? 1 : 0;
- if( this._isReversed() ) {
- idx = 1 - idx;
- }
- var s = dojo.getComputedStyle(this.sliderBarContainer),
- c = dojo._getContentBox(this.sliderBarContainer, s),
- count = this.discreteValues,
- myValue = this.value[idx]
- ;
- if(count <= 1 || count == Infinity){ count = c[this._pixelCount]; }
- count--;
-
- var value = (myValue - this.minimum) * count / (this.maximum - this.minimum) + signedChange;
- if(value < 0){ value = 0; }
- if(value > count){ value = count; }
-
- return value * (this.maximum - this.minimum) / count + this.minimum;
- },
-
- _onBarClick: function(e){
- if(this.disabled || this.readOnly){ return; }
- if(!dojo.isIE){
-
-
- dijit.focus(this.progressBar);
- }
- dojo.stopEvent(e);
- },
-
- _onRemainingBarClick: function(e){
- if(this.disabled || this.readOnly){ return; }
- if(!dojo.isIE){
-
-
- dijit.focus(this.progressBar);
- }
-
- var abspos = dojo.coords(this.sliderBarContainer, true),
- bar = dojo.coords(this.progressBar, true),
- relMousePos = e[this._mousePixelCoord] - abspos[this._startingPixelCoord],
- leftPos = bar[this._startingPixelCount],
- rightPos = leftPos + bar[this._pixelCount],
- isMaxVal = this._isReversed() ? relMousePos <= leftPos : relMousePos >= rightPos,
- p = this._isReversed() ? abspos[this._pixelCount] - relMousePos : relMousePos
- ;
- this._setPixelValue(p, abspos[this._pixelCount], true, isMaxVal);
- dojo.stopEvent(e);
- },
-
- _setPixelValue: function(/*Number*/ pixelValue, /*Number*/ maxPixels, /*Boolean*/ priorityChange, /*Boolean*/ isMaxVal){
- if(this.disabled || this.readOnly){ return; }
- var myValue = this._getValueByPixelValue(pixelValue, maxPixels);
- this._setValueAttr(myValue, priorityChange, isMaxVal);
- },
-
- _getValueByPixelValue: function(/*Number*/ pixelValue, /*Number*/ maxPixels){
- pixelValue = pixelValue < 0 ? 0 : maxPixels < pixelValue ? maxPixels : pixelValue;
- var count = this.discreteValues;
- if(count <= 1 || count == Infinity){ count = maxPixels; }
- count--;
- var pixelsPerValue = maxPixels / count;
- var wholeIncrements = Math.round(pixelValue / pixelsPerValue);
- return (this.maximum-this.minimum)*wholeIncrements/count + this.minimum;
- },
-
- _setValueAttr: function(/*Array or Number*/ value, /*Boolean, optional*/ priorityChange, /*Boolean, optional*/ isMaxVal){
-
- var actValue = this.value;
- if(!dojo.isArray(value)){
- if(isMaxVal){
- if(this._isReversed()){
- actValue[0] = value;
- }else{
- actValue[1] = value;
- }
- }else{
- if(this._isReversed()){
- actValue[1] = value;
- }else{
- actValue[0] = value;
- }
- }
- }else{
- actValue = value;
- }
-
- this._lastValueReported = "";
- this.valueNode.value = this.value = value = actValue;
- dijit.setWaiState(this.focusNode, "valuenow", actValue[0]);
- dijit.setWaiState(this.focusNodeMax, "valuenow", actValue[1]);
-
- this.value.sort(this._isReversed() ? sortReversed : sortForward);
-
-
- dijit.form._FormValueWidget.prototype._setValueAttr.apply(this, arguments);
- this._printSliderBar(priorityChange, isMaxVal);
- },
-
- _printSliderBar: function(priorityChange, isMaxVal){
- var percentMin = (this.value[0] - this.minimum) / (this.maximum - this.minimum);
- var percentMax = (this.value[1] - this.minimum) / (this.maximum - this.minimum);
- var percentMinSave = percentMin;
- if(percentMin > percentMax){
- percentMin = percentMax;
- percentMax = percentMinSave;
- }
- var sliderHandleVal = this._isReversed() ? ((1-percentMin)*100) : (percentMin * 100);
- var sliderHandleMaxVal = this._isReversed() ? ((1-percentMax)*100) : (percentMax * 100);
- var progressBarVal = this._isReversed() ? ((1-percentMax)*100) : (percentMin * 100);
- if (priorityChange && this.slideDuration > 0 && this.progressBar.style[this._progressPixelSize]){
-
- var percent = isMaxVal ? percentMax : percentMin;
- var _this = this;
- var props = {};
- var start = parseFloat(this.progressBar.style[this._handleOffsetCoord]);
- var duration = this.slideDuration / 10;
- if(duration === 0){ return; }
- if(duration < 0){ duration = 0 - duration; }
- var propsHandle = {};
- var propsHandleMax = {};
- var propsBar = {};
-
- propsHandle[this._handleOffsetCoord] = { start: this.sliderHandle.style[this._handleOffsetCoord], end: sliderHandleVal, units:"%"};
- propsHandleMax[this._handleOffsetCoord] = { start: this.sliderHandleMax.style[this._handleOffsetCoord], end: sliderHandleMaxVal, units:"%"};
- propsBar[this._handleOffsetCoord] = { start: this.progressBar.style[this._handleOffsetCoord], end: progressBarVal, units:"%"};
- propsBar[this._progressPixelSize] = { start: this.progressBar.style[this._progressPixelSize], end: (percentMax - percentMin) * 100, units:"%"};
- var animHandle = dojo.animateProperty({node: this.sliderHandle,duration: duration, properties: propsHandle});
- var animHandleMax = dojo.animateProperty({node: this.sliderHandleMax,duration: duration, properties: propsHandleMax});
- var animBar = dojo.animateProperty({node: this.progressBar,duration: duration, properties: propsBar});
- var animCombine = dojo.fx.combine([animHandle, animHandleMax, animBar]);
- animCombine.play();
- }else{
- this.sliderHandle.style[this._handleOffsetCoord] = sliderHandleVal + "%";
- this.sliderHandleMax.style[this._handleOffsetCoord] = sliderHandleMaxVal + "%";
- this.progressBar.style[this._handleOffsetCoord] = progressBarVal + "%";
- this.progressBar.style[this._progressPixelSize] = ((percentMax - percentMin) * 100) + "%";
- }
- }
- });
- dojo.declare("dijit.form._SliderMoverMax", dijit.form._SliderMover, {
- onMouseMove: function(e){
- var widget = this.widget;
- var abspos = widget._abspos;
- if(!abspos){
- abspos = widget._abspos = dojo.coords(widget.sliderBarContainer, true);
- widget._setPixelValue_ = dojo.hitch(widget, "_setPixelValue");
- widget._isReversed_ = widget._isReversed();
- }
-
- var coordEvent = e.touches ? e.touches[0] : e;
- var pixelValue = coordEvent[widget._mousePixelCoord] - abspos[widget._startingPixelCoord];
- widget._setPixelValue_(widget._isReversed_ ? (abspos[widget._pixelCount]-pixelValue) : pixelValue, abspos[widget._pixelCount], false, true);
- },
-
- destroy: function(e){
- dojo.dnd.Mover.prototype.destroy.apply(this, arguments);
- var widget = this.widget;
- widget._abspos = null;
- widget._setValueAttr(widget.value, true);
- }
- });
- dojo.declare("dijit.form._SliderBarMover", dojo.dnd.Mover, {
- onMouseMove: function(e){
- var widget = this.widget;
- if(widget.disabled || widget.readOnly){ return; }
- var abspos = widget._abspos;
- var bar = widget._bar;
- var mouseOffset = widget._mouseOffset;
- if(!abspos){
- abspos = widget._abspos = dojo.coords(widget.sliderBarContainer, true);
- widget._setPixelValue_ = dojo.hitch(widget, "_setPixelValue");
- widget._getValueByPixelValue_ = dojo.hitch(widget, "_getValueByPixelValue");
- widget._isReversed_ = widget._isReversed();
- }
-
- if(!bar){
- bar = widget._bar = dojo.coords(widget.progressBar, true);
- }
- var coordEvent = e.touches ? e.touches[0] : e;
-
- if(!mouseOffset){
- mouseOffset = widget._mouseOffset = coordEvent[widget._mousePixelCoord] - abspos[widget._startingPixelCoord] - bar[widget._startingPixelCount];
- }
-
-
- var pixelValueMin = coordEvent[widget._mousePixelCoord] - abspos[widget._startingPixelCoord] - mouseOffset,
- pixelValueMax = pixelValueMin + bar[widget._pixelCount];
-
-
- pixelValues = [pixelValueMin, pixelValueMax]
- ;
- pixelValues.sort(sortForward);
- if(pixelValues[0] <= 0){
- pixelValues[0] = 0;
- pixelValues[1] = bar[widget._pixelCount];
- }
- if(pixelValues[1] >= abspos[widget._pixelCount]){
- pixelValues[1] = abspos[widget._pixelCount];
- pixelValues[0] = abspos[widget._pixelCount] - bar[widget._pixelCount];
- }
-
- var myValues = [
- widget._getValueByPixelValue(widget._isReversed_ ? (abspos[widget._pixelCount] - pixelValues[0]) : pixelValues[0], abspos[widget._pixelCount]),
- widget._getValueByPixelValue(widget._isReversed_ ? (abspos[widget._pixelCount] - pixelValues[1]) : pixelValues[1], abspos[widget._pixelCount])
- ];
-
- widget._setValueAttr(myValues, false, false);
- },
-
- destroy: function(){
- dojo.dnd.Mover.prototype.destroy.apply(this, arguments);
- var widget = this.widget;
- widget._abspos = null;
- widget._bar = null;
- widget._mouseOffset = null;
- widget._setValueAttr(widget.value, true);
- }
- });
- dojo.declare("dojox.form.HorizontalRangeSlider",
- [dijit.form.HorizontalSlider, dojox.form._RangeSliderMixin],
- {
-
-
- templateString: dojo.cache("dojox.form", "resources/HorizontalRangeSlider.html", "<table class=\"dijit dijitReset dijitSlider dijitSliderH dojoxRangeSlider\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\" dojoAttachEvent=\"onkeypress:_onKeyPress,onkeyup:_onKeyUp\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"topDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationT dijitSliderDecorationH\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\"\n\t\t\t><div class=\"dijitSliderDecrementIconH\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"decrementButton\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderLeftBumper\" dojoAttachEvent=\"onmousedown:_onClkDecBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" ${!nameAttrSetting}\n\t\t\t/><div role=\"presentation\" class=\"dojoxRangeSliderBarContainer\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div dojoAttachPoint=\"sliderHandle\" tabIndex=\"${tabIndex}\" class=\"dijitSliderMoveable dijitSliderMoveableH\" dojoAttachEvent=\"onmousedown:_onHandleClick\" role=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"\n\t\t\t\t\t><div class=\"dijitSliderImageHandle dijitSliderImageHandleH\"></div\n\t\t\t\t></div\n\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"progressBar,focusNode\" class=\"dijitSliderBar dijitSliderBarH dijitSliderProgressBar dijitSliderProgressBarH\" dojoAttachEvent=\"onmousedown:_onBarClick\"></div\n\t\t\t\t><div dojoAttachPoint=\"sliderHandleMax,focusNodeMax\" tabIndex=\"${tabIndex}\" class=\"dijitSliderMoveable dijitSliderMoveableH\" dojoAttachEvent=\"onmousedown:_onHandleClickMax\" role=\"sliderMax\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"\n\t\t\t\t\t><div class=\"dijitSliderImageHandle dijitSliderImageHandleH\"></div\n\t\t\t\t></div\n\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarH dijitSliderRemainingBar dijitSliderRemainingBarH\" dojoAttachEvent=\"onmousedown:_onRemainingBarClick\"></div\n\t\t\t></div\n\t\t></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperH dijitSliderRightBumper\" dojoAttachEvent=\"onmousedown:_onClkIncBumper\"></div\n\t\t></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerH\"\n\t\t\t><div class=\"dijitSliderIncrementIconH\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"incrementButton\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t\t><td dojoAttachPoint=\"containerNode,bottomDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationB dijitSliderDecorationH\"></td\n\t\t><td class=\"dijitReset\" colspan=\"2\"></td\n\t></tr\n></table>\n")
- }
- );
- dojo.declare("dojox.form.VerticalRangeSlider",
- [dijit.form.VerticalSlider, dojox.form._RangeSliderMixin],
- {
-
-
- templateString: dojo.cache("dojox.form", "resources/VerticalRangeSlider.html", "<table class=\"dijitReset dijitSlider dijitSliderV dojoxRangeSlider\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" rules=\"none\"\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderIncrementIconV\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"decrementButton\" dojoAttachEvent=\"onclick: increment\"><span class=\"dijitSliderButtonInner\">+</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderTopBumper\" dojoAttachEvent=\"onclick:_onClkIncBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td dojoAttachPoint=\"leftDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationL dijitSliderDecorationV\" style=\"text-align:center;height:100%;\"></td\n\t\t><td class=\"dijitReset\" style=\"height:100%;\"\n\t\t\t><input dojoAttachPoint=\"valueNode\" type=\"hidden\" ${!nameAttrSetting}\n\t\t\t/><center role=\"presentation\" style=\"position:relative;height:100%;\" dojoAttachPoint=\"sliderBarContainer\"\n\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"remainingBar\" class=\"dijitSliderBar dijitSliderBarV dijitSliderRemainingBar dijitSliderRemainingBarV\" dojoAttachEvent=\"onmousedown:_onRemainingBarClick\"\n\t\t\t\t\t><div dojoAttachPoint=\"sliderHandle\" tabIndex=\"${tabIndex}\" class=\"dijitSliderMoveable dijitSliderMoveableV\" dojoAttachEvent=\"onkeypress:_onKeyPress,onmousedown:_onHandleClick\" style=\"vertical-align:top;\" role=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"\n\t\t\t\t\t\t><div class=\"dijitSliderImageHandle dijitSliderImageHandleV\"></div\n\t\t\t\t\t></div\n\t\t\t\t\t><div role=\"presentation\" dojoAttachPoint=\"progressBar,focusNode\" tabIndex=\"${tabIndex}\" class=\"dijitSliderBar dijitSliderBarV dijitSliderProgressBar dijitSliderProgressBarV\" dojoAttachEvent=\"onkeypress:_onKeyPress,onmousedown:_onBarClick\"\n\t\t\t\t\t></div\n\t\t\t\t\t><div dojoAttachPoint=\"sliderHandleMax,focusNodeMax\" tabIndex=\"${tabIndex}\" class=\"dijitSliderMoveable dijitSliderMoveableV\" dojoAttachEvent=\"onkeypress:_onKeyPress,onmousedown:_onHandleClickMax\" style=\"vertical-align:top;\" role=\"slider\" valuemin=\"${minimum}\" valuemax=\"${maximum}\"\n\t\t\t\t\t\t><div class=\"dijitSliderImageHandle dijitSliderImageHandleV\"></div\n\t\t\t\t\t></div\n\t\t\t\t></div\n\t\t\t></center\n\t\t></td\n\t\t><td dojoAttachPoint=\"containerNode,rightDecoration\" class=\"dijitReset dijitSliderDecoration dijitSliderDecorationR dijitSliderDecorationV\" style=\"text-align:center;height:100%;\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset\"\n\t\t\t><center><div class=\"dijitSliderBar dijitSliderBumper dijitSliderBumperV dijitSliderBottomBumper\" dojoAttachEvent=\"onclick:_onClkDecBumper\"></div></center\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n\t><tr class=\"dijitReset\"\n\t\t><td class=\"dijitReset\"></td\n\t\t><td class=\"dijitReset dijitSliderButtonContainer dijitSliderButtonContainerV\"\n\t\t\t><div class=\"dijitSliderDecrementIconV\" tabIndex=\"-1\" style=\"display:none\" dojoAttachPoint=\"incrementButton\" dojoAttachEvent=\"onclick: decrement\"><span class=\"dijitSliderButtonInner\">-</span></div\n\t\t></td\n\t\t><td class=\"dijitReset\"></td\n\t></tr\n></table>\n")
- }
- );
- })();
- }
- if(!dojo._hasResource["dojox.fx._core"]){
- dojo._hasResource["dojox.fx._core"] = true;
- dojo.provide("dojox.fx._core");
- dojox.fx._Line = function(start, end){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.start = start;
- this.end = end;
-
- var isArray = dojo.isArray(start),
- d = (isArray ? [] : end - start);
-
- if(isArray){
-
- dojo.forEach(this.start, function(s, i){
- d[i] = this.end[i] - s;
- }, this);
-
- this.getValue = function(/*float*/ n){
- var res = [];
- dojo.forEach(this.start, function(s, i){
- res[i] = (d[i] * n) + s;
- }, this);
- return res;
- }
- }else{
-
- this.getValue = function(/*float*/ n){
-
-
-
- return (d * n) + this.start;
- }
- }
- };
- }
- if(!dojo._hasResource["dojox.json.query"]){
- dojo._hasResource["dojox.json.query"] = true;
- dojo.provide("dojox.json.query");
- (function(){
- dojox.json._slice = function(obj,start,end,step){
-
- var len=obj.length,results = [];
- end = end || len;
- start = (start < 0) ? Math.max(0,start+len) : Math.min(len,start);
- end = (end < 0) ? Math.max(0,end+len) : Math.min(len,end);
- for(var i=start; i<end; i+=step){
- results.push(obj[i]);
- }
- return results;
- }
- dojox.json._find = function e(obj,name){
-
-
- var results = [];
- function walk(obj){
- if(name){
- if(name===true && !(obj instanceof Array)){
-
- results.push(obj);
- }else if(obj[name]){
-
- results.push(obj[name]);
- }
- }
- for(var i in obj){
- var val = obj[i];
- if(!name){
-
- results.push(val);
- }else if(val && typeof val == 'object'){
-
- walk(val);
- }
- }
- }
- if(name instanceof Array){
-
- if(name.length==1){
-
-
-
- return obj[name[0]];
- }
- for(var i = 0; i < name.length; i++){
- results.push(obj[name[i]]);
- }
- }else{
-
- walk(obj);
- }
- return results;
- }
-
- dojox.json._distinctFilter = function(array, callback){
-
- var outArr = [];
- var primitives = {};
- for(var i=0,l=array.length; i<l; ++i){
- var value = array[i];
- if(callback(value, i, array)){
- if((typeof value == 'object') && value){
-
- if(!value.__included){
- value.__included = true;
- outArr.push(value);
- }
- }else if(!primitives[value + typeof value]){
-
- primitives[value + typeof value] = true;
- outArr.push(value);
- }
- }
- }
- for(i=0,l=outArr.length; i<l; ++i){
-
- if(outArr[i]){
- delete outArr[i].__included;
- }
- }
- return outArr;
- }
- dojox.json.query = function(/*String*/query,/*Object?*/obj){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var depth = 0;
- var str = [];
- query = query.replace(/"(\\.|[^"\\])*"|'(\\.|[^'\\])*'|[\[\]]/g,function(t){
- depth += t == '[' ? 1 : t == ']' ? -1 : 0;
- return (t == ']' && depth > 0) ? '`]' :
- (t.charAt(0) == '"' || t.charAt(0) == "'") ? "`" + (str.push(t) - 1) :
- t;
- });
- var prefix = '';
- function call(name){
-
- prefix = name + "(" + prefix;
- }
- function makeRegex(t,a,b,c,d,e,f,g){
-
- return str[g].match(/[\*\?]/) || f == '~' ?
- "/^" + str[g].substring(1,str[g].length-1).replace(/\\([btnfr\\"'])|([^\w\*\?])/g,"\\$1$2").replace(/([\*\?])/g,"[\\w\\W]$1") + (f == '~' ? '$/i' : '$/') + ".test(" + a + ")" :
- t;
- }
- query.replace(/(\]|\)|push|pop|shift|splice|sort|reverse)\s*\(/,function(){
- throw new Error("Unsafe function call");
- });
-
- query = query.replace(/([^=]=)([^=])/g,"$1=$2").
- replace(/@|(\.\s*)?[a-zA-Z\$_]+(\s*:)?/g,function(t){
- return t.charAt(0) == '.' ? t :
- t == '@' ? "$obj" :
- (t.match(/:|^(\$|Math|true|false|null)$/) ? "" : "$obj.") + t;
- }).
- replace(/\.?\.?\[(`\]|[^\]])*\]|\?.*|\.\.([\w\$_]+)|\.\*/g,function(t,a,b){
- var oper = t.match(/^\.?\.?(\[\s*\^?\?|\^?\?|\[\s*==)(.*?)\]?$/);
- if(oper){
- var prefix = '';
- if(t.match(/^\./)){
-
- call("dojox.json._find");
- prefix = ",true)";
- }
- call(oper[1].match(/\=/) ? "dojo.map" : oper[1].match(/\^/) ? "dojox.json._distinctFilter" : "dojo.filter");
- return prefix + ",function($obj){return " + oper[2] + "})";
- }
- oper = t.match(/^\[\s*([\/\\].*)\]/);
- if(oper){
-
- return ".concat().sort(function(a,b){" + oper[1].replace(/\s*,?\s*([\/\\])\s*([^,\\\/]+)/g,function(t,a,b){
- return "var av= " + b.replace(/\$obj/,"a") + ",bv= " + b.replace(/\$obj/,"b") +
- ";if(av>bv||bv==null){return " + (a== "/" ? 1 : -1) +";}\n" +
- "if(bv>av||av==null){return " + (a== "/" ? -1 : 1) +";}\n";
- }) + "return 0;})";
- }
- oper = t.match(/^\[(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)\]/);
- if(oper){
- call("dojox.json._slice");
- return "," + (oper[1] || 0) + "," + (oper[2] || 0) + "," + (oper[3] || 1) + ")";
- }
- if(t.match(/^\.\.|\.\*|\[\s*\*\s*\]|,/)){
- call("dojox.json._find");
- return (t.charAt(1) == '.' ?
- ",'" + b + "'" :
- t.match(/,/) ?
- "," + t :
- "") + ")";
- }
- return t;
- }).
- replace(/(\$obj\s*((\.\s*[\w_$]+\s*)|(\[\s*`([0-9]+)\s*`\]))*)(==|~)\s*`([0-9]+)/g,makeRegex).
- replace(/`([0-9]+)\s*(==|~)\s*(\$obj\s*((\.\s*[\w_$]+)|(\[\s*`([0-9]+)\s*`\]))*)/g,function(t,a,b,c,d,e,f,g){
- return makeRegex(t,c,d,e,f,g,b,a);
- });
- query = prefix + (query.charAt(0) == '$' ? "" : "$") + query.replace(/`([0-9]+|\])/g,function(t,a){
-
- return a == ']' ? ']' : str[a];
- });
-
-
- var executor = eval("1&&function($,$1,$2,$3,$4,$5,$6,$7,$8,$9){var $obj=$;return " + query + "}");
- for(var i = 0;i<arguments.length-1;i++){
- arguments[i] = arguments[i+1];
- }
- return obj ? executor.apply(this,arguments) : executor;
- };
-
- })();
- }
- if(!dojo._hasResource["dojox.html._base"]){
- dojo._hasResource["dojox.html._base"] = true;
- dojo.provide("dojox.html._base");
- (function() {
- if(dojo.isIE){
- var alphaImageLoader = /(AlphaImageLoader\([^)]*?src=(['"]))(?![a-z]+:|\/)([^\r\n;}]+?)(\2[^)]*\)\s*[;}]?)/g;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- var cssPaths = /(?:(?:@import\s*(['"])(?![a-z]+:|\/)([^\r\n;{]+?)\1)|url\(\s*(['"]?)(?![a-z]+:|\/)([^\r\n;]+?)\3\s*\))([a-z, \s]*[;}]?)/g;
- var adjustCssPaths = dojox.html._adjustCssPaths = function(cssUrl, cssText){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!cssText || !cssUrl){ return; }
-
-
-
-
-
-
- if(alphaImageLoader){
- cssText = cssText.replace(alphaImageLoader, function(ignore, pre, delim, url, post){
- return pre + (new dojo._Url(cssUrl, './'+url).toString()) + post;
- });
- }
- return cssText.replace(cssPaths, function(ignore, delimStr, strUrl, delimUrl, urlUrl, media){
- if(strUrl){
- return '@import "' + (new dojo._Url(cssUrl, './'+strUrl).toString()) + '"' + media;
- }else{
- return 'url(' + (new dojo._Url(cssUrl, './'+urlUrl).toString()) + ')' + media;
- }
- });
- };
-
-
-
- var htmlAttrPaths = /(<[a-z][a-z0-9]*\s[^>]*)(?:(href|src)=(['"]?)([^>]*?)\3|style=(['"]?)([^>]*?)\5)([^>]*>)/gi;
- var adjustHtmlPaths = dojox.html._adjustHtmlPaths = function(htmlUrl, cont){
- var url = htmlUrl || "./";
- return cont.replace(htmlAttrPaths,
- function(tag, start, name, delim, relUrl, delim2, cssText, end){
- return start + (name ?
- (name + '=' + delim + (new dojo._Url(url, relUrl).toString()) + delim)
- : ('style=' + delim2 + adjustCssPaths(url, cssText) + delim2)
- ) + end;
- }
- );
- };
-
- var snarfStyles = dojox.html._snarfStyles = function (/*String*/cssUrl, /*String*/cont, /*Array*/styles){
-
-
-
- styles.attributes = [];
- return cont.replace(/(?:<style([^>]*)>([\s\S]*?)<\/style>|<link\s+(?=[^>]*rel=['"]?stylesheet)([^>]*?href=(['"])([^>]*?)\4[^>\/]*)\/?>)/gi,
- function(ignore, styleAttr, cssText, linkAttr, delim, href){
-
- var i, attr = (styleAttr||linkAttr||"").replace(/^\s*([\s\S]*?)\s*$/i, "$1");
- if(cssText){
- i = styles.push(cssUrl ? adjustCssPaths(cssUrl, cssText) : cssText);
- }else{
- i = styles.push('@import "' + href + '";');
- attr = attr.replace(/\s*(?:rel|href)=(['"])?[^\s]*\1\s*/gi, "");
- }
- if(attr){
- attr = attr.split(/\s+/);
- var atObj = {}, tmp;
- for(var j = 0, e = attr.length; j < e; j++){
- tmp = attr[j].split('=');
- atObj[tmp[0]] = tmp[1].replace(/^\s*['"]?([\s\S]*?)['"]?\s*$/, "$1");
- }
- styles.attributes[i - 1] = atObj;
- }
- return "";
- }
- );
- };
- var snarfScripts = dojox.html._snarfScripts = function(cont, byRef){
-
-
-
-
-
- byRef.code = "";
-
-
- cont = cont.replace(/<[!][-][-](.|\s)*?[-][-]>/g,
- function(comment){
- return comment.replace(/<(\/?)script\b/ig,"<$1Script");
- }
- );
- function download(src){
- if(byRef.downloadRemote){
-
-
-
- src = src.replace(/&([a-z0-9#]+);/g, function(m, name) {
- switch(name) {
- case "amp" : return "&";
- case "gt" : return ">";
- case "lt" : return "<";
- default:
- return name.charAt(0)=="#" ? String.fromCharCode(name.substring(1)) : "&"+name+";";
- }
- });
- dojo.xhrGet({
- url: src,
- sync: true,
- load: function(code){
- byRef.code += code+";";
- },
- error: byRef.errBack
- });
- }
- }
-
-
- return cont.replace(/<script\s*(?![^>]*type=['"]?(?:dojo\/|text\/html\b))(?:[^>]*?(?:src=(['"]?)([^>]*?)\1[^>]*)?)*>([\s\S]*?)<\/script>/gi,
- function(ignore, delim, src, code){
- if(src){
- download(src);
- }else{
- byRef.code += code;
- }
- return "";
- }
- );
- };
-
- var evalInGlobal = dojox.html.evalInGlobal = function(code, appendNode){
-
-
-
- appendNode = appendNode || dojo.doc.body;
- var n = appendNode.ownerDocument.createElement('script');
- n.type = "text/javascript";
- appendNode.appendChild(n);
- n.text = code;
- };
- dojo.declare("dojox.html._ContentSetter", [dojo.html._ContentSetter], {
-
-
-
- adjustPaths: false,
- referencePath: ".",
- renderStyles: false,
- executeScripts: false,
- scriptHasHooks: false,
- scriptHookReplacement: null,
-
- _renderStyles: function(styles){
-
- this._styleNodes = [];
- var st, att, cssText, doc = this.node.ownerDocument;
- var head = doc.getElementsByTagName('head')[0];
- for(var i = 0, e = styles.length; i < e; i++){
- cssText = styles[i]; att = styles.attributes[i];
- st = doc.createElement('style');
- st.setAttribute("type", "text/css");
- for(var x in att){
- st.setAttribute(x, att[x]);
- }
- this._styleNodes.push(st);
- head.appendChild(st);
- if(st.styleSheet){
- st.styleSheet.cssText = cssText;
- }else{
- st.appendChild(doc.createTextNode(cssText));
- }
- }
- },
- empty: function() {
- this.inherited("empty", arguments);
-
-
- this._styles = [];
- },
-
- onBegin: function() {
-
-
-
-
-
-
- this.inherited("onBegin", arguments);
-
- var cont = this.content,
- node = this.node;
-
- var styles = this._styles;
- if(dojo.isString(cont)){
- if(this.adjustPaths && this.referencePath){
- cont = adjustHtmlPaths(this.referencePath, cont);
- }
- if(this.renderStyles || this.cleanContent){
- cont = snarfStyles(this.referencePath, cont, styles);
- }
-
-
- if(this.executeScripts){
- var _t = this;
- var byRef = {
- downloadRemote: true,
- errBack:function(e){
- _t._onError.call(_t, 'Exec', 'Error downloading remote script in "'+_t.id+'"', e);
- }
- };
- cont = snarfScripts(cont, byRef);
- this._code = byRef.code;
- }
- }
- this.content = cont;
- },
-
- onEnd: function() {
-
-
-
-
-
- var code = this._code,
- styles = this._styles;
-
-
-
-
-
- if(this._styleNodes && this._styleNodes.length){
- while(this._styleNodes.length){
- dojo.destroy(this._styleNodes.pop());
- }
- }
-
- if(this.renderStyles && styles && styles.length){
- this._renderStyles(styles);
- }
- if(this.executeScripts && code){
- if(this.cleanContent){
-
-
- code = code.replace(/(<!--|(?:\/\/)?-->|<!\[CDATA\[|\]\]>)/g, '');
- }
- if(this.scriptHasHooks){
-
-
-
- code = code.replace(/_container_(?!\s*=[^=])/g, this.scriptHookReplacement);
- }
- try{
- evalInGlobal(code, this.node);
- }catch(e){
- this._onError('Exec', 'Error eval script in '+this.id+', '+e.message, e);
- }
- }
- this.inherited("onEnd", arguments);
- },
- tearDown: function() {
- this.inherited(arguments);
- delete this._styles;
-
-
- if(this._styleNodes && this._styleNodes.length){
- while(this._styleNodes.length){
- dojo.destroy(this._styleNodes.pop());
- }
- }
- delete this._styleNodes;
-
- dojo.mixin(this, dojo.getObject(this.declaredClass).prototype);
- }
-
- });
-
- dojox.html.set = function(/* DomNode */ node, /* String|DomNode|NodeList */ cont, /* Object? */ params){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if(!params){
-
- return dojo.html._setNodeContent(node, cont, true);
- }else{
-
- var op = new dojox.html._ContentSetter(dojo.mixin(
- params,
- { content: cont, node: node }
- ));
- return op.set();
- }
- };
-
- })();
- }
- if(!dojo._hasResource["dojox.layout.ContentPane"]){
- dojo._hasResource["dojox.layout.ContentPane"] = true;
- dojo.provide("dojox.layout.ContentPane");
- dojo.declare("dojox.layout.ContentPane", dijit.layout.ContentPane, {
-
-
-
-
-
-
-
-
-
-
-
-
- adjustPaths: false,
-
-
-
-
-
-
-
-
-
- cleanContent: false,
-
-
- renderStyles: false,
-
-
- executeScripts: true,
-
-
-
- scriptHasHooks: false,
-
- constructor: function(){
-
- this.ioArgs = {};
- this.ioMethod = dojo.xhrGet;
- },
- onExecError: function(e){
-
-
-
-
- },
- _setContent: function(cont){
-
-
- var setter = this._contentSetter;
- if(! (setter && setter instanceof dojox.html._ContentSetter)) {
- setter = this._contentSetter = new dojox.html._ContentSetter({
- node: this.containerNode,
- _onError: dojo.hitch(this, this._onError),
- onContentError: dojo.hitch(this, function(e){
-
-
- var errMess = this.onContentError(e);
- try{
- this.containerNode.innerHTML = errMess;
- }catch(e){
- console.error('Fatal '+this.id+' could not change content due to '+e.message, e);
- }
- })
- });
- };
-
- this._contentSetterParams = {
- adjustPaths: Boolean(this.adjustPaths && (this.href||this.referencePath)),
- referencePath: this.href || this.referencePath,
- renderStyles: this.renderStyles,
- executeScripts: this.executeScripts,
- scriptHasHooks: this.scriptHasHooks,
- scriptHookReplacement: "dijit.byId('"+this.id+"')"
- };
- this.inherited("_setContent", arguments);
- }
-
- });
- }
- if(!dojo._hasResource["dojox.layout.ResizeHandle"]){
- dojo._hasResource["dojox.layout.ResizeHandle"] = true;
- dojo.provide("dojox.layout.ResizeHandle");
- dojo.experimental("dojox.layout.ResizeHandle");
- dojo.declare("dojox.layout.ResizeHandle",
- [dijit._Widget, dijit._Templated],
- {
-
-
-
-
-
-
-
-
-
- targetId: "",
-
-
-
- targetContainer: null,
-
-
-
- resizeAxis: "xy",
-
-
-
-
- activeResize: false,
-
-
-
- activeResizeClass: "dojoxResizeHandleClone",
-
-
-
-
- animateSizing: true,
-
-
-
-
- animateMethod: "chain",
-
-
-
- animateDuration: 225,
-
-
- minHeight: 100,
-
-
- minWidth: 100,
-
-
-
- constrainMax: false,
-
-
- maxHeight:0,
-
-
-
- maxWidth:0,
-
-
-
- fixedAspect: false,
-
-
-
-
-
- intermediateChanges: false,
-
-
- startTopic: "/dojo/resize/start",
-
-
-
- endTopic:"/dojo/resize/stop",
- templateString: '<div dojoAttachPoint="resizeHandle" class="dojoxResizeHandle"><div></div></div>',
- postCreate: function(){
-
- this.connect(this.resizeHandle, "onmousedown", "_beginSizing");
- if(!this.activeResize){
-
-
-
-
- this._resizeHelper = dijit.byId('dojoxGlobalResizeHelper');
- if(!this._resizeHelper){
- this._resizeHelper = new dojox.layout._ResizeHelper({
- id: 'dojoxGlobalResizeHelper'
- }).placeAt(dojo.body());
- dojo.addClass(this._resizeHelper.domNode, this.activeResizeClass);
- }
- }else{ this.animateSizing = false; }
- if(!this.minSize){
- this.minSize = { w: this.minWidth, h: this.minHeight };
- }
-
- if(this.constrainMax){
- this.maxSize = { w: this.maxWidth, h: this.maxHeight }
- }
-
-
- this._resizeX = this._resizeY = false;
- var addClass = dojo.partial(dojo.addClass, this.resizeHandle);
- switch(this.resizeAxis.toLowerCase()){
- case "xy" :
- this._resizeX = this._resizeY = true;
-
-
- addClass("dojoxResizeNW");
- break;
- case "x" :
- this._resizeX = true;
- addClass("dojoxResizeW");
- break;
- case "y" :
- this._resizeY = true;
- addClass("dojoxResizeN");
- break;
- }
- },
- _beginSizing: function(/*Event*/ e){
-
-
- if(this._isSizing){ return false; }
- dojo.publish(this.startTopic, [ this ]);
- this.targetWidget = dijit.byId(this.targetId);
- this.targetDomNode = this.targetWidget ? this.targetWidget.domNode : dojo.byId(this.targetId);
- if(this.targetContainer){ this.targetDomNode = this.targetContainer; }
- if(!this.targetDomNode){ return false; }
- if(!this.activeResize){
- var c = dojo.position(this.targetDomNode, true);
- console.log(c);
- console.log(dojo.window.getBox());
- this._resizeHelper.resize({l: c.x, t: c.y, w: c.w, h: c.h});
- this._resizeHelper.show();
- if(!this.isLeftToRight()){
- this._resizeHelper.startPosition = {l: c.x, t: c.y};
- }
- }
- this._isSizing = true;
- this.startPoint = { x:e.clientX, y:e.clientY};
-
- var mb = this.targetWidget ? dojo.marginBox(this.targetDomNode) : dojo.contentBox(this.targetDomNode);
- this.startSize = { w:mb.w, h:mb.h };
- if(!this.isLeftToRight() && dojo.style(this.targetDomNode, "position") == "absolute"){
- this.startPosition = {l: mb.l, t: mb.t};
- }
-
- if(this.fixedAspect){
- var max, val;
- if(mb.w > mb.h){
- max = "w";
- val = mb.w / mb.h
- }else{
- max = "h";
- val = mb.h / mb.w
- }
- this._aspect = { prop: max };
- this._aspect[max] = val;
- }
- this._pconnects = [];
- this._pconnects.push(dojo.connect(dojo.doc,"onmousemove",this,"_updateSizing"));
- this._pconnects.push(dojo.connect(dojo.doc,"onmouseup", this, "_endSizing"));
-
- dojo.stopEvent(e);
- },
- _updateSizing: function(/*Event*/ e){
-
-
- if(this.activeResize){
- this._changeSizing(e);
- }else{
- var tmp = this._getNewCoords(e, this._resizeHelper.startPosition);
- if(tmp === false){ return; }
- this._resizeHelper.resize(tmp);
- }
- e.preventDefault();
- },
- _getNewCoords: function(/* Event */ e, /* Object */startPosition){
-
-
-
- try{
- if(!e.clientX || !e.clientY){ return false; }
- }catch(e){
-
- return false;
- }
- this._activeResizeLastEvent = e;
- var dx = (this.isLeftToRight()? this.startPoint.x - e.clientX: e.clientX - this.startPoint.x),
- dy = this.startPoint.y - e.clientY,
- newW = this.startSize.w - (this._resizeX ? dx : 0),
- newH = this.startSize.h - (this._resizeY ? dy : 0)
- ;
-
- var newSize = this._checkConstraints(newW, newH);
- startPosition = (startPosition || this.startPosition);
- if(newSize && startPosition && this._resizeX){
-
- newSize.l = startPosition.l + dx;
- if(newSize.w != newW){
- newSize.l += (newW - newSize.w);
- }
- newSize.t = startPosition.t;
- }
- return newSize;
- },
-
- _checkConstraints: function(newW, newH){
-
-
-
- if(this.minSize){
- var tm = this.minSize;
- if(newW < tm.w){
- newW = tm.w;
- }
- if(newH < tm.h){
- newH = tm.h;
- }
- }
-
-
- if(this.constrainMax && this.maxSize){
- var ms = this.maxSize;
- if(newW > ms.w){
- newW = ms.w;
- }
- if(newH > ms.h){
- newH = ms.h;
- }
- }
-
- if(this.fixedAspect){
- var ta = this._aspect[this._aspect.prop];
- if(newW < newH){
- newH = newW * ta;
- }else if(newH < newW){
- newW = newH * ta;
- }
- }
-
- return { w: newW, h: newH };
- },
-
- _changeSizing: function(/*Event*/ e){
-
- var tmp = this._getNewCoords(e);
- if(tmp === false){ return; }
- if(this.targetWidget && dojo.isFunction(this.targetWidget.resize)){
- this.targetWidget.resize(tmp);
- }else{
- if(this.animateSizing){
- var anim = dojo.fx[this.animateMethod]([
- dojo.animateProperty({
- node: this.targetDomNode,
- properties: {
- width: { start: this.startSize.w, end: tmp.w }
- },
- duration: this.animateDuration
- }),
- dojo.animateProperty({
- node: this.targetDomNode,
- properties: {
- height: { start: this.startSize.h, end: tmp.h }
- },
- duration: this.animateDuration
- })
- ]);
- anim.play();
- }else{
- dojo.style(this.targetDomNode,{
- width: tmp.w + "px",
- height: tmp.h + "px"
- });
- }
- }
- if(this.intermediateChanges){
- this.onResize(e);
- }
- },
- _endSizing: function(/*Event*/ e){
-
- dojo.forEach(this._pconnects, dojo.disconnect);
- var pub = dojo.partial(dojo.publish, this.endTopic, [ this ]);
- if(!this.activeResize){
- this._resizeHelper.hide();
- this._changeSizing(e);
- setTimeout(pub, this.animateDuration + 15);
- }else{
- pub();
- }
- this._isSizing = false;
- this.onResize(e);
- },
-
- onResize: function(e){
-
-
-
- }
-
- });
- dojo.declare("dojox.layout._ResizeHelper",
- dijit._Widget,
- {
-
-
-
- show: function(){
-
- dojo.fadeIn({
- node: this.domNode,
- duration: 120,
- beforeBegin: function(n){ dojo.style(n, "display", "") }
- }).play();
- },
-
- hide: function(){
-
- dojo.fadeOut({
- node: this.domNode,
- duration: 250,
- onEnd: function(n){ dojo.style(n, "display", "none") }
- }).play();
- },
-
- resize: function(/* Object */dim){
-
-
- dojo.marginBox(this.domNode, dim);
- }
-
- });
- }
- if(!dojo._hasResource["dojox.layout.FloatingPane"]){
- dojo._hasResource["dojox.layout.FloatingPane"] = true;
- dojo.provide("dojox.layout.FloatingPane");
- dojo.experimental("dojox.layout.FloatingPane");
- dojo.declare("dojox.layout.FloatingPane",
- [ dojox.layout.ContentPane, dijit._Templated ],
- {
-
-
-
-
-
-
-
-
-
-
- closable: true,
-
-
- dockable: true,
-
-
- resizable: false,
-
-
- maxable: false,
-
-
- resizeAxis: "xy",
-
-
- title: "",
-
-
-
- dockTo: "",
-
-
- duration: 400,
-
-
-
- contentClass: "dojoxFloatingPaneContent",
-
- _showAnim: null,
- _hideAnim: null,
-
- _dockNode: null,
-
- _restoreState: {},
- _allFPs: [],
- _startZ: 100,
- templateString: dojo.cache("dojox.layout", "resources/FloatingPane.html", "<div class=\"dojoxFloatingPane\" id=\"${id}\">\n\t<div tabindex=\"0\" role=\"button\" class=\"dojoxFloatingPaneTitle\" dojoAttachPoint=\"focusNode\">\n\t\t<span dojoAttachPoint=\"closeNode\" dojoAttachEvent=\"onclick: close\" class=\"dojoxFloatingCloseIcon\"></span>\n\t\t<span dojoAttachPoint=\"maxNode\" dojoAttachEvent=\"onclick: maximize\" class=\"dojoxFloatingMaximizeIcon\"> </span>\n\t\t<span dojoAttachPoint=\"restoreNode\" dojoAttachEvent=\"onclick: _restore\" class=\"dojoxFloatingRestoreIcon\"> </span>\t\n\t\t<span dojoAttachPoint=\"dockNode\" dojoAttachEvent=\"onclick: minimize\" class=\"dojoxFloatingMinimizeIcon\"> </span>\n\t\t<span dojoAttachPoint=\"titleNode\" class=\"dijitInline dijitTitleNode\"></span>\n\t</div>\n\t<div dojoAttachPoint=\"canvas\" class=\"dojoxFloatingPaneCanvas\">\n\t\t<div dojoAttachPoint=\"containerNode\" role=\"region\" tabindex=\"-1\" class=\"${contentClass}\">\n\t\t</div>\n\t\t<span dojoAttachPoint=\"resizeHandle\" class=\"dojoxFloatingResizeHandle\"></span>\n\t</div>\n</div>\n"),
-
- attributeMap: dojo.delegate(dijit._Widget.prototype.attributeMap, {
- title: { type:"innerHTML", node:"titleNode" }
- }),
-
- postCreate: function(){
- this.inherited(arguments);
- new dojo.dnd.Moveable(this.domNode,{ handle: this.focusNode });
-
- if(!this.dockable){ this.dockNode.style.display = "none"; }
- if(!this.closable){ this.closeNode.style.display = "none"; }
- if(!this.maxable){
- this.maxNode.style.display = "none";
- this.restoreNode.style.display = "none";
- }
- if(!this.resizable){
- this.resizeHandle.style.display = "none";
- }else{
- this.domNode.style.width = dojo.marginBox(this.domNode).w + "px";
- }
- this._allFPs.push(this);
- this.domNode.style.position = "absolute";
-
- this.bgIframe = new dijit.BackgroundIframe(this.domNode);
- this._naturalState = dojo.coords(this.domNode);
- },
-
- startup: function(){
- if(this._started){ return; }
-
- this.inherited(arguments);
- if(this.resizable){
- if(dojo.isIE){
- this.canvas.style.overflow = "auto";
- }else{
- this.containerNode.style.overflow = "auto";
- }
-
- this._resizeHandle = new dojox.layout.ResizeHandle({
- targetId: this.id,
- resizeAxis: this.resizeAxis
- },this.resizeHandle);
- }
- if(this.dockable){
-
- var tmpName = this.dockTo;
- if(this.dockTo){
- this.dockTo = dijit.byId(this.dockTo);
- }else{
- this.dockTo = dijit.byId('dojoxGlobalFloatingDock');
- }
- if(!this.dockTo){
- var tmpId, tmpNode;
-
-
-
-
- if(tmpName){
- tmpId = tmpName;
- tmpNode = dojo.byId(tmpName);
- }else{
- tmpNode = dojo.create('div', null, dojo.body());
- dojo.addClass(tmpNode,"dojoxFloatingDockDefault");
- tmpId = 'dojoxGlobalFloatingDock';
- }
- this.dockTo = new dojox.layout.Dock({ id: tmpId, autoPosition: "south" }, tmpNode);
- this.dockTo.startup();
- }
-
- if((this.domNode.style.display == "none")||(this.domNode.style.visibility == "hidden")){
-
- this.minimize();
- }
- }
- this.connect(this.focusNode,"onmousedown","bringToTop");
- this.connect(this.domNode, "onmousedown","bringToTop");
-
- this.resize(dojo.coords(this.domNode));
-
- this._started = true;
- },
- setTitle: function(/* String */ title){
-
- dojo.deprecated("pane.setTitle", "Use pane.set('title', someTitle)", "2.0");
- this.set("title", title);
-
- },
-
- close: function(){
-
- if(!this.closable){ return; }
- dojo.unsubscribe(this._listener);
- this.hide(dojo.hitch(this,function(){
- this.destroyRecursive();
- }));
- },
- hide: function(/* Function? */ callback){
-
- dojo.fadeOut({
- node:this.domNode,
- duration:this.duration,
- onEnd: dojo.hitch(this,function() {
- this.domNode.style.display = "none";
- this.domNode.style.visibility = "hidden";
- if(this.dockTo && this.dockable){
- this.dockTo._positionDock(null);
- }
- if(callback){
- callback();
- }
- })
- }).play();
- },
- show: function(/* Function? */callback){
-
- var anim = dojo.fadeIn({node:this.domNode, duration:this.duration,
- beforeBegin: dojo.hitch(this,function(){
- this.domNode.style.display = "";
- this.domNode.style.visibility = "visible";
- if (this.dockTo && this.dockable) { this.dockTo._positionDock(null); }
- if (typeof callback == "function") { callback(); }
- this._isDocked = false;
- if (this._dockNode) {
- this._dockNode.destroy();
- this._dockNode = null;
- }
- })
- }).play();
- this.resize(dojo.coords(this.domNode));
- this._onShow();
- },
- minimize: function(){
-
- if(!this._isDocked){ this.hide(dojo.hitch(this,"_dock")); }
- },
- maximize: function(){
-
- if(this._maximized){ return; }
- this._naturalState = dojo.position(this.domNode);
- if(this._isDocked){
- this.show();
- setTimeout(dojo.hitch(this,"maximize"),this.duration);
- }
- dojo.addClass(this.focusNode,"floatingPaneMaximized");
- this.resize(dojo.window.getBox());
- this._maximized = true;
- },
- _restore: function(){
- if(this._maximized){
- this.resize(this._naturalState);
- dojo.removeClass(this.focusNode,"floatingPaneMaximized");
- this._maximized = false;
- }
- },
- _dock: function(){
- if(!this._isDocked && this.dockable){
- this._dockNode = this.dockTo.addNode(this);
- this._isDocked = true;
- }
- },
-
- resize: function(/* Object */dim){
-
- dim = dim || this._naturalState;
- this._naturalState = dim;
-
- var dns = this.domNode.style;
- if("t" in dim){ dns.top = dim.t + "px"; }
- if("l" in dim){ dns.left = dim.l + "px"; }
- dns.width = dim.w + "px";
- dns.height = dim.h + "px";
-
- var mbCanvas = { l: 0, t: 0, w: dim.w, h: (dim.h - this.focusNode.offsetHeight) };
- dojo.marginBox(this.canvas, mbCanvas);
-
-
- this._checkIfSingleChild();
- if(this._singleChild && this._singleChild.resize){
- this._singleChild.resize(mbCanvas);
- }
- },
-
- bringToTop: function(){
-
- var windows = dojo.filter(
- this._allFPs,
- function(i){
- return i !== this;
- },
- this);
- windows.sort(function(a, b){
- return a.domNode.style.zIndex - b.domNode.style.zIndex;
- });
- windows.push(this);
-
- dojo.forEach(windows, function(w, x){
- w.domNode.style.zIndex = this._startZ + (x * 2);
- dojo.removeClass(w.domNode, "dojoxFloatingPaneFg");
- }, this);
- dojo.addClass(this.domNode, "dojoxFloatingPaneFg");
- },
-
- destroy: function(){
-
- this._allFPs.splice(dojo.indexOf(this._allFPs, this), 1);
- if(this._resizeHandle){
- this._resizeHandle.destroy();
- }
- this.inherited(arguments);
- }
- });
- dojo.declare("dojox.layout.Dock",
- [dijit._Widget,dijit._Templated],
- {
-
-
-
- templateString: '<div class="dojoxDock"><ul dojoAttachPoint="containerNode" class="dojoxDockList"></ul></div>',
-
- _docked: [],
-
- _inPositioning: false,
-
- autoPosition: false,
-
- addNode: function(refNode){
-
-
- var div = dojo.create('li', null, this.containerNode),
- node = new dojox.layout._DockNode({
- title: refNode.title,
- paneRef: refNode
- }, div)
- ;
- node.startup();
- return node;
- },
- startup: function(){
-
- if (this.id == "dojoxGlobalFloatingDock" || this.isFixedDock) {
-
- this.connect(window, 'onresize', "_positionDock");
- this.connect(window, 'onscroll', "_positionDock");
- if(dojo.isIE){
- this.connect(this.domNode, "onresize", "_positionDock");
- }
- }
- this._positionDock(null);
- this.inherited(arguments);
- },
-
- _positionDock: function(/* Event? */e){
- if(!this._inPositioning){
- if(this.autoPosition == "south"){
-
- setTimeout(dojo.hitch(this, function() {
- this._inPositiononing = true;
- var viewport = dojo.window.getBox();
- var s = this.domNode.style;
- s.left = viewport.l + "px";
- s.width = (viewport.w-2) + "px";
- s.top = (viewport.h + viewport.t) - this.domNode.offsetHeight + "px";
- this._inPositioning = false;
- }), 125);
- }
- }
- }
- });
- dojo.declare("dojox.layout._DockNode",
- [dijit._Widget,dijit._Templated],
- {
-
-
-
-
-
-
- title: "",
-
-
- paneRef: null,
- templateString:
- '<li dojoAttachEvent="onclick: restore" class="dojoxDockNode">'+
- '<span dojoAttachPoint="restoreNode" class="dojoxDockRestoreButton" dojoAttachEvent="onclick: restore"></span>'+
- '<span class="dojoxDockTitleNode" dojoAttachPoint="titleNode">${title}</span>'+
- '</li>',
- restore: function(){
-
- this.paneRef.show();
- this.paneRef.bringToTop();
- this.destroy();
- }
- });
- }
- if(!dojo._hasResource["dojox.layout.ExpandoPane"]){
- dojo._hasResource["dojox.layout.ExpandoPane"] = true;
- dojo.provide("dojox.layout.ExpandoPane");
- dojo.experimental("dojox.layout.ExpandoPane");
- dojo.declare("dojox.layout.ExpandoPane",
- [dijit.layout.ContentPane, dijit._Templated, dijit._Contained, dijit._Container],
- {
-
-
-
-
-
-
-
-
-
- attributeMap: dojo.delegate(dijit.layout.ContentPane.prototype.attributeMap, {
- title: { node: "titleNode", type: "innerHTML" }
- }),
-
- templateString: dojo.cache("dojox.layout", "resources/ExpandoPane.html", "<div class=\"dojoxExpandoPane\">\n\t<div dojoAttachPoint=\"titleWrapper\" class=\"dojoxExpandoTitle\">\n\t\t<div class=\"dojoxExpandoIcon\" dojoAttachPoint=\"iconNode\" dojoAttachEvent=\"onclick:toggle\"><span class=\"a11yNode\">X</span></div>\t\t\t\n\t\t<span class=\"dojoxExpandoTitleNode\" dojoAttachPoint=\"titleNode\">${title}</span>\n\t</div>\n\t<div class=\"dojoxExpandoWrapper\" dojoAttachPoint=\"cwrapper\" dojoAttachEvent=\"ondblclick:_trap\">\n\t\t<div class=\"dojoxExpandoContent\" dojoAttachPoint=\"containerNode\"></div>\n\t</div>\n</div>\n"),
-
-
- easeOut: "dojo._DefaultEasing",
-
-
-
- easeIn: "dojo._DefaultEasing",
-
-
-
- duration: 420,
-
-
- startExpanded: true,
-
-
-
- previewOpacity: 0.75,
-
-
-
-
- previewOnDblClick: false,
- baseClass: "dijitExpandoPane",
- postCreate: function(){
- this.inherited(arguments);
- this._animConnects = [];
- this._isHorizontal = true;
-
- if(dojo.isString(this.easeOut)){
- this.easeOut = dojo.getObject(this.easeOut);
- }
- if(dojo.isString(this.easeIn)){
- this.easeIn = dojo.getObject(this.easeIn);
- }
-
- var thisClass = "", rtl = !this.isLeftToRight();
- if(this.region){
- switch(this.region){
- case "trailing" :
- case "right" :
- thisClass = rtl ? "Left" : "Right";
- break;
- case "leading" :
- case "left" :
- thisClass = rtl ? "Right" : "Left";
- break;
- case "top" :
- thisClass = "Top";
- break;
- case "bottom" :
- thisClass = "Bottom";
- break;
- }
- dojo.addClass(this.domNode, "dojoxExpando" + thisClass);
- dojo.addClass(this.iconNode, "dojoxExpandoIcon" + thisClass);
- this._isHorizontal = /top|bottom/.test(this.region);
- }
- dojo.style(this.domNode, {
- overflow: "hidden",
- padding:0
- });
-
- this.connect(this.domNode, "ondblclick", this.previewOnDblClick ? "preview" : "toggle");
-
- if(this.previewOnDblClick){
- this.connect(this.getParent(), "_layoutChildren", dojo.hitch(this, function(){
- this._isonlypreview = false;
- }));
- }
-
- },
-
- _startupSizes: function(){
-
- this._container = this.getParent();
- this._closedSize = this._titleHeight = dojo.marginBox(this.titleWrapper).h;
-
- if(this.splitter){
-
- var myid = this.id;
- dijit.registry.filter(function(w){
- return w && w.child && w.child.id == myid;
- }).forEach(dojo.hitch(this,function(w){
- this.connect(w,"_stopDrag","_afterResize");
- }));
- }
-
- this._currentSize = dojo.contentBox(this.domNode);
- this._showSize = this._currentSize[(this._isHorizontal ? "h" : "w")];
- this._setupAnims();
- if(this.startExpanded){
- this._showing = true;
- }else{
- this._showing = false;
- this._hideWrapper();
- this._hideAnim.gotoPercent(99,true);
- }
-
- this._hasSizes = true;
- },
-
- _afterResize: function(e){
- var tmp = this._currentSize;
- this._currentSize = dojo.marginBox(this.domNode);
- var n = this._currentSize[(this._isHorizontal ? "h" : "w")]
- if(n > this._titleHeight){
- if(!this._showing){
- this._showing = !this._showing;
- this._showEnd();
- }
- this._showSize = n;
- this._setupAnims();
- }else{
- this._showSize = tmp[(this._isHorizontal ? "h" : "w")];
- this._showing = false;
- this._hideWrapper();
- this._hideAnim.gotoPercent(89,true);
- }
-
- },
-
- _setupAnims: function(){
-
- dojo.forEach(this._animConnects, dojo.disconnect);
-
- var _common = {
- node:this.domNode,
- duration:this.duration
- },
- isHorizontal = this._isHorizontal,
- showProps = {},
- hideProps = {},
- dimension = isHorizontal ? "height" : "width"
- ;
- showProps[dimension] = {
- end: this._showSize
- };
- hideProps[dimension] = {
- end: this._closedSize
- };
-
- this._showAnim = dojo.animateProperty(dojo.mixin(_common,{
- easing:this.easeIn,
- properties: showProps
- }));
- this._hideAnim = dojo.animateProperty(dojo.mixin(_common,{
- easing:this.easeOut,
- properties: hideProps
- }));
- this._animConnects = [
- dojo.connect(this._showAnim, "onEnd", this, "_showEnd"),
- dojo.connect(this._hideAnim, "onEnd", this, "_hideEnd")
- ];
- },
-
- preview: function(){
-
- if(!this._showing){
- this._isonlypreview = !this._isonlypreview;
- }
- this.toggle();
- },
- toggle: function(){
-
- if(this._showing){
- this._hideWrapper();
- this._showAnim && this._showAnim.stop();
- this._hideAnim.play();
- }else{
- this._hideAnim && this._hideAnim.stop();
- this._showAnim.play();
- }
- this._showing = !this._showing;
- },
-
- _hideWrapper: function(){
-
- dojo.addClass(this.domNode, "dojoxExpandoClosed");
-
- dojo.style(this.cwrapper,{
- visibility: "hidden",
- opacity: "0",
- overflow: "hidden"
- });
- },
-
- _showEnd: function(){
-
- dojo.style(this.cwrapper, {
- opacity: 0,
- visibility:"visible"
- });
- dojo.anim(this.cwrapper, {
- opacity: this._isonlypreview ? this.previewOpacity : 1
- }, 227);
- dojo.removeClass(this.domNode, "dojoxExpandoClosed");
- if(!this._isonlypreview){
- setTimeout(dojo.hitch(this._container, "layout"), 15);
- }else{
- this._previewShowing = true;
- this.resize();
- }
- },
-
- _hideEnd: function(){
-
-
- if(!this._isonlypreview){
- setTimeout(dojo.hitch(this._container, "layout"), 25);
- }else{
- this._previewShowing = false;
- }
- this._isonlypreview = false;
-
- },
-
- resize: function(/* Object? */newSize){
-
-
-
-
- if(!this._hasSizes){ this._startupSizes(newSize); }
-
-
- var currentSize = dojo.marginBox(this.domNode);
- this._contentBox = {
- w: newSize && "w" in newSize ? newSize.w : currentSize.w,
- h: (newSize && "h" in newSize ? newSize.h : currentSize.h) - this._titleHeight
- };
- dojo.style(this.containerNode, "height", this._contentBox.h + "px");
- if(newSize){
- dojo.marginBox(this.domNode, newSize);
- }
- this._layoutChildren();
- },
-
- _trap: function(e){
-
- dojo.stopEvent(e);
- }
- });
- }
- if(!dojo._hasResource["dojox.color._base"]){
- dojo._hasResource["dojox.color._base"] = true;
- dojo.provide("dojox.color._base");
- dojox.color.Color=dojo.Color;
- dojox.color.blend=dojo.blendColors;
- dojox.color.fromRgb=dojo.colorFromRgb;
- dojox.color.fromHex=dojo.colorFromHex;
- dojox.color.fromArray=dojo.colorFromArray;
- dojox.color.fromString=dojo.colorFromString;
- dojox.color.greyscale=dojo.colors.makeGrey;
- dojo.mixin(dojox.color, {
- fromCmy: function(/* Object|Array|int */cyan, /*int*/magenta, /*int*/yellow){
-
-
-
- if(dojo.isArray(cyan)){
- magenta=cyan[1], yellow=cyan[2], cyan=cyan[0];
- } else if(dojo.isObject(cyan)){
- magenta=cyan.m, yellow=cyan.y, cyan=cyan.c;
- }
- cyan/=100, magenta/=100, yellow/=100;
- var r=1-cyan, g=1-magenta, b=1-yellow;
- return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) });
- },
- fromCmyk: function(/* Object|Array|int */cyan, /*int*/magenta, /*int*/yellow, /*int*/black){
-
-
-
- if(dojo.isArray(cyan)){
- magenta=cyan[1], yellow=cyan[2], black=cyan[3], cyan=cyan[0];
- } else if(dojo.isObject(cyan)){
- magenta=cyan.m, yellow=cyan.y, black=cyan.b, cyan=cyan.c;
- }
- cyan/=100, magenta/=100, yellow/=100, black/=100;
- var r,g,b;
- r = 1-Math.min(1, cyan*(1-black)+black);
- g = 1-Math.min(1, magenta*(1-black)+black);
- b = 1-Math.min(1, yellow*(1-black)+black);
- return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) });
- },
-
- fromHsl: function(/* Object|Array|int */hue, /* int */saturation, /* int */luminosity){
-
-
-
- if(dojo.isArray(hue)){
- saturation=hue[1], luminosity=hue[2], hue=hue[0];
- } else if(dojo.isObject(hue)){
- saturation=hue.s, luminosity=hue.l, hue=hue.h;
- }
- saturation/=100;
- luminosity/=100;
- while(hue<0){ hue+=360; }
- while(hue>=360){ hue-=360; }
-
- var r, g, b;
- if(hue<120){
- r=(120-hue)/60, g=hue/60, b=0;
- } else if (hue<240){
- r=0, g=(240-hue)/60, b=(hue-120)/60;
- } else {
- r=(hue-240)/60, g=0, b=(360-hue)/60;
- }
-
- r=2*saturation*Math.min(r, 1)+(1-saturation);
- g=2*saturation*Math.min(g, 1)+(1-saturation);
- b=2*saturation*Math.min(b, 1)+(1-saturation);
- if(luminosity<0.5){
- r*=luminosity, g*=luminosity, b*=luminosity;
- }else{
- r=(1-luminosity)*r+2*luminosity-1;
- g=(1-luminosity)*g+2*luminosity-1;
- b=(1-luminosity)*b+2*luminosity-1;
- }
- return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) });
- },
-
- fromHsv: function(/* Object|Array|int */hue, /* int */saturation, /* int */value){
-
-
-
- if(dojo.isArray(hue)){
- saturation=hue[1], value=hue[2], hue=hue[0];
- } else if (dojo.isObject(hue)){
- saturation=hue.s, value=hue.v, hue=hue.h;
- }
-
- if(hue==360){ hue=0; }
- saturation/=100;
- value/=100;
-
- var r, g, b;
- if(saturation==0){
- r=value, b=value, g=value;
- }else{
- var hTemp=hue/60, i=Math.floor(hTemp), f=hTemp-i;
- var p=value*(1-saturation);
- var q=value*(1-(saturation*f));
- var t=value*(1-(saturation*(1-f)));
- switch(i){
- case 0:{ r=value, g=t, b=p; break; }
- case 1:{ r=q, g=value, b=p; break; }
- case 2:{ r=p, g=value, b=t; break; }
- case 3:{ r=p, g=q, b=value; break; }
- case 4:{ r=t, g=p, b=value; break; }
- case 5:{ r=value, g=p, b=q; break; }
- }
- }
- return new dojox.color.Color({ r:Math.round(r*255), g:Math.round(g*255), b:Math.round(b*255) });
- }
- });
- dojo.extend(dojox.color.Color, {
- toCmy: function(){
-
-
- var cyan=1-(this.r/255), magenta=1-(this.g/255), yellow=1-(this.b/255);
- return { c:Math.round(cyan*100), m:Math.round(magenta*100), y:Math.round(yellow*100) };
- },
-
- toCmyk: function(){
-
-
- var cyan, magenta, yellow, black;
- var r=this.r/255, g=this.g/255, b=this.b/255;
- black = Math.min(1-r, 1-g, 1-b);
- cyan = (1-r-black)/(1-black);
- magenta = (1-g-black)/(1-black);
- yellow = (1-b-black)/(1-black);
- return { c:Math.round(cyan*100), m:Math.round(magenta*100), y:Math.round(yellow*100), b:Math.round(black*100) };
- },
-
- toHsl: function(){
-
-
- var r=this.r/255, g=this.g/255, b=this.b/255;
- var min = Math.min(r, b, g), max = Math.max(r, g, b);
- var delta = max-min;
- var h=0, s=0, l=(min+max)/2;
- if(l>0 && l<1){
- s = delta/((l<0.5)?(2*l):(2-2*l));
- }
- if(delta>0){
- if(max==r && max!=g){
- h+=(g-b)/delta;
- }
- if(max==g && max!=b){
- h+=(2+(b-r)/delta);
- }
- if(max==b && max!=r){
- h+=(4+(r-g)/delta);
- }
- h*=60;
- }
- return { h:h, s:Math.round(s*100), l:Math.round(l*100) };
- },
- toHsv: function(){
-
-
- var r=this.r/255, g=this.g/255, b=this.b/255;
- var min = Math.min(r, b, g), max = Math.max(r, g, b);
- var delta = max-min;
- var h = null, s = (max==0)?0:(delta/max);
- if(s==0){
- h = 0;
- }else{
- if(r==max){
- h = 60*(g-b)/delta;
- }else if(g==max){
- h = 120 + 60*(b-r)/delta;
- }else{
- h = 240 + 60*(r-g)/delta;
- }
- if(h<0){ h+=360; }
- }
- return { h:h, s:Math.round(s*100), v:Math.round(max*100) };
- }
- });
- }
- if(!dojo._hasResource["dojox.color"]){
- dojo._hasResource["dojox.color"] = true;
- dojo.provide("dojox.color");
- }
- if(!dojo._hasResource["dojox.widget.ColorPicker"]){
- dojo._hasResource["dojox.widget.ColorPicker"] = true;
- dojo.provide("dojox.widget.ColorPicker");
- dojo.experimental("dojox.widget.ColorPicker");
- (function(d){
-
- var webSafeFromHex = function(hex){
-
- return hex;
- };
-
- dojo.declare("dojox.widget.ColorPicker",
- dijit.form._FormWidget,
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- showRgb: true,
-
-
-
- showHsv: true,
-
-
-
- showHex: true,
-
-
- webSafe: true,
-
-
- animatePoint: true,
-
-
- slideDuration: 250,
-
-
- liveUpdate: false,
-
-
- PICKER_HUE_H: 150,
-
-
-
- PICKER_SAT_VAL_H: 150,
-
-
-
- PICKER_SAT_VAL_W: 150,
-
-
-
- PICKER_HUE_SELECTOR_H: 8,
-
-
-
-
- PICKER_SAT_SELECTOR_H: 10,
-
-
-
- PICKER_SAT_SELECTOR_W: 10,
-
-
-
-
- value: "#ffffff",
-
- _underlay: d.moduleUrl("dojox.widget","ColorPicker/images/underlay.png"),
- _hueUnderlay: d.moduleUrl("dojox.widget","ColorPicker/images/hue.png"),
- _pickerPointer: d.moduleUrl("dojox.widget","ColorPicker/images/pickerPointer.png"),
- _huePickerPointer: d.moduleUrl("dojox.widget","ColorPicker/images/hueHandle.png"),
- _huePickerPointerAlly: d.moduleUrl("dojox.widget","ColorPicker/images/hueHandleA11y.png"),
-
- templateString: dojo.cache("dojox.widget", "ColorPicker/ColorPicker.html", "<table class=\"dojoxColorPicker\" dojoAttachEvent=\"onkeypress: _handleKey\" cellpadding=\"0\" cellspacing=\"0\">\n\t<tr>\n\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\n\t\t\t<div class=\"dojoxColorPickerBox\">\n\t\t\t\t<!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. -->\n\t\t\t\t<img role=\"status\" title=\"${saturationPickerTitle}\" alt=\"${saturationPickerTitle}\" class=\"dojoxColorPickerPoint\" src=\"${_pickerPointer}\" tabIndex=\"0\" dojoAttachPoint=\"cursorNode\" style=\"position: absolute; top: 0px; left: 0px;\">\n\t\t\t\t<img role=\"presentation\" alt=\"\" dojoAttachPoint=\"colorUnderlay\" dojoAttachEvent=\"onclick: _setPoint, onmousedown: _stopDrag\" class=\"dojoxColorPickerUnderlay\" src=\"${_underlay}\" ondragstart=\"return false\">\n\t\t\t</div>\n\t\t</td>\n\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\n\t\t\t<div class=\"dojoxHuePicker\">\n\t\t\t\t<!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. -->\n\t\t\t\t<img role=\"status\" dojoAttachPoint=\"hueCursorNode\" tabIndex=\"0\" class=\"dojoxHuePickerPoint\" title=\"${huePickerTitle}\" alt=\"${huePickerTitle}\" src=\"${_huePickerPointer}\" style=\"position: absolute; top: 0px; left: 0px;\">\n\t\t\t\t<div class=\"dojoxHuePickerUnderlay\" dojoAttachPoint=\"hueNode\">\n\t\t\t\t <img role=\"presentation\" alt=\"\" dojoAttachEvent=\"onclick: _setHuePoint, onmousedown: _stopDrag\" src=\"${_hueUnderlay}\">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</td>\n\t\t<td valign=\"top\">\n\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"top\" class=\"dojoxColorPickerPreviewContainer\">\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\n\t\t\t\t\t\t\t\t\t<div dojoAttachPoint=\"previewNode\" class=\"dojoxColorPickerPreview\"></div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td valign=\"top\">\n\t\t\t\t\t\t\t\t\t<div dojoAttachPoint=\"safePreviewNode\" class=\"dojoxColorPickerWebSafePreview\"></div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign=\"bottom\">\n\t\t\t\t\t\t<table class=\"dojoxColorPickerOptional\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<div class=\"dijitInline dojoxColorPickerRgb\" dojoAttachPoint=\"rgbNode\">\n\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"1\" cellspacing=\"1\">\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_r\">${redLabel}</label></td><td><input id=\"${_uId}_r\" dojoAttachPoint=\"Rval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_g\">${greenLabel}</label></td><td><input id=\"${_uId}_g\" dojoAttachPoint=\"Gval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_b\">${blueLabel}</label></td><td><input id=\"${_uId}_b\" dojoAttachPoint=\"Bval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<div class=\"dijitInline dojoxColorPickerHsv\" dojoAttachPoint=\"hsvNode\">\n\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"1\" cellspacing=\"1\">\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_h\">${hueLabel}</label></td><td><input id=\"${_uId}_h\" dojoAttachPoint=\"Hval\"size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${degLabel}</td></tr>\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_s\">${saturationLabel}</label></td><td><input id=\"${_uId}_s\" dojoAttachPoint=\"Sval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${percentSign}</td></tr>\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_v\">${valueLabel}</label></td><td><input id=\"${_uId}_v\" dojoAttachPoint=\"Vval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${percentSign}</td></tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t\t\t\t\t<div class=\"dojoxColorPickerHex\" dojoAttachPoint=\"hexNode\" aria-live=\"polite\">\t\n\t\t\t\t\t\t\t\t\t\t<label for=\"${_uId}_hex\"> ${hexLabel} </label><input id=\"${_uId}_hex\" dojoAttachPoint=\"hexCode, focusNode, valueNode\" size=\"6\" class=\"dojoxColorPickerHexCode\" dojoAttachEvent=\"onchange: _colorInputChange\">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n</table>\n\n"),
- postMixInProperties: function(){
- if(dojo.hasClass(dojo.body(), "dijit_a11y")){
-
- this._huePickerPointer = this._huePickerPointerAlly;
- }
- this._uId = dijit.getUniqueId(this.id);
- dojo.mixin(this, dojo.i18n.getLocalization("dojox.widget", "ColorPicker"));
- dojo.mixin(this, dojo.i18n.getLocalization("dojo.cldr", "number"));
- this.inherited(arguments);
- },
- postCreate: function(){
-
-
-
-
- this.inherited(arguments);
- if(d.isIE < 7){
- this.colorUnderlay.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._underlay+"', sizingMethod='scale')";
- this.colorUnderlay.src = this._blankGif.toString();
- }
-
- if(!this.showRgb){ this.rgbNode.style.visibility = "hidden"; }
- if(!this.showHsv){ this.hsvNode.style.visibility = "hidden"; }
- if(!this.showHex){ this.hexNode.style.visibility = "hidden"; }
- if(!this.webSafe){ this.safePreviewNode.style.visibility = "hidden"; }
- },
-
- startup: function(){
- if(this._started){
- return;
- }
- this._started = true;
- this.set("value", this.value);
- this._mover = new d.dnd.move.boxConstrainedMoveable(this.cursorNode, {
- box: {
- t: -(this.PICKER_SAT_SELECTOR_H/2),
- l: -(this.PICKER_SAT_SELECTOR_W/2),
- w:this.PICKER_SAT_VAL_W,
- h:this.PICKER_SAT_VAL_H
- }
- });
-
- this._hueMover = new d.dnd.move.boxConstrainedMoveable(this.hueCursorNode, {
- box: {
- t: -(this.PICKER_HUE_SELECTOR_H/2),
- l:0,
- w:0,
- h:this.PICKER_HUE_H
- }
- });
-
- this._subs = [];
-
- this._subs.push(d.subscribe("/dnd/move/stop", d.hitch(this, "_clearTimer")));
- this._subs.push(d.subscribe("/dnd/move/start", d.hitch(this, "_setTimer")));
-
- this._keyListeners = [];
- this._connects.push(dijit.typematic.addKeyListener(this.hueCursorNode,{
- charOrCode: dojo.keys.UP_ARROW,
- shiftKey: false,
- metaKey: false,
- ctrlKey: false,
- altKey: false
- }, this, dojo.hitch(this, this._updateHueCursorNode), 25, 25));
- this._connects.push(dijit.typematic.addKeyListener(this.hueCursorNode,{
- charOrCode: dojo.keys.DOWN_ARROW,
- shiftKey: false,
- metaKey: false,
- ctrlKey: false,
- altKey: false
- }, this, dojo.hitch(this, this._updateHueCursorNode), 25, 25));
- this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
- charOrCode: dojo.keys.UP_ARROW,
- shiftKey: false,
- metaKey: false,
- ctrlKey: false,
- altKey: false
- }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
- this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
- charOrCode: dojo.keys.DOWN_ARROW,
- shiftKey: false,
- metaKey: false,
- ctrlKey: false,
- altKey: false
- }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
- this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
- charOrCode: dojo.keys.LEFT_ARROW,
- shiftKey: false,
- metaKey: false,
- ctrlKey: false,
- altKey: false
- }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
- this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
- charOrCode: dojo.keys.RIGHT_ARROW,
- shiftKey: false,
- metaKey: false,
- ctrlKey: false,
- altKey: false
- }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
- },
-
- _setValueAttr: function(value){
- if(!this._started){ return; }
- this.setColor(value, true);
- },
-
- setColor: function(/* String */color, force){
-
-
-
- var col = dojox.color.fromString(color);
- this._updatePickerLocations(col);
- this._updateColorInputs(col);
- this._updateValue(col, force);
- },
-
- _setTimer: function(/* d.dnd.Mover */mover){
-
- dijit.focus(mover.node);
- d.setSelectable(this.domNode,false);
- this._timer = setInterval(d.hitch(this, "_updateColor"), 45);
- },
-
- _clearTimer: function(/* d.dnd.Mover */mover){
- clearInterval(this._timer);
- this._timer = null;
- this.onChange(this.value);
- d.setSelectable(this.domNode,true);
- },
-
- _setHue: function(/* Decimal */h){
-
-
-
-
- d.style(this.colorUnderlay, "backgroundColor", dojox.color.fromHsv(h,100,100).toHex());
-
- },
- _updateHueCursorNode: function(count, node, e){
-
-
-
-
-
-
-
-
-
- if(count !== -1){
- var y = dojo.style(this.hueCursorNode, "top");
- var selCenter = (this.PICKER_HUE_SELECTOR_H/2);
-
- y += selCenter;
- var update = false;
- if(e.charOrCode == dojo.keys.UP_ARROW){
- if(y > 0){
- y -= 1;
- update = true;
- }
- }else if(e.charOrCode == dojo.keys.DOWN_ARROW){
- if(y < this.PICKER_HUE_H){
- y += 1;
- update = true;
- }
- }
- y -= selCenter;
- if(update){
- dojo.style(this.hueCursorNode, "top", y + "px");
- }
- }else{
- this._updateColor(true);
- }
- },
-
- _updateCursorNode: function(count, node, e){
-
-
-
-
-
-
-
-
-
- var selCenterH = this.PICKER_SAT_SELECTOR_H/2;
- var selCenterW = this.PICKER_SAT_SELECTOR_W/2;
- if(count !== -1){
- var y = dojo.style(this.cursorNode, "top");
- var x = dojo.style(this.cursorNode, "left");
-
-
- y += selCenterH;
- x += selCenterW;
- var update = false;
- if(e.charOrCode == dojo.keys.UP_ARROW){
- if(y > 0){
- y -= 1;
- update = true;
- }
- }else if(e.charOrCode == dojo.keys.DOWN_ARROW){
- if(y < this.PICKER_SAT_VAL_H){
- y += 1;
- update = true;
- }
- }else if(e.charOrCode == dojo.keys.LEFT_ARROW){
- if(x > 0){
- x -= 1;
- update = true;
- }
- }else if(e.charOrCode == dojo.keys.RIGHT_ARROW){
- if(x < this.PICKER_SAT_VAL_W){
- x += 1;
- update = true;
- }
- }
- if(update){
-
- y -= selCenterH;
- x -= selCenterW;
- dojo.style(this.cursorNode, "top", y + "px");
- dojo.style(this.cursorNode, "left", x + "px");
- }
- }else{
- this._updateColor(true);
- }
- },
- _updateColor: function(){
-
-
- var hueSelCenter = this.PICKER_HUE_SELECTOR_H/2,
- satSelCenterH = this.PICKER_SAT_SELECTOR_H/2,
- satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
- var _huetop = d.style(this.hueCursorNode,"top") + hueSelCenter,
- _pickertop = d.style(this.cursorNode,"top") + satSelCenterH,
- _pickerleft = d.style(this.cursorNode,"left") + satSelCenterW,
- h = Math.round(360 - (_huetop / this.PICKER_HUE_H * 360)),
- col = dojox.color.fromHsv(h, _pickerleft / this.PICKER_SAT_VAL_W * 100, 100 - (_pickertop / this.PICKER_SAT_VAL_H * 100))
- ;
-
- this._updateColorInputs(col);
- this._updateValue(col, true);
-
-
- if (h!=this._hue) {
- this._setHue(h);
- }
- },
-
- _colorInputChange: function(e){
-
-
- var col, hasit = false;
- switch (e.target) {
-
- case this.hexCode:
- col = dojox.color.fromString(e.target.value);
- hasit = true;
-
- break;
- case this.Rval:
- case this.Gval:
- case this.Bval:
- col = dojox.color.fromArray([this.Rval.value, this.Gval.value, this.Bval.value]);
- hasit = true;
- break;
- case this.Hval:
- case this.Sval:
- case this.Vval:
- col = dojox.color.fromHsv(this.Hval.value, this.Sval.value, this.Vval.value);
- hasit = true;
- break;
- }
-
- if(hasit){
- this._updatePickerLocations(col);
- this._updateColorInputs(col);
- this._updateValue(col, true);
- }
-
- },
-
- _updateValue: function(/* dojox.color.Color */col, /* Boolean */fireChange){
-
-
- var hex = col.toHex();
-
- this.value = this.valueNode.value = hex;
-
-
- if(fireChange && (!this._timer || this.liveUpdate)) {
- this.onChange(hex);
- }
- },
-
- _updatePickerLocations: function(/* dojox.color.Color */col){
-
-
- var hueSelCenter = this.PICKER_HUE_SELECTOR_H/2,
- satSelCenterH = this.PICKER_SAT_SELECTOR_H/2,
- satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
- var hsv = col.toHsv(),
- ypos = Math.round(this.PICKER_HUE_H - hsv.h / 360 * this.PICKER_HUE_H) - hueSelCenter,
- newLeft = Math.round(hsv.s / 100 * this.PICKER_SAT_VAL_W) - satSelCenterW,
- newTop = Math.round(this.PICKER_SAT_VAL_H - hsv.v / 100 * this.PICKER_SAT_VAL_H) - satSelCenterH
- ;
-
- if (this.animatePoint) {
- d.fx.slideTo({
- node: this.hueCursorNode,
- duration: this.slideDuration,
- top: ypos,
- left: 0
- }).play();
-
- d.fx.slideTo({
- node: this.cursorNode,
- duration: this.slideDuration,
- top: newTop,
- left: newLeft
- }).play();
-
- }
- else {
- d.style(this.hueCursorNode, "top", ypos + "px");
- d.style(this.cursorNode, {
- left: newLeft + "px",
- top: newTop + "px"
- });
- }
-
-
- if (hsv.h != this._hue) {
- this._setHue(hsv.h);
- }
-
- },
-
- _updateColorInputs: function(/* dojox.color.Color */col){
-
-
-
- var hex = col.toHex();
-
- if (this.showRgb) {
- this.Rval.value = col.r;
- this.Gval.value = col.g;
- this.Bval.value = col.b;
- }
-
- if (this.showHsv) {
- var hsv = col.toHsv();
- this.Hval.value = Math.round((hsv.h));
- this.Sval.value = Math.round(hsv.s);
- this.Vval.value = Math.round(hsv.v);
- }
-
- if (this.showHex) {
- this.hexCode.value = hex;
- }
-
- this.previewNode.style.backgroundColor = hex;
-
- if (this.webSafe) {
- this.safePreviewNode.style.backgroundColor = webSafeFromHex(hex);
- }
- },
-
- _setHuePoint: function(/* Event */evt){
-
- var selCenter = (this.PICKER_HUE_SELECTOR_H/2);
- var ypos = evt.layerY - selCenter;
- if(this.animatePoint){
- d.fx.slideTo({
- node: this.hueCursorNode,
- duration:this.slideDuration,
- top: ypos,
- left: 0,
- onEnd: d.hitch(this, function() {this._updateColor(true); dijit.focus(this.hueCursorNode);})
- }).play();
- }else{
- d.style(this.hueCursorNode, "top", ypos + "px");
- this._updateColor(false);
- }
- },
-
- _setPoint: function(/* Event */evt){
-
-
- var satSelCenterH = this.PICKER_SAT_SELECTOR_H/2;
- var satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
- var newTop = evt.layerY - satSelCenterH;
- var newLeft = evt.layerX - satSelCenterW;
-
- if(evt){ dijit.focus(evt.target); }
- if(this.animatePoint){
- d.fx.slideTo({
- node: this.cursorNode,
- duration: this.slideDuration,
- top: newTop,
- left: newLeft,
- onEnd: d.hitch(this, function() {this._updateColor(true); dijit.focus(this.cursorNode);})
- }).play();
- }else{
- d.style(this.cursorNode, {
- left: newLeft + "px",
- top: newTop + "px"
- });
- this._updateColor(false);
- }
- },
-
- _handleKey: function(/* Event */e){
-
-
- },
- focus: function(){
-
-
- if(!this._focused){
- dijit.focus(this.focusNode);
- }
- },
- _stopDrag: function(e){
-
-
-
-
- dojo.stopEvent(e);
- },
- destroy: function(){
-
-
- this.inherited(arguments);
- dojo.forEach(this._subs, function(sub){
- dojo.unsubscribe(sub);
- });
- delete this._subs;
- }
- });
- })(dojo);
- }
- if(!dojo._hasResource["dojox.uuid._base"]){
- dojo._hasResource["dojox.uuid._base"] = true;
- dojo.provide("dojox.uuid._base");
- dojox.uuid.NIL_UUID = "00000000-0000-0000-0000-000000000000";
- dojox.uuid.version = {
-
- UNKNOWN: 0,
- TIME_BASED: 1,
- DCE_SECURITY: 2,
- NAME_BASED_MD5: 3,
- RANDOM: 4,
- NAME_BASED_SHA1: 5 };
- dojox.uuid.variant = {
-
- NCS: "0",
- DCE: "10",
- MICROSOFT: "110",
- UNKNOWN: "111" };
- dojox.uuid.assert = function(/*Boolean*/ booleanValue, /*String?*/ message){
-
-
-
-
-
-
-
-
- if(!booleanValue){
- if(!message){
- message = "An assert statement failed.\n" +
- "The method dojox.uuid.assert() was called with a 'false' value.\n";
- }
- throw new Error(message);
- }
- };
- dojox.uuid.generateNilUuid = function(){
-
-
-
-
-
-
-
- return dojox.uuid.NIL_UUID;
- };
- dojox.uuid.isValid = function(/*String*/ uuidString){
-
-
- uuidString = uuidString.toString();
- var valid = (dojo.isString(uuidString) &&
- (uuidString.length == 36) &&
- (uuidString == uuidString.toLowerCase()));
- if(valid){
- var arrayOfParts = uuidString.split("-");
- valid = ((arrayOfParts.length == 5) &&
- (arrayOfParts[0].length == 8) &&
- (arrayOfParts[1].length == 4) &&
- (arrayOfParts[2].length == 4) &&
- (arrayOfParts[3].length == 4) &&
- (arrayOfParts[4].length == 12));
- var HEX_RADIX = 16;
- for (var i in arrayOfParts) {
- var part = arrayOfParts[i];
- var integer = parseInt(part, HEX_RADIX);
- valid = valid && isFinite(integer);
- }
- }
- return valid;
- };
- dojox.uuid.getVariant = function(/*String*/ uuidString){
-
-
-
-
-
-
-
-
-
-
-
- if(!dojox.uuid._ourVariantLookupTable){
- var variant = dojox.uuid.variant;
- var lookupTable = [];
- lookupTable[0x0] = variant.NCS;
- lookupTable[0x1] = variant.NCS;
- lookupTable[0x2] = variant.NCS;
- lookupTable[0x3] = variant.NCS;
- lookupTable[0x4] = variant.NCS;
- lookupTable[0x5] = variant.NCS;
- lookupTable[0x6] = variant.NCS;
- lookupTable[0x7] = variant.NCS;
- lookupTable[0x8] = variant.DCE;
- lookupTable[0x9] = variant.DCE;
- lookupTable[0xA] = variant.DCE;
- lookupTable[0xB] = variant.DCE;
- lookupTable[0xC] = variant.MICROSOFT;
- lookupTable[0xD] = variant.MICROSOFT;
- lookupTable[0xE] = variant.UNKNOWN;
- lookupTable[0xF] = variant.UNKNOWN;
-
- dojox.uuid._ourVariantLookupTable = lookupTable;
- }
- uuidString = uuidString.toString();
- var variantCharacter = uuidString.charAt(19);
- var HEX_RADIX = 16;
- var variantNumber = parseInt(variantCharacter, HEX_RADIX);
- dojox.uuid.assert((variantNumber >= 0) && (variantNumber <= 16));
- return dojox.uuid._ourVariantLookupTable[variantNumber];
- };
- dojox.uuid.getVersion = function(/*String*/ uuidString){
-
-
-
-
-
-
-
-
- var errorMessage = "dojox.uuid.getVersion() was not passed a DCE Variant UUID.";
- dojox.uuid.assert(dojox.uuid.getVariant(uuidString) == dojox.uuid.variant.DCE, errorMessage);
- uuidString = uuidString.toString();
-
-
-
-
-
- var versionCharacter = uuidString.charAt(14);
- var HEX_RADIX = 16;
- var versionNumber = parseInt(versionCharacter, HEX_RADIX);
- return versionNumber;
- };
- dojox.uuid.getNode = function(/*String*/ uuidString){
-
-
-
-
-
-
- var errorMessage = "dojox.uuid.getNode() was not passed a TIME_BASED UUID.";
- dojox.uuid.assert(dojox.uuid.getVersion(uuidString) == dojox.uuid.version.TIME_BASED, errorMessage);
- uuidString = uuidString.toString();
- var arrayOfStrings = uuidString.split('-');
- var nodeString = arrayOfStrings[4];
- return nodeString;
- };
- dojox.uuid.getTimestamp = function(/*String*/ uuidString, /*String?*/ returnType){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var errorMessage = "dojox.uuid.getTimestamp() was not passed a TIME_BASED UUID.";
- dojox.uuid.assert(dojox.uuid.getVersion(uuidString) == dojox.uuid.version.TIME_BASED, errorMessage);
-
- uuidString = uuidString.toString();
- if(!returnType){returnType = null};
- switch(returnType){
- case "string":
- case String:
- return dojox.uuid.getTimestamp(uuidString, Date).toUTCString();
- break;
- case "hex":
-
-
- var arrayOfStrings = uuidString.split('-');
- var hexTimeLow = arrayOfStrings[0];
- var hexTimeMid = arrayOfStrings[1];
- var hexTimeHigh = arrayOfStrings[2];
-
-
-
- hexTimeHigh = hexTimeHigh.slice(1);
-
- var timestampAsHexString = hexTimeHigh + hexTimeMid + hexTimeLow;
- dojox.uuid.assert(timestampAsHexString.length == 15);
- return timestampAsHexString;
- break;
- case null:
- case "date":
- case Date:
-
- var GREGORIAN_CHANGE_OFFSET_IN_HOURS = 3394248;
- var HEX_RADIX = 16;
-
- var arrayOfParts = uuidString.split('-');
- var timeLow = parseInt(arrayOfParts[0], HEX_RADIX);
- var timeMid = parseInt(arrayOfParts[1], HEX_RADIX);
- var timeHigh = parseInt(arrayOfParts[2], HEX_RADIX);
- var hundredNanosecondIntervalsSince1582 = timeHigh & 0x0FFF;
- hundredNanosecondIntervalsSince1582 <<= 16;
- hundredNanosecondIntervalsSince1582 += timeMid;
-
-
-
- hundredNanosecondIntervalsSince1582 *= 0x100000000;
- hundredNanosecondIntervalsSince1582 += timeLow;
- var millisecondsSince1582 = hundredNanosecondIntervalsSince1582 / 10000;
-
-
-
- var secondsPerHour = 60 * 60;
- var hoursBetween1582and1970 = GREGORIAN_CHANGE_OFFSET_IN_HOURS;
- var secondsBetween1582and1970 = hoursBetween1582and1970 * secondsPerHour;
- var millisecondsBetween1582and1970 = secondsBetween1582and1970 * 1000;
- var millisecondsSince1970 = millisecondsSince1582 - millisecondsBetween1582and1970;
-
- var timestampAsDate = new Date(millisecondsSince1970);
- return timestampAsDate;
- break;
- default:
-
- dojox.uuid.assert(false, "dojox.uuid.getTimestamp was not passed a valid returnType: " + returnType);
- break;
- }
- };
- }
- if(!dojo._hasResource["dojox.uuid"]){
- dojo._hasResource["dojox.uuid"] = true;
- dojo.provide("dojox.uuid");
- }
- if(!dojo._hasResource["dojox.uuid.generateRandomUuid"]){
- dojo._hasResource["dojox.uuid.generateRandomUuid"] = true;
- dojo.provide("dojox.uuid.generateRandomUuid");
- dojox.uuid.generateRandomUuid = function(){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var HEX_RADIX = 16;
- function _generateRandomEightCharacterHexString(){
-
-
- var random32bitNumber = Math.floor( (Math.random() % 1) * Math.pow(2, 32) );
- var eightCharacterHexString = random32bitNumber.toString(HEX_RADIX);
- while(eightCharacterHexString.length < 8){
- eightCharacterHexString = "0" + eightCharacterHexString;
- }
- return eightCharacterHexString;
- }
- var hyphen = "-";
- var versionCodeForRandomlyGeneratedUuids = "4";
- var variantCodeForDCEUuids = "8";
- var a = _generateRandomEightCharacterHexString();
- var b = _generateRandomEightCharacterHexString();
- b = b.substring(0, 4) + hyphen + versionCodeForRandomlyGeneratedUuids + b.substring(5, 8);
- var c = _generateRandomEightCharacterHexString();
- c = variantCodeForDCEUuids + c.substring(1, 4) + hyphen + c.substring(4, 8);
- var d = _generateRandomEightCharacterHexString();
- var returnValue = a + hyphen + b + hyphen + c + d;
- returnValue = returnValue.toLowerCase();
- return returnValue;
- };
- }
- dojo.i18n._preloadLocalizations("dojo.nls.buxdojo", ["ROOT","ar","az","ca","cs","da","de","de-de","el","en","en-gb","en-us","es","es-es","fi","fi-fi","fr","fr-fr","he","he-il","hr","hu","it","it-it","ja","ja-jp","ko","ko-kr","nb","nl","nl-nl","no","pl","pt","pt-br","pt-pt","ro","ru","sk","sl","sv","th","tr","xx","zh","zh-cn","zh-tw"]);
|