Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

project-win32-16.00.debug.js 289KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853
  1. /* Project specific JavaScript API library */
  2. /* Version: 16.0.7310.1000 */
  3. /*
  4. Copyright (c) Microsoft Corporation. All rights reserved.
  5. */
  6. /*
  7. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  8. */
  9. var __extends = (this && this.__extends) || function (d, b) {
  10. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  11. function __() { this.constructor = d; }
  12. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13. };
  14. var OfficeExt;
  15. (function (OfficeExt) {
  16. var MicrosoftAjaxFactory = (function () {
  17. function MicrosoftAjaxFactory() {
  18. }
  19. MicrosoftAjaxFactory.prototype.isMsAjaxLoaded = function () {
  20. if (typeof (Sys) !== 'undefined' && typeof (Type) !== 'undefined' &&
  21. Sys.StringBuilder && typeof (Sys.StringBuilder) === "function" &&
  22. Type.registerNamespace && typeof (Type.registerNamespace) === "function" &&
  23. Type.registerClass && typeof (Type.registerClass) === "function" &&
  24. typeof (Function._validateParams) === "function" &&
  25. Sys.Serialization && Sys.Serialization.JavaScriptSerializer && typeof (Sys.Serialization.JavaScriptSerializer.serialize) === "function") {
  26. return true;
  27. }
  28. else {
  29. return false;
  30. }
  31. };
  32. MicrosoftAjaxFactory.prototype.loadMsAjaxFull = function (callback) {
  33. var msAjaxCDNPath = (window.location.protocol.toLowerCase() === 'https:' ? 'https:' : 'http:') + '//ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js';
  34. OSF.OUtil.loadScript(msAjaxCDNPath, callback);
  35. };
  36. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxError", {
  37. get: function () {
  38. if (this._msAjaxError == null && this.isMsAjaxLoaded()) {
  39. this._msAjaxError = Error;
  40. }
  41. return this._msAjaxError;
  42. },
  43. set: function (errorClass) {
  44. this._msAjaxError = errorClass;
  45. },
  46. enumerable: true,
  47. configurable: true
  48. });
  49. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxSerializer", {
  50. get: function () {
  51. if (this._msAjaxSerializer == null && this.isMsAjaxLoaded()) {
  52. this._msAjaxSerializer = Sys.Serialization.JavaScriptSerializer;
  53. }
  54. return this._msAjaxSerializer;
  55. },
  56. set: function (serializerClass) {
  57. this._msAjaxSerializer = serializerClass;
  58. },
  59. enumerable: true,
  60. configurable: true
  61. });
  62. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxString", {
  63. get: function () {
  64. if (this._msAjaxString == null && this.isMsAjaxLoaded()) {
  65. this._msAjaxSerializer = String;
  66. }
  67. return this._msAjaxString;
  68. },
  69. set: function (stringClass) {
  70. this._msAjaxString = stringClass;
  71. },
  72. enumerable: true,
  73. configurable: true
  74. });
  75. Object.defineProperty(MicrosoftAjaxFactory.prototype, "msAjaxDebug", {
  76. get: function () {
  77. if (this._msAjaxDebug == null && this.isMsAjaxLoaded()) {
  78. this._msAjaxDebug = Sys.Debug;
  79. }
  80. return this._msAjaxDebug;
  81. },
  82. set: function (debugClass) {
  83. this._msAjaxDebug = debugClass;
  84. },
  85. enumerable: true,
  86. configurable: true
  87. });
  88. return MicrosoftAjaxFactory;
  89. })();
  90. OfficeExt.MicrosoftAjaxFactory = MicrosoftAjaxFactory;
  91. })(OfficeExt || (OfficeExt = {}));
  92. var OsfMsAjaxFactory = new OfficeExt.MicrosoftAjaxFactory();
  93. var OSF = OSF || {};
  94. var OfficeExt;
  95. (function (OfficeExt) {
  96. var SafeStorage = (function () {
  97. function SafeStorage(_internalStorage) {
  98. this._internalStorage = _internalStorage;
  99. }
  100. SafeStorage.prototype.getItem = function (key) {
  101. try {
  102. return this._internalStorage && this._internalStorage.getItem(key);
  103. }
  104. catch (e) {
  105. return null;
  106. }
  107. };
  108. SafeStorage.prototype.setItem = function (key, data) {
  109. try {
  110. this._internalStorage && this._internalStorage.setItem(key, data);
  111. }
  112. catch (e) {
  113. }
  114. };
  115. SafeStorage.prototype.clear = function () {
  116. try {
  117. this._internalStorage && this._internalStorage.clear();
  118. }
  119. catch (e) {
  120. }
  121. };
  122. SafeStorage.prototype.removeItem = function (key) {
  123. try {
  124. this._internalStorage && this._internalStorage.removeItem(key);
  125. }
  126. catch (e) {
  127. }
  128. };
  129. SafeStorage.prototype.getKeysWithPrefix = function (keyPrefix) {
  130. var keyList = [];
  131. try {
  132. var len = this._internalStorage && this._internalStorage.length || 0;
  133. for (var i = 0; i < len; i++) {
  134. var key = this._internalStorage.key(i);
  135. if (key.indexOf(keyPrefix) === 0) {
  136. keyList.push(key);
  137. }
  138. }
  139. }
  140. catch (e) {
  141. }
  142. return keyList;
  143. };
  144. return SafeStorage;
  145. })();
  146. OfficeExt.SafeStorage = SafeStorage;
  147. })(OfficeExt || (OfficeExt = {}));
  148. OSF.XdmFieldName = {
  149. ConversationUrl: "ConversationUrl",
  150. AppId: "AppId"
  151. };
  152. OSF.WindowNameItemKeys = {
  153. BaseFrameName: "baseFrameName",
  154. HostInfo: "hostInfo",
  155. XdmInfo: "xdmInfo",
  156. SerializerVersion: "serializerVersion",
  157. AppContext: "appContext"
  158. };
  159. OSF.OUtil = (function () {
  160. var _uniqueId = -1;
  161. var _xdmInfoKey = '&_xdm_Info=';
  162. var _serializerVersionKey = '&_serializer_version=';
  163. var _xdmSessionKeyPrefix = '_xdm_';
  164. var _serializerVersionKeyPrefix = '_serializer_version=';
  165. var _fragmentSeparator = '#';
  166. var _fragmentInfoDelimiter = '&';
  167. var _classN = "class";
  168. var _loadedScripts = {};
  169. var _defaultScriptLoadingTimeout = 30000;
  170. var _safeSessionStorage = null;
  171. var _safeLocalStorage = null;
  172. var _rndentropy = new Date().getTime();
  173. function _random() {
  174. var nextrand = 0x7fffffff * (Math.random());
  175. nextrand ^= _rndentropy ^ ((new Date().getMilliseconds()) << Math.floor(Math.random() * (31 - 10)));
  176. return nextrand.toString(16);
  177. }
  178. ;
  179. function _getSessionStorage() {
  180. if (!_safeSessionStorage) {
  181. try {
  182. var sessionStorage = window.sessionStorage;
  183. }
  184. catch (ex) {
  185. sessionStorage = null;
  186. }
  187. _safeSessionStorage = new OfficeExt.SafeStorage(sessionStorage);
  188. }
  189. return _safeSessionStorage;
  190. }
  191. ;
  192. function _reOrderTabbableElements(elements) {
  193. var bucket0 = [];
  194. var bucketPositive = [];
  195. var i;
  196. var len = elements.length;
  197. var ele;
  198. for (i = 0; i < len; i++) {
  199. ele = elements[i];
  200. if (ele.tabIndex) {
  201. if (ele.tabIndex > 0) {
  202. bucketPositive.push(ele);
  203. }
  204. else if (ele.tabIndex === 0) {
  205. bucket0.push(ele);
  206. }
  207. }
  208. else {
  209. bucket0.push(ele);
  210. }
  211. }
  212. bucketPositive = bucketPositive.sort(function (left, right) {
  213. var diff = left.tabIndex - right.tabIndex;
  214. if (diff === 0) {
  215. diff = bucketPositive.indexOf(left) - bucketPositive.indexOf(right);
  216. }
  217. return diff;
  218. });
  219. return [].concat(bucketPositive, bucket0);
  220. }
  221. ;
  222. return {
  223. set_entropy: function OSF_OUtil$set_entropy(entropy) {
  224. if (typeof entropy == "string") {
  225. for (var i = 0; i < entropy.length; i += 4) {
  226. var temp = 0;
  227. for (var j = 0; j < 4 && i + j < entropy.length; j++) {
  228. temp = (temp << 8) + entropy.charCodeAt(i + j);
  229. }
  230. _rndentropy ^= temp;
  231. }
  232. }
  233. else if (typeof entropy == "number") {
  234. _rndentropy ^= entropy;
  235. }
  236. else {
  237. _rndentropy ^= 0x7fffffff * Math.random();
  238. }
  239. _rndentropy &= 0x7fffffff;
  240. },
  241. extend: function OSF_OUtil$extend(child, parent) {
  242. var F = function () { };
  243. F.prototype = parent.prototype;
  244. child.prototype = new F();
  245. child.prototype.constructor = child;
  246. child.uber = parent.prototype;
  247. if (parent.prototype.constructor === Object.prototype.constructor) {
  248. parent.prototype.constructor = parent;
  249. }
  250. },
  251. setNamespace: function OSF_OUtil$setNamespace(name, parent) {
  252. if (parent && name && !parent[name]) {
  253. parent[name] = {};
  254. }
  255. },
  256. unsetNamespace: function OSF_OUtil$unsetNamespace(name, parent) {
  257. if (parent && name && parent[name]) {
  258. delete parent[name];
  259. }
  260. },
  261. loadScript: function OSF_OUtil$loadScript(url, callback, timeoutInMs) {
  262. if (url && callback) {
  263. var doc = window.document;
  264. var _loadedScriptEntry = _loadedScripts[url];
  265. if (!_loadedScriptEntry) {
  266. var script = doc.createElement("script");
  267. script.type = "text/javascript";
  268. _loadedScriptEntry = { loaded: false, pendingCallbacks: [callback], timer: null };
  269. _loadedScripts[url] = _loadedScriptEntry;
  270. var onLoadCallback = function OSF_OUtil_loadScript$onLoadCallback() {
  271. if (_loadedScriptEntry.timer != null) {
  272. clearTimeout(_loadedScriptEntry.timer);
  273. delete _loadedScriptEntry.timer;
  274. }
  275. _loadedScriptEntry.loaded = true;
  276. var pendingCallbackCount = _loadedScriptEntry.pendingCallbacks.length;
  277. for (var i = 0; i < pendingCallbackCount; i++) {
  278. var currentCallback = _loadedScriptEntry.pendingCallbacks.shift();
  279. currentCallback();
  280. }
  281. };
  282. var onLoadError = function OSF_OUtil_loadScript$onLoadError() {
  283. delete _loadedScripts[url];
  284. if (_loadedScriptEntry.timer != null) {
  285. clearTimeout(_loadedScriptEntry.timer);
  286. delete _loadedScriptEntry.timer;
  287. }
  288. var pendingCallbackCount = _loadedScriptEntry.pendingCallbacks.length;
  289. for (var i = 0; i < pendingCallbackCount; i++) {
  290. var currentCallback = _loadedScriptEntry.pendingCallbacks.shift();
  291. currentCallback();
  292. }
  293. };
  294. if (script.readyState) {
  295. script.onreadystatechange = function () {
  296. if (script.readyState == "loaded" || script.readyState == "complete") {
  297. script.onreadystatechange = null;
  298. onLoadCallback();
  299. }
  300. };
  301. }
  302. else {
  303. script.onload = onLoadCallback;
  304. }
  305. script.onerror = onLoadError;
  306. timeoutInMs = timeoutInMs || _defaultScriptLoadingTimeout;
  307. _loadedScriptEntry.timer = setTimeout(onLoadError, timeoutInMs);
  308. script.src = url;
  309. doc.getElementsByTagName("head")[0].appendChild(script);
  310. }
  311. else if (_loadedScriptEntry.loaded) {
  312. callback();
  313. }
  314. else {
  315. _loadedScriptEntry.pendingCallbacks.push(callback);
  316. }
  317. }
  318. },
  319. loadCSS: function OSF_OUtil$loadCSS(url) {
  320. if (url) {
  321. var doc = window.document;
  322. var link = doc.createElement("link");
  323. link.type = "text/css";
  324. link.rel = "stylesheet";
  325. link.href = url;
  326. doc.getElementsByTagName("head")[0].appendChild(link);
  327. }
  328. },
  329. parseEnum: function OSF_OUtil$parseEnum(str, enumObject) {
  330. var parsed = enumObject[str.trim()];
  331. if (typeof (parsed) == 'undefined') {
  332. OsfMsAjaxFactory.msAjaxDebug.trace("invalid enumeration string:" + str);
  333. throw OsfMsAjaxFactory.msAjaxError.argument("str");
  334. }
  335. return parsed;
  336. },
  337. delayExecutionAndCache: function OSF_OUtil$delayExecutionAndCache() {
  338. var obj = { calc: arguments[0] };
  339. return function () {
  340. if (obj.calc) {
  341. obj.val = obj.calc.apply(this, arguments);
  342. delete obj.calc;
  343. }
  344. return obj.val;
  345. };
  346. },
  347. getUniqueId: function OSF_OUtil$getUniqueId() {
  348. _uniqueId = _uniqueId + 1;
  349. return _uniqueId.toString();
  350. },
  351. formatString: function OSF_OUtil$formatString() {
  352. var args = arguments;
  353. var source = args[0];
  354. return source.replace(/{(\d+)}/gm, function (match, number) {
  355. var index = parseInt(number, 10) + 1;
  356. return args[index] === undefined ? '{' + number + '}' : args[index];
  357. });
  358. },
  359. generateConversationId: function OSF_OUtil$generateConversationId() {
  360. return [_random(), _random(), (new Date()).getTime().toString()].join('_');
  361. },
  362. getFrameName: function OSF_OUtil$getFrameName(cacheKey) {
  363. return _xdmSessionKeyPrefix + cacheKey + this.generateConversationId();
  364. },
  365. addXdmInfoAsHash: function OSF_OUtil$addXdmInfoAsHash(url, xdmInfoValue) {
  366. return OSF.OUtil.addInfoAsHash(url, _xdmInfoKey, xdmInfoValue, false);
  367. },
  368. addSerializerVersionAsHash: function OSF_OUtil$addSerializerVersionAsHash(url, serializerVersion) {
  369. return OSF.OUtil.addInfoAsHash(url, _serializerVersionKey, serializerVersion, true);
  370. },
  371. addInfoAsHash: function OSF_OUtil$addInfoAsHash(url, keyName, infoValue, encodeInfo) {
  372. url = url.trim() || '';
  373. var urlParts = url.split(_fragmentSeparator);
  374. var urlWithoutFragment = urlParts.shift();
  375. var fragment = urlParts.join(_fragmentSeparator);
  376. var newFragment;
  377. if (encodeInfo) {
  378. newFragment = [keyName, encodeURIComponent(infoValue), fragment].join('');
  379. }
  380. else {
  381. newFragment = [fragment, keyName, infoValue].join('');
  382. }
  383. return [urlWithoutFragment, _fragmentSeparator, newFragment].join('');
  384. },
  385. parseHostInfoFromWindowName: function OSF_OUtil$parseHostInfoFromWindowName(skipSessionStorage, windowName) {
  386. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.HostInfo);
  387. },
  388. parseXdmInfo: function OSF_OUtil$parseXdmInfo(skipSessionStorage) {
  389. var xdmInfoValue = OSF.OUtil.parseXdmInfoWithGivenFragment(skipSessionStorage, window.location.hash);
  390. if (!xdmInfoValue) {
  391. xdmInfoValue = OSF.OUtil.parseXdmInfoFromWindowName(skipSessionStorage, window.name);
  392. }
  393. return xdmInfoValue;
  394. },
  395. parseXdmInfoFromWindowName: function OSF_OUtil$parseXdmInfoFromWindowName(skipSessionStorage, windowName) {
  396. return OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.XdmInfo);
  397. },
  398. parseXdmInfoWithGivenFragment: function OSF_OUtil$parseXdmInfoWithGivenFragment(skipSessionStorage, fragment) {
  399. return OSF.OUtil.parseInfoWithGivenFragment(_xdmInfoKey, _xdmSessionKeyPrefix, false, skipSessionStorage, fragment);
  400. },
  401. parseSerializerVersion: function OSF_OUtil$parseSerializerVersion(skipSessionStorage) {
  402. var serializerVersion = OSF.OUtil.parseSerializerVersionWithGivenFragment(skipSessionStorage, window.location.hash);
  403. if (isNaN(serializerVersion)) {
  404. serializerVersion = OSF.OUtil.parseSerializerVersionFromWindowName(skipSessionStorage, window.name);
  405. }
  406. return serializerVersion;
  407. },
  408. parseSerializerVersionFromWindowName: function OSF_OUtil$parseSerializerVersionFromWindowName(skipSessionStorage, windowName) {
  409. return parseInt(OSF.OUtil.parseInfoFromWindowName(skipSessionStorage, windowName, OSF.WindowNameItemKeys.SerializerVersion));
  410. },
  411. parseSerializerVersionWithGivenFragment: function OSF_OUtil$parseSerializerVersionWithGivenFragment(skipSessionStorage, fragment) {
  412. return parseInt(OSF.OUtil.parseInfoWithGivenFragment(_serializerVersionKey, _serializerVersionKeyPrefix, true, skipSessionStorage, fragment));
  413. },
  414. parseInfoFromWindowName: function OSF_OUtil$parseInfoFromWindowName(skipSessionStorage, windowName, infoKey) {
  415. try {
  416. var windowNameObj = JSON.parse(windowName);
  417. var infoValue = windowNameObj != null ? windowNameObj[infoKey] : null;
  418. var osfSessionStorage = _getSessionStorage();
  419. if (!skipSessionStorage && osfSessionStorage && windowNameObj != null) {
  420. var sessionKey = windowNameObj[OSF.WindowNameItemKeys.BaseFrameName] + infoKey;
  421. if (infoValue) {
  422. osfSessionStorage.setItem(sessionKey, infoValue);
  423. }
  424. else {
  425. infoValue = osfSessionStorage.getItem(sessionKey);
  426. }
  427. }
  428. return infoValue;
  429. }
  430. catch (Exception) {
  431. return null;
  432. }
  433. },
  434. parseInfoWithGivenFragment: function OSF_OUtil$parseInfoWithGivenFragment(infoKey, infoKeyPrefix, decodeInfo, skipSessionStorage, fragment) {
  435. var fragmentParts = fragment.split(infoKey);
  436. var infoValue = fragmentParts.length > 1 ? fragmentParts[fragmentParts.length - 1] : null;
  437. if (decodeInfo && infoValue != null) {
  438. if (infoValue.indexOf(_fragmentInfoDelimiter) >= 0) {
  439. infoValue = infoValue.split(_fragmentInfoDelimiter)[0];
  440. }
  441. infoValue = decodeURIComponent(infoValue);
  442. }
  443. var osfSessionStorage = _getSessionStorage();
  444. if (!skipSessionStorage && osfSessionStorage) {
  445. var sessionKeyStart = window.name.indexOf(infoKeyPrefix);
  446. if (sessionKeyStart > -1) {
  447. var sessionKeyEnd = window.name.indexOf(";", sessionKeyStart);
  448. if (sessionKeyEnd == -1) {
  449. sessionKeyEnd = window.name.length;
  450. }
  451. var sessionKey = window.name.substring(sessionKeyStart, sessionKeyEnd);
  452. if (infoValue) {
  453. osfSessionStorage.setItem(sessionKey, infoValue);
  454. }
  455. else {
  456. infoValue = osfSessionStorage.getItem(sessionKey);
  457. }
  458. }
  459. }
  460. return infoValue;
  461. },
  462. getConversationId: function OSF_OUtil$getConversationId() {
  463. var searchString = window.location.search;
  464. var conversationId = null;
  465. if (searchString) {
  466. var index = searchString.indexOf("&");
  467. conversationId = index > 0 ? searchString.substring(1, index) : searchString.substr(1);
  468. if (conversationId && conversationId.charAt(conversationId.length - 1) === '=') {
  469. conversationId = conversationId.substring(0, conversationId.length - 1);
  470. if (conversationId) {
  471. conversationId = decodeURIComponent(conversationId);
  472. }
  473. }
  474. }
  475. return conversationId;
  476. },
  477. getInfoItems: function OSF_OUtil$getInfoItems(strInfo) {
  478. var items = strInfo.split("$");
  479. if (typeof items[1] == "undefined") {
  480. items = strInfo.split("|");
  481. }
  482. if (typeof items[1] == "undefined") {
  483. items = strInfo.split("%7C");
  484. }
  485. return items;
  486. },
  487. getXdmFieldValue: function OSF_OUtil$getXdmFieldValue(xdmFieldName, skipSessionStorage) {
  488. var fieldValue = '';
  489. var xdmInfoValue = OSF.OUtil.parseXdmInfo(skipSessionStorage);
  490. if (xdmInfoValue) {
  491. var items = OSF.OUtil.getInfoItems(xdmInfoValue);
  492. if (items != undefined && items.length >= 3) {
  493. switch (xdmFieldName) {
  494. case OSF.XdmFieldName.ConversationUrl:
  495. fieldValue = items[2];
  496. case OSF.XdmFieldName.AppId:
  497. fieldValue = items[1];
  498. }
  499. }
  500. }
  501. return fieldValue;
  502. },
  503. validateParamObject: function OSF_OUtil$validateParamObject(params, expectedProperties, callback) {
  504. var e = Function._validateParams(arguments, [{ name: "params", type: Object, mayBeNull: false },
  505. { name: "expectedProperties", type: Object, mayBeNull: false },
  506. { name: "callback", type: Function, mayBeNull: true }
  507. ]);
  508. if (e)
  509. throw e;
  510. for (var p in expectedProperties) {
  511. e = Function._validateParameter(params[p], expectedProperties[p], p);
  512. if (e)
  513. throw e;
  514. }
  515. },
  516. writeProfilerMark: function OSF_OUtil$writeProfilerMark(text) {
  517. if (window.msWriteProfilerMark) {
  518. window.msWriteProfilerMark(text);
  519. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  520. }
  521. },
  522. outputDebug: function OSF_OUtil$outputDebug(text) {
  523. if (typeof (OsfMsAjaxFactory) !== 'undefined' && OsfMsAjaxFactory.msAjaxDebug && OsfMsAjaxFactory.msAjaxDebug.trace) {
  524. OsfMsAjaxFactory.msAjaxDebug.trace(text);
  525. }
  526. },
  527. defineNondefaultProperty: function OSF_OUtil$defineNondefaultProperty(obj, prop, descriptor, attributes) {
  528. descriptor = descriptor || {};
  529. for (var nd in attributes) {
  530. var attribute = attributes[nd];
  531. if (descriptor[attribute] == undefined) {
  532. descriptor[attribute] = true;
  533. }
  534. }
  535. Object.defineProperty(obj, prop, descriptor);
  536. return obj;
  537. },
  538. defineNondefaultProperties: function OSF_OUtil$defineNondefaultProperties(obj, descriptors, attributes) {
  539. descriptors = descriptors || {};
  540. for (var prop in descriptors) {
  541. OSF.OUtil.defineNondefaultProperty(obj, prop, descriptors[prop], attributes);
  542. }
  543. return obj;
  544. },
  545. defineEnumerableProperty: function OSF_OUtil$defineEnumerableProperty(obj, prop, descriptor) {
  546. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["enumerable"]);
  547. },
  548. defineEnumerableProperties: function OSF_OUtil$defineEnumerableProperties(obj, descriptors) {
  549. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["enumerable"]);
  550. },
  551. defineMutableProperty: function OSF_OUtil$defineMutableProperty(obj, prop, descriptor) {
  552. return OSF.OUtil.defineNondefaultProperty(obj, prop, descriptor, ["writable", "enumerable", "configurable"]);
  553. },
  554. defineMutableProperties: function OSF_OUtil$defineMutableProperties(obj, descriptors) {
  555. return OSF.OUtil.defineNondefaultProperties(obj, descriptors, ["writable", "enumerable", "configurable"]);
  556. },
  557. finalizeProperties: function OSF_OUtil$finalizeProperties(obj, descriptor) {
  558. descriptor = descriptor || {};
  559. var props = Object.getOwnPropertyNames(obj);
  560. var propsLength = props.length;
  561. for (var i = 0; i < propsLength; i++) {
  562. var prop = props[i];
  563. var desc = Object.getOwnPropertyDescriptor(obj, prop);
  564. if (!desc.get && !desc.set) {
  565. desc.writable = descriptor.writable || false;
  566. }
  567. desc.configurable = descriptor.configurable || false;
  568. desc.enumerable = descriptor.enumerable || true;
  569. Object.defineProperty(obj, prop, desc);
  570. }
  571. return obj;
  572. },
  573. mapList: function OSF_OUtil$MapList(list, mapFunction) {
  574. var ret = [];
  575. if (list) {
  576. for (var item in list) {
  577. ret.push(mapFunction(list[item]));
  578. }
  579. }
  580. return ret;
  581. },
  582. listContainsKey: function OSF_OUtil$listContainsKey(list, key) {
  583. for (var item in list) {
  584. if (key == item) {
  585. return true;
  586. }
  587. }
  588. return false;
  589. },
  590. listContainsValue: function OSF_OUtil$listContainsElement(list, value) {
  591. for (var item in list) {
  592. if (value == list[item]) {
  593. return true;
  594. }
  595. }
  596. return false;
  597. },
  598. augmentList: function OSF_OUtil$augmentList(list, addenda) {
  599. var add = list.push ? function (key, value) { list.push(value); } : function (key, value) { list[key] = value; };
  600. for (var key in addenda) {
  601. add(key, addenda[key]);
  602. }
  603. },
  604. redefineList: function OSF_Outil$redefineList(oldList, newList) {
  605. for (var key1 in oldList) {
  606. delete oldList[key1];
  607. }
  608. for (var key2 in newList) {
  609. oldList[key2] = newList[key2];
  610. }
  611. },
  612. isArray: function OSF_OUtil$isArray(obj) {
  613. return Object.prototype.toString.apply(obj) === "[object Array]";
  614. },
  615. isFunction: function OSF_OUtil$isFunction(obj) {
  616. return Object.prototype.toString.apply(obj) === "[object Function]";
  617. },
  618. isDate: function OSF_OUtil$isDate(obj) {
  619. return Object.prototype.toString.apply(obj) === "[object Date]";
  620. },
  621. addEventListener: function OSF_OUtil$addEventListener(element, eventName, listener) {
  622. if (element.addEventListener) {
  623. element.addEventListener(eventName, listener, false);
  624. }
  625. else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.attachEvent) {
  626. element.attachEvent("on" + eventName, listener);
  627. }
  628. else {
  629. element["on" + eventName] = listener;
  630. }
  631. },
  632. removeEventListener: function OSF_OUtil$removeEventListener(element, eventName, listener) {
  633. if (element.removeEventListener) {
  634. element.removeEventListener(eventName, listener, false);
  635. }
  636. else if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && element.detachEvent) {
  637. element.detachEvent("on" + eventName, listener);
  638. }
  639. else {
  640. element["on" + eventName] = null;
  641. }
  642. },
  643. getCookieValue: function OSF_OUtil$getCookieValue(cookieName) {
  644. var tmpCookieString = RegExp(cookieName + "[^;]+").exec(document.cookie);
  645. return tmpCookieString.toString().replace(/^[^=]+./, "");
  646. },
  647. xhrGet: function OSF_OUtil$xhrGet(url, onSuccess, onError) {
  648. var xmlhttp;
  649. try {
  650. xmlhttp = new XMLHttpRequest();
  651. xmlhttp.onreadystatechange = function () {
  652. if (xmlhttp.readyState == 4) {
  653. if (xmlhttp.status == 200) {
  654. onSuccess(xmlhttp.responseText);
  655. }
  656. else {
  657. onError(xmlhttp.status);
  658. }
  659. }
  660. };
  661. xmlhttp.open("GET", url, true);
  662. xmlhttp.send();
  663. }
  664. catch (ex) {
  665. onError(ex);
  666. }
  667. },
  668. xhrGetFull: function OSF_OUtil$xhrGetFull(url, oneDriveFileName, onSuccess, onError) {
  669. var xmlhttp;
  670. var requestedFileName = oneDriveFileName;
  671. try {
  672. xmlhttp = new XMLHttpRequest();
  673. xmlhttp.onreadystatechange = function () {
  674. if (xmlhttp.readyState == 4) {
  675. if (xmlhttp.status == 200) {
  676. onSuccess(xmlhttp, requestedFileName);
  677. }
  678. else {
  679. onError(xmlhttp.status);
  680. }
  681. }
  682. };
  683. xmlhttp.open("GET", url, true);
  684. xmlhttp.send();
  685. }
  686. catch (ex) {
  687. onError(ex);
  688. }
  689. },
  690. encodeBase64: function OSF_Outil$encodeBase64(input) {
  691. if (!input)
  692. return input;
  693. var codex = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/=";
  694. var output = [];
  695. var temp = [];
  696. var index = 0;
  697. var c1, c2, c3, a, b, c;
  698. var i;
  699. var length = input.length;
  700. do {
  701. c1 = input.charCodeAt(index++);
  702. c2 = input.charCodeAt(index++);
  703. c3 = input.charCodeAt(index++);
  704. i = 0;
  705. a = c1 & 255;
  706. b = c1 >> 8;
  707. c = c2 & 255;
  708. temp[i++] = a >> 2;
  709. temp[i++] = ((a & 3) << 4) | (b >> 4);
  710. temp[i++] = ((b & 15) << 2) | (c >> 6);
  711. temp[i++] = c & 63;
  712. if (!isNaN(c2)) {
  713. a = c2 >> 8;
  714. b = c3 & 255;
  715. c = c3 >> 8;
  716. temp[i++] = a >> 2;
  717. temp[i++] = ((a & 3) << 4) | (b >> 4);
  718. temp[i++] = ((b & 15) << 2) | (c >> 6);
  719. temp[i++] = c & 63;
  720. }
  721. if (isNaN(c2)) {
  722. temp[i - 1] = 64;
  723. }
  724. else if (isNaN(c3)) {
  725. temp[i - 2] = 64;
  726. temp[i - 1] = 64;
  727. }
  728. for (var t = 0; t < i; t++) {
  729. output.push(codex.charAt(temp[t]));
  730. }
  731. } while (index < length);
  732. return output.join("");
  733. },
  734. getSessionStorage: function OSF_Outil$getSessionStorage() {
  735. return _getSessionStorage();
  736. },
  737. getLocalStorage: function OSF_Outil$getLocalStorage() {
  738. if (!_safeLocalStorage) {
  739. try {
  740. var localStorage = window.localStorage;
  741. }
  742. catch (ex) {
  743. localStorage = null;
  744. }
  745. _safeLocalStorage = new OfficeExt.SafeStorage(localStorage);
  746. }
  747. return _safeLocalStorage;
  748. },
  749. convertIntToCssHexColor: function OSF_Outil$convertIntToCssHexColor(val) {
  750. var hex = "#" + (Number(val) + 0x1000000).toString(16).slice(-6);
  751. return hex;
  752. },
  753. attachClickHandler: function OSF_Outil$attachClickHandler(element, handler) {
  754. element.onclick = function (e) {
  755. handler();
  756. };
  757. element.ontouchend = function (e) {
  758. handler();
  759. e.preventDefault();
  760. };
  761. },
  762. getQueryStringParamValue: function OSF_Outil$getQueryStringParamValue(queryString, paramName) {
  763. var e = Function._validateParams(arguments, [{ name: "queryString", type: String, mayBeNull: false },
  764. { name: "paramName", type: String, mayBeNull: false }
  765. ]);
  766. if (e) {
  767. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: Parameters cannot be null.");
  768. return "";
  769. }
  770. var queryExp = new RegExp("[\\?&]" + paramName + "=([^&#]*)", "i");
  771. if (!queryExp.test(queryString)) {
  772. OsfMsAjaxFactory.msAjaxDebug.trace("OSF_Outil_getQueryStringParamValue: The parameter is not found.");
  773. return "";
  774. }
  775. return queryExp.exec(queryString)[1];
  776. },
  777. isiOS: function OSF_Outil$isiOS() {
  778. return (window.navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
  779. },
  780. isChrome: function OSF_Outil$isChrome() {
  781. return (window.navigator.userAgent.indexOf("Chrome") > 0) && !OSF.OUtil.isEdge();
  782. },
  783. isEdge: function OSF_Outil$isEdge() {
  784. return window.navigator.userAgent.indexOf("Edge") > 0;
  785. },
  786. isIE: function OSF_Outil$isIE() {
  787. return window.navigator.userAgent.indexOf("Trident") > 0;
  788. },
  789. isFirefox: function OSF_Outil$isFirefox() {
  790. return window.navigator.userAgent.indexOf("Firefox") > 0;
  791. },
  792. shallowCopy: function OSF_Outil$shallowCopy(sourceObj) {
  793. var copyObj = sourceObj.constructor();
  794. for (var property in sourceObj) {
  795. if (sourceObj.hasOwnProperty(property)) {
  796. copyObj[property] = sourceObj[property];
  797. }
  798. }
  799. return copyObj;
  800. },
  801. createObject: function OSF_Outil$createObject(properties) {
  802. var obj = null;
  803. if (properties) {
  804. obj = {};
  805. var len = properties.length;
  806. for (var i = 0; i < len; i++) {
  807. obj[properties[i].name] = properties[i].value;
  808. }
  809. }
  810. return obj;
  811. },
  812. addClass: function OSF_OUtil$addClass(elmt, val) {
  813. if (!OSF.OUtil.hasClass(elmt, val)) {
  814. var className = elmt.getAttribute(_classN);
  815. if (className) {
  816. elmt.setAttribute(_classN, className + " " + val);
  817. }
  818. else {
  819. elmt.setAttribute(_classN, val);
  820. }
  821. }
  822. },
  823. hasClass: function OSF_OUtil$hasClass(elmt, clsName) {
  824. var className = elmt.getAttribute(_classN);
  825. return className && className.match(new RegExp('(\\s|^)' + clsName + '(\\s|$)'));
  826. },
  827. focusToFirstTabbable: function OSF_OUtil$focusToFirstTabbable(all, backward) {
  828. var next;
  829. var focused = false;
  830. var candidate;
  831. var setFlag = function (e) {
  832. focused = true;
  833. };
  834. var findNextPos = function (allLen, currPos, backward) {
  835. if (currPos < 0 || currPos > allLen) {
  836. return -1;
  837. }
  838. else if (currPos === 0 && backward) {
  839. return -1;
  840. }
  841. else if (currPos === allLen - 1 && !backward) {
  842. return -1;
  843. }
  844. if (backward) {
  845. return currPos - 1;
  846. }
  847. else {
  848. return currPos + 1;
  849. }
  850. };
  851. all = _reOrderTabbableElements(all);
  852. next = backward ? all.length - 1 : 0;
  853. if (all.length === 0) {
  854. return null;
  855. }
  856. while (!focused && next >= 0 && next < all.length) {
  857. candidate = all[next];
  858. window.focus();
  859. candidate.addEventListener('focus', setFlag);
  860. candidate.focus();
  861. candidate.removeEventListener('focus', setFlag);
  862. next = findNextPos(all.length, next, backward);
  863. if (!focused && candidate === document.activeElement) {
  864. focused = true;
  865. }
  866. }
  867. if (focused) {
  868. return candidate;
  869. }
  870. else {
  871. return null;
  872. }
  873. },
  874. focusToNextTabbable: function OSF_OUtil$focusToNextTabbable(all, curr, shift) {
  875. var currPos;
  876. var next;
  877. var focused = false;
  878. var candidate;
  879. var setFlag = function (e) {
  880. focused = true;
  881. };
  882. var findCurrPos = function (all, curr) {
  883. var i = 0;
  884. for (; i < all.length; i++) {
  885. if (all[i] === curr) {
  886. return i;
  887. }
  888. }
  889. return -1;
  890. };
  891. var findNextPos = function (allLen, currPos, shift) {
  892. if (currPos < 0 || currPos > allLen) {
  893. return -1;
  894. }
  895. else if (currPos === 0 && shift) {
  896. return -1;
  897. }
  898. else if (currPos === allLen - 1 && !shift) {
  899. return -1;
  900. }
  901. if (shift) {
  902. return currPos - 1;
  903. }
  904. else {
  905. return currPos + 1;
  906. }
  907. };
  908. all = _reOrderTabbableElements(all);
  909. currPos = findCurrPos(all, curr);
  910. next = findNextPos(all.length, currPos, shift);
  911. if (next < 0) {
  912. return null;
  913. }
  914. while (!focused && next >= 0 && next < all.length) {
  915. candidate = all[next];
  916. candidate.addEventListener('focus', setFlag);
  917. candidate.focus();
  918. candidate.removeEventListener('focus', setFlag);
  919. next = findNextPos(all.length, next, shift);
  920. if (!focused && candidate === document.activeElement) {
  921. focused = true;
  922. }
  923. }
  924. if (focused) {
  925. return candidate;
  926. }
  927. else {
  928. return null;
  929. }
  930. }
  931. };
  932. })();
  933. OSF.OUtil.Guid = (function () {
  934. var hexCode = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
  935. return {
  936. generateNewGuid: function OSF_Outil_Guid$generateNewGuid() {
  937. var result = "";
  938. var tick = (new Date()).getTime();
  939. var index = 0;
  940. for (; index < 32 && tick > 0; index++) {
  941. if (index == 8 || index == 12 || index == 16 || index == 20) {
  942. result += "-";
  943. }
  944. result += hexCode[tick % 16];
  945. tick = Math.floor(tick / 16);
  946. }
  947. for (; index < 32; index++) {
  948. if (index == 8 || index == 12 || index == 16 || index == 20) {
  949. result += "-";
  950. }
  951. result += hexCode[Math.floor(Math.random() * 16)];
  952. }
  953. return result;
  954. }
  955. };
  956. })();
  957. window.OSF = OSF;
  958. OSF.OUtil.setNamespace("OSF", window);
  959. OSF.AppName = {
  960. Unsupported: 0,
  961. Excel: 1,
  962. Word: 2,
  963. PowerPoint: 4,
  964. Outlook: 8,
  965. ExcelWebApp: 16,
  966. WordWebApp: 32,
  967. OutlookWebApp: 64,
  968. Project: 128,
  969. AccessWebApp: 256,
  970. PowerpointWebApp: 512,
  971. ExcelIOS: 1024,
  972. Sway: 2048,
  973. WordIOS: 4096,
  974. PowerPointIOS: 8192,
  975. Access: 16384,
  976. Lync: 32768,
  977. OutlookIOS: 65536,
  978. OneNoteWebApp: 131072,
  979. OneNote: 262144,
  980. ExcelWinRT: 524288,
  981. WordWinRT: 1048576,
  982. PowerpointWinRT: 2097152,
  983. OutlookAndroid: 4194304,
  984. OneNoteWinRT: 8388608
  985. };
  986. OSF.InternalPerfMarker = {
  987. DataCoercionBegin: "Agave.HostCall.CoerceDataStart",
  988. DataCoercionEnd: "Agave.HostCall.CoerceDataEnd"
  989. };
  990. OSF.HostCallPerfMarker = {
  991. IssueCall: "Agave.HostCall.IssueCall",
  992. ReceiveResponse: "Agave.HostCall.ReceiveResponse",
  993. RuntimeExceptionRaised: "Agave.HostCall.RuntimeExecptionRaised"
  994. };
  995. OSF.AgaveHostAction = {
  996. "Select": 0,
  997. "UnSelect": 1,
  998. "CancelDialog": 2,
  999. "InsertAgave": 3,
  1000. "CtrlF6In": 4,
  1001. "CtrlF6Exit": 5,
  1002. "CtrlF6ExitShift": 6,
  1003. "SelectWithError": 7,
  1004. "NotifyHostError": 8,
  1005. "RefreshAddinCommands": 9,
  1006. "PageIsReady": 10,
  1007. "TabIn": 11,
  1008. "TabInShift": 12,
  1009. "TabExit": 13,
  1010. "TabExitShift": 14,
  1011. "EscExit": 15,
  1012. "F2Exit": 16,
  1013. "ExitNoFocusable": 17,
  1014. "ExitNoFocusableShift": 18
  1015. };
  1016. OSF.SharedConstants = {
  1017. "NotificationConversationIdSuffix": '_ntf'
  1018. };
  1019. OSF.DialogMessageType = {
  1020. DialogMessageReceived: 0,
  1021. DialogClosed: 12006
  1022. };
  1023. OSF.OfficeAppContext = function OSF_OfficeAppContext(id, appName, appVersion, appUILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, appMinorVersion, requirementMatrix, hostCustomMessage, hostFullVersion, clientWindowHeight, clientWindowWidth, addinName) {
  1024. this._id = id;
  1025. this._appName = appName;
  1026. this._appVersion = appVersion;
  1027. this._appUILocale = appUILocale;
  1028. this._dataLocale = dataLocale;
  1029. this._docUrl = docUrl;
  1030. this._clientMode = clientMode;
  1031. this._settings = settings;
  1032. this._reason = reason;
  1033. this._osfControlType = osfControlType;
  1034. this._eToken = eToken;
  1035. this._correlationId = correlationId;
  1036. this._appInstanceId = appInstanceId;
  1037. this._touchEnabled = touchEnabled;
  1038. this._commerceAllowed = commerceAllowed;
  1039. this._appMinorVersion = appMinorVersion;
  1040. this._requirementMatrix = requirementMatrix;
  1041. this._hostCustomMessage = hostCustomMessage;
  1042. this._hostFullVersion = hostFullVersion;
  1043. this._isDialog = false;
  1044. this._clientWindowHeight = clientWindowHeight;
  1045. this._clientWindowWidth = clientWindowWidth;
  1046. this._addinName = addinName;
  1047. this.get_id = function get_id() { return this._id; };
  1048. this.get_appName = function get_appName() { return this._appName; };
  1049. this.get_appVersion = function get_appVersion() { return this._appVersion; };
  1050. this.get_appUILocale = function get_appUILocale() { return this._appUILocale; };
  1051. this.get_dataLocale = function get_dataLocale() { return this._dataLocale; };
  1052. this.get_docUrl = function get_docUrl() { return this._docUrl; };
  1053. this.get_clientMode = function get_clientMode() { return this._clientMode; };
  1054. this.get_bindings = function get_bindings() { return this._bindings; };
  1055. this.get_settings = function get_settings() { return this._settings; };
  1056. this.get_reason = function get_reason() { return this._reason; };
  1057. this.get_osfControlType = function get_osfControlType() { return this._osfControlType; };
  1058. this.get_eToken = function get_eToken() { return this._eToken; };
  1059. this.get_correlationId = function get_correlationId() { return this._correlationId; };
  1060. this.get_appInstanceId = function get_appInstanceId() { return this._appInstanceId; };
  1061. this.get_touchEnabled = function get_touchEnabled() { return this._touchEnabled; };
  1062. this.get_commerceAllowed = function get_commerceAllowed() { return this._commerceAllowed; };
  1063. this.get_appMinorVersion = function get_appMinorVersion() { return this._appMinorVersion; };
  1064. this.get_requirementMatrix = function get_requirementMatrix() { return this._requirementMatrix; };
  1065. this.get_hostCustomMessage = function get_hostCustomMessage() { return this._hostCustomMessage; };
  1066. this.get_hostFullVersion = function get_hostFullVersion() { return this._hostFullVersion; };
  1067. this.get_isDialog = function get_isDialog() { return this._isDialog; };
  1068. this.get_clientWindowHeight = function get_clientWindowHeight() { return this._clientWindowHeight; };
  1069. this.get_clientWindowWidth = function get_clientWindowWidth() { return this._clientWindowWidth; };
  1070. this.get_addinName = function get_addinName() { return this._addinName; };
  1071. };
  1072. OSF.OsfControlType = {
  1073. DocumentLevel: 0,
  1074. ContainerLevel: 1
  1075. };
  1076. OSF.ClientMode = {
  1077. ReadOnly: 0,
  1078. ReadWrite: 1
  1079. };
  1080. OSF.OUtil.setNamespace("Microsoft", window);
  1081. OSF.OUtil.setNamespace("Office", Microsoft);
  1082. OSF.OUtil.setNamespace("Client", Microsoft.Office);
  1083. OSF.OUtil.setNamespace("WebExtension", Microsoft.Office);
  1084. Microsoft.Office.WebExtension.InitializationReason = {
  1085. Inserted: "inserted",
  1086. DocumentOpened: "documentOpened"
  1087. };
  1088. Microsoft.Office.WebExtension.ValueFormat = {
  1089. Unformatted: "unformatted",
  1090. Formatted: "formatted"
  1091. };
  1092. Microsoft.Office.WebExtension.FilterType = {
  1093. All: "all"
  1094. };
  1095. Microsoft.Office.WebExtension.Parameters = {
  1096. BindingType: "bindingType",
  1097. CoercionType: "coercionType",
  1098. ValueFormat: "valueFormat",
  1099. FilterType: "filterType",
  1100. Columns: "columns",
  1101. SampleData: "sampleData",
  1102. GoToType: "goToType",
  1103. SelectionMode: "selectionMode",
  1104. Id: "id",
  1105. PromptText: "promptText",
  1106. ItemName: "itemName",
  1107. FailOnCollision: "failOnCollision",
  1108. StartRow: "startRow",
  1109. StartColumn: "startColumn",
  1110. RowCount: "rowCount",
  1111. ColumnCount: "columnCount",
  1112. Callback: "callback",
  1113. AsyncContext: "asyncContext",
  1114. Data: "data",
  1115. Rows: "rows",
  1116. OverwriteIfStale: "overwriteIfStale",
  1117. FileType: "fileType",
  1118. EventType: "eventType",
  1119. Handler: "handler",
  1120. SliceSize: "sliceSize",
  1121. SliceIndex: "sliceIndex",
  1122. ActiveView: "activeView",
  1123. Status: "status",
  1124. Xml: "xml",
  1125. Namespace: "namespace",
  1126. Prefix: "prefix",
  1127. XPath: "xPath",
  1128. Text: "text",
  1129. ImageLeft: "imageLeft",
  1130. ImageTop: "imageTop",
  1131. ImageWidth: "imageWidth",
  1132. ImageHeight: "imageHeight",
  1133. TaskId: "taskId",
  1134. FieldId: "fieldId",
  1135. FieldValue: "fieldValue",
  1136. ServerUrl: "serverUrl",
  1137. ListName: "listName",
  1138. ResourceId: "resourceId",
  1139. ViewType: "viewType",
  1140. ViewName: "viewName",
  1141. GetRawValue: "getRawValue",
  1142. CellFormat: "cellFormat",
  1143. TableOptions: "tableOptions",
  1144. TaskIndex: "taskIndex",
  1145. ResourceIndex: "resourceIndex",
  1146. CustomFieldId: "customFieldId",
  1147. Url: "url",
  1148. MessageHandler: "messageHandler",
  1149. Width: "width",
  1150. Height: "height",
  1151. RequireHTTPs: "requireHTTPS",
  1152. MessageToParent: "messageToParent",
  1153. DisplayInIframe: "displayInIframe"
  1154. };
  1155. OSF.OUtil.setNamespace("DDA", OSF);
  1156. OSF.DDA.DocumentMode = {
  1157. ReadOnly: 1,
  1158. ReadWrite: 0
  1159. };
  1160. OSF.DDA.PropertyDescriptors = {
  1161. AsyncResultStatus: "AsyncResultStatus"
  1162. };
  1163. OSF.DDA.EventDescriptors = {};
  1164. OSF.DDA.ListDescriptors = {};
  1165. OSF.DDA.UI = {};
  1166. OSF.DDA.getXdmEventName = function OSF_DDA$GetXdmEventName(id, eventType) {
  1167. if (eventType == Microsoft.Office.WebExtension.EventType.BindingSelectionChanged ||
  1168. eventType == Microsoft.Office.WebExtension.EventType.BindingDataChanged ||
  1169. eventType == Microsoft.Office.WebExtension.EventType.DataNodeDeleted ||
  1170. eventType == Microsoft.Office.WebExtension.EventType.DataNodeInserted ||
  1171. eventType == Microsoft.Office.WebExtension.EventType.DataNodeReplaced) {
  1172. return id + "_" + eventType;
  1173. }
  1174. else {
  1175. return eventType;
  1176. }
  1177. };
  1178. OSF.DDA.MethodDispId = {
  1179. dispidMethodMin: 64,
  1180. dispidGetSelectedDataMethod: 64,
  1181. dispidSetSelectedDataMethod: 65,
  1182. dispidAddBindingFromSelectionMethod: 66,
  1183. dispidAddBindingFromPromptMethod: 67,
  1184. dispidGetBindingMethod: 68,
  1185. dispidReleaseBindingMethod: 69,
  1186. dispidGetBindingDataMethod: 70,
  1187. dispidSetBindingDataMethod: 71,
  1188. dispidAddRowsMethod: 72,
  1189. dispidClearAllRowsMethod: 73,
  1190. dispidGetAllBindingsMethod: 74,
  1191. dispidLoadSettingsMethod: 75,
  1192. dispidSaveSettingsMethod: 76,
  1193. dispidGetDocumentCopyMethod: 77,
  1194. dispidAddBindingFromNamedItemMethod: 78,
  1195. dispidAddColumnsMethod: 79,
  1196. dispidGetDocumentCopyChunkMethod: 80,
  1197. dispidReleaseDocumentCopyMethod: 81,
  1198. dispidNavigateToMethod: 82,
  1199. dispidGetActiveViewMethod: 83,
  1200. dispidGetDocumentThemeMethod: 84,
  1201. dispidGetOfficeThemeMethod: 85,
  1202. dispidGetFilePropertiesMethod: 86,
  1203. dispidClearFormatsMethod: 87,
  1204. dispidSetTableOptionsMethod: 88,
  1205. dispidSetFormatsMethod: 89,
  1206. dispidExecuteRichApiRequestMethod: 93,
  1207. dispidAppCommandInvocationCompletedMethod: 94,
  1208. dispidCloseContainerMethod: 97,
  1209. dispidAddDataPartMethod: 128,
  1210. dispidGetDataPartByIdMethod: 129,
  1211. dispidGetDataPartsByNamespaceMethod: 130,
  1212. dispidGetDataPartXmlMethod: 131,
  1213. dispidGetDataPartNodesMethod: 132,
  1214. dispidDeleteDataPartMethod: 133,
  1215. dispidGetDataNodeValueMethod: 134,
  1216. dispidGetDataNodeXmlMethod: 135,
  1217. dispidGetDataNodesMethod: 136,
  1218. dispidSetDataNodeValueMethod: 137,
  1219. dispidSetDataNodeXmlMethod: 138,
  1220. dispidAddDataNamespaceMethod: 139,
  1221. dispidGetDataUriByPrefixMethod: 140,
  1222. dispidGetDataPrefixByUriMethod: 141,
  1223. dispidGetDataNodeTextMethod: 142,
  1224. dispidSetDataNodeTextMethod: 143,
  1225. dispidMessageParentMethod: 144,
  1226. dispidMethodMax: 144,
  1227. dispidGetSelectedTaskMethod: 110,
  1228. dispidGetSelectedResourceMethod: 111,
  1229. dispidGetTaskMethod: 112,
  1230. dispidGetResourceFieldMethod: 113,
  1231. dispidGetWSSUrlMethod: 114,
  1232. dispidGetTaskFieldMethod: 115,
  1233. dispidGetProjectFieldMethod: 116,
  1234. dispidGetSelectedViewMethod: 117,
  1235. dispidGetTaskByIndexMethod: 118,
  1236. dispidGetResourceByIndexMethod: 119,
  1237. dispidSetTaskFieldMethod: 120,
  1238. dispidSetResourceFieldMethod: 121,
  1239. dispidGetMaxTaskIndexMethod: 122,
  1240. dispidGetMaxResourceIndexMethod: 123,
  1241. dispidCreateTaskMethod: 124
  1242. };
  1243. OSF.DDA.EventDispId = {
  1244. dispidEventMin: 0,
  1245. dispidInitializeEvent: 0,
  1246. dispidSettingsChangedEvent: 1,
  1247. dispidDocumentSelectionChangedEvent: 2,
  1248. dispidBindingSelectionChangedEvent: 3,
  1249. dispidBindingDataChangedEvent: 4,
  1250. dispidDocumentOpenEvent: 5,
  1251. dispidDocumentCloseEvent: 6,
  1252. dispidActiveViewChangedEvent: 7,
  1253. dispidDocumentThemeChangedEvent: 8,
  1254. dispidOfficeThemeChangedEvent: 9,
  1255. dispidDialogMessageReceivedEvent: 10,
  1256. dispidDialogNotificationShownInAddinEvent: 11,
  1257. dispidActivationStatusChangedEvent: 32,
  1258. dispidAppCommandInvokedEvent: 39,
  1259. dispidOlkItemSelectedChangedEvent: 46,
  1260. dispidTaskSelectionChangedEvent: 56,
  1261. dispidResourceSelectionChangedEvent: 57,
  1262. dispidViewSelectionChangedEvent: 58,
  1263. dispidDataNodeAddedEvent: 60,
  1264. dispidDataNodeReplacedEvent: 61,
  1265. dispidDataNodeDeletedEvent: 62,
  1266. dispidEventMax: 63
  1267. };
  1268. OSF.DDA.ErrorCodeManager = (function () {
  1269. var _errorMappings = {};
  1270. return {
  1271. getErrorArgs: function OSF_DDA_ErrorCodeManager$getErrorArgs(errorCode) {
  1272. var errorArgs = _errorMappings[errorCode];
  1273. if (!errorArgs) {
  1274. errorArgs = _errorMappings[this.errorCodes.ooeInternalError];
  1275. }
  1276. else {
  1277. if (!errorArgs.name) {
  1278. errorArgs.name = _errorMappings[this.errorCodes.ooeInternalError].name;
  1279. }
  1280. if (!errorArgs.message) {
  1281. errorArgs.message = _errorMappings[this.errorCodes.ooeInternalError].message;
  1282. }
  1283. }
  1284. return errorArgs;
  1285. },
  1286. addErrorMessage: function OSF_DDA_ErrorCodeManager$addErrorMessage(errorCode, errorNameMessage) {
  1287. _errorMappings[errorCode] = errorNameMessage;
  1288. },
  1289. errorCodes: {
  1290. ooeSuccess: 0,
  1291. ooeChunkResult: 1,
  1292. ooeCoercionTypeNotSupported: 1000,
  1293. ooeGetSelectionNotMatchDataType: 1001,
  1294. ooeCoercionTypeNotMatchBinding: 1002,
  1295. ooeInvalidGetRowColumnCounts: 1003,
  1296. ooeSelectionNotSupportCoercionType: 1004,
  1297. ooeInvalidGetStartRowColumn: 1005,
  1298. ooeNonUniformPartialGetNotSupported: 1006,
  1299. ooeGetDataIsTooLarge: 1008,
  1300. ooeFileTypeNotSupported: 1009,
  1301. ooeGetDataParametersConflict: 1010,
  1302. ooeInvalidGetColumns: 1011,
  1303. ooeInvalidGetRows: 1012,
  1304. ooeInvalidReadForBlankRow: 1013,
  1305. ooeUnsupportedDataObject: 2000,
  1306. ooeCannotWriteToSelection: 2001,
  1307. ooeDataNotMatchSelection: 2002,
  1308. ooeOverwriteWorksheetData: 2003,
  1309. ooeDataNotMatchBindingSize: 2004,
  1310. ooeInvalidSetStartRowColumn: 2005,
  1311. ooeInvalidDataFormat: 2006,
  1312. ooeDataNotMatchCoercionType: 2007,
  1313. ooeDataNotMatchBindingType: 2008,
  1314. ooeSetDataIsTooLarge: 2009,
  1315. ooeNonUniformPartialSetNotSupported: 2010,
  1316. ooeInvalidSetColumns: 2011,
  1317. ooeInvalidSetRows: 2012,
  1318. ooeSetDataParametersConflict: 2013,
  1319. ooeCellDataAmountBeyondLimits: 2014,
  1320. ooeSelectionCannotBound: 3000,
  1321. ooeBindingNotExist: 3002,
  1322. ooeBindingToMultipleSelection: 3003,
  1323. ooeInvalidSelectionForBindingType: 3004,
  1324. ooeOperationNotSupportedOnThisBindingType: 3005,
  1325. ooeNamedItemNotFound: 3006,
  1326. ooeMultipleNamedItemFound: 3007,
  1327. ooeInvalidNamedItemForBindingType: 3008,
  1328. ooeUnknownBindingType: 3009,
  1329. ooeOperationNotSupportedOnMatrixData: 3010,
  1330. ooeInvalidColumnsForBinding: 3011,
  1331. ooeSettingNameNotExist: 4000,
  1332. ooeSettingsCannotSave: 4001,
  1333. ooeSettingsAreStale: 4002,
  1334. ooeOperationNotSupported: 5000,
  1335. ooeInternalError: 5001,
  1336. ooeDocumentReadOnly: 5002,
  1337. ooeEventHandlerNotExist: 5003,
  1338. ooeInvalidApiCallInContext: 5004,
  1339. ooeShuttingDown: 5005,
  1340. ooeUnsupportedEnumeration: 5007,
  1341. ooeIndexOutOfRange: 5008,
  1342. ooeBrowserAPINotSupported: 5009,
  1343. ooeInvalidParam: 5010,
  1344. ooeRequestTimeout: 5011,
  1345. ooeTooManyIncompleteRequests: 5100,
  1346. ooeRequestTokenUnavailable: 5101,
  1347. ooeActivityLimitReached: 5102,
  1348. ooeCustomXmlNodeNotFound: 6000,
  1349. ooeCustomXmlError: 6100,
  1350. ooeCustomXmlExceedQuota: 6101,
  1351. ooeCustomXmlOutOfDate: 6102,
  1352. ooeNoCapability: 7000,
  1353. ooeCannotNavTo: 7001,
  1354. ooeSpecifiedIdNotExist: 7002,
  1355. ooeNavOutOfBound: 7004,
  1356. ooeElementMissing: 8000,
  1357. ooeProtectedError: 8001,
  1358. ooeInvalidCellsValue: 8010,
  1359. ooeInvalidTableOptionValue: 8011,
  1360. ooeInvalidFormatValue: 8012,
  1361. ooeRowIndexOutOfRange: 8020,
  1362. ooeColIndexOutOfRange: 8021,
  1363. ooeFormatValueOutOfRange: 8022,
  1364. ooeCellFormatAmountBeyondLimits: 8023,
  1365. ooeMemoryFileLimit: 11000,
  1366. ooeNetworkProblemRetrieveFile: 11001,
  1367. ooeInvalidSliceSize: 11002,
  1368. ooeInvalidCallback: 11101,
  1369. ooeInvalidWidth: 12000,
  1370. ooeInvalidHeight: 12001,
  1371. ooeNavigationError: 12002,
  1372. ooeInvalidScheme: 12003,
  1373. ooeAppDomains: 12004,
  1374. ooeRequireHTTPS: 12005,
  1375. ooeWebDialogClosed: 12006,
  1376. ooeDialogAlreadyOpened: 12007,
  1377. ooeEndUserAllow: 12008,
  1378. ooeEndUserIgnore: 12009
  1379. },
  1380. initializeErrorMessages: function OSF_DDA_ErrorCodeManager$initializeErrorMessages(stringNS) {
  1381. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotSupported] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotSupported };
  1382. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetSelectionNotMatchDataType] = { name: stringNS.L_DataReadError, message: stringNS.L_GetSelectionNotSupported };
  1383. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCoercionTypeNotMatchBinding] = { name: stringNS.L_InvalidCoercion, message: stringNS.L_CoercionTypeNotMatchBinding };
  1384. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRowColumnCounts] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRowColumnCounts };
  1385. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionNotSupportCoercionType] = { name: stringNS.L_DataReadError, message: stringNS.L_SelectionNotSupportCoercionType };
  1386. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetStartRowColumn] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetStartRowColumn };
  1387. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialGetNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_NonUniformPartialGetNotSupported };
  1388. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataIsTooLarge] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataIsTooLarge };
  1389. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFileTypeNotSupported] = { name: stringNS.L_DataReadError, message: stringNS.L_FileTypeNotSupported };
  1390. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeGetDataParametersConflict] = { name: stringNS.L_DataReadError, message: stringNS.L_GetDataParametersConflict };
  1391. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetColumns] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetColumns };
  1392. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidGetRows] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidGetRows };
  1393. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidReadForBlankRow] = { name: stringNS.L_DataReadError, message: stringNS.L_InvalidReadForBlankRow };
  1394. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject] = { name: stringNS.L_DataWriteError, message: stringNS.L_UnsupportedDataObject };
  1395. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotWriteToSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_CannotWriteToSelection };
  1396. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchSelection] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchSelection };
  1397. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOverwriteWorksheetData] = { name: stringNS.L_DataWriteError, message: stringNS.L_OverwriteWorksheetData };
  1398. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingSize] = { name: stringNS.L_DataWriteError, message: stringNS.L_DataNotMatchBindingSize };
  1399. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetStartRowColumn] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetStartRowColumn };
  1400. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidDataFormat] = { name: stringNS.L_InvalidFormat, message: stringNS.L_InvalidDataFormat };
  1401. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchCoercionType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchCoercionType };
  1402. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDataNotMatchBindingType] = { name: stringNS.L_InvalidDataObject, message: stringNS.L_DataNotMatchBindingType };
  1403. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataIsTooLarge] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataIsTooLarge };
  1404. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNonUniformPartialSetNotSupported] = { name: stringNS.L_DataWriteError, message: stringNS.L_NonUniformPartialSetNotSupported };
  1405. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetColumns] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetColumns };
  1406. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSetRows] = { name: stringNS.L_DataWriteError, message: stringNS.L_InvalidSetRows };
  1407. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSetDataParametersConflict] = { name: stringNS.L_DataWriteError, message: stringNS.L_SetDataParametersConflict };
  1408. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSelectionCannotBound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_SelectionCannotBound };
  1409. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingNotExist] = { name: stringNS.L_InvalidBindingError, message: stringNS.L_BindingNotExist };
  1410. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBindingToMultipleSelection] = { name: stringNS.L_BindingCreationError, message: stringNS.L_BindingToMultipleSelection };
  1411. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSelectionForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidSelectionForBindingType };
  1412. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnThisBindingType] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnThisBindingType };
  1413. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNamedItemNotFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_NamedItemNotFound };
  1414. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMultipleNamedItemFound] = { name: stringNS.L_BindingCreationError, message: stringNS.L_MultipleNamedItemFound };
  1415. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidNamedItemForBindingType] = { name: stringNS.L_BindingCreationError, message: stringNS.L_InvalidNamedItemForBindingType };
  1416. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnknownBindingType] = { name: stringNS.L_InvalidBinding, message: stringNS.L_UnknownBindingType };
  1417. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupportedOnMatrixData] = { name: stringNS.L_InvalidBindingOperation, message: stringNS.L_OperationNotSupportedOnMatrixData };
  1418. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidColumnsForBinding] = { name: stringNS.L_InvalidBinding, message: stringNS.L_InvalidColumnsForBinding };
  1419. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingNameNotExist] = { name: stringNS.L_ReadSettingsError, message: stringNS.L_SettingNameNotExist };
  1420. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsCannotSave] = { name: stringNS.L_SaveSettingsError, message: stringNS.L_SettingsCannotSave };
  1421. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSettingsAreStale] = { name: stringNS.L_SettingsStaleError, message: stringNS.L_SettingsAreStale };
  1422. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeOperationNotSupported] = { name: stringNS.L_HostError, message: stringNS.L_OperationNotSupported };
  1423. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError] = { name: stringNS.L_InternalError, message: stringNS.L_InternalErrorDescription };
  1424. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDocumentReadOnly] = { name: stringNS.L_PermissionDenied, message: stringNS.L_DocumentReadOnly };
  1425. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist] = { name: stringNS.L_EventRegistrationError, message: stringNS.L_EventHandlerNotExist };
  1426. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext] = { name: stringNS.L_InvalidAPICall, message: stringNS.L_InvalidApiCallInContext };
  1427. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeShuttingDown] = { name: stringNS.L_ShuttingDown, message: stringNS.L_ShuttingDown };
  1428. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration] = { name: stringNS.L_UnsupportedEnumeration, message: stringNS.L_UnsupportedEnumerationMessage };
  1429. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeIndexOutOfRange] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1430. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeBrowserAPINotSupported] = { name: stringNS.L_APINotSupported, message: stringNS.L_BrowserAPINotSupported };
  1431. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTimeout] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTimeout };
  1432. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeTooManyIncompleteRequests] = { name: stringNS.L_APICallFailed, message: stringNS.L_TooManyIncompleteRequests };
  1433. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequestTokenUnavailable] = { name: stringNS.L_APICallFailed, message: stringNS.L_RequestTokenUnavailable };
  1434. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeActivityLimitReached] = { name: stringNS.L_APICallFailed, message: stringNS.L_ActivityLimitReached };
  1435. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlNodeNotFound] = { name: stringNS.L_InvalidNode, message: stringNS.L_CustomXmlNodeNotFound };
  1436. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlError] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1437. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlExceedQuota] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1438. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCustomXmlOutOfDate] = { name: stringNS.L_CustomXmlError, message: stringNS.L_CustomXmlError };
  1439. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1440. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCannotNavTo] = { name: stringNS.L_CannotNavigateTo, message: stringNS.L_CannotNavigateTo };
  1441. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeSpecifiedIdNotExist] = { name: stringNS.L_SpecifiedIdNotExist, message: stringNS.L_SpecifiedIdNotExist };
  1442. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavOutOfBound] = { name: stringNS.L_NavOutOfBound, message: stringNS.L_NavOutOfBound };
  1443. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellDataAmountBeyondLimits] = { name: stringNS.L_DataWriteReminder, message: stringNS.L_CellDataAmountBeyondLimits };
  1444. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeElementMissing] = { name: stringNS.L_MissingParameter, message: stringNS.L_ElementMissing };
  1445. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeProtectedError] = { name: stringNS.L_PermissionDenied, message: stringNS.L_NoCapability };
  1446. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidCellsValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidCellsValue };
  1447. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidTableOptionValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidTableOptionValue };
  1448. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidFormatValue] = { name: stringNS.L_InvalidValue, message: stringNS.L_InvalidFormatValue };
  1449. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRowIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_RowIndexOutOfRange };
  1450. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeColIndexOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_ColIndexOutOfRange };
  1451. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeFormatValueOutOfRange] = { name: stringNS.L_OutOfRange, message: stringNS.L_FormatValueOutOfRange };
  1452. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeCellFormatAmountBeyondLimits] = { name: stringNS.L_FormattingReminder, message: stringNS.L_CellFormatAmountBeyondLimits };
  1453. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeMemoryFileLimit] = { name: stringNS.L_MemoryLimit, message: stringNS.L_CloseFileBeforeRetrieve };
  1454. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNetworkProblemRetrieveFile] = { name: stringNS.L_NetworkProblem, message: stringNS.L_NetworkProblemRetrieveFile };
  1455. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidSliceSize] = { name: stringNS.L_InvalidValue, message: stringNS.L_SliceSizeNotSupported };
  1456. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened] = { name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAlreadyOpened };
  1457. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidWidth] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1458. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidHeight] = { name: stringNS.L_IndexOutOfRange, message: stringNS.L_IndexOutOfRange };
  1459. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeNavigationError] = { name: stringNS.L_DisplayDialogError, message: stringNS.L_NetworkProblem };
  1460. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidScheme] = { name: stringNS.L_DialogNavigateError, message: stringNS.L_DialogAddressNotTrusted };
  1461. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeAppDomains] = { name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1462. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeRequireHTTPS] = { name: stringNS.L_DisplayDialogError, message: stringNS.L_DialogAddressNotTrusted };
  1463. _errorMappings[OSF.DDA.ErrorCodeManager.errorCodes.ooeEndUserIgnore] = { name: stringNS.L_DisplayDialogError, message: stringNS.L_UserClickIgnore };
  1464. }
  1465. };
  1466. })();
  1467. var OfficeExt;
  1468. (function (OfficeExt) {
  1469. var Requirement;
  1470. (function (Requirement) {
  1471. var RequirementMatrix = (function () {
  1472. function RequirementMatrix(_setMap) {
  1473. this.isSetSupported = function _isSetSupported(name, minVersion) {
  1474. if (name == undefined) {
  1475. return false;
  1476. }
  1477. if (minVersion == undefined) {
  1478. minVersion = 0;
  1479. }
  1480. var setSupportArray = this._setMap;
  1481. var sets = setSupportArray._sets;
  1482. if (sets.hasOwnProperty(name.toLowerCase())) {
  1483. var setMaxVersion = sets[name.toLowerCase()];
  1484. return setMaxVersion > 0 && setMaxVersion >= minVersion;
  1485. }
  1486. else {
  1487. return false;
  1488. }
  1489. };
  1490. this._setMap = _setMap;
  1491. }
  1492. return RequirementMatrix;
  1493. })();
  1494. Requirement.RequirementMatrix = RequirementMatrix;
  1495. var DefaultSetRequirement = (function () {
  1496. function DefaultSetRequirement(setMap) {
  1497. this._addSetMap = function DefaultSetRequirement_addSetMap(addedSet) {
  1498. for (var name in addedSet) {
  1499. this._sets[name] = addedSet[name];
  1500. }
  1501. };
  1502. this._sets = setMap;
  1503. }
  1504. return DefaultSetRequirement;
  1505. })();
  1506. Requirement.DefaultSetRequirement = DefaultSetRequirement;
  1507. var ExcelClientDefaultSetRequirement = (function (_super) {
  1508. __extends(ExcelClientDefaultSetRequirement, _super);
  1509. function ExcelClientDefaultSetRequirement() {
  1510. _super.call(this, {
  1511. "bindingevents": 1.1,
  1512. "documentevents": 1.1,
  1513. "excelapi": 1.1,
  1514. "matrixbindings": 1.1,
  1515. "matrixcoercion": 1.1,
  1516. "selection": 1.1,
  1517. "settings": 1.1,
  1518. "tablebindings": 1.1,
  1519. "tablecoercion": 1.1,
  1520. "textbindings": 1.1,
  1521. "textcoercion": 1.1
  1522. });
  1523. }
  1524. return ExcelClientDefaultSetRequirement;
  1525. })(DefaultSetRequirement);
  1526. Requirement.ExcelClientDefaultSetRequirement = ExcelClientDefaultSetRequirement;
  1527. var ExcelClientV1DefaultSetRequirement = (function (_super) {
  1528. __extends(ExcelClientV1DefaultSetRequirement, _super);
  1529. function ExcelClientV1DefaultSetRequirement() {
  1530. _super.call(this);
  1531. this._addSetMap({
  1532. "imagecoercion": 1.1
  1533. });
  1534. }
  1535. return ExcelClientV1DefaultSetRequirement;
  1536. })(ExcelClientDefaultSetRequirement);
  1537. Requirement.ExcelClientV1DefaultSetRequirement = ExcelClientV1DefaultSetRequirement;
  1538. var OutlookClientDefaultSetRequirement = (function (_super) {
  1539. __extends(OutlookClientDefaultSetRequirement, _super);
  1540. function OutlookClientDefaultSetRequirement() {
  1541. _super.call(this, {
  1542. "mailbox": 1.3
  1543. });
  1544. }
  1545. return OutlookClientDefaultSetRequirement;
  1546. })(DefaultSetRequirement);
  1547. Requirement.OutlookClientDefaultSetRequirement = OutlookClientDefaultSetRequirement;
  1548. var WordClientDefaultSetRequirement = (function (_super) {
  1549. __extends(WordClientDefaultSetRequirement, _super);
  1550. function WordClientDefaultSetRequirement() {
  1551. _super.call(this, {
  1552. "bindingevents": 1.1,
  1553. "compressedfile": 1.1,
  1554. "customxmlparts": 1.1,
  1555. "documentevents": 1.1,
  1556. "file": 1.1,
  1557. "htmlcoercion": 1.1,
  1558. "matrixbindings": 1.1,
  1559. "matrixcoercion": 1.1,
  1560. "ooxmlcoercion": 1.1,
  1561. "pdffile": 1.1,
  1562. "selection": 1.1,
  1563. "settings": 1.1,
  1564. "tablebindings": 1.1,
  1565. "tablecoercion": 1.1,
  1566. "textbindings": 1.1,
  1567. "textcoercion": 1.1,
  1568. "textfile": 1.1,
  1569. "wordapi": 1.1
  1570. });
  1571. }
  1572. return WordClientDefaultSetRequirement;
  1573. })(DefaultSetRequirement);
  1574. Requirement.WordClientDefaultSetRequirement = WordClientDefaultSetRequirement;
  1575. var WordClientV1DefaultSetRequirement = (function (_super) {
  1576. __extends(WordClientV1DefaultSetRequirement, _super);
  1577. function WordClientV1DefaultSetRequirement() {
  1578. _super.call(this);
  1579. this._addSetMap({
  1580. "customxmlparts": 1.2,
  1581. "wordapi": 1.2,
  1582. "imagecoercion": 1.1
  1583. });
  1584. }
  1585. return WordClientV1DefaultSetRequirement;
  1586. })(WordClientDefaultSetRequirement);
  1587. Requirement.WordClientV1DefaultSetRequirement = WordClientV1DefaultSetRequirement;
  1588. var PowerpointClientDefaultSetRequirement = (function (_super) {
  1589. __extends(PowerpointClientDefaultSetRequirement, _super);
  1590. function PowerpointClientDefaultSetRequirement() {
  1591. _super.call(this, {
  1592. "activeview": 1.1,
  1593. "compressedfile": 1.1,
  1594. "documentevents": 1.1,
  1595. "file": 1.1,
  1596. "pdffile": 1.1,
  1597. "selection": 1.1,
  1598. "settings": 1.1,
  1599. "textcoercion": 1.1
  1600. });
  1601. }
  1602. return PowerpointClientDefaultSetRequirement;
  1603. })(DefaultSetRequirement);
  1604. Requirement.PowerpointClientDefaultSetRequirement = PowerpointClientDefaultSetRequirement;
  1605. var PowerpointClientV1DefaultSetRequirement = (function (_super) {
  1606. __extends(PowerpointClientV1DefaultSetRequirement, _super);
  1607. function PowerpointClientV1DefaultSetRequirement() {
  1608. _super.call(this);
  1609. this._addSetMap({
  1610. "imagecoercion": 1.1
  1611. });
  1612. }
  1613. return PowerpointClientV1DefaultSetRequirement;
  1614. })(PowerpointClientDefaultSetRequirement);
  1615. Requirement.PowerpointClientV1DefaultSetRequirement = PowerpointClientV1DefaultSetRequirement;
  1616. var ProjectClientDefaultSetRequirement = (function (_super) {
  1617. __extends(ProjectClientDefaultSetRequirement, _super);
  1618. function ProjectClientDefaultSetRequirement() {
  1619. _super.call(this, {
  1620. "selection": 1.1,
  1621. "textcoercion": 1.1
  1622. });
  1623. }
  1624. return ProjectClientDefaultSetRequirement;
  1625. })(DefaultSetRequirement);
  1626. Requirement.ProjectClientDefaultSetRequirement = ProjectClientDefaultSetRequirement;
  1627. var ExcelWebDefaultSetRequirement = (function (_super) {
  1628. __extends(ExcelWebDefaultSetRequirement, _super);
  1629. function ExcelWebDefaultSetRequirement() {
  1630. _super.call(this, {
  1631. "bindingevents": 1.1,
  1632. "documentevents": 1.1,
  1633. "matrixbindings": 1.1,
  1634. "matrixcoercion": 1.1,
  1635. "selection": 1.1,
  1636. "settings": 1.1,
  1637. "tablebindings": 1.1,
  1638. "tablecoercion": 1.1,
  1639. "textbindings": 1.1,
  1640. "textcoercion": 1.1,
  1641. "file": 1.1
  1642. });
  1643. }
  1644. return ExcelWebDefaultSetRequirement;
  1645. })(DefaultSetRequirement);
  1646. Requirement.ExcelWebDefaultSetRequirement = ExcelWebDefaultSetRequirement;
  1647. var WordWebDefaultSetRequirement = (function (_super) {
  1648. __extends(WordWebDefaultSetRequirement, _super);
  1649. function WordWebDefaultSetRequirement() {
  1650. _super.call(this, {
  1651. "customxmlparts": 1.1,
  1652. "documentevents": 1.1,
  1653. "file": 1.1,
  1654. "ooxmlcoercion": 1.1,
  1655. "selection": 1.1,
  1656. "settings": 1.1,
  1657. "textcoercion": 1.1
  1658. });
  1659. }
  1660. return WordWebDefaultSetRequirement;
  1661. })(DefaultSetRequirement);
  1662. Requirement.WordWebDefaultSetRequirement = WordWebDefaultSetRequirement;
  1663. var PowerpointWebDefaultSetRequirement = (function (_super) {
  1664. __extends(PowerpointWebDefaultSetRequirement, _super);
  1665. function PowerpointWebDefaultSetRequirement() {
  1666. _super.call(this, {
  1667. "activeview": 1.1,
  1668. "settings": 1.1
  1669. });
  1670. }
  1671. return PowerpointWebDefaultSetRequirement;
  1672. })(DefaultSetRequirement);
  1673. Requirement.PowerpointWebDefaultSetRequirement = PowerpointWebDefaultSetRequirement;
  1674. var OutlookWebDefaultSetRequirement = (function (_super) {
  1675. __extends(OutlookWebDefaultSetRequirement, _super);
  1676. function OutlookWebDefaultSetRequirement() {
  1677. _super.call(this, {
  1678. "mailbox": 1.3
  1679. });
  1680. }
  1681. return OutlookWebDefaultSetRequirement;
  1682. })(DefaultSetRequirement);
  1683. Requirement.OutlookWebDefaultSetRequirement = OutlookWebDefaultSetRequirement;
  1684. var SwayWebDefaultSetRequirement = (function (_super) {
  1685. __extends(SwayWebDefaultSetRequirement, _super);
  1686. function SwayWebDefaultSetRequirement() {
  1687. _super.call(this, {
  1688. "activeview": 1.1,
  1689. "documentevents": 1.1,
  1690. "selection": 1.1,
  1691. "settings": 1.1,
  1692. "textcoercion": 1.1
  1693. });
  1694. }
  1695. return SwayWebDefaultSetRequirement;
  1696. })(DefaultSetRequirement);
  1697. Requirement.SwayWebDefaultSetRequirement = SwayWebDefaultSetRequirement;
  1698. var AccessWebDefaultSetRequirement = (function (_super) {
  1699. __extends(AccessWebDefaultSetRequirement, _super);
  1700. function AccessWebDefaultSetRequirement() {
  1701. _super.call(this, {
  1702. "bindingevents": 1.1,
  1703. "partialtablebindings": 1.1,
  1704. "settings": 1.1,
  1705. "tablebindings": 1.1,
  1706. "tablecoercion": 1.1
  1707. });
  1708. }
  1709. return AccessWebDefaultSetRequirement;
  1710. })(DefaultSetRequirement);
  1711. Requirement.AccessWebDefaultSetRequirement = AccessWebDefaultSetRequirement;
  1712. var ExcelIOSDefaultSetRequirement = (function (_super) {
  1713. __extends(ExcelIOSDefaultSetRequirement, _super);
  1714. function ExcelIOSDefaultSetRequirement() {
  1715. _super.call(this, {
  1716. "bindingevents": 1.1,
  1717. "documentevents": 1.1,
  1718. "matrixbindings": 1.1,
  1719. "matrixcoercion": 1.1,
  1720. "selection": 1.1,
  1721. "settings": 1.1,
  1722. "tablebindings": 1.1,
  1723. "tablecoercion": 1.1,
  1724. "textbindings": 1.1,
  1725. "textcoercion": 1.1
  1726. });
  1727. }
  1728. return ExcelIOSDefaultSetRequirement;
  1729. })(DefaultSetRequirement);
  1730. Requirement.ExcelIOSDefaultSetRequirement = ExcelIOSDefaultSetRequirement;
  1731. var WordIOSDefaultSetRequirement = (function (_super) {
  1732. __extends(WordIOSDefaultSetRequirement, _super);
  1733. function WordIOSDefaultSetRequirement() {
  1734. _super.call(this, {
  1735. "bindingevents": 1.1,
  1736. "compressedfile": 1.1,
  1737. "customxmlparts": 1.1,
  1738. "documentevents": 1.1,
  1739. "file": 1.1,
  1740. "htmlcoercion": 1.1,
  1741. "matrixbindings": 1.1,
  1742. "matrixcoercion": 1.1,
  1743. "ooxmlcoercion": 1.1,
  1744. "pdffile": 1.1,
  1745. "selection": 1.1,
  1746. "settings": 1.1,
  1747. "tablebindings": 1.1,
  1748. "tablecoercion": 1.1,
  1749. "textbindings": 1.1,
  1750. "textcoercion": 1.1,
  1751. "textfile": 1.1
  1752. });
  1753. }
  1754. return WordIOSDefaultSetRequirement;
  1755. })(DefaultSetRequirement);
  1756. Requirement.WordIOSDefaultSetRequirement = WordIOSDefaultSetRequirement;
  1757. var WordIOSV1DefaultSetRequirement = (function (_super) {
  1758. __extends(WordIOSV1DefaultSetRequirement, _super);
  1759. function WordIOSV1DefaultSetRequirement() {
  1760. _super.call(this);
  1761. this._addSetMap({
  1762. "customxmlparts": 1.2,
  1763. "wordapi": 1.2
  1764. });
  1765. }
  1766. return WordIOSV1DefaultSetRequirement;
  1767. })(WordIOSDefaultSetRequirement);
  1768. Requirement.WordIOSV1DefaultSetRequirement = WordIOSV1DefaultSetRequirement;
  1769. var PowerpointIOSDefaultSetRequirement = (function (_super) {
  1770. __extends(PowerpointIOSDefaultSetRequirement, _super);
  1771. function PowerpointIOSDefaultSetRequirement() {
  1772. _super.call(this, {
  1773. "activeview": 1.1,
  1774. "compressedfile": 1.1,
  1775. "documentevents": 1.1,
  1776. "file": 1.1,
  1777. "pdffile": 1.1,
  1778. "selection": 1.1,
  1779. "settings": 1.1,
  1780. "textcoercion": 1.1
  1781. });
  1782. }
  1783. return PowerpointIOSDefaultSetRequirement;
  1784. })(DefaultSetRequirement);
  1785. Requirement.PowerpointIOSDefaultSetRequirement = PowerpointIOSDefaultSetRequirement;
  1786. var OutlookIOSDefaultSetRequirement = (function (_super) {
  1787. __extends(OutlookIOSDefaultSetRequirement, _super);
  1788. function OutlookIOSDefaultSetRequirement() {
  1789. _super.call(this, {
  1790. "mailbox": 1.1
  1791. });
  1792. }
  1793. return OutlookIOSDefaultSetRequirement;
  1794. })(DefaultSetRequirement);
  1795. Requirement.OutlookIOSDefaultSetRequirement = OutlookIOSDefaultSetRequirement;
  1796. var RequirementsMatrixFactory = (function () {
  1797. function RequirementsMatrixFactory() {
  1798. }
  1799. RequirementsMatrixFactory.initializeOsfDda = function () {
  1800. OSF.OUtil.setNamespace("Requirement", OSF.DDA);
  1801. };
  1802. RequirementsMatrixFactory.getDefaultRequirementMatrix = function (appContext) {
  1803. this.initializeDefaultSetMatrix();
  1804. var defaultRequirementMatrix = undefined;
  1805. var clientRequirement = appContext.get_requirementMatrix();
  1806. if (clientRequirement != undefined && clientRequirement.length > 0 && typeof (JSON) !== "undefined") {
  1807. var matrixItem = JSON.parse(appContext.get_requirementMatrix().toLowerCase());
  1808. defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement(matrixItem));
  1809. }
  1810. else {
  1811. var appLocator = RequirementsMatrixFactory.getClientFullVersionString(appContext);
  1812. if (RequirementsMatrixFactory.DefaultSetArrayMatrix != undefined && RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator] != undefined) {
  1813. defaultRequirementMatrix = new RequirementMatrix(RequirementsMatrixFactory.DefaultSetArrayMatrix[appLocator]);
  1814. }
  1815. else {
  1816. defaultRequirementMatrix = new RequirementMatrix(new DefaultSetRequirement({}));
  1817. }
  1818. }
  1819. return defaultRequirementMatrix;
  1820. };
  1821. RequirementsMatrixFactory.getClientFullVersionString = function (appContext) {
  1822. var appMinorVersion = appContext.get_appMinorVersion();
  1823. var appMinorVersionString = "";
  1824. var appFullVersion = "";
  1825. var appName = appContext.get_appName();
  1826. var isIOSClient = appName == 1024 ||
  1827. appName == 4096 ||
  1828. appName == 8192 ||
  1829. appName == 65536;
  1830. if (isIOSClient && appContext.get_appVersion() == 1) {
  1831. if (appName == 4096 && appMinorVersion >= 15) {
  1832. appFullVersion = "16.00.01";
  1833. }
  1834. else {
  1835. appFullVersion = "16.00";
  1836. }
  1837. }
  1838. else if (appContext.get_appName() == 64) {
  1839. appFullVersion = appContext.get_appVersion();
  1840. }
  1841. else {
  1842. if (appMinorVersion < 10) {
  1843. appMinorVersionString = "0" + appMinorVersion;
  1844. }
  1845. else {
  1846. appMinorVersionString = "" + appMinorVersion;
  1847. }
  1848. appFullVersion = appContext.get_appVersion() + "." + appMinorVersionString;
  1849. }
  1850. return appContext.get_appName() + "-" + appFullVersion;
  1851. };
  1852. RequirementsMatrixFactory.initializeDefaultSetMatrix = function () {
  1853. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1600] = new ExcelClientDefaultSetRequirement();
  1854. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1600] = new WordClientDefaultSetRequirement();
  1855. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1600] = new PowerpointClientDefaultSetRequirement();
  1856. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_RCLIENT_1601] = new ExcelClientV1DefaultSetRequirement();
  1857. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_RCLIENT_1601] = new WordClientV1DefaultSetRequirement();
  1858. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_RCLIENT_1601] = new PowerpointClientV1DefaultSetRequirement();
  1859. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_RCLIENT_1600] = new OutlookClientDefaultSetRequirement();
  1860. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_WAC_1600] = new ExcelWebDefaultSetRequirement();
  1861. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_WAC_1600] = new WordWebDefaultSetRequirement();
  1862. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1600] = new OutlookWebDefaultSetRequirement();
  1863. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_WAC_1601] = new OutlookWebDefaultSetRequirement();
  1864. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Project_RCLIENT_1600] = new ProjectClientDefaultSetRequirement();
  1865. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Access_WAC_1600] = new AccessWebDefaultSetRequirement();
  1866. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_WAC_1600] = new PowerpointWebDefaultSetRequirement();
  1867. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Excel_IOS_1600] = new ExcelIOSDefaultSetRequirement();
  1868. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.SWAY_WAC_1600] = new SwayWebDefaultSetRequirement();
  1869. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_1600] = new WordIOSDefaultSetRequirement();
  1870. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Word_IOS_16001] = new WordIOSV1DefaultSetRequirement();
  1871. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.PowerPoint_IOS_1600] = new PowerpointIOSDefaultSetRequirement();
  1872. RequirementsMatrixFactory.DefaultSetArrayMatrix[RequirementsMatrixFactory.Outlook_IOS_1600] = new OutlookIOSDefaultSetRequirement();
  1873. };
  1874. RequirementsMatrixFactory.Excel_RCLIENT_1600 = "1-16.00";
  1875. RequirementsMatrixFactory.Excel_RCLIENT_1601 = "1-16.01";
  1876. RequirementsMatrixFactory.Word_RCLIENT_1600 = "2-16.00";
  1877. RequirementsMatrixFactory.Word_RCLIENT_1601 = "2-16.01";
  1878. RequirementsMatrixFactory.PowerPoint_RCLIENT_1600 = "4-16.00";
  1879. RequirementsMatrixFactory.PowerPoint_RCLIENT_1601 = "4-16.01";
  1880. RequirementsMatrixFactory.Outlook_RCLIENT_1600 = "8-16.00";
  1881. RequirementsMatrixFactory.Excel_WAC_1600 = "16-16.00";
  1882. RequirementsMatrixFactory.Word_WAC_1600 = "32-16.00";
  1883. RequirementsMatrixFactory.Outlook_WAC_1600 = "64-16.00";
  1884. RequirementsMatrixFactory.Outlook_WAC_1601 = "64-16.01";
  1885. RequirementsMatrixFactory.Project_RCLIENT_1600 = "128-16.00";
  1886. RequirementsMatrixFactory.Access_WAC_1600 = "256-16.00";
  1887. RequirementsMatrixFactory.PowerPoint_WAC_1600 = "512-16.00";
  1888. RequirementsMatrixFactory.Excel_IOS_1600 = "1024-16.00";
  1889. RequirementsMatrixFactory.SWAY_WAC_1600 = "2048-16.00";
  1890. RequirementsMatrixFactory.Word_IOS_1600 = "4096-16.00";
  1891. RequirementsMatrixFactory.Word_IOS_16001 = "4096-16.00.01";
  1892. RequirementsMatrixFactory.PowerPoint_IOS_1600 = "8192-16.00";
  1893. RequirementsMatrixFactory.Outlook_IOS_1600 = "65536-16.00";
  1894. RequirementsMatrixFactory.DefaultSetArrayMatrix = {};
  1895. return RequirementsMatrixFactory;
  1896. })();
  1897. Requirement.RequirementsMatrixFactory = RequirementsMatrixFactory;
  1898. })(Requirement = OfficeExt.Requirement || (OfficeExt.Requirement = {}));
  1899. })(OfficeExt || (OfficeExt = {}));
  1900. OfficeExt.Requirement.RequirementsMatrixFactory.initializeOsfDda();
  1901. Microsoft.Office.WebExtension.ApplicationMode = {
  1902. WebEditor: "webEditor",
  1903. WebViewer: "webViewer",
  1904. Client: "client"
  1905. };
  1906. Microsoft.Office.WebExtension.DocumentMode = {
  1907. ReadOnly: "readOnly",
  1908. ReadWrite: "readWrite"
  1909. };
  1910. OSF.NamespaceManager = (function OSF_NamespaceManager() {
  1911. var _userOffice;
  1912. var _useShortcut = false;
  1913. return {
  1914. enableShortcut: function OSF_NamespaceManager$enableShortcut() {
  1915. if (!_useShortcut) {
  1916. if (window.Office) {
  1917. _userOffice = window.Office;
  1918. }
  1919. else {
  1920. OSF.OUtil.setNamespace("Office", window);
  1921. }
  1922. window.Office = Microsoft.Office.WebExtension;
  1923. _useShortcut = true;
  1924. }
  1925. },
  1926. disableShortcut: function OSF_NamespaceManager$disableShortcut() {
  1927. if (_useShortcut) {
  1928. if (_userOffice) {
  1929. window.Office = _userOffice;
  1930. }
  1931. else {
  1932. OSF.OUtil.unsetNamespace("Office", window);
  1933. }
  1934. _useShortcut = false;
  1935. }
  1936. }
  1937. };
  1938. })();
  1939. OSF.NamespaceManager.enableShortcut();
  1940. Microsoft.Office.WebExtension.useShortNamespace = function Microsoft_Office_WebExtension_useShortNamespace(useShortcut) {
  1941. if (useShortcut) {
  1942. OSF.NamespaceManager.enableShortcut();
  1943. }
  1944. else {
  1945. OSF.NamespaceManager.disableShortcut();
  1946. }
  1947. };
  1948. Microsoft.Office.WebExtension.select = function Microsoft_Office_WebExtension_select(str, errorCallback) {
  1949. var promise;
  1950. if (str && typeof str == "string") {
  1951. var index = str.indexOf("#");
  1952. if (index != -1) {
  1953. var op = str.substring(0, index);
  1954. var target = str.substring(index + 1);
  1955. switch (op) {
  1956. case "binding":
  1957. case "bindings":
  1958. if (target) {
  1959. promise = new OSF.DDA.BindingPromise(target);
  1960. }
  1961. break;
  1962. }
  1963. }
  1964. }
  1965. if (!promise) {
  1966. if (errorCallback) {
  1967. var callbackType = typeof errorCallback;
  1968. if (callbackType == "function") {
  1969. var callArgs = {};
  1970. callArgs[Microsoft.Office.WebExtension.Parameters.Callback] = errorCallback;
  1971. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext, OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidApiCallInContext));
  1972. }
  1973. else {
  1974. throw OSF.OUtil.formatString(Strings.OfficeOM.L_CallbackNotAFunction, callbackType);
  1975. }
  1976. }
  1977. }
  1978. else {
  1979. promise.onFail = errorCallback;
  1980. return promise;
  1981. }
  1982. };
  1983. OSF.DDA.Context = function OSF_DDA_Context(officeAppContext, document, license, appOM, getOfficeTheme) {
  1984. OSF.OUtil.defineEnumerableProperties(this, {
  1985. "contentLanguage": {
  1986. value: officeAppContext.get_dataLocale()
  1987. },
  1988. "displayLanguage": {
  1989. value: officeAppContext.get_appUILocale()
  1990. },
  1991. "touchEnabled": {
  1992. value: officeAppContext.get_touchEnabled()
  1993. },
  1994. "commerceAllowed": {
  1995. value: officeAppContext.get_commerceAllowed()
  1996. }
  1997. });
  1998. if (license) {
  1999. OSF.OUtil.defineEnumerableProperty(this, "license", {
  2000. value: license
  2001. });
  2002. }
  2003. if (officeAppContext.ui) {
  2004. OSF.OUtil.defineEnumerableProperty(this, "ui", {
  2005. value: officeAppContext.ui
  2006. });
  2007. }
  2008. if (!officeAppContext.get_isDialog()) {
  2009. if (document) {
  2010. OSF.OUtil.defineEnumerableProperty(this, "document", {
  2011. value: document
  2012. });
  2013. }
  2014. if (appOM) {
  2015. var displayName = appOM.displayName || "appOM";
  2016. delete appOM.displayName;
  2017. OSF.OUtil.defineEnumerableProperty(this, displayName, {
  2018. value: appOM
  2019. });
  2020. }
  2021. if (getOfficeTheme) {
  2022. OSF.OUtil.defineEnumerableProperty(this, "officeTheme", {
  2023. get: function () {
  2024. return getOfficeTheme();
  2025. }
  2026. });
  2027. }
  2028. var requirements = OfficeExt.Requirement.RequirementsMatrixFactory.getDefaultRequirementMatrix(officeAppContext);
  2029. OSF.OUtil.defineEnumerableProperty(this, "requirements", {
  2030. value: requirements
  2031. });
  2032. }
  2033. };
  2034. OSF.DDA.OutlookContext = function OSF_DDA_OutlookContext(appContext, settings, license, appOM, getOfficeTheme) {
  2035. OSF.DDA.OutlookContext.uber.constructor.call(this, appContext, null, license, appOM, getOfficeTheme);
  2036. if (settings) {
  2037. OSF.OUtil.defineEnumerableProperty(this, "roamingSettings", {
  2038. value: settings
  2039. });
  2040. }
  2041. };
  2042. OSF.OUtil.extend(OSF.DDA.OutlookContext, OSF.DDA.Context);
  2043. OSF.DDA.OutlookAppOm = function OSF_DDA_OutlookAppOm(appContext, window, appReady) { };
  2044. OSF.DDA.Document = function OSF_DDA_Document(officeAppContext, settings) {
  2045. var mode;
  2046. switch (officeAppContext.get_clientMode()) {
  2047. case OSF.ClientMode.ReadOnly:
  2048. mode = Microsoft.Office.WebExtension.DocumentMode.ReadOnly;
  2049. break;
  2050. case OSF.ClientMode.ReadWrite:
  2051. mode = Microsoft.Office.WebExtension.DocumentMode.ReadWrite;
  2052. break;
  2053. }
  2054. ;
  2055. if (settings) {
  2056. OSF.OUtil.defineEnumerableProperty(this, "settings", {
  2057. value: settings
  2058. });
  2059. }
  2060. ;
  2061. OSF.OUtil.defineMutableProperties(this, {
  2062. "mode": {
  2063. value: mode
  2064. },
  2065. "url": {
  2066. value: officeAppContext.get_docUrl()
  2067. }
  2068. });
  2069. };
  2070. OSF.DDA.JsomDocument = function OSF_DDA_JsomDocument(officeAppContext, bindingFacade, settings) {
  2071. OSF.DDA.JsomDocument.uber.constructor.call(this, officeAppContext, settings);
  2072. if (bindingFacade) {
  2073. OSF.OUtil.defineEnumerableProperty(this, "bindings", {
  2074. get: function OSF_DDA_Document$GetBindings() { return bindingFacade; }
  2075. });
  2076. }
  2077. var am = OSF.DDA.AsyncMethodNames;
  2078. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  2079. am.GetSelectedDataAsync,
  2080. am.SetSelectedDataAsync
  2081. ]);
  2082. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged]));
  2083. };
  2084. OSF.OUtil.extend(OSF.DDA.JsomDocument, OSF.DDA.Document);
  2085. OSF.OUtil.defineEnumerableProperty(Microsoft.Office.WebExtension, "context", {
  2086. get: function Microsoft_Office_WebExtension$GetContext() {
  2087. var context;
  2088. if (OSF && OSF._OfficeAppFactory) {
  2089. context = OSF._OfficeAppFactory.getContext();
  2090. }
  2091. return context;
  2092. }
  2093. });
  2094. OSF.DDA.License = function OSF_DDA_License(eToken) {
  2095. OSF.OUtil.defineEnumerableProperty(this, "value", {
  2096. value: eToken
  2097. });
  2098. };
  2099. OSF.DDA.ApiMethodCall = function OSF_DDA_ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2100. var requiredCount = requiredParameters.length;
  2101. var getInvalidParameterString = OSF.OUtil.delayExecutionAndCache(function () {
  2102. return OSF.OUtil.formatString(Strings.OfficeOM.L_InvalidParameters, displayName);
  2103. });
  2104. this.verifyArguments = function OSF_DDA_ApiMethodCall$VerifyArguments(params, args) {
  2105. for (var name in params) {
  2106. var param = params[name];
  2107. var arg = args[name];
  2108. if (param["enum"]) {
  2109. switch (typeof arg) {
  2110. case "string":
  2111. if (OSF.OUtil.listContainsValue(param["enum"], arg)) {
  2112. break;
  2113. }
  2114. case "undefined":
  2115. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedEnumeration;
  2116. default:
  2117. throw getInvalidParameterString();
  2118. }
  2119. }
  2120. if (param["types"]) {
  2121. if (!OSF.OUtil.listContainsValue(param["types"], typeof arg)) {
  2122. throw getInvalidParameterString();
  2123. }
  2124. }
  2125. }
  2126. };
  2127. this.extractRequiredArguments = function OSF_DDA_ApiMethodCall$ExtractRequiredArguments(userArgs, caller, stateInfo) {
  2128. if (userArgs.length < requiredCount) {
  2129. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_MissingRequiredArguments);
  2130. }
  2131. var requiredArgs = [];
  2132. var index;
  2133. for (index = 0; index < requiredCount; index++) {
  2134. requiredArgs.push(userArgs[index]);
  2135. }
  2136. this.verifyArguments(requiredParameters, requiredArgs);
  2137. var ret = {};
  2138. for (index = 0; index < requiredCount; index++) {
  2139. var param = requiredParameters[index];
  2140. var arg = requiredArgs[index];
  2141. if (param.verify) {
  2142. var isValid = param.verify(arg, caller, stateInfo);
  2143. if (!isValid) {
  2144. throw getInvalidParameterString();
  2145. }
  2146. }
  2147. ret[param.name] = arg;
  2148. }
  2149. return ret;
  2150. },
  2151. this.fillOptions = function OSF_DDA_ApiMethodCall$FillOptions(options, requiredArgs, caller, stateInfo) {
  2152. options = options || {};
  2153. for (var optionName in supportedOptions) {
  2154. if (!OSF.OUtil.listContainsKey(options, optionName)) {
  2155. var value = undefined;
  2156. var option = supportedOptions[optionName];
  2157. if (option.calculate && requiredArgs) {
  2158. value = option.calculate(requiredArgs, caller, stateInfo);
  2159. }
  2160. if (!value && option.defaultValue !== undefined) {
  2161. value = option.defaultValue;
  2162. }
  2163. options[optionName] = value;
  2164. }
  2165. }
  2166. return options;
  2167. };
  2168. this.constructCallArgs = function OSF_DAA_ApiMethodCall$ConstructCallArgs(required, options, caller, stateInfo) {
  2169. var callArgs = {};
  2170. for (var r in required) {
  2171. callArgs[r] = required[r];
  2172. }
  2173. for (var o in options) {
  2174. callArgs[o] = options[o];
  2175. }
  2176. for (var s in privateStateCallbacks) {
  2177. callArgs[s] = privateStateCallbacks[s](caller, stateInfo);
  2178. }
  2179. if (checkCallArgs) {
  2180. callArgs = checkCallArgs(callArgs, caller, stateInfo);
  2181. }
  2182. return callArgs;
  2183. };
  2184. };
  2185. OSF.OUtil.setNamespace("AsyncResultEnum", OSF.DDA);
  2186. OSF.DDA.AsyncResultEnum.Properties = {
  2187. Context: "Context",
  2188. Value: "Value",
  2189. Status: "Status",
  2190. Error: "Error"
  2191. };
  2192. Microsoft.Office.WebExtension.AsyncResultStatus = {
  2193. Succeeded: "succeeded",
  2194. Failed: "failed"
  2195. };
  2196. OSF.DDA.AsyncResultEnum.ErrorCode = {
  2197. Success: 0,
  2198. Failed: 1
  2199. };
  2200. OSF.DDA.AsyncResultEnum.ErrorProperties = {
  2201. Name: "Name",
  2202. Message: "Message",
  2203. Code: "Code"
  2204. };
  2205. OSF.DDA.AsyncMethodNames = {};
  2206. OSF.DDA.AsyncMethodNames.addNames = function (methodNames) {
  2207. for (var entry in methodNames) {
  2208. var am = {};
  2209. OSF.OUtil.defineEnumerableProperties(am, {
  2210. "id": {
  2211. value: entry
  2212. },
  2213. "displayName": {
  2214. value: methodNames[entry]
  2215. }
  2216. });
  2217. OSF.DDA.AsyncMethodNames[entry] = am;
  2218. }
  2219. };
  2220. OSF.DDA.AsyncMethodCall = function OSF_DDA_AsyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, onSucceeded, onFailed, checkCallArgs, displayName) {
  2221. var requiredCount = requiredParameters.length;
  2222. var apiMethods = new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2223. function OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2224. if (userArgs.length > requiredCount + 2) {
  2225. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2226. }
  2227. var options, parameterCallback;
  2228. for (var i = userArgs.length - 1; i >= requiredCount; i--) {
  2229. var argument = userArgs[i];
  2230. switch (typeof argument) {
  2231. case "object":
  2232. if (options) {
  2233. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2234. }
  2235. else {
  2236. options = argument;
  2237. }
  2238. break;
  2239. case "function":
  2240. if (parameterCallback) {
  2241. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalFunction);
  2242. }
  2243. else {
  2244. parameterCallback = argument;
  2245. }
  2246. break;
  2247. default:
  2248. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2249. break;
  2250. }
  2251. }
  2252. options = apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2253. if (parameterCallback) {
  2254. if (options[Microsoft.Office.WebExtension.Parameters.Callback]) {
  2255. throw Strings.OfficeOM.L_RedundantCallbackSpecification;
  2256. }
  2257. else {
  2258. options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback;
  2259. }
  2260. }
  2261. apiMethods.verifyArguments(supportedOptions, options);
  2262. return options;
  2263. }
  2264. ;
  2265. this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2266. var required = apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2267. var options = OSF_DAA_AsyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2268. var callArgs = apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2269. return callArgs;
  2270. };
  2271. this.processResponse = function OSF_DAA_AsyncMethodCall$ProcessResponse(status, response, caller, callArgs) {
  2272. var payload;
  2273. if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2274. if (onSucceeded) {
  2275. payload = onSucceeded(response, caller, callArgs);
  2276. }
  2277. else {
  2278. payload = response;
  2279. }
  2280. }
  2281. else {
  2282. if (onFailed) {
  2283. payload = onFailed(status, response);
  2284. }
  2285. else {
  2286. payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2287. }
  2288. }
  2289. return payload;
  2290. };
  2291. this.getCallArgs = function (suppliedArgs) {
  2292. var options, parameterCallback;
  2293. for (var i = suppliedArgs.length - 1; i >= requiredCount; i--) {
  2294. var argument = suppliedArgs[i];
  2295. switch (typeof argument) {
  2296. case "object":
  2297. options = argument;
  2298. break;
  2299. case "function":
  2300. parameterCallback = argument;
  2301. break;
  2302. }
  2303. }
  2304. options = options || {};
  2305. if (parameterCallback) {
  2306. options[Microsoft.Office.WebExtension.Parameters.Callback] = parameterCallback;
  2307. }
  2308. return options;
  2309. };
  2310. };
  2311. OSF.DDA.AsyncMethodCallFactory = (function () {
  2312. return {
  2313. manufacture: function (params) {
  2314. var supportedOptions = params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2315. var privateStateCallbacks = params.privateStateCallbacks ? OSF.OUtil.createObject(params.privateStateCallbacks) : [];
  2316. return new OSF.DDA.AsyncMethodCall(params.requiredArguments || [], supportedOptions, privateStateCallbacks, params.onSucceeded, params.onFailed, params.checkCallArgs, params.method.displayName);
  2317. }
  2318. };
  2319. })();
  2320. OSF.DDA.AsyncMethodCalls = {};
  2321. OSF.DDA.AsyncMethodCalls.define = function (callDefinition) {
  2322. OSF.DDA.AsyncMethodCalls[callDefinition.method.id] = OSF.DDA.AsyncMethodCallFactory.manufacture(callDefinition);
  2323. };
  2324. OSF.DDA.Error = function OSF_DDA_Error(name, message, code) {
  2325. OSF.OUtil.defineEnumerableProperties(this, {
  2326. "name": {
  2327. value: name
  2328. },
  2329. "message": {
  2330. value: message
  2331. },
  2332. "code": {
  2333. value: code
  2334. }
  2335. });
  2336. };
  2337. OSF.DDA.AsyncResult = function OSF_DDA_AsyncResult(initArgs, errorArgs) {
  2338. OSF.OUtil.defineEnumerableProperties(this, {
  2339. "value": {
  2340. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Value]
  2341. },
  2342. "status": {
  2343. value: errorArgs ? Microsoft.Office.WebExtension.AsyncResultStatus.Failed : Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded
  2344. }
  2345. });
  2346. if (initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]) {
  2347. OSF.OUtil.defineEnumerableProperty(this, "asyncContext", {
  2348. value: initArgs[OSF.DDA.AsyncResultEnum.Properties.Context]
  2349. });
  2350. }
  2351. if (errorArgs) {
  2352. OSF.OUtil.defineEnumerableProperty(this, "error", {
  2353. value: new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code])
  2354. });
  2355. }
  2356. };
  2357. OSF.DDA.issueAsyncResult = function OSF_DDA$IssueAsyncResult(callArgs, status, payload) {
  2358. var callback = callArgs[Microsoft.Office.WebExtension.Parameters.Callback];
  2359. if (callback) {
  2360. var asyncInitArgs = {};
  2361. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Context] = callArgs[Microsoft.Office.WebExtension.Parameters.AsyncContext];
  2362. var errorArgs;
  2363. if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2364. asyncInitArgs[OSF.DDA.AsyncResultEnum.Properties.Value] = payload;
  2365. }
  2366. else {
  2367. errorArgs = {};
  2368. payload = payload || OSF.DDA.ErrorCodeManager.getErrorArgs(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  2369. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  2370. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload;
  2371. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload;
  2372. }
  2373. callback(new OSF.DDA.AsyncResult(asyncInitArgs, errorArgs));
  2374. }
  2375. };
  2376. OSF.DDA.SyncMethodNames = {};
  2377. OSF.DDA.SyncMethodNames.addNames = function (methodNames) {
  2378. for (var entry in methodNames) {
  2379. var am = {};
  2380. OSF.OUtil.defineEnumerableProperties(am, {
  2381. "id": {
  2382. value: entry
  2383. },
  2384. "displayName": {
  2385. value: methodNames[entry]
  2386. }
  2387. });
  2388. OSF.DDA.SyncMethodNames[entry] = am;
  2389. }
  2390. };
  2391. OSF.DDA.SyncMethodCall = function OSF_DDA_SyncMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName) {
  2392. var requiredCount = requiredParameters.length;
  2393. var apiMethods = new OSF.DDA.ApiMethodCall(requiredParameters, supportedOptions, privateStateCallbacks, checkCallArgs, displayName);
  2394. function OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, requiredArgs, caller, stateInfo) {
  2395. if (userArgs.length > requiredCount + 1) {
  2396. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyArguments);
  2397. }
  2398. var options, parameterCallback;
  2399. for (var i = userArgs.length - 1; i >= requiredCount; i--) {
  2400. var argument = userArgs[i];
  2401. switch (typeof argument) {
  2402. case "object":
  2403. if (options) {
  2404. throw OsfMsAjaxFactory.msAjaxError.parameterCount(Strings.OfficeOM.L_TooManyOptionalObjects);
  2405. }
  2406. else {
  2407. options = argument;
  2408. }
  2409. break;
  2410. default:
  2411. throw OsfMsAjaxFactory.msAjaxError.argument(Strings.OfficeOM.L_InValidOptionalArgument);
  2412. break;
  2413. }
  2414. }
  2415. options = apiMethods.fillOptions(options, requiredArgs, caller, stateInfo);
  2416. apiMethods.verifyArguments(supportedOptions, options);
  2417. return options;
  2418. }
  2419. ;
  2420. this.verifyAndExtractCall = function OSF_DAA_AsyncMethodCall$VerifyAndExtractCall(userArgs, caller, stateInfo) {
  2421. var required = apiMethods.extractRequiredArguments(userArgs, caller, stateInfo);
  2422. var options = OSF_DAA_SyncMethodCall$ExtractOptions(userArgs, required, caller, stateInfo);
  2423. var callArgs = apiMethods.constructCallArgs(required, options, caller, stateInfo);
  2424. return callArgs;
  2425. };
  2426. };
  2427. OSF.DDA.SyncMethodCallFactory = (function () {
  2428. return {
  2429. manufacture: function (params) {
  2430. var supportedOptions = params.supportedOptions ? OSF.OUtil.createObject(params.supportedOptions) : [];
  2431. return new OSF.DDA.SyncMethodCall(params.requiredArguments || [], supportedOptions, params.privateStateCallbacks, params.checkCallArgs, params.method.displayName);
  2432. }
  2433. };
  2434. })();
  2435. OSF.DDA.SyncMethodCalls = {};
  2436. OSF.DDA.SyncMethodCalls.define = function (callDefinition) {
  2437. OSF.DDA.SyncMethodCalls[callDefinition.method.id] = OSF.DDA.SyncMethodCallFactory.manufacture(callDefinition);
  2438. };
  2439. OSF.DDA.ListType = (function () {
  2440. var listTypes = {};
  2441. return {
  2442. setListType: function OSF_DDA_ListType$AddListType(t, prop) { listTypes[t] = prop; },
  2443. isListType: function OSF_DDA_ListType$IsListType(t) { return OSF.OUtil.listContainsKey(listTypes, t); },
  2444. getDescriptor: function OSF_DDA_ListType$getDescriptor(t) { return listTypes[t]; }
  2445. };
  2446. })();
  2447. OSF.DDA.HostParameterMap = function (specialProcessor, mappings) {
  2448. var toHostMap = "toHost";
  2449. var fromHostMap = "fromHost";
  2450. var self = "self";
  2451. var dynamicTypes = {};
  2452. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = {
  2453. toHost: function (data) {
  2454. if (data != null && data.rows !== undefined) {
  2455. var tableData = {};
  2456. tableData[OSF.DDA.TableDataProperties.TableRows] = data.rows;
  2457. tableData[OSF.DDA.TableDataProperties.TableHeaders] = data.headers;
  2458. data = tableData;
  2459. }
  2460. return data;
  2461. },
  2462. fromHost: function (args) {
  2463. return args;
  2464. }
  2465. };
  2466. dynamicTypes[Microsoft.Office.WebExtension.Parameters.SampleData] = dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data];
  2467. function mapValues(preimageSet, mapping) {
  2468. var ret = preimageSet ? {} : undefined;
  2469. for (var entry in preimageSet) {
  2470. var preimage = preimageSet[entry];
  2471. var image;
  2472. if (OSF.DDA.ListType.isListType(entry)) {
  2473. image = [];
  2474. for (var subEntry in preimage) {
  2475. image.push(mapValues(preimage[subEntry], mapping));
  2476. }
  2477. }
  2478. else if (OSF.OUtil.listContainsKey(dynamicTypes, entry)) {
  2479. image = dynamicTypes[entry][mapping](preimage);
  2480. }
  2481. else if (mapping == fromHostMap && specialProcessor.preserveNesting(entry)) {
  2482. image = mapValues(preimage, mapping);
  2483. }
  2484. else {
  2485. var maps = mappings[entry];
  2486. if (maps) {
  2487. var map = maps[mapping];
  2488. if (map) {
  2489. image = map[preimage];
  2490. if (image === undefined) {
  2491. image = preimage;
  2492. }
  2493. }
  2494. }
  2495. else {
  2496. image = preimage;
  2497. }
  2498. }
  2499. ret[entry] = image;
  2500. }
  2501. return ret;
  2502. }
  2503. ;
  2504. function generateArguments(imageSet, parameters) {
  2505. var ret;
  2506. for (var param in parameters) {
  2507. var arg;
  2508. if (specialProcessor.isComplexType(param)) {
  2509. arg = generateArguments(imageSet, mappings[param][toHostMap]);
  2510. }
  2511. else {
  2512. arg = imageSet[param];
  2513. }
  2514. if (arg != undefined) {
  2515. if (!ret) {
  2516. ret = {};
  2517. }
  2518. var index = parameters[param];
  2519. if (index == self) {
  2520. index = param;
  2521. }
  2522. ret[index] = specialProcessor.pack(param, arg);
  2523. }
  2524. }
  2525. return ret;
  2526. }
  2527. ;
  2528. function extractArguments(source, parameters, extracted) {
  2529. if (!extracted) {
  2530. extracted = {};
  2531. }
  2532. for (var param in parameters) {
  2533. var index = parameters[param];
  2534. var value;
  2535. if (index == self) {
  2536. value = source;
  2537. }
  2538. else {
  2539. value = source[index];
  2540. }
  2541. if (value === null || value === undefined) {
  2542. extracted[param] = undefined;
  2543. }
  2544. else {
  2545. value = specialProcessor.unpack(param, value);
  2546. var map;
  2547. if (specialProcessor.isComplexType(param)) {
  2548. map = mappings[param][fromHostMap];
  2549. if (specialProcessor.preserveNesting(param)) {
  2550. extracted[param] = extractArguments(value, map);
  2551. }
  2552. else {
  2553. extractArguments(value, map, extracted);
  2554. }
  2555. }
  2556. else {
  2557. if (OSF.DDA.ListType.isListType(param)) {
  2558. map = {};
  2559. var entryDescriptor = OSF.DDA.ListType.getDescriptor(param);
  2560. map[entryDescriptor] = self;
  2561. var extractedValues = new Array(value.length);
  2562. for (var item in value) {
  2563. extractedValues[item] = extractArguments(value[item], map);
  2564. }
  2565. extracted[param] = extractedValues;
  2566. }
  2567. else {
  2568. extracted[param] = value;
  2569. }
  2570. }
  2571. }
  2572. }
  2573. return extracted;
  2574. }
  2575. ;
  2576. function applyMap(mapName, preimage, mapping) {
  2577. var parameters = mappings[mapName][mapping];
  2578. var image;
  2579. if (mapping == "toHost") {
  2580. var imageSet = mapValues(preimage, mapping);
  2581. image = generateArguments(imageSet, parameters);
  2582. }
  2583. else if (mapping == "fromHost") {
  2584. var argumentSet = extractArguments(preimage, parameters);
  2585. image = mapValues(argumentSet, mapping);
  2586. }
  2587. return image;
  2588. }
  2589. ;
  2590. if (!mappings) {
  2591. mappings = {};
  2592. }
  2593. this.addMapping = function (mapName, description) {
  2594. var toHost, fromHost;
  2595. if (description.map) {
  2596. toHost = description.map;
  2597. fromHost = {};
  2598. for (var preimage in toHost) {
  2599. var image = toHost[preimage];
  2600. if (image == self) {
  2601. image = preimage;
  2602. }
  2603. fromHost[image] = preimage;
  2604. }
  2605. }
  2606. else {
  2607. toHost = description.toHost;
  2608. fromHost = description.fromHost;
  2609. }
  2610. var pair = mappings[mapName];
  2611. if (pair) {
  2612. var currMap = pair[toHostMap];
  2613. for (var th in currMap)
  2614. toHost[th] = currMap[th];
  2615. currMap = pair[fromHostMap];
  2616. for (var fh in currMap)
  2617. fromHost[fh] = currMap[fh];
  2618. }
  2619. else {
  2620. pair = mappings[mapName] = {};
  2621. }
  2622. pair[toHostMap] = toHost;
  2623. pair[fromHostMap] = fromHost;
  2624. };
  2625. this.toHost = function (mapName, preimage) { return applyMap(mapName, preimage, toHostMap); };
  2626. this.fromHost = function (mapName, image) { return applyMap(mapName, image, fromHostMap); };
  2627. this.self = self;
  2628. this.addComplexType = function (ct) { specialProcessor.addComplexType(ct); };
  2629. this.getDynamicType = function (dt) { return specialProcessor.getDynamicType(dt); };
  2630. this.setDynamicType = function (dt, handler) { specialProcessor.setDynamicType(dt, handler); };
  2631. this.dynamicTypes = dynamicTypes;
  2632. this.doMapValues = function (preimageSet, mapping) { return mapValues(preimageSet, mapping); };
  2633. };
  2634. OSF.DDA.SpecialProcessor = function (complexTypes, dynamicTypes) {
  2635. this.addComplexType = function OSF_DDA_SpecialProcessor$addComplexType(ct) {
  2636. complexTypes.push(ct);
  2637. };
  2638. this.getDynamicType = function OSF_DDA_SpecialProcessor$getDynamicType(dt) {
  2639. return dynamicTypes[dt];
  2640. };
  2641. this.setDynamicType = function OSF_DDA_SpecialProcessor$setDynamicType(dt, handler) {
  2642. dynamicTypes[dt] = handler;
  2643. };
  2644. this.isComplexType = function OSF_DDA_SpecialProcessor$isComplexType(t) {
  2645. return OSF.OUtil.listContainsValue(complexTypes, t);
  2646. };
  2647. this.isDynamicType = function OSF_DDA_SpecialProcessor$isDynamicType(p) {
  2648. return OSF.OUtil.listContainsKey(dynamicTypes, p);
  2649. };
  2650. this.preserveNesting = function OSF_DDA_SpecialProcessor$preserveNesting(p) {
  2651. var pn = [];
  2652. if (OSF.DDA.PropertyDescriptors)
  2653. pn.push(OSF.DDA.PropertyDescriptors.Subset);
  2654. if (OSF.DDA.DataNodeEventProperties) {
  2655. pn = pn.concat([
  2656. OSF.DDA.DataNodeEventProperties.OldNode,
  2657. OSF.DDA.DataNodeEventProperties.NewNode,
  2658. OSF.DDA.DataNodeEventProperties.NextSiblingNode
  2659. ]);
  2660. }
  2661. return OSF.OUtil.listContainsValue(pn, p);
  2662. };
  2663. this.pack = function OSF_DDA_SpecialProcessor$pack(param, arg) {
  2664. var value;
  2665. if (this.isDynamicType(param)) {
  2666. value = dynamicTypes[param].toHost(arg);
  2667. }
  2668. else {
  2669. value = arg;
  2670. }
  2671. return value;
  2672. };
  2673. this.unpack = function OSF_DDA_SpecialProcessor$unpack(param, arg) {
  2674. var value;
  2675. if (this.isDynamicType(param)) {
  2676. value = dynamicTypes[param].fromHost(arg);
  2677. }
  2678. else {
  2679. value = arg;
  2680. }
  2681. return value;
  2682. };
  2683. };
  2684. OSF.DDA.getDecoratedParameterMap = function (specialProcessor, initialDefs) {
  2685. var parameterMap = new OSF.DDA.HostParameterMap(specialProcessor);
  2686. var self = parameterMap.self;
  2687. function createObject(properties) {
  2688. var obj = null;
  2689. if (properties) {
  2690. obj = {};
  2691. var len = properties.length;
  2692. for (var i = 0; i < len; i++) {
  2693. obj[properties[i].name] = properties[i].value;
  2694. }
  2695. }
  2696. return obj;
  2697. }
  2698. parameterMap.define = function define(definition) {
  2699. var args = {};
  2700. var toHost = createObject(definition.toHost);
  2701. if (definition.invertible) {
  2702. args.map = toHost;
  2703. }
  2704. else if (definition.canonical) {
  2705. args.toHost = args.fromHost = toHost;
  2706. }
  2707. else {
  2708. args.toHost = toHost;
  2709. args.fromHost = createObject(definition.fromHost);
  2710. }
  2711. parameterMap.addMapping(definition.type, args);
  2712. if (definition.isComplexType)
  2713. parameterMap.addComplexType(definition.type);
  2714. };
  2715. for (var id in initialDefs)
  2716. parameterMap.define(initialDefs[id]);
  2717. return parameterMap;
  2718. };
  2719. OSF.OUtil.setNamespace("DispIdHost", OSF.DDA);
  2720. OSF.DDA.DispIdHost.Methods = {
  2721. InvokeMethod: "invokeMethod",
  2722. AddEventHandler: "addEventHandler",
  2723. RemoveEventHandler: "removeEventHandler",
  2724. OpenDialog: "openDialog",
  2725. CloseDialog: "closeDialog",
  2726. MessageParent: "messageParent"
  2727. };
  2728. OSF.DDA.DispIdHost.Delegates = {
  2729. ExecuteAsync: "executeAsync",
  2730. RegisterEventAsync: "registerEventAsync",
  2731. UnregisterEventAsync: "unregisterEventAsync",
  2732. ParameterMap: "parameterMap",
  2733. OpenDialog: "openDialog",
  2734. CloseDialog: "closeDialog",
  2735. MessageParent: "messageParent"
  2736. };
  2737. OSF.DDA.DispIdHost.Facade = function OSF_DDA_DispIdHost_Facade(getDelegateMethods, parameterMap) {
  2738. var dispIdMap = {};
  2739. var jsom = OSF.DDA.AsyncMethodNames;
  2740. var did = OSF.DDA.MethodDispId;
  2741. var methodMap = {
  2742. "GoToByIdAsync": did.dispidNavigateToMethod,
  2743. "GetSelectedDataAsync": did.dispidGetSelectedDataMethod,
  2744. "SetSelectedDataAsync": did.dispidSetSelectedDataMethod,
  2745. "GetDocumentCopyChunkAsync": did.dispidGetDocumentCopyChunkMethod,
  2746. "ReleaseDocumentCopyAsync": did.dispidReleaseDocumentCopyMethod,
  2747. "GetDocumentCopyAsync": did.dispidGetDocumentCopyMethod,
  2748. "AddFromSelectionAsync": did.dispidAddBindingFromSelectionMethod,
  2749. "AddFromPromptAsync": did.dispidAddBindingFromPromptMethod,
  2750. "AddFromNamedItemAsync": did.dispidAddBindingFromNamedItemMethod,
  2751. "GetAllAsync": did.dispidGetAllBindingsMethod,
  2752. "GetByIdAsync": did.dispidGetBindingMethod,
  2753. "ReleaseByIdAsync": did.dispidReleaseBindingMethod,
  2754. "GetDataAsync": did.dispidGetBindingDataMethod,
  2755. "SetDataAsync": did.dispidSetBindingDataMethod,
  2756. "AddRowsAsync": did.dispidAddRowsMethod,
  2757. "AddColumnsAsync": did.dispidAddColumnsMethod,
  2758. "DeleteAllDataValuesAsync": did.dispidClearAllRowsMethod,
  2759. "RefreshAsync": did.dispidLoadSettingsMethod,
  2760. "SaveAsync": did.dispidSaveSettingsMethod,
  2761. "GetActiveViewAsync": did.dispidGetActiveViewMethod,
  2762. "GetFilePropertiesAsync": did.dispidGetFilePropertiesMethod,
  2763. "GetOfficeThemeAsync": did.dispidGetOfficeThemeMethod,
  2764. "GetDocumentThemeAsync": did.dispidGetDocumentThemeMethod,
  2765. "ClearFormatsAsync": did.dispidClearFormatsMethod,
  2766. "SetTableOptionsAsync": did.dispidSetTableOptionsMethod,
  2767. "SetFormatsAsync": did.dispidSetFormatsMethod,
  2768. "ExecuteRichApiRequestAsync": did.dispidExecuteRichApiRequestMethod,
  2769. "AppCommandInvocationCompletedAsync": did.dispidAppCommandInvocationCompletedMethod,
  2770. "CloseContainerAsync": did.dispidCloseContainerMethod,
  2771. "AddDataPartAsync": did.dispidAddDataPartMethod,
  2772. "GetDataPartByIdAsync": did.dispidGetDataPartByIdMethod,
  2773. "GetDataPartsByNameSpaceAsync": did.dispidGetDataPartsByNamespaceMethod,
  2774. "GetPartXmlAsync": did.dispidGetDataPartXmlMethod,
  2775. "GetPartNodesAsync": did.dispidGetDataPartNodesMethod,
  2776. "DeleteDataPartAsync": did.dispidDeleteDataPartMethod,
  2777. "GetNodeValueAsync": did.dispidGetDataNodeValueMethod,
  2778. "GetNodeXmlAsync": did.dispidGetDataNodeXmlMethod,
  2779. "GetRelativeNodesAsync": did.dispidGetDataNodesMethod,
  2780. "SetNodeValueAsync": did.dispidSetDataNodeValueMethod,
  2781. "SetNodeXmlAsync": did.dispidSetDataNodeXmlMethod,
  2782. "AddDataPartNamespaceAsync": did.dispidAddDataNamespaceMethod,
  2783. "GetDataPartNamespaceAsync": did.dispidGetDataUriByPrefixMethod,
  2784. "GetDataPartPrefixAsync": did.dispidGetDataPrefixByUriMethod,
  2785. "GetNodeTextAsync": did.dispidGetDataNodeTextMethod,
  2786. "SetNodeTextAsync": did.dispidSetDataNodeTextMethod,
  2787. "GetSelectedTask": did.dispidGetSelectedTaskMethod,
  2788. "GetTask": did.dispidGetTaskMethod,
  2789. "GetWSSUrl": did.dispidGetWSSUrlMethod,
  2790. "GetTaskField": did.dispidGetTaskFieldMethod,
  2791. "GetSelectedResource": did.dispidGetSelectedResourceMethod,
  2792. "GetResourceField": did.dispidGetResourceFieldMethod,
  2793. "GetProjectField": did.dispidGetProjectFieldMethod,
  2794. "GetSelectedView": did.dispidGetSelectedViewMethod,
  2795. "GetTaskByIndex": did.dispidGetTaskByIndexMethod,
  2796. "GetResourceByIndex": did.dispidGetResourceByIndexMethod,
  2797. "SetTaskField": did.dispidSetTaskFieldMethod,
  2798. "SetResourceField": did.dispidSetResourceFieldMethod,
  2799. "GetMaxTaskIndex": did.dispidGetMaxTaskIndexMethod,
  2800. "GetMaxResourceIndex": did.dispidGetMaxResourceIndexMethod,
  2801. "CreateTask": did.dispidCreateTaskMethod
  2802. };
  2803. for (var method in methodMap) {
  2804. if (jsom[method]) {
  2805. dispIdMap[jsom[method].id] = methodMap[method];
  2806. }
  2807. }
  2808. jsom = OSF.DDA.SyncMethodNames;
  2809. did = OSF.DDA.MethodDispId;
  2810. var asyncMethodMap = {
  2811. "MessageParent": did.dispidMessageParentMethod
  2812. };
  2813. for (var method in asyncMethodMap) {
  2814. if (jsom[method]) {
  2815. dispIdMap[jsom[method].id] = asyncMethodMap[method];
  2816. }
  2817. }
  2818. jsom = Microsoft.Office.WebExtension.EventType;
  2819. did = OSF.DDA.EventDispId;
  2820. var eventMap = {
  2821. "SettingsChanged": did.dispidSettingsChangedEvent,
  2822. "DocumentSelectionChanged": did.dispidDocumentSelectionChangedEvent,
  2823. "BindingSelectionChanged": did.dispidBindingSelectionChangedEvent,
  2824. "BindingDataChanged": did.dispidBindingDataChangedEvent,
  2825. "ActiveViewChanged": did.dispidActiveViewChangedEvent,
  2826. "OfficeThemeChanged": did.dispidOfficeThemeChangedEvent,
  2827. "DocumentThemeChanged": did.dispidDocumentThemeChangedEvent,
  2828. "AppCommandInvoked": did.dispidAppCommandInvokedEvent,
  2829. "DialogMessageReceived": did.dispidDialogMessageReceivedEvent,
  2830. "OlkItemSelectedChanged": did.dispidOlkItemSelectedChangedEvent,
  2831. "TaskSelectionChanged": did.dispidTaskSelectionChangedEvent,
  2832. "ResourceSelectionChanged": did.dispidResourceSelectionChangedEvent,
  2833. "ViewSelectionChanged": did.dispidViewSelectionChangedEvent,
  2834. "DataNodeInserted": did.dispidDataNodeAddedEvent,
  2835. "DataNodeReplaced": did.dispidDataNodeReplacedEvent,
  2836. "DataNodeDeleted": did.dispidDataNodeDeletedEvent
  2837. };
  2838. for (var event in eventMap) {
  2839. if (jsom[event]) {
  2840. dispIdMap[jsom[event]] = eventMap[event];
  2841. }
  2842. }
  2843. function onException(ex, asyncMethodCall, suppliedArgs, callArgs) {
  2844. if (typeof ex == "number") {
  2845. if (!callArgs) {
  2846. callArgs = asyncMethodCall.getCallArgs(suppliedArgs);
  2847. }
  2848. OSF.DDA.issueAsyncResult(callArgs, ex, OSF.DDA.ErrorCodeManager.getErrorArgs(ex));
  2849. }
  2850. else {
  2851. throw ex;
  2852. }
  2853. }
  2854. ;
  2855. this[OSF.DDA.DispIdHost.Methods.InvokeMethod] = function OSF_DDA_DispIdHost_Facade$InvokeMethod(method, suppliedArguments, caller, privateState) {
  2856. var callArgs;
  2857. try {
  2858. var methodName = method.id;
  2859. var asyncMethodCall = OSF.DDA.AsyncMethodCalls[methodName];
  2860. callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, privateState);
  2861. var dispId = dispIdMap[methodName];
  2862. var delegate = getDelegateMethods(methodName);
  2863. var richApiInExcelMethodSubstitution = null;
  2864. if (window.Excel && window.Office.context.requirements.isSetSupported("RedirectV1Api")) {
  2865. window.Excel._RedirectV1APIs = true;
  2866. }
  2867. if (window.Excel && window.Excel._RedirectV1APIs && (richApiInExcelMethodSubstitution = window.Excel._V1APIMap[methodName])) {
  2868. if (richApiInExcelMethodSubstitution.preprocess) {
  2869. callArgs = richApiInExcelMethodSubstitution.preprocess(callArgs);
  2870. }
  2871. var ctx = new window.Excel.RequestContext();
  2872. var result = richApiInExcelMethodSubstitution.call(ctx, callArgs);
  2873. ctx.sync()
  2874. .then(function () {
  2875. var response = result.value;
  2876. var status = response.status;
  2877. delete response["status"];
  2878. delete response["@odata.type"];
  2879. if (richApiInExcelMethodSubstitution.postprocess) {
  2880. response = richApiInExcelMethodSubstitution.postprocess(response, callArgs);
  2881. }
  2882. if (status != 0) {
  2883. response = OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2884. }
  2885. OSF.DDA.issueAsyncResult(callArgs, status, response);
  2886. })["catch"](function (error) {
  2887. OSF.DDA.issueAsyncResult(callArgs, OSF.DDA.ErrorCodeManager.errorCodes.ooeFailure, null);
  2888. });
  2889. }
  2890. else {
  2891. var hostCallArgs;
  2892. if (parameterMap.toHost) {
  2893. hostCallArgs = parameterMap.toHost(dispId, callArgs);
  2894. }
  2895. else {
  2896. hostCallArgs = callArgs;
  2897. }
  2898. delegate[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]({
  2899. "dispId": dispId,
  2900. "hostCallArgs": hostCallArgs,
  2901. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { },
  2902. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { },
  2903. "onComplete": function (status, hostResponseArgs) {
  2904. var responseArgs;
  2905. if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2906. if (parameterMap.fromHost) {
  2907. responseArgs = parameterMap.fromHost(dispId, hostResponseArgs);
  2908. }
  2909. else {
  2910. responseArgs = hostResponseArgs;
  2911. }
  2912. }
  2913. else {
  2914. responseArgs = hostResponseArgs;
  2915. }
  2916. var payload = asyncMethodCall.processResponse(status, responseArgs, caller, callArgs);
  2917. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  2918. }
  2919. });
  2920. }
  2921. }
  2922. catch (ex) {
  2923. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2924. }
  2925. };
  2926. this[OSF.DDA.DispIdHost.Methods.AddEventHandler] = function OSF_DDA_DispIdHost_Facade$AddEventHandler(suppliedArguments, eventDispatch, caller) {
  2927. var callArgs;
  2928. var eventType, handler;
  2929. function onEnsureRegistration(status) {
  2930. if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2931. var added = eventDispatch.addEventHandler(eventType, handler);
  2932. if (!added) {
  2933. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerAdditionFailed;
  2934. }
  2935. }
  2936. var error;
  2937. if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2938. error = OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2939. }
  2940. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2941. }
  2942. try {
  2943. var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.AddHandlerAsync.id];
  2944. callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2945. eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  2946. handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  2947. if (eventDispatch.getEventHandlerCount(eventType) == 0) {
  2948. var dispId = dispIdMap[eventType];
  2949. var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  2950. invoker({
  2951. "eventType": eventType,
  2952. "dispId": dispId,
  2953. "targetId": caller.id || "",
  2954. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  2955. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  2956. "onComplete": onEnsureRegistration,
  2957. "onEvent": function handleEvent(hostArgs) {
  2958. var args = parameterMap.fromHost(dispId, hostArgs);
  2959. eventDispatch.fireEvent(OSF.DDA.OMFactory.manufactureEventArgs(eventType, caller, args));
  2960. }
  2961. });
  2962. }
  2963. else {
  2964. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess);
  2965. }
  2966. }
  2967. catch (ex) {
  2968. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  2969. }
  2970. };
  2971. this[OSF.DDA.DispIdHost.Methods.RemoveEventHandler] = function OSF_DDA_DispIdHost_Facade$RemoveEventHandler(suppliedArguments, eventDispatch, caller) {
  2972. var callArgs;
  2973. var eventType, handler;
  2974. function onEnsureRegistration(status) {
  2975. var error;
  2976. if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  2977. error = OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  2978. }
  2979. OSF.DDA.issueAsyncResult(callArgs, status, error);
  2980. }
  2981. try {
  2982. var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.id];
  2983. callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  2984. eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  2985. handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  2986. var status, removeSuccess;
  2987. if (handler === null) {
  2988. removeSuccess = eventDispatch.clearEventHandlers(eventType);
  2989. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  2990. }
  2991. else {
  2992. removeSuccess = eventDispatch.removeEventHandler(eventType, handler);
  2993. status = removeSuccess ? OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess : OSF.DDA.ErrorCodeManager.errorCodes.ooeEventHandlerNotExist;
  2994. }
  2995. if (removeSuccess && eventDispatch.getEventHandlerCount(eventType) == 0) {
  2996. var dispId = dispIdMap[eventType];
  2997. var invoker = getDelegateMethods(eventType)[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  2998. invoker({
  2999. "eventType": eventType,
  3000. "dispId": dispId,
  3001. "targetId": caller.id || "",
  3002. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3003. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3004. "onComplete": onEnsureRegistration
  3005. });
  3006. }
  3007. else {
  3008. onEnsureRegistration(status);
  3009. }
  3010. }
  3011. catch (ex) {
  3012. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3013. }
  3014. };
  3015. this[OSF.DDA.DispIdHost.Methods.OpenDialog] = function OSF_DDA_DispIdHost_Facade$OpenDialog(suppliedArguments, eventDispatch, caller) {
  3016. var callArgs;
  3017. var targetId;
  3018. var dialogMessageEvent = Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3019. var dialogOtherEvent = Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3020. function onEnsureRegistration(status) {
  3021. var payload;
  3022. if (status != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3023. payload = OSF.DDA.ErrorCodeManager.getErrorArgs(status);
  3024. }
  3025. else {
  3026. var onSucceedArgs = {};
  3027. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Id] = targetId;
  3028. onSucceedArgs[Microsoft.Office.WebExtension.Parameters.Data] = eventDispatch;
  3029. var payload = asyncMethodCall.processResponse(status, onSucceedArgs, caller, callArgs);
  3030. OSF.DialogShownStatus.hasDialogShown = true;
  3031. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3032. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3033. }
  3034. OSF.DDA.issueAsyncResult(callArgs, status, payload);
  3035. }
  3036. try {
  3037. if (dialogMessageEvent == undefined || dialogOtherEvent == undefined) {
  3038. onEnsureRegistration(OSF.DDA.ErrorCodeManager.ooeOperationNotSupported);
  3039. }
  3040. if (OSF.DDA.AsyncMethodNames.DisplayDialogAsync == null) {
  3041. onEnsureRegistration(OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3042. return;
  3043. }
  3044. var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.DisplayDialogAsync.id];
  3045. callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3046. var dispId = dispIdMap[dialogMessageEvent];
  3047. var delegateMethods = getDelegateMethods(dialogMessageEvent);
  3048. var invoker = delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] != undefined ?
  3049. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] :
  3050. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync];
  3051. targetId = JSON.stringify(callArgs);
  3052. invoker({
  3053. "eventType": dialogMessageEvent,
  3054. "dispId": dispId,
  3055. "targetId": targetId,
  3056. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3057. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3058. "onComplete": onEnsureRegistration,
  3059. "onEvent": function handleEvent(hostArgs) {
  3060. var args = parameterMap.fromHost(dispId, hostArgs);
  3061. var event = OSF.DDA.OMFactory.manufactureEventArgs(dialogMessageEvent, caller, args);
  3062. if (event.type == dialogOtherEvent) {
  3063. var payload = OSF.DDA.ErrorCodeManager.getErrorArgs(event.error);
  3064. var errorArgs = {};
  3065. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code] = status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3066. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name] = payload.name || payload;
  3067. errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message] = payload.message || payload;
  3068. event.error = new OSF.DDA.Error(errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Name], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Message], errorArgs[OSF.DDA.AsyncResultEnum.ErrorProperties.Code]);
  3069. }
  3070. eventDispatch.fireOrQueueEvent(event);
  3071. if (args[OSF.DDA.PropertyDescriptors.MessageType] == OSF.DialogMessageType.DialogClosed) {
  3072. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3073. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3074. OSF.DialogShownStatus.hasDialogShown = false;
  3075. }
  3076. }
  3077. });
  3078. }
  3079. catch (ex) {
  3080. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3081. }
  3082. };
  3083. this[OSF.DDA.DispIdHost.Methods.CloseDialog] = function OSF_DDA_DispIdHost_Facade$CloseDialog(suppliedArguments, targetId, eventDispatch, caller) {
  3084. var callArgs;
  3085. var dialogMessageEvent, dialogOtherEvent;
  3086. var closeStatus = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  3087. function closeCallback(status) {
  3088. closeStatus = status;
  3089. OSF.DialogShownStatus.hasDialogShown = false;
  3090. }
  3091. try {
  3092. var asyncMethodCall = OSF.DDA.AsyncMethodCalls[OSF.DDA.AsyncMethodNames.CloseAsync.id];
  3093. callArgs = asyncMethodCall.verifyAndExtractCall(suppliedArguments, caller, eventDispatch);
  3094. dialogMessageEvent = Microsoft.Office.WebExtension.EventType.DialogMessageReceived;
  3095. dialogOtherEvent = Microsoft.Office.WebExtension.EventType.DialogEventReceived;
  3096. eventDispatch.clearEventHandlers(dialogMessageEvent);
  3097. eventDispatch.clearEventHandlers(dialogOtherEvent);
  3098. var dispId = dispIdMap[dialogMessageEvent];
  3099. var delegateMethods = getDelegateMethods(dialogMessageEvent);
  3100. var invoker = delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] != undefined ?
  3101. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] :
  3102. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync];
  3103. invoker({
  3104. "eventType": dialogMessageEvent,
  3105. "dispId": dispId,
  3106. "targetId": targetId,
  3107. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3108. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); },
  3109. "onComplete": closeCallback
  3110. });
  3111. }
  3112. catch (ex) {
  3113. onException(ex, asyncMethodCall, suppliedArguments, callArgs);
  3114. }
  3115. if (closeStatus != OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3116. throw OSF.OUtil.formatString(Strings.OfficeOM.L_FunctionCallFailed, OSF.DDA.AsyncMethodNames.CloseAsync.displayName, closeStatus);
  3117. }
  3118. };
  3119. this[OSF.DDA.DispIdHost.Methods.MessageParent] = function OSF_DDA_DispIdHost_Facade$MessageParent(suppliedArguments, caller) {
  3120. var stateInfo = {};
  3121. var syncMethodCall = OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.MessageParent.id];
  3122. var callArgs = syncMethodCall.verifyAndExtractCall(suppliedArguments, caller, stateInfo);
  3123. var delegate = getDelegateMethods(OSF.DDA.SyncMethodNames.MessageParent.id);
  3124. var invoker = delegate[OSF.DDA.DispIdHost.Delegates.MessageParent];
  3125. var dispId = dispIdMap[OSF.DDA.SyncMethodNames.MessageParent.id];
  3126. return invoker({
  3127. "dispId": dispId,
  3128. "hostCallArgs": callArgs,
  3129. "onCalling": function OSF_DDA_DispIdFacade$Execute_onCalling() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.IssueCall); },
  3130. "onReceiving": function OSF_DDA_DispIdFacade$Execute_onReceiving() { OSF.OUtil.writeProfilerMark(OSF.HostCallPerfMarker.ReceiveResponse); }
  3131. });
  3132. };
  3133. };
  3134. OSF.DDA.DispIdHost.addAsyncMethods = function OSF_DDA_DispIdHost$AddAsyncMethods(target, asyncMethodNames, privateState) {
  3135. for (var entry in asyncMethodNames) {
  3136. var method = asyncMethodNames[entry];
  3137. var name = method.displayName;
  3138. if (!target[name]) {
  3139. OSF.OUtil.defineEnumerableProperty(target, name, {
  3140. value: (function (asyncMethod) {
  3141. return function () {
  3142. var invokeMethod = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.InvokeMethod];
  3143. invokeMethod(asyncMethod, arguments, target, privateState);
  3144. };
  3145. })(method)
  3146. });
  3147. }
  3148. }
  3149. };
  3150. OSF.DDA.DispIdHost.addEventSupport = function OSF_DDA_DispIdHost$AddEventSupport(target, eventDispatch) {
  3151. var add = OSF.DDA.AsyncMethodNames.AddHandlerAsync.displayName;
  3152. var remove = OSF.DDA.AsyncMethodNames.RemoveHandlerAsync.displayName;
  3153. if (!target[add]) {
  3154. OSF.OUtil.defineEnumerableProperty(target, add, {
  3155. value: function () {
  3156. var addEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.AddEventHandler];
  3157. addEventHandler(arguments, eventDispatch, target);
  3158. }
  3159. });
  3160. }
  3161. if (!target[remove]) {
  3162. OSF.OUtil.defineEnumerableProperty(target, remove, {
  3163. value: function () {
  3164. var removeEventHandler = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.RemoveEventHandler];
  3165. removeEventHandler(arguments, eventDispatch, target);
  3166. }
  3167. });
  3168. }
  3169. };
  3170. var OfficeExt;
  3171. (function (OfficeExt) {
  3172. var MsAjaxTypeHelper = (function () {
  3173. function MsAjaxTypeHelper() {
  3174. }
  3175. MsAjaxTypeHelper.isInstanceOfType = function (type, instance) {
  3176. if (typeof (instance) === "undefined" || instance === null)
  3177. return false;
  3178. if (instance instanceof type)
  3179. return true;
  3180. var instanceType = instance.constructor;
  3181. if (!instanceType || (typeof (instanceType) !== "function") || !instanceType.__typeName || instanceType.__typeName === 'Object') {
  3182. instanceType = Object;
  3183. }
  3184. return !!(instanceType === type) ||
  3185. (instanceType.__typeName && type.__typeName && instanceType.__typeName === type.__typeName);
  3186. };
  3187. return MsAjaxTypeHelper;
  3188. })();
  3189. OfficeExt.MsAjaxTypeHelper = MsAjaxTypeHelper;
  3190. var MsAjaxError = (function () {
  3191. function MsAjaxError() {
  3192. }
  3193. MsAjaxError.create = function (message, errorInfo) {
  3194. var err = new Error(message);
  3195. err.message = message;
  3196. if (errorInfo) {
  3197. for (var v in errorInfo) {
  3198. err[v] = errorInfo[v];
  3199. }
  3200. }
  3201. err.popStackFrame();
  3202. return err;
  3203. };
  3204. MsAjaxError.parameterCount = function (message) {
  3205. var displayMessage = "Sys.ParameterCountException: " + (message ? message : "Parameter count mismatch.");
  3206. var err = MsAjaxError.create(displayMessage, { name: 'Sys.ParameterCountException' });
  3207. err.popStackFrame();
  3208. return err;
  3209. };
  3210. MsAjaxError.argument = function (paramName, message) {
  3211. var displayMessage = "Sys.ArgumentException: " + (message ? message : "Value does not fall within the expected range.");
  3212. if (paramName) {
  3213. displayMessage += "\n" + MsAjaxString.format("Parameter name: {0}", paramName);
  3214. }
  3215. var err = MsAjaxError.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
  3216. err.popStackFrame();
  3217. return err;
  3218. };
  3219. MsAjaxError.argumentNull = function (paramName, message) {
  3220. var displayMessage = "Sys.ArgumentNullException: " + (message ? message : "Value cannot be null.");
  3221. if (paramName) {
  3222. displayMessage += "\n" + MsAjaxString.format("Parameter name: {0}", paramName);
  3223. }
  3224. var err = MsAjaxError.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
  3225. err.popStackFrame();
  3226. return err;
  3227. };
  3228. MsAjaxError.argumentOutOfRange = function (paramName, actualValue, message) {
  3229. var displayMessage = "Sys.ArgumentOutOfRangeException: " + (message ? message : "Specified argument was out of the range of valid values.");
  3230. if (paramName) {
  3231. displayMessage += "\n" + MsAjaxString.format("Parameter name: {0}", paramName);
  3232. }
  3233. if (typeof (actualValue) !== "undefined" && actualValue !== null) {
  3234. displayMessage += "\n" + MsAjaxString.format("Actual value was {0}.", actualValue);
  3235. }
  3236. var err = MsAjaxError.create(displayMessage, {
  3237. name: "Sys.ArgumentOutOfRangeException",
  3238. paramName: paramName,
  3239. actualValue: actualValue
  3240. });
  3241. err.popStackFrame();
  3242. return err;
  3243. };
  3244. MsAjaxError.argumentType = function (paramName, actualType, expectedType, message) {
  3245. var displayMessage = "Sys.ArgumentTypeException: ";
  3246. if (message) {
  3247. displayMessage += message;
  3248. }
  3249. else if (actualType && expectedType) {
  3250. displayMessage += MsAjaxString.format("Object of type '{0}' cannot be converted to type '{1}'.", actualType.getName ? actualType.getName() : actualType, expectedType.getName ? expectedType.getName() : expectedType);
  3251. }
  3252. else {
  3253. displayMessage += "Object cannot be converted to the required type.";
  3254. }
  3255. if (paramName) {
  3256. displayMessage += "\n" + MsAjaxString.format("Parameter name: {0}", paramName);
  3257. }
  3258. var err = MsAjaxError.create(displayMessage, {
  3259. name: "Sys.ArgumentTypeException",
  3260. paramName: paramName,
  3261. actualType: actualType,
  3262. expectedType: expectedType
  3263. });
  3264. err.popStackFrame();
  3265. return err;
  3266. };
  3267. MsAjaxError.argumentUndefined = function (paramName, message) {
  3268. var displayMessage = "Sys.ArgumentUndefinedException: " + (message ? message : "Value cannot be undefined.");
  3269. if (paramName) {
  3270. displayMessage += "\n" + MsAjaxString.format("Parameter name: {0}", paramName);
  3271. }
  3272. var err = MsAjaxError.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
  3273. err.popStackFrame();
  3274. return err;
  3275. };
  3276. MsAjaxError.invalidOperation = function (message) {
  3277. var displayMessage = "Sys.InvalidOperationException: " + (message ? message : "Operation is not valid due to the current state of the object.");
  3278. var err = MsAjaxError.create(displayMessage, { name: 'Sys.InvalidOperationException' });
  3279. err.popStackFrame();
  3280. return err;
  3281. };
  3282. return MsAjaxError;
  3283. })();
  3284. OfficeExt.MsAjaxError = MsAjaxError;
  3285. var MsAjaxString = (function () {
  3286. function MsAjaxString() {
  3287. }
  3288. MsAjaxString.format = function (format) {
  3289. var args = [];
  3290. for (var _i = 1; _i < arguments.length; _i++) {
  3291. args[_i - 1] = arguments[_i];
  3292. }
  3293. var source = format;
  3294. return source.replace(/{(\d+)}/gm, function (match, number) {
  3295. var index = parseInt(number, 10);
  3296. return args[index] === undefined ? '{' + number + '}' : args[index];
  3297. });
  3298. };
  3299. MsAjaxString.startsWith = function (str, prefix) {
  3300. return (str.substr(0, prefix.length) === prefix);
  3301. };
  3302. return MsAjaxString;
  3303. })();
  3304. OfficeExt.MsAjaxString = MsAjaxString;
  3305. var MsAjaxDebug = (function () {
  3306. function MsAjaxDebug() {
  3307. }
  3308. MsAjaxDebug.trace = function (text) {
  3309. if (typeof Debug !== "undefined" && Debug.writeln)
  3310. Debug.writeln(text);
  3311. if (window.console && window.console.log)
  3312. window.console.log(text);
  3313. if (window.opera && window.opera.postError)
  3314. window.opera.postError(text);
  3315. if (window.debugService && window.debugService.trace)
  3316. window.debugService.trace(text);
  3317. var a = document.getElementById("TraceConsole");
  3318. if (a && a.tagName.toUpperCase() === "TEXTAREA") {
  3319. a.innerHTML += text + "\n";
  3320. }
  3321. };
  3322. return MsAjaxDebug;
  3323. })();
  3324. OfficeExt.MsAjaxDebug = MsAjaxDebug;
  3325. if (!OsfMsAjaxFactory.isMsAjaxLoaded()) {
  3326. var registerTypeInternal = function registerTypeInternal(type, name, isClass) {
  3327. if (type.__typeName === undefined) {
  3328. type.__typeName = name;
  3329. }
  3330. if (type.__class === undefined) {
  3331. type.__class = isClass;
  3332. }
  3333. };
  3334. registerTypeInternal(Function, "Function", true);
  3335. registerTypeInternal(Error, "Error", true);
  3336. registerTypeInternal(Object, "Object", true);
  3337. registerTypeInternal(String, "String", true);
  3338. registerTypeInternal(Boolean, "Boolean", true);
  3339. registerTypeInternal(Date, "Date", true);
  3340. registerTypeInternal(Number, "Number", true);
  3341. registerTypeInternal(RegExp, "RegExp", true);
  3342. registerTypeInternal(Array, "Array", true);
  3343. if (!Function.createCallback) {
  3344. Function.createCallback = function Function$createCallback(method, context) {
  3345. var e = Function._validateParams(arguments, [
  3346. { name: "method", type: Function },
  3347. { name: "context", mayBeNull: true }
  3348. ]);
  3349. if (e)
  3350. throw e;
  3351. return function () {
  3352. var l = arguments.length;
  3353. if (l > 0) {
  3354. var args = [];
  3355. for (var i = 0; i < l; i++) {
  3356. args[i] = arguments[i];
  3357. }
  3358. args[l] = context;
  3359. return method.apply(this, args);
  3360. }
  3361. return method.call(this, context);
  3362. };
  3363. };
  3364. }
  3365. if (!Function.createDelegate) {
  3366. Function.createDelegate = function Function$createDelegate(instance, method) {
  3367. var e = Function._validateParams(arguments, [
  3368. { name: "instance", mayBeNull: true },
  3369. { name: "method", type: Function }
  3370. ]);
  3371. if (e)
  3372. throw e;
  3373. return function () {
  3374. return method.apply(instance, arguments);
  3375. };
  3376. };
  3377. }
  3378. if (!Function._validateParams) {
  3379. Function._validateParams = function (params, expectedParams, validateParameterCount) {
  3380. var e, expectedLength = expectedParams.length;
  3381. validateParameterCount = validateParameterCount || (typeof (validateParameterCount) === "undefined");
  3382. e = Function._validateParameterCount(params, expectedParams, validateParameterCount);
  3383. if (e) {
  3384. e.popStackFrame();
  3385. return e;
  3386. }
  3387. for (var i = 0, l = params.length; i < l; i++) {
  3388. var expectedParam = expectedParams[Math.min(i, expectedLength - 1)], paramName = expectedParam.name;
  3389. if (expectedParam.parameterArray) {
  3390. paramName += "[" + (i - expectedLength + 1) + "]";
  3391. }
  3392. else if (!validateParameterCount && (i >= expectedLength)) {
  3393. break;
  3394. }
  3395. e = Function._validateParameter(params[i], expectedParam, paramName);
  3396. if (e) {
  3397. e.popStackFrame();
  3398. return e;
  3399. }
  3400. }
  3401. return null;
  3402. };
  3403. }
  3404. if (!Function._validateParameterCount) {
  3405. Function._validateParameterCount = function (params, expectedParams, validateParameterCount) {
  3406. var i, error, expectedLen = expectedParams.length, actualLen = params.length;
  3407. if (actualLen < expectedLen) {
  3408. var minParams = expectedLen;
  3409. for (i = 0; i < expectedLen; i++) {
  3410. var param = expectedParams[i];
  3411. if (param.optional || param.parameterArray) {
  3412. minParams--;
  3413. }
  3414. }
  3415. if (actualLen < minParams) {
  3416. error = true;
  3417. }
  3418. }
  3419. else if (validateParameterCount && (actualLen > expectedLen)) {
  3420. error = true;
  3421. for (i = 0; i < expectedLen; i++) {
  3422. if (expectedParams[i].parameterArray) {
  3423. error = false;
  3424. break;
  3425. }
  3426. }
  3427. }
  3428. if (error) {
  3429. var e = MsAjaxError.parameterCount();
  3430. e.popStackFrame();
  3431. return e;
  3432. }
  3433. return null;
  3434. };
  3435. }
  3436. if (!Function._validateParameter) {
  3437. Function._validateParameter = function (param, expectedParam, paramName) {
  3438. var e, expectedType = expectedParam.type, expectedInteger = !!expectedParam.integer, expectedDomElement = !!expectedParam.domElement, mayBeNull = !!expectedParam.mayBeNull;
  3439. e = Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
  3440. if (e) {
  3441. e.popStackFrame();
  3442. return e;
  3443. }
  3444. var expectedElementType = expectedParam.elementType, elementMayBeNull = !!expectedParam.elementMayBeNull;
  3445. if (expectedType === Array && typeof (param) !== "undefined" && param !== null &&
  3446. (expectedElementType || !elementMayBeNull)) {
  3447. var expectedElementInteger = !!expectedParam.elementInteger, expectedElementDomElement = !!expectedParam.elementDomElement;
  3448. for (var i = 0; i < param.length; i++) {
  3449. var elem = param[i];
  3450. e = Function._validateParameterType(elem, expectedElementType, expectedElementInteger, expectedElementDomElement, elementMayBeNull, paramName + "[" + i + "]");
  3451. if (e) {
  3452. e.popStackFrame();
  3453. return e;
  3454. }
  3455. }
  3456. }
  3457. return null;
  3458. };
  3459. }
  3460. if (!Function._validateParameterType) {
  3461. Function._validateParameterType = function (param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
  3462. var e, i;
  3463. if (typeof (param) === "undefined") {
  3464. if (mayBeNull) {
  3465. return null;
  3466. }
  3467. else {
  3468. e = OfficeExt.MsAjaxError.argumentUndefined(paramName);
  3469. e.popStackFrame();
  3470. return e;
  3471. }
  3472. }
  3473. if (param === null) {
  3474. if (mayBeNull) {
  3475. return null;
  3476. }
  3477. else {
  3478. e = OfficeExt.MsAjaxError.argumentNull(paramName);
  3479. e.popStackFrame();
  3480. return e;
  3481. }
  3482. }
  3483. if (expectedType && !OfficeExt.MsAjaxTypeHelper.isInstanceOfType(expectedType, param)) {
  3484. e = OfficeExt.MsAjaxError.argumentType(paramName, typeof (param), expectedType);
  3485. e.popStackFrame();
  3486. return e;
  3487. }
  3488. return null;
  3489. };
  3490. }
  3491. if (!window.Type) {
  3492. window.Type = Function;
  3493. }
  3494. if (!Type.registerNamespace) {
  3495. Type.registerNamespace = function (ns) {
  3496. var namespaceParts = ns.split('.');
  3497. var currentNamespace = window;
  3498. for (var i = 0; i < namespaceParts.length; i++) {
  3499. currentNamespace[namespaceParts[i]] = currentNamespace[namespaceParts[i]] || {};
  3500. currentNamespace = currentNamespace[namespaceParts[i]];
  3501. }
  3502. };
  3503. }
  3504. if (!Type.prototype.registerClass) {
  3505. Type.prototype.registerClass = function (cls) { cls = {}; };
  3506. }
  3507. if (typeof (Sys) === "undefined") {
  3508. Type.registerNamespace('Sys');
  3509. }
  3510. if (!Error.prototype.popStackFrame) {
  3511. Error.prototype.popStackFrame = function () {
  3512. if (arguments.length !== 0)
  3513. throw MsAjaxError.parameterCount();
  3514. if (typeof (this.stack) === "undefined" || this.stack === null ||
  3515. typeof (this.fileName) === "undefined" || this.fileName === null ||
  3516. typeof (this.lineNumber) === "undefined" || this.lineNumber === null) {
  3517. return;
  3518. }
  3519. var stackFrames = this.stack.split("\n");
  3520. var currentFrame = stackFrames[0];
  3521. var pattern = this.fileName + ":" + this.lineNumber;
  3522. while (typeof (currentFrame) !== "undefined" &&
  3523. currentFrame !== null &&
  3524. currentFrame.indexOf(pattern) === -1) {
  3525. stackFrames.shift();
  3526. currentFrame = stackFrames[0];
  3527. }
  3528. var nextFrame = stackFrames[1];
  3529. if (typeof (nextFrame) === "undefined" || nextFrame === null) {
  3530. return;
  3531. }
  3532. var nextFrameParts = nextFrame.match(/@(.*):(\d+)$/);
  3533. if (typeof (nextFrameParts) === "undefined" || nextFrameParts === null) {
  3534. return;
  3535. }
  3536. this.fileName = nextFrameParts[1];
  3537. this.lineNumber = parseInt(nextFrameParts[2]);
  3538. stackFrames.shift();
  3539. this.stack = stackFrames.join("\n");
  3540. };
  3541. }
  3542. OsfMsAjaxFactory.msAjaxError = MsAjaxError;
  3543. OsfMsAjaxFactory.msAjaxString = MsAjaxString;
  3544. OsfMsAjaxFactory.msAjaxDebug = MsAjaxDebug;
  3545. }
  3546. })(OfficeExt || (OfficeExt = {}));
  3547. OSF.OUtil.setNamespace("SafeArray", OSF.DDA);
  3548. OSF.DDA.SafeArray.Response = {
  3549. Status: 0,
  3550. Payload: 1
  3551. };
  3552. OSF.DDA.SafeArray.UniqueArguments = {
  3553. Offset: "offset",
  3554. Run: "run",
  3555. BindingSpecificData: "bindingSpecificData",
  3556. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  3557. };
  3558. OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray);
  3559. OSF.DDA.SafeArray.Delegate._onException = function OSF_DDA_SafeArray_Delegate$OnException(ex, args) {
  3560. var status;
  3561. var statusNumber = ex.number;
  3562. if (statusNumber) {
  3563. switch (statusNumber) {
  3564. case -2146828218:
  3565. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3566. break;
  3567. case -2147467259:
  3568. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeDialogAlreadyOpened;
  3569. break;
  3570. case -2146828283:
  3571. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInvalidParam;
  3572. break;
  3573. case -2146827850:
  3574. default:
  3575. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3576. break;
  3577. }
  3578. }
  3579. if (args.onComplete) {
  3580. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  3581. }
  3582. };
  3583. OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod = function OSF_DDA_SafeArray_Delegate$OnExceptionSyncMethod(ex, args) {
  3584. var status;
  3585. var number = ex.number;
  3586. if (number) {
  3587. switch (number) {
  3588. case -2146828218:
  3589. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  3590. break;
  3591. case -2146827850:
  3592. default:
  3593. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3594. break;
  3595. }
  3596. }
  3597. return status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3598. };
  3599. OSF.DDA.SafeArray.Delegate.SpecialProcessor = function OSF_DDA_SafeArray_Delegate_SpecialProcessor() {
  3600. function _2DVBArrayToJaggedArray(vbArr) {
  3601. var ret;
  3602. try {
  3603. var rows = vbArr.ubound(1);
  3604. var cols = vbArr.ubound(2);
  3605. vbArr = vbArr.toArray();
  3606. if (rows == 1 && cols == 1) {
  3607. ret = [vbArr];
  3608. }
  3609. else {
  3610. ret = [];
  3611. for (var row = 0; row < rows; row++) {
  3612. var rowArr = [];
  3613. for (var col = 0; col < cols; col++) {
  3614. var datum = vbArr[row * cols + col];
  3615. if (datum != OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) {
  3616. rowArr.push(datum);
  3617. }
  3618. }
  3619. if (rowArr.length > 0) {
  3620. ret.push(rowArr);
  3621. }
  3622. }
  3623. }
  3624. }
  3625. catch (ex) {
  3626. }
  3627. return ret;
  3628. }
  3629. var complexTypes = [];
  3630. var dynamicTypes = {};
  3631. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data] = (function () {
  3632. var tableRows = 0;
  3633. var tableHeaders = 1;
  3634. return {
  3635. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) {
  3636. if (OSF.DDA.TableDataProperties && typeof data != "string" && data[OSF.DDA.TableDataProperties.TableRows] !== undefined) {
  3637. var tableData = [];
  3638. tableData[tableRows] = data[OSF.DDA.TableDataProperties.TableRows];
  3639. tableData[tableHeaders] = data[OSF.DDA.TableDataProperties.TableHeaders];
  3640. data = tableData;
  3641. }
  3642. return data;
  3643. },
  3644. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  3645. var ret;
  3646. if (hostArgs.toArray) {
  3647. var dimensions = hostArgs.dimensions();
  3648. if (dimensions === 2) {
  3649. ret = _2DVBArrayToJaggedArray(hostArgs);
  3650. }
  3651. else {
  3652. var array = hostArgs.toArray();
  3653. if (array.length === 2 && ((array[0] != null && array[0].toArray) || (array[1] != null && array[1].toArray))) {
  3654. ret = {};
  3655. ret[OSF.DDA.TableDataProperties.TableRows] = _2DVBArrayToJaggedArray(array[tableRows]);
  3656. ret[OSF.DDA.TableDataProperties.TableHeaders] = _2DVBArrayToJaggedArray(array[tableHeaders]);
  3657. }
  3658. else {
  3659. ret = array;
  3660. }
  3661. }
  3662. }
  3663. else {
  3664. ret = hostArgs;
  3665. }
  3666. return ret;
  3667. }
  3668. };
  3669. })();
  3670. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  3671. this.unpack = function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) {
  3672. var value;
  3673. if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) {
  3674. var toArraySupported = (arg || typeof arg === "unknown") && arg.toArray;
  3675. value = toArraySupported ? arg.toArray() : arg || {};
  3676. }
  3677. else if (this.isDynamicType(param)) {
  3678. value = dynamicTypes[param].fromHost(arg);
  3679. }
  3680. else {
  3681. value = arg;
  3682. }
  3683. return value;
  3684. };
  3685. };
  3686. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  3687. OSF.DDA.SafeArray.Delegate.ParameterMap = OSF.DDA.getDecoratedParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor(), [
  3688. {
  3689. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  3690. toHost: [
  3691. { name: Microsoft.Office.WebExtension.ValueFormat.Unformatted, value: 0 },
  3692. { name: Microsoft.Office.WebExtension.ValueFormat.Formatted, value: 1 }
  3693. ]
  3694. },
  3695. {
  3696. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  3697. toHost: [
  3698. { name: Microsoft.Office.WebExtension.FilterType.All, value: 0 }
  3699. ]
  3700. }
  3701. ]);
  3702. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  3703. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  3704. fromHost: [
  3705. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Succeeded, value: 0 },
  3706. { name: Microsoft.Office.WebExtension.AsyncResultStatus.Failed, value: 1 }
  3707. ]
  3708. });
  3709. OSF.DDA.SafeArray.Delegate.executeAsync = function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) {
  3710. function toArray(args) {
  3711. var arrArgs = args;
  3712. if (OSF.OUtil.isArray(args)) {
  3713. var len = arrArgs.length;
  3714. for (var i = 0; i < len; i++) {
  3715. arrArgs[i] = toArray(arrArgs[i]);
  3716. }
  3717. }
  3718. else if (OSF.OUtil.isDate(args)) {
  3719. arrArgs = args.getVarDate();
  3720. }
  3721. else if (typeof args === "object" && !OSF.OUtil.isArray(args)) {
  3722. arrArgs = [];
  3723. for (var index in args) {
  3724. if (!OSF.OUtil.isFunction(args[index])) {
  3725. arrArgs[index] = toArray(args[index]);
  3726. }
  3727. }
  3728. }
  3729. return arrArgs;
  3730. }
  3731. function fromSafeArray(value) {
  3732. var ret = value;
  3733. if (value != null && value.toArray) {
  3734. var arrayResult = value.toArray();
  3735. ret = new Array(arrayResult.length);
  3736. for (var i = 0; i < arrayResult.length; i++) {
  3737. ret[i] = fromSafeArray(arrayResult[i]);
  3738. }
  3739. }
  3740. return ret;
  3741. }
  3742. try {
  3743. if (args.onCalling) {
  3744. args.onCalling();
  3745. }
  3746. var startTime = (new Date()).getTime();
  3747. OSF.ClientHostController.execute(args.dispId, toArray(args.hostCallArgs), function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs, resultCode) {
  3748. var result = hostResponseArgs.toArray();
  3749. var status = result[OSF.DDA.SafeArray.Response.Status];
  3750. if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeChunkResult) {
  3751. var payload = result[OSF.DDA.SafeArray.Response.Payload];
  3752. payload = fromSafeArray(payload);
  3753. if (payload != null) {
  3754. if (!args._chunkResultData) {
  3755. args._chunkResultData = new Array();
  3756. }
  3757. args._chunkResultData[payload[0]] = payload[1];
  3758. }
  3759. return false;
  3760. }
  3761. if (args.onReceiving) {
  3762. args.onReceiving();
  3763. }
  3764. if (args.onComplete) {
  3765. var payload;
  3766. if (status == OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  3767. if (result.length > 2) {
  3768. payload = [];
  3769. for (var i = 1; i < result.length; i++)
  3770. payload[i - 1] = result[i];
  3771. }
  3772. else {
  3773. payload = result[OSF.DDA.SafeArray.Response.Payload];
  3774. }
  3775. if (args._chunkResultData) {
  3776. payload = fromSafeArray(payload);
  3777. if (payload != null) {
  3778. var expectedChunkCount = payload[payload.length - 1];
  3779. if (args._chunkResultData.length == expectedChunkCount) {
  3780. payload[payload.length - 1] = args._chunkResultData;
  3781. }
  3782. else {
  3783. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  3784. }
  3785. }
  3786. }
  3787. }
  3788. else {
  3789. payload = result[OSF.DDA.SafeArray.Response.Payload];
  3790. }
  3791. args.onComplete(status, payload);
  3792. }
  3793. if (OSF.AppTelemetry) {
  3794. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status);
  3795. }
  3796. return true;
  3797. });
  3798. }
  3799. catch (ex) {
  3800. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3801. }
  3802. };
  3803. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent = function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) {
  3804. var startTime = (new Date()).getTime();
  3805. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) {
  3806. if (args.onReceiving) {
  3807. args.onReceiving();
  3808. }
  3809. var status = hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  3810. if (args.onComplete) {
  3811. args.onComplete(status);
  3812. }
  3813. if (OSF.AppTelemetry) {
  3814. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  3815. }
  3816. };
  3817. };
  3818. OSF.DDA.SafeArray.Delegate.registerEventAsync = function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) {
  3819. if (args.onCalling) {
  3820. args.onCalling();
  3821. }
  3822. var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  3823. try {
  3824. OSF.ClientHostController.registerEvent(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  3825. if (args.onEvent) {
  3826. args.onEvent(payload);
  3827. }
  3828. if (OSF.AppTelemetry) {
  3829. OSF.AppTelemetry.onEventDone(args.dispId);
  3830. }
  3831. }, callback);
  3832. }
  3833. catch (ex) {
  3834. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3835. }
  3836. };
  3837. OSF.DDA.SafeArray.Delegate.unregisterEventAsync = function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) {
  3838. if (args.onCalling) {
  3839. args.onCalling();
  3840. }
  3841. var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  3842. try {
  3843. OSF.ClientHostController.unregisterEvent(args.dispId, args.targetId, callback);
  3844. }
  3845. catch (ex) {
  3846. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  3847. }
  3848. };
  3849. OSF.ClientMode = {
  3850. ReadWrite: 0,
  3851. ReadOnly: 1
  3852. };
  3853. OSF.DDA.RichInitializationReason = {
  3854. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  3855. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  3856. };
  3857. OSF.InitializationHelper = function OSF_InitializationHelper(hostInfo, webAppState, context, settings, hostFacade) {
  3858. this._hostInfo = hostInfo;
  3859. this._webAppState = webAppState;
  3860. this._context = context;
  3861. this._settings = settings;
  3862. this._hostFacade = hostFacade;
  3863. this._initializeSettings = this.initializeSettings;
  3864. };
  3865. OSF.InitializationHelper.prototype.deserializeSettings = function OSF_InitializationHelper$deserializeSettings(serializedSettings, refreshSupported) {
  3866. var settings;
  3867. var osfSessionStorage = OSF.OUtil.getSessionStorage();
  3868. if (osfSessionStorage) {
  3869. var storageSettings = osfSessionStorage.getItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey());
  3870. if (storageSettings) {
  3871. serializedSettings = (typeof (JSON) !== "undefined") ? JSON.parse(storageSettings) : OsfMsAjaxFactory.msAjaxSerializer.deserialize(storageSettings, true);
  3872. }
  3873. else {
  3874. storageSettings = (typeof (JSON) !== "undefined") ? JSON.stringify(serializedSettings) : OsfMsAjaxFactory.msAjaxSerializer.serialize(serializedSettings);
  3875. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  3876. }
  3877. }
  3878. var deserializedSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  3879. if (refreshSupported) {
  3880. settings = new OSF.DDA.RefreshableSettings(deserializedSettings);
  3881. }
  3882. else {
  3883. settings = new OSF.DDA.Settings(deserializedSettings);
  3884. }
  3885. return settings;
  3886. };
  3887. OSF.InitializationHelper.prototype.saveAndSetDialogInfo = function OSF_InitializationHelper$saveAndSetDialogInfo(hostInfoValue) {
  3888. };
  3889. OSF.InitializationHelper.prototype.setAgaveHostCommunication = function OSF_InitializationHelper$setAgaveHostCommunication() {
  3890. };
  3891. OSF.InitializationHelper.prototype.prepareRightBeforeWebExtensionInitialize = function OSF_InitializationHelper$prepareRightBeforeWebExtensionInitialize(appContext) {
  3892. this.prepareApiSurface(appContext);
  3893. Microsoft.Office.WebExtension.initialize(this.getInitializationReason(appContext));
  3894. };
  3895. OSF.InitializationHelper.prototype.prepareApiSurface = function OSF_InitializationHelper$prepareApiSurfaceAndInitialize(appContext) {
  3896. var license = new OSF.DDA.License(appContext.get_eToken());
  3897. var getOfficeThemeHandler = (OSF.DDA.OfficeTheme && OSF.DDA.OfficeTheme.getOfficeTheme) ? OSF.DDA.OfficeTheme.getOfficeTheme : null;
  3898. if (appContext.get_isDialog()) {
  3899. if (OSF.DDA.UI.ChildUI) {
  3900. appContext.ui = new OSF.DDA.UI.ChildUI();
  3901. }
  3902. }
  3903. else {
  3904. if (OSF.DDA.UI.ParentUI) {
  3905. appContext.ui = new OSF.DDA.UI.ParentUI();
  3906. if (OfficeExt.Container) {
  3907. OSF.DDA.DispIdHost.addAsyncMethods(appContext.ui, [OSF.DDA.AsyncMethodNames.CloseContainerAsync]);
  3908. }
  3909. }
  3910. }
  3911. OSF._OfficeAppFactory.setContext(new OSF.DDA.Context(appContext, appContext.doc, license, null, getOfficeThemeHandler));
  3912. var getDelegateMethods, parameterMap;
  3913. getDelegateMethods = OSF.DDA.DispIdHost.getClientDelegateMethods;
  3914. parameterMap = OSF.DDA.SafeArray.Delegate.ParameterMap;
  3915. OSF._OfficeAppFactory.setHostFacade(new OSF.DDA.DispIdHost.Facade(getDelegateMethods, parameterMap));
  3916. };
  3917. OSF.InitializationHelper.prototype.getInitializationReason = function (appContext) { return OSF.DDA.RichInitializationReason[appContext.get_reason()]; };
  3918. OSF.DDA.DispIdHost.getClientDelegateMethods = function (actionId) {
  3919. var delegateMethods = {};
  3920. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.SafeArray.Delegate.executeAsync;
  3921. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync] = OSF.DDA.SafeArray.Delegate.registerEventAsync;
  3922. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync] = OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  3923. delegateMethods[OSF.DDA.DispIdHost.Delegates.OpenDialog] = OSF.DDA.SafeArray.Delegate.openDialog;
  3924. delegateMethods[OSF.DDA.DispIdHost.Delegates.CloseDialog] = OSF.DDA.SafeArray.Delegate.closeDialog;
  3925. delegateMethods[OSF.DDA.DispIdHost.Delegates.MessageParent] = OSF.DDA.SafeArray.Delegate.messageParent;
  3926. if (OSF.DDA.AsyncMethodNames.RefreshAsync && actionId == OSF.DDA.AsyncMethodNames.RefreshAsync.id) {
  3927. var readSerializedSettings = function (hostCallArgs, onCalling, onReceiving) {
  3928. return OSF.DDA.ClientSettingsManager.read(onCalling, onReceiving);
  3929. };
  3930. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(readSerializedSettings);
  3931. }
  3932. if (OSF.DDA.AsyncMethodNames.SaveAsync && actionId == OSF.DDA.AsyncMethodNames.SaveAsync.id) {
  3933. var writeSerializedSettings = function (hostCallArgs, onCalling, onReceiving) {
  3934. return OSF.DDA.ClientSettingsManager.write(hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings], hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale], onCalling, onReceiving);
  3935. };
  3936. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync] = OSF.DDA.ClientSettingsManager.getSettingsExecuteMethod(writeSerializedSettings);
  3937. }
  3938. return delegateMethods;
  3939. };
  3940. var OfficeExt;
  3941. (function (OfficeExt) {
  3942. var RichClientHostController = (function () {
  3943. function RichClientHostController() {
  3944. }
  3945. RichClientHostController.prototype.execute = function (id, params, callback) {
  3946. window.external.Execute(id, params, callback);
  3947. };
  3948. RichClientHostController.prototype.registerEvent = function (id, targetId, handler, callback) {
  3949. window.external.RegisterEvent(id, targetId, handler, callback);
  3950. };
  3951. RichClientHostController.prototype.unregisterEvent = function (id, targetId, callback) {
  3952. window.external.UnregisterEvent(id, targetId, callback);
  3953. };
  3954. return RichClientHostController;
  3955. })();
  3956. OfficeExt.RichClientHostController = RichClientHostController;
  3957. })(OfficeExt || (OfficeExt = {}));
  3958. var OfficeExt;
  3959. (function (OfficeExt) {
  3960. var Win32RichClientHostController = (function (_super) {
  3961. __extends(Win32RichClientHostController, _super);
  3962. function Win32RichClientHostController() {
  3963. _super.apply(this, arguments);
  3964. }
  3965. Win32RichClientHostController.prototype.messageParent = function (params) {
  3966. var message = params[Microsoft.Office.WebExtension.Parameters.MessageToParent];
  3967. window.external.MessageParent(message);
  3968. };
  3969. Win32RichClientHostController.prototype.openDialog = function (id, targetId, handler, callback) {
  3970. this.registerEvent(id, targetId, handler, callback);
  3971. };
  3972. Win32RichClientHostController.prototype.closeDialog = function (id, targetId, callback) {
  3973. this.unregisterEvent(id, targetId, callback);
  3974. };
  3975. return Win32RichClientHostController;
  3976. })(OfficeExt.RichClientHostController);
  3977. OfficeExt.Win32RichClientHostController = Win32RichClientHostController;
  3978. })(OfficeExt || (OfficeExt = {}));
  3979. OSF.ClientHostController = new OfficeExt.Win32RichClientHostController();
  3980. var OfficeExt;
  3981. (function (OfficeExt) {
  3982. var OfficeTheme;
  3983. (function (OfficeTheme) {
  3984. var OfficeThemeManager = (function () {
  3985. function OfficeThemeManager() {
  3986. this._osfOfficeTheme = null;
  3987. this._osfOfficeThemeTimeStamp = null;
  3988. }
  3989. OfficeThemeManager.prototype.getOfficeTheme = function () {
  3990. if (OSF.DDA._OsfControlContext) {
  3991. if (this._osfOfficeTheme && this._osfOfficeThemeTimeStamp && ((new Date()).getTime() - this._osfOfficeThemeTimeStamp < OfficeThemeManager._osfOfficeThemeCacheValidPeriod)) {
  3992. if (OSF.AppTelemetry) {
  3993. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", 0);
  3994. }
  3995. }
  3996. else {
  3997. var startTime = (new Date()).getTime();
  3998. var osfOfficeTheme = OSF.DDA._OsfControlContext.GetOfficeThemeInfo();
  3999. var endTime = (new Date()).getTime();
  4000. if (OSF.AppTelemetry) {
  4001. OSF.AppTelemetry.onPropertyDone("GetOfficeThemeInfo", Math.abs(endTime - startTime));
  4002. }
  4003. this._osfOfficeTheme = JSON.parse(osfOfficeTheme);
  4004. for (var color in this._osfOfficeTheme) {
  4005. this._osfOfficeTheme[color] = OSF.OUtil.convertIntToCssHexColor(this._osfOfficeTheme[color]);
  4006. }
  4007. this._osfOfficeThemeTimeStamp = endTime;
  4008. }
  4009. return this._osfOfficeTheme;
  4010. }
  4011. };
  4012. OfficeThemeManager.instance = function () {
  4013. if (OfficeThemeManager._instance == null) {
  4014. OfficeThemeManager._instance = new OfficeThemeManager();
  4015. }
  4016. return OfficeThemeManager._instance;
  4017. };
  4018. OfficeThemeManager._osfOfficeThemeCacheValidPeriod = 5000;
  4019. OfficeThemeManager._instance = null;
  4020. return OfficeThemeManager;
  4021. })();
  4022. OfficeTheme.OfficeThemeManager = OfficeThemeManager;
  4023. OSF.OUtil.setNamespace("OfficeTheme", OSF.DDA);
  4024. OSF.DDA.OfficeTheme.getOfficeTheme = OfficeExt.OfficeTheme.OfficeThemeManager.instance().getOfficeTheme;
  4025. })(OfficeTheme = OfficeExt.OfficeTheme || (OfficeExt.OfficeTheme = {}));
  4026. })(OfficeExt || (OfficeExt = {}));
  4027. OSF.DDA.ClientSettingsManager = {
  4028. getSettingsExecuteMethod: function OSF_DDA_ClientSettingsManager$getSettingsExecuteMethod(hostDelegateMethod) {
  4029. return function (args) {
  4030. var status, response;
  4031. try {
  4032. response = hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  4033. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  4034. }
  4035. catch (ex) {
  4036. status = OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  4037. response = { name: Strings.OfficeOM.L_InternalError, message: ex };
  4038. }
  4039. if (args.onComplete) {
  4040. args.onComplete(status, response);
  4041. }
  4042. };
  4043. },
  4044. read: function OSF_DDA_ClientSettingsManager$read(onCalling, onReceiving) {
  4045. var keys = [];
  4046. var values = [];
  4047. if (onCalling) {
  4048. onCalling();
  4049. }
  4050. OSF.DDA._OsfControlContext.GetSettings().Read(keys, values);
  4051. if (onReceiving) {
  4052. onReceiving();
  4053. }
  4054. var serializedSettings = {};
  4055. for (var index = 0; index < keys.length; index++) {
  4056. serializedSettings[keys[index]] = values[index];
  4057. }
  4058. return serializedSettings;
  4059. },
  4060. write: function OSF_DDA_ClientSettingsManager$write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  4061. var keys = [];
  4062. var values = [];
  4063. for (var key in serializedSettings) {
  4064. keys.push(key);
  4065. values.push(serializedSettings[key]);
  4066. }
  4067. if (onCalling) {
  4068. onCalling();
  4069. }
  4070. OSF.DDA._OsfControlContext.GetSettings().Write(keys, values);
  4071. if (onReceiving) {
  4072. onReceiving();
  4073. }
  4074. }
  4075. };
  4076. OSF.InitializationHelper.prototype.initializeSettings = function OSF_InitializationHelper$initializeSettings(refreshSupported) {
  4077. var serializedSettings = OSF.DDA.ClientSettingsManager.read();
  4078. var settings = this.deserializeSettings(serializedSettings, refreshSupported);
  4079. return settings;
  4080. };
  4081. OSF.InitializationHelper.prototype.getAppContext = function OSF_InitializationHelper$getAppContext(wnd, gotAppContext) {
  4082. var returnedContext;
  4083. var context;
  4084. var warningText = "Warning: Office.js is loaded outside of Office client";
  4085. try {
  4086. if (window.external && typeof window.external.GetContext !== 'undefined') {
  4087. context = OSF.DDA._OsfControlContext = window.external.GetContext();
  4088. }
  4089. else {
  4090. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4091. return;
  4092. }
  4093. }
  4094. catch (e) {
  4095. OsfMsAjaxFactory.msAjaxDebug.trace(warningText);
  4096. return;
  4097. }
  4098. var appType = context.GetAppType();
  4099. var id = context.GetSolutionRef();
  4100. var version = context.GetAppVersionMajor();
  4101. var minorVersion = context.GetAppVersionMinor();
  4102. var UILocale = context.GetAppUILocale();
  4103. var dataLocale = context.GetAppDataLocale();
  4104. var docUrl = context.GetDocUrl();
  4105. var clientMode = context.GetAppCapabilities();
  4106. var reason = context.GetActivationMode();
  4107. var osfControlType = context.GetControlIntegrationLevel();
  4108. var settings = [];
  4109. var eToken;
  4110. try {
  4111. eToken = context.GetSolutionToken();
  4112. }
  4113. catch (ex) {
  4114. }
  4115. var correlationId;
  4116. if (typeof context.GetCorrelationId !== "undefined") {
  4117. correlationId = context.GetCorrelationId();
  4118. }
  4119. var appInstanceId;
  4120. if (typeof context.GetInstanceId !== "undefined") {
  4121. appInstanceId = context.GetInstanceId();
  4122. }
  4123. var touchEnabled;
  4124. if (typeof context.GetTouchEnabled !== "undefined") {
  4125. touchEnabled = context.GetTouchEnabled();
  4126. }
  4127. var commerceAllowed;
  4128. if (typeof context.GetCommerceAllowed !== "undefined") {
  4129. commerceAllowed = context.GetCommerceAllowed();
  4130. }
  4131. var requirementMatrix;
  4132. if (typeof context.GetSupportedMatrix !== "undefined") {
  4133. requirementMatrix = context.GetSupportedMatrix();
  4134. }
  4135. var hostCustomMessage;
  4136. if (typeof context.GetHostCustomMessage !== "undefined") {
  4137. hostCustomMessage = context.GetHostCustomMessage();
  4138. }
  4139. var hostFullVersion;
  4140. if (typeof context.GetHostFullVersion !== "undefined") {
  4141. hostFullVersion = context.GetHostFullVersion();
  4142. }
  4143. eToken = eToken ? eToken.toString() : "";
  4144. returnedContext = new OSF.OfficeAppContext(id, appType, version, UILocale, dataLocale, docUrl, clientMode, settings, reason, osfControlType, eToken, correlationId, appInstanceId, touchEnabled, commerceAllowed, minorVersion, requirementMatrix, hostCustomMessage, hostFullVersion);
  4145. if (OSF.AppTelemetry) {
  4146. OSF.AppTelemetry.initialize(returnedContext);
  4147. }
  4148. gotAppContext(returnedContext);
  4149. };
  4150. var OSFLog;
  4151. (function (OSFLog) {
  4152. var BaseUsageData = (function () {
  4153. function BaseUsageData(table) {
  4154. this._table = table;
  4155. this._fields = {};
  4156. }
  4157. Object.defineProperty(BaseUsageData.prototype, "Fields", {
  4158. get: function () {
  4159. return this._fields;
  4160. },
  4161. enumerable: true,
  4162. configurable: true
  4163. });
  4164. Object.defineProperty(BaseUsageData.prototype, "Table", {
  4165. get: function () {
  4166. return this._table;
  4167. },
  4168. enumerable: true,
  4169. configurable: true
  4170. });
  4171. BaseUsageData.prototype.SerializeFields = function () {
  4172. };
  4173. BaseUsageData.prototype.SetSerializedField = function (key, value) {
  4174. if (typeof (value) !== "undefined" && value !== null) {
  4175. this._serializedFields[key] = value.toString();
  4176. }
  4177. };
  4178. BaseUsageData.prototype.SerializeRow = function () {
  4179. this._serializedFields = {};
  4180. this.SetSerializedField("Table", this._table);
  4181. this.SerializeFields();
  4182. return JSON.stringify(this._serializedFields);
  4183. };
  4184. return BaseUsageData;
  4185. })();
  4186. OSFLog.BaseUsageData = BaseUsageData;
  4187. var AppActivatedUsageData = (function (_super) {
  4188. __extends(AppActivatedUsageData, _super);
  4189. function AppActivatedUsageData() {
  4190. _super.call(this, "AppActivated");
  4191. }
  4192. Object.defineProperty(AppActivatedUsageData.prototype, "CorrelationId", {
  4193. get: function () { return this.Fields["CorrelationId"]; },
  4194. set: function (value) { this.Fields["CorrelationId"] = value; },
  4195. enumerable: true,
  4196. configurable: true
  4197. });
  4198. Object.defineProperty(AppActivatedUsageData.prototype, "SessionId", {
  4199. get: function () { return this.Fields["SessionId"]; },
  4200. set: function (value) { this.Fields["SessionId"] = value; },
  4201. enumerable: true,
  4202. configurable: true
  4203. });
  4204. Object.defineProperty(AppActivatedUsageData.prototype, "AppId", {
  4205. get: function () { return this.Fields["AppId"]; },
  4206. set: function (value) { this.Fields["AppId"] = value; },
  4207. enumerable: true,
  4208. configurable: true
  4209. });
  4210. Object.defineProperty(AppActivatedUsageData.prototype, "AppInstanceId", {
  4211. get: function () { return this.Fields["AppInstanceId"]; },
  4212. set: function (value) { this.Fields["AppInstanceId"] = value; },
  4213. enumerable: true,
  4214. configurable: true
  4215. });
  4216. Object.defineProperty(AppActivatedUsageData.prototype, "AppURL", {
  4217. get: function () { return this.Fields["AppURL"]; },
  4218. set: function (value) { this.Fields["AppURL"] = value; },
  4219. enumerable: true,
  4220. configurable: true
  4221. });
  4222. Object.defineProperty(AppActivatedUsageData.prototype, "AssetId", {
  4223. get: function () { return this.Fields["AssetId"]; },
  4224. set: function (value) { this.Fields["AssetId"] = value; },
  4225. enumerable: true,
  4226. configurable: true
  4227. });
  4228. Object.defineProperty(AppActivatedUsageData.prototype, "Browser", {
  4229. get: function () { return this.Fields["Browser"]; },
  4230. set: function (value) { this.Fields["Browser"] = value; },
  4231. enumerable: true,
  4232. configurable: true
  4233. });
  4234. Object.defineProperty(AppActivatedUsageData.prototype, "UserId", {
  4235. get: function () { return this.Fields["UserId"]; },
  4236. set: function (value) { this.Fields["UserId"] = value; },
  4237. enumerable: true,
  4238. configurable: true
  4239. });
  4240. Object.defineProperty(AppActivatedUsageData.prototype, "Host", {
  4241. get: function () { return this.Fields["Host"]; },
  4242. set: function (value) { this.Fields["Host"] = value; },
  4243. enumerable: true,
  4244. configurable: true
  4245. });
  4246. Object.defineProperty(AppActivatedUsageData.prototype, "HostVersion", {
  4247. get: function () { return this.Fields["HostVersion"]; },
  4248. set: function (value) { this.Fields["HostVersion"] = value; },
  4249. enumerable: true,
  4250. configurable: true
  4251. });
  4252. Object.defineProperty(AppActivatedUsageData.prototype, "ClientId", {
  4253. get: function () { return this.Fields["ClientId"]; },
  4254. set: function (value) { this.Fields["ClientId"] = value; },
  4255. enumerable: true,
  4256. configurable: true
  4257. });
  4258. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeWidth", {
  4259. get: function () { return this.Fields["AppSizeWidth"]; },
  4260. set: function (value) { this.Fields["AppSizeWidth"] = value; },
  4261. enumerable: true,
  4262. configurable: true
  4263. });
  4264. Object.defineProperty(AppActivatedUsageData.prototype, "AppSizeHeight", {
  4265. get: function () { return this.Fields["AppSizeHeight"]; },
  4266. set: function (value) { this.Fields["AppSizeHeight"] = value; },
  4267. enumerable: true,
  4268. configurable: true
  4269. });
  4270. Object.defineProperty(AppActivatedUsageData.prototype, "Message", {
  4271. get: function () { return this.Fields["Message"]; },
  4272. set: function (value) { this.Fields["Message"] = value; },
  4273. enumerable: true,
  4274. configurable: true
  4275. });
  4276. Object.defineProperty(AppActivatedUsageData.prototype, "DocUrl", {
  4277. get: function () { return this.Fields["DocUrl"]; },
  4278. set: function (value) { this.Fields["DocUrl"] = value; },
  4279. enumerable: true,
  4280. configurable: true
  4281. });
  4282. Object.defineProperty(AppActivatedUsageData.prototype, "OfficeJSVersion", {
  4283. get: function () { return this.Fields["OfficeJSVersion"]; },
  4284. set: function (value) { this.Fields["OfficeJSVersion"] = value; },
  4285. enumerable: true,
  4286. configurable: true
  4287. });
  4288. Object.defineProperty(AppActivatedUsageData.prototype, "HostJSVersion", {
  4289. get: function () { return this.Fields["HostJSVersion"]; },
  4290. set: function (value) { this.Fields["HostJSVersion"] = value; },
  4291. enumerable: true,
  4292. configurable: true
  4293. });
  4294. AppActivatedUsageData.prototype.SerializeFields = function () {
  4295. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4296. this.SetSerializedField("SessionId", this.SessionId);
  4297. this.SetSerializedField("AppId", this.AppId);
  4298. this.SetSerializedField("AppInstanceId", this.AppInstanceId);
  4299. this.SetSerializedField("AppURL", this.AppURL);
  4300. this.SetSerializedField("AssetId", this.AssetId);
  4301. this.SetSerializedField("Browser", this.Browser);
  4302. this.SetSerializedField("UserId", this.UserId);
  4303. this.SetSerializedField("Host", this.Host);
  4304. this.SetSerializedField("HostVersion", this.HostVersion);
  4305. this.SetSerializedField("ClientId", this.ClientId);
  4306. this.SetSerializedField("AppSizeWidth", this.AppSizeWidth);
  4307. this.SetSerializedField("AppSizeHeight", this.AppSizeHeight);
  4308. this.SetSerializedField("Message", this.Message);
  4309. this.SetSerializedField("DocUrl", this.DocUrl);
  4310. this.SetSerializedField("OfficeJSVersion", this.OfficeJSVersion);
  4311. this.SetSerializedField("HostJSVersion", this.HostJSVersion);
  4312. };
  4313. return AppActivatedUsageData;
  4314. })(BaseUsageData);
  4315. OSFLog.AppActivatedUsageData = AppActivatedUsageData;
  4316. var ScriptLoadUsageData = (function (_super) {
  4317. __extends(ScriptLoadUsageData, _super);
  4318. function ScriptLoadUsageData() {
  4319. _super.call(this, "ScriptLoad");
  4320. }
  4321. Object.defineProperty(ScriptLoadUsageData.prototype, "CorrelationId", {
  4322. get: function () { return this.Fields["CorrelationId"]; },
  4323. set: function (value) { this.Fields["CorrelationId"] = value; },
  4324. enumerable: true,
  4325. configurable: true
  4326. });
  4327. Object.defineProperty(ScriptLoadUsageData.prototype, "SessionId", {
  4328. get: function () { return this.Fields["SessionId"]; },
  4329. set: function (value) { this.Fields["SessionId"] = value; },
  4330. enumerable: true,
  4331. configurable: true
  4332. });
  4333. Object.defineProperty(ScriptLoadUsageData.prototype, "ScriptId", {
  4334. get: function () { return this.Fields["ScriptId"]; },
  4335. set: function (value) { this.Fields["ScriptId"] = value; },
  4336. enumerable: true,
  4337. configurable: true
  4338. });
  4339. Object.defineProperty(ScriptLoadUsageData.prototype, "StartTime", {
  4340. get: function () { return this.Fields["StartTime"]; },
  4341. set: function (value) { this.Fields["StartTime"] = value; },
  4342. enumerable: true,
  4343. configurable: true
  4344. });
  4345. Object.defineProperty(ScriptLoadUsageData.prototype, "ResponseTime", {
  4346. get: function () { return this.Fields["ResponseTime"]; },
  4347. set: function (value) { this.Fields["ResponseTime"] = value; },
  4348. enumerable: true,
  4349. configurable: true
  4350. });
  4351. ScriptLoadUsageData.prototype.SerializeFields = function () {
  4352. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4353. this.SetSerializedField("SessionId", this.SessionId);
  4354. this.SetSerializedField("ScriptId", this.ScriptId);
  4355. this.SetSerializedField("StartTime", this.StartTime);
  4356. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4357. };
  4358. return ScriptLoadUsageData;
  4359. })(BaseUsageData);
  4360. OSFLog.ScriptLoadUsageData = ScriptLoadUsageData;
  4361. var AppClosedUsageData = (function (_super) {
  4362. __extends(AppClosedUsageData, _super);
  4363. function AppClosedUsageData() {
  4364. _super.call(this, "AppClosed");
  4365. }
  4366. Object.defineProperty(AppClosedUsageData.prototype, "CorrelationId", {
  4367. get: function () { return this.Fields["CorrelationId"]; },
  4368. set: function (value) { this.Fields["CorrelationId"] = value; },
  4369. enumerable: true,
  4370. configurable: true
  4371. });
  4372. Object.defineProperty(AppClosedUsageData.prototype, "SessionId", {
  4373. get: function () { return this.Fields["SessionId"]; },
  4374. set: function (value) { this.Fields["SessionId"] = value; },
  4375. enumerable: true,
  4376. configurable: true
  4377. });
  4378. Object.defineProperty(AppClosedUsageData.prototype, "FocusTime", {
  4379. get: function () { return this.Fields["FocusTime"]; },
  4380. set: function (value) { this.Fields["FocusTime"] = value; },
  4381. enumerable: true,
  4382. configurable: true
  4383. });
  4384. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalWidth", {
  4385. get: function () { return this.Fields["AppSizeFinalWidth"]; },
  4386. set: function (value) { this.Fields["AppSizeFinalWidth"] = value; },
  4387. enumerable: true,
  4388. configurable: true
  4389. });
  4390. Object.defineProperty(AppClosedUsageData.prototype, "AppSizeFinalHeight", {
  4391. get: function () { return this.Fields["AppSizeFinalHeight"]; },
  4392. set: function (value) { this.Fields["AppSizeFinalHeight"] = value; },
  4393. enumerable: true,
  4394. configurable: true
  4395. });
  4396. Object.defineProperty(AppClosedUsageData.prototype, "OpenTime", {
  4397. get: function () { return this.Fields["OpenTime"]; },
  4398. set: function (value) { this.Fields["OpenTime"] = value; },
  4399. enumerable: true,
  4400. configurable: true
  4401. });
  4402. Object.defineProperty(AppClosedUsageData.prototype, "CloseMethod", {
  4403. get: function () { return this.Fields["CloseMethod"]; },
  4404. set: function (value) { this.Fields["CloseMethod"] = value; },
  4405. enumerable: true,
  4406. configurable: true
  4407. });
  4408. AppClosedUsageData.prototype.SerializeFields = function () {
  4409. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4410. this.SetSerializedField("SessionId", this.SessionId);
  4411. this.SetSerializedField("FocusTime", this.FocusTime);
  4412. this.SetSerializedField("AppSizeFinalWidth", this.AppSizeFinalWidth);
  4413. this.SetSerializedField("AppSizeFinalHeight", this.AppSizeFinalHeight);
  4414. this.SetSerializedField("OpenTime", this.OpenTime);
  4415. this.SetSerializedField("CloseMethod", this.CloseMethod);
  4416. };
  4417. return AppClosedUsageData;
  4418. })(BaseUsageData);
  4419. OSFLog.AppClosedUsageData = AppClosedUsageData;
  4420. var APIUsageUsageData = (function (_super) {
  4421. __extends(APIUsageUsageData, _super);
  4422. function APIUsageUsageData() {
  4423. _super.call(this, "APIUsage");
  4424. }
  4425. Object.defineProperty(APIUsageUsageData.prototype, "CorrelationId", {
  4426. get: function () { return this.Fields["CorrelationId"]; },
  4427. set: function (value) { this.Fields["CorrelationId"] = value; },
  4428. enumerable: true,
  4429. configurable: true
  4430. });
  4431. Object.defineProperty(APIUsageUsageData.prototype, "SessionId", {
  4432. get: function () { return this.Fields["SessionId"]; },
  4433. set: function (value) { this.Fields["SessionId"] = value; },
  4434. enumerable: true,
  4435. configurable: true
  4436. });
  4437. Object.defineProperty(APIUsageUsageData.prototype, "APIType", {
  4438. get: function () { return this.Fields["APIType"]; },
  4439. set: function (value) { this.Fields["APIType"] = value; },
  4440. enumerable: true,
  4441. configurable: true
  4442. });
  4443. Object.defineProperty(APIUsageUsageData.prototype, "APIID", {
  4444. get: function () { return this.Fields["APIID"]; },
  4445. set: function (value) { this.Fields["APIID"] = value; },
  4446. enumerable: true,
  4447. configurable: true
  4448. });
  4449. Object.defineProperty(APIUsageUsageData.prototype, "Parameters", {
  4450. get: function () { return this.Fields["Parameters"]; },
  4451. set: function (value) { this.Fields["Parameters"] = value; },
  4452. enumerable: true,
  4453. configurable: true
  4454. });
  4455. Object.defineProperty(APIUsageUsageData.prototype, "ResponseTime", {
  4456. get: function () { return this.Fields["ResponseTime"]; },
  4457. set: function (value) { this.Fields["ResponseTime"] = value; },
  4458. enumerable: true,
  4459. configurable: true
  4460. });
  4461. Object.defineProperty(APIUsageUsageData.prototype, "ErrorType", {
  4462. get: function () { return this.Fields["ErrorType"]; },
  4463. set: function (value) { this.Fields["ErrorType"] = value; },
  4464. enumerable: true,
  4465. configurable: true
  4466. });
  4467. APIUsageUsageData.prototype.SerializeFields = function () {
  4468. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4469. this.SetSerializedField("SessionId", this.SessionId);
  4470. this.SetSerializedField("APIType", this.APIType);
  4471. this.SetSerializedField("APIID", this.APIID);
  4472. this.SetSerializedField("Parameters", this.Parameters);
  4473. this.SetSerializedField("ResponseTime", this.ResponseTime);
  4474. this.SetSerializedField("ErrorType", this.ErrorType);
  4475. };
  4476. return APIUsageUsageData;
  4477. })(BaseUsageData);
  4478. OSFLog.APIUsageUsageData = APIUsageUsageData;
  4479. var AppInitializationUsageData = (function (_super) {
  4480. __extends(AppInitializationUsageData, _super);
  4481. function AppInitializationUsageData() {
  4482. _super.call(this, "AppInitialization");
  4483. }
  4484. Object.defineProperty(AppInitializationUsageData.prototype, "CorrelationId", {
  4485. get: function () { return this.Fields["CorrelationId"]; },
  4486. set: function (value) { this.Fields["CorrelationId"] = value; },
  4487. enumerable: true,
  4488. configurable: true
  4489. });
  4490. Object.defineProperty(AppInitializationUsageData.prototype, "SessionId", {
  4491. get: function () { return this.Fields["SessionId"]; },
  4492. set: function (value) { this.Fields["SessionId"] = value; },
  4493. enumerable: true,
  4494. configurable: true
  4495. });
  4496. Object.defineProperty(AppInitializationUsageData.prototype, "SuccessCode", {
  4497. get: function () { return this.Fields["SuccessCode"]; },
  4498. set: function (value) { this.Fields["SuccessCode"] = value; },
  4499. enumerable: true,
  4500. configurable: true
  4501. });
  4502. Object.defineProperty(AppInitializationUsageData.prototype, "Message", {
  4503. get: function () { return this.Fields["Message"]; },
  4504. set: function (value) { this.Fields["Message"] = value; },
  4505. enumerable: true,
  4506. configurable: true
  4507. });
  4508. AppInitializationUsageData.prototype.SerializeFields = function () {
  4509. this.SetSerializedField("CorrelationId", this.CorrelationId);
  4510. this.SetSerializedField("SessionId", this.SessionId);
  4511. this.SetSerializedField("SuccessCode", this.SuccessCode);
  4512. this.SetSerializedField("Message", this.Message);
  4513. };
  4514. return AppInitializationUsageData;
  4515. })(BaseUsageData);
  4516. OSFLog.AppInitializationUsageData = AppInitializationUsageData;
  4517. })(OSFLog || (OSFLog = {}));
  4518. var Logger;
  4519. (function (Logger) {
  4520. "use strict";
  4521. (function (TraceLevel) {
  4522. TraceLevel[TraceLevel["info"] = 0] = "info";
  4523. TraceLevel[TraceLevel["warning"] = 1] = "warning";
  4524. TraceLevel[TraceLevel["error"] = 2] = "error";
  4525. })(Logger.TraceLevel || (Logger.TraceLevel = {}));
  4526. var TraceLevel = Logger.TraceLevel;
  4527. (function (SendFlag) {
  4528. SendFlag[SendFlag["none"] = 0] = "none";
  4529. SendFlag[SendFlag["flush"] = 1] = "flush";
  4530. })(Logger.SendFlag || (Logger.SendFlag = {}));
  4531. var SendFlag = Logger.SendFlag;
  4532. function allowUploadingData() {
  4533. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4534. OSF.Logger.ulsEndpoint.loadProxyFrame();
  4535. }
  4536. }
  4537. Logger.allowUploadingData = allowUploadingData;
  4538. function sendLog(traceLevel, message, flag) {
  4539. if (OSF.Logger && OSF.Logger.ulsEndpoint) {
  4540. var jsonObj = { traceLevel: traceLevel, message: message, flag: flag, internalLog: true };
  4541. var logs = JSON.stringify(jsonObj);
  4542. OSF.Logger.ulsEndpoint.writeLog(logs);
  4543. }
  4544. }
  4545. Logger.sendLog = sendLog;
  4546. function creatULSEndpoint() {
  4547. try {
  4548. return new ULSEndpointProxy();
  4549. }
  4550. catch (e) {
  4551. return null;
  4552. }
  4553. }
  4554. var ULSEndpointProxy = (function () {
  4555. function ULSEndpointProxy() {
  4556. var _this = this;
  4557. this.proxyFrame = null;
  4558. this.telemetryEndPoint = "https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html";
  4559. this.buffer = [];
  4560. this.proxyFrameReady = false;
  4561. OSF.OUtil.addEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4562. setTimeout(function () {
  4563. _this.loadProxyFrame();
  4564. }, 3000);
  4565. }
  4566. ULSEndpointProxy.prototype.writeLog = function (log) {
  4567. if (this.proxyFrameReady === true) {
  4568. this.proxyFrame.contentWindow.postMessage(log, ULSEndpointProxy.telemetryOrigin);
  4569. }
  4570. else {
  4571. if (this.buffer.length < 128) {
  4572. this.buffer.push(log);
  4573. }
  4574. }
  4575. };
  4576. ULSEndpointProxy.prototype.loadProxyFrame = function () {
  4577. if (this.proxyFrame == null) {
  4578. this.proxyFrame = document.createElement("iframe");
  4579. this.proxyFrame.setAttribute("style", "display:none");
  4580. this.proxyFrame.setAttribute("src", this.telemetryEndPoint);
  4581. document.head.appendChild(this.proxyFrame);
  4582. }
  4583. };
  4584. ULSEndpointProxy.prototype.tellProxyFrameReady = function (e) {
  4585. var _this = this;
  4586. if (e.data === "ProxyFrameReadyToLog") {
  4587. this.proxyFrameReady = true;
  4588. for (var i = 0; i < this.buffer.length; i++) {
  4589. this.writeLog(this.buffer[i]);
  4590. }
  4591. this.buffer.length = 0;
  4592. OSF.OUtil.removeEventListener(window, "message", function (e) { return _this.tellProxyFrameReady(e); });
  4593. }
  4594. else if (e.data === "ProxyFrameReadyToInit") {
  4595. var initJson = { appName: "Office APPs", sessionId: OSF.OUtil.Guid.generateNewGuid() };
  4596. var initStr = JSON.stringify(initJson);
  4597. this.proxyFrame.contentWindow.postMessage(initStr, ULSEndpointProxy.telemetryOrigin);
  4598. }
  4599. };
  4600. ULSEndpointProxy.telemetryOrigin = "https://telemetryservice.firstpartyapps.oaspapps.com";
  4601. return ULSEndpointProxy;
  4602. })();
  4603. if (!OSF.Logger) {
  4604. OSF.Logger = Logger;
  4605. }
  4606. Logger.ulsEndpoint = creatULSEndpoint();
  4607. })(Logger || (Logger = {}));
  4608. var OSFAppTelemetry;
  4609. (function (OSFAppTelemetry) {
  4610. "use strict";
  4611. var appInfo;
  4612. var sessionId = OSF.OUtil.Guid.generateNewGuid();
  4613. var osfControlAppCorrelationId = "";
  4614. var omexDomainRegex = new RegExp("^https?://store\\.office(ppe|-int)?\\.com/", "i");
  4615. ;
  4616. var AppInfo = (function () {
  4617. function AppInfo() {
  4618. }
  4619. return AppInfo;
  4620. })();
  4621. var Event = (function () {
  4622. function Event(name, handler) {
  4623. this.name = name;
  4624. this.handler = handler;
  4625. }
  4626. return Event;
  4627. })();
  4628. var AppStorage = (function () {
  4629. function AppStorage() {
  4630. this.clientIDKey = "Office API client";
  4631. this.logIdSetKey = "Office App Log Id Set";
  4632. }
  4633. AppStorage.prototype.getClientId = function () {
  4634. var clientId = this.getValue(this.clientIDKey);
  4635. if (!clientId || clientId.length <= 0 || clientId.length > 40) {
  4636. clientId = OSF.OUtil.Guid.generateNewGuid();
  4637. this.setValue(this.clientIDKey, clientId);
  4638. }
  4639. return clientId;
  4640. };
  4641. AppStorage.prototype.saveLog = function (logId, log) {
  4642. var logIdSet = this.getValue(this.logIdSetKey);
  4643. logIdSet = ((logIdSet && logIdSet.length > 0) ? (logIdSet + ";") : "") + logId;
  4644. this.setValue(this.logIdSetKey, logIdSet);
  4645. this.setValue(logId, log);
  4646. };
  4647. AppStorage.prototype.enumerateLog = function (callback, clean) {
  4648. var logIdSet = this.getValue(this.logIdSetKey);
  4649. if (logIdSet) {
  4650. var ids = logIdSet.split(";");
  4651. for (var id in ids) {
  4652. var logId = ids[id];
  4653. var log = this.getValue(logId);
  4654. if (log) {
  4655. if (callback) {
  4656. callback(logId, log);
  4657. }
  4658. if (clean) {
  4659. this.remove(logId);
  4660. }
  4661. }
  4662. }
  4663. if (clean) {
  4664. this.remove(this.logIdSetKey);
  4665. }
  4666. }
  4667. };
  4668. AppStorage.prototype.getValue = function (key) {
  4669. var osfLocalStorage = OSF.OUtil.getLocalStorage();
  4670. var value = "";
  4671. if (osfLocalStorage) {
  4672. value = osfLocalStorage.getItem(key);
  4673. }
  4674. return value;
  4675. };
  4676. AppStorage.prototype.setValue = function (key, value) {
  4677. var osfLocalStorage = OSF.OUtil.getLocalStorage();
  4678. if (osfLocalStorage) {
  4679. osfLocalStorage.setItem(key, value);
  4680. }
  4681. };
  4682. AppStorage.prototype.remove = function (key) {
  4683. var osfLocalStorage = OSF.OUtil.getLocalStorage();
  4684. if (osfLocalStorage) {
  4685. try {
  4686. osfLocalStorage.removeItem(key);
  4687. }
  4688. catch (ex) {
  4689. }
  4690. }
  4691. };
  4692. return AppStorage;
  4693. })();
  4694. var AppLogger = (function () {
  4695. function AppLogger() {
  4696. }
  4697. AppLogger.prototype.LogData = function (data) {
  4698. if (!OSF.Logger) {
  4699. return;
  4700. }
  4701. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, data.SerializeRow(), OSF.Logger.SendFlag.none);
  4702. };
  4703. AppLogger.prototype.LogRawData = function (log) {
  4704. if (!OSF.Logger) {
  4705. return;
  4706. }
  4707. OSF.Logger.sendLog(OSF.Logger.TraceLevel.info, log, OSF.Logger.SendFlag.none);
  4708. };
  4709. return AppLogger;
  4710. })();
  4711. function initialize(context) {
  4712. if (!OSF.Logger) {
  4713. return;
  4714. }
  4715. if (appInfo) {
  4716. return;
  4717. }
  4718. appInfo = new AppInfo();
  4719. if (context.get_hostFullVersion()) {
  4720. appInfo.hostVersion = context.get_hostFullVersion();
  4721. }
  4722. else {
  4723. appInfo.hostVersion = context.get_appVersion();
  4724. }
  4725. appInfo.appId = context.get_id();
  4726. appInfo.host = context.get_appName();
  4727. appInfo.browser = window.navigator.userAgent;
  4728. appInfo.correlationId = context.get_correlationId();
  4729. appInfo.clientId = (new AppStorage()).getClientId();
  4730. appInfo.appInstanceId = context.get_appInstanceId();
  4731. if (appInfo.appInstanceId) {
  4732. appInfo.appInstanceId = appInfo.appInstanceId.replace(/[{}]/g, "").toLowerCase();
  4733. }
  4734. appInfo.message = context.get_hostCustomMessage();
  4735. appInfo.officeJSVersion = OSF.ConstantNames.FileVersion;
  4736. appInfo.hostJSVersion = "16.0.7310.1000";
  4737. var docUrl = context.get_docUrl();
  4738. appInfo.docUrl = omexDomainRegex.test(docUrl) ? docUrl : "";
  4739. var index = location.href.indexOf("?");
  4740. appInfo.appURL = (index == -1) ? location.href : location.href.substring(0, index);
  4741. (function getUserIdAndAssetIdFromToken(token, appInfo) {
  4742. var xmlContent;
  4743. var parser;
  4744. var xmlDoc;
  4745. appInfo.assetId = "";
  4746. appInfo.userId = "";
  4747. try {
  4748. xmlContent = decodeURIComponent(token);
  4749. parser = new DOMParser();
  4750. xmlDoc = parser.parseFromString(xmlContent, "text/xml");
  4751. appInfo.userId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("cid").nodeValue;
  4752. appInfo.assetId = xmlDoc.getElementsByTagName("t")[0].attributes.getNamedItem("aid").nodeValue;
  4753. }
  4754. catch (e) {
  4755. }
  4756. finally {
  4757. xmlContent = null;
  4758. xmlDoc = null;
  4759. parser = null;
  4760. }
  4761. })(context.get_eToken(), appInfo);
  4762. (function handleLifecycle() {
  4763. var startTime = new Date();
  4764. var lastFocus = null;
  4765. var focusTime = 0;
  4766. var finished = false;
  4767. var adjustFocusTime = function () {
  4768. if (document.hasFocus()) {
  4769. if (lastFocus == null) {
  4770. lastFocus = new Date();
  4771. }
  4772. }
  4773. else if (lastFocus) {
  4774. focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime());
  4775. lastFocus = null;
  4776. }
  4777. };
  4778. var eventList = [];
  4779. eventList.push(new Event("focus", adjustFocusTime));
  4780. eventList.push(new Event("blur", adjustFocusTime));
  4781. eventList.push(new Event("focusout", adjustFocusTime));
  4782. eventList.push(new Event("focusin", adjustFocusTime));
  4783. var exitFunction = function () {
  4784. for (var i = 0; i < eventList.length; i++) {
  4785. OSF.OUtil.removeEventListener(window, eventList[i].name, eventList[i].handler);
  4786. }
  4787. eventList.length = 0;
  4788. if (!finished) {
  4789. if (document.hasFocus() && lastFocus) {
  4790. focusTime += Math.abs((new Date()).getTime() - lastFocus.getTime());
  4791. lastFocus = null;
  4792. }
  4793. OSFAppTelemetry.onAppClosed(Math.abs((new Date()).getTime() - startTime.getTime()), focusTime);
  4794. finished = true;
  4795. }
  4796. };
  4797. eventList.push(new Event("beforeunload", exitFunction));
  4798. eventList.push(new Event("unload", exitFunction));
  4799. for (var i = 0; i < eventList.length; i++) {
  4800. OSF.OUtil.addEventListener(window, eventList[i].name, eventList[i].handler);
  4801. }
  4802. adjustFocusTime();
  4803. })();
  4804. OSFAppTelemetry.onAppActivated();
  4805. }
  4806. OSFAppTelemetry.initialize = initialize;
  4807. function onAppActivated() {
  4808. if (!appInfo) {
  4809. return;
  4810. }
  4811. (new AppStorage()).enumerateLog(function (id, log) { return (new AppLogger()).LogRawData(log); }, true);
  4812. var data = new OSFLog.AppActivatedUsageData();
  4813. data.SessionId = sessionId;
  4814. data.AppId = appInfo.appId;
  4815. data.AssetId = appInfo.assetId;
  4816. data.AppURL = appInfo.appURL;
  4817. data.UserId = appInfo.userId;
  4818. data.ClientId = appInfo.clientId;
  4819. data.Browser = appInfo.browser;
  4820. data.Host = appInfo.host;
  4821. data.HostVersion = appInfo.hostVersion;
  4822. data.CorrelationId = appInfo.correlationId;
  4823. data.AppSizeWidth = window.innerWidth;
  4824. data.AppSizeHeight = window.innerHeight;
  4825. data.AppInstanceId = appInfo.appInstanceId;
  4826. data.Message = appInfo.message;
  4827. data.DocUrl = appInfo.docUrl;
  4828. data.OfficeJSVersion = appInfo.officeJSVersion;
  4829. data.HostJSVersion = appInfo.hostJSVersion;
  4830. (new AppLogger()).LogData(data);
  4831. setTimeout(function () {
  4832. if (!OSF.Logger) {
  4833. return;
  4834. }
  4835. OSF.Logger.allowUploadingData();
  4836. }, 100);
  4837. }
  4838. OSFAppTelemetry.onAppActivated = onAppActivated;
  4839. function onScriptDone(scriptId, msStartTime, msResponseTime, appCorrelationId) {
  4840. var data = new OSFLog.ScriptLoadUsageData();
  4841. data.CorrelationId = appCorrelationId;
  4842. data.SessionId = sessionId;
  4843. data.ScriptId = scriptId;
  4844. data.StartTime = msStartTime;
  4845. data.ResponseTime = msResponseTime;
  4846. (new AppLogger()).LogData(data);
  4847. }
  4848. OSFAppTelemetry.onScriptDone = onScriptDone;
  4849. function onCallDone(apiType, id, parameters, msResponseTime, errorType) {
  4850. if (!appInfo) {
  4851. return;
  4852. }
  4853. var data = new OSFLog.APIUsageUsageData();
  4854. data.CorrelationId = osfControlAppCorrelationId;
  4855. data.SessionId = sessionId;
  4856. data.APIType = apiType;
  4857. data.APIID = id;
  4858. data.Parameters = parameters;
  4859. data.ResponseTime = msResponseTime;
  4860. data.ErrorType = errorType;
  4861. (new AppLogger()).LogData(data);
  4862. }
  4863. OSFAppTelemetry.onCallDone = onCallDone;
  4864. ;
  4865. function onMethodDone(id, args, msResponseTime, errorType) {
  4866. var parameters = null;
  4867. if (args) {
  4868. if (typeof args == "number") {
  4869. parameters = String(args);
  4870. }
  4871. else if (typeof args === "object") {
  4872. for (var index in args) {
  4873. if (parameters !== null) {
  4874. parameters += ",";
  4875. }
  4876. else {
  4877. parameters = "";
  4878. }
  4879. if (typeof args[index] == "number") {
  4880. parameters += String(args[index]);
  4881. }
  4882. }
  4883. }
  4884. else {
  4885. parameters = "";
  4886. }
  4887. }
  4888. OSF.AppTelemetry.onCallDone("method", id, parameters, msResponseTime, errorType);
  4889. }
  4890. OSFAppTelemetry.onMethodDone = onMethodDone;
  4891. function onPropertyDone(propertyName, msResponseTime) {
  4892. OSF.AppTelemetry.onCallDone("property", -1, propertyName, msResponseTime);
  4893. }
  4894. OSFAppTelemetry.onPropertyDone = onPropertyDone;
  4895. function onEventDone(id, errorType) {
  4896. OSF.AppTelemetry.onCallDone("event", id, null, 0, errorType);
  4897. }
  4898. OSFAppTelemetry.onEventDone = onEventDone;
  4899. function onRegisterDone(register, id, msResponseTime, errorType) {
  4900. OSF.AppTelemetry.onCallDone(register ? "registerevent" : "unregisterevent", id, null, msResponseTime, errorType);
  4901. }
  4902. OSFAppTelemetry.onRegisterDone = onRegisterDone;
  4903. function onAppClosed(openTime, focusTime) {
  4904. if (!appInfo) {
  4905. return;
  4906. }
  4907. var data = new OSFLog.AppClosedUsageData();
  4908. data.CorrelationId = osfControlAppCorrelationId;
  4909. data.SessionId = sessionId;
  4910. data.FocusTime = focusTime;
  4911. data.OpenTime = openTime;
  4912. data.AppSizeFinalWidth = window.innerWidth;
  4913. data.AppSizeFinalHeight = window.innerHeight;
  4914. (new AppStorage()).saveLog(sessionId, data.SerializeRow());
  4915. }
  4916. OSFAppTelemetry.onAppClosed = onAppClosed;
  4917. function setOsfControlAppCorrelationId(correlationId) {
  4918. osfControlAppCorrelationId = correlationId;
  4919. }
  4920. OSFAppTelemetry.setOsfControlAppCorrelationId = setOsfControlAppCorrelationId;
  4921. function doAppInitializationLogging(isException, message) {
  4922. var data = new OSFLog.AppInitializationUsageData();
  4923. data.CorrelationId = osfControlAppCorrelationId;
  4924. data.SessionId = sessionId;
  4925. data.SuccessCode = isException ? 1 : 0;
  4926. data.Message = message;
  4927. (new AppLogger()).LogData(data);
  4928. }
  4929. OSFAppTelemetry.doAppInitializationLogging = doAppInitializationLogging;
  4930. function logAppCommonMessage(message) {
  4931. doAppInitializationLogging(false, message);
  4932. }
  4933. OSFAppTelemetry.logAppCommonMessage = logAppCommonMessage;
  4934. function logAppException(errorMessage) {
  4935. doAppInitializationLogging(true, errorMessage);
  4936. }
  4937. OSFAppTelemetry.logAppException = logAppException;
  4938. OSF.AppTelemetry = OSFAppTelemetry;
  4939. })(OSFAppTelemetry || (OSFAppTelemetry = {}));
  4940. Microsoft.Office.WebExtension.EventType = {};
  4941. OSF.EventDispatch = function OSF_EventDispatch(eventTypes) {
  4942. this._eventHandlers = {};
  4943. this._queuedEventsArgs = {};
  4944. for (var entry in eventTypes) {
  4945. var eventType = eventTypes[entry];
  4946. this._eventHandlers[eventType] = [];
  4947. this._queuedEventsArgs[eventType] = [];
  4948. }
  4949. };
  4950. OSF.EventDispatch.prototype = {
  4951. getSupportedEvents: function OSF_EventDispatch$getSupportedEvents() {
  4952. var events = [];
  4953. for (var eventName in this._eventHandlers)
  4954. events.push(eventName);
  4955. return events;
  4956. },
  4957. supportsEvent: function OSF_EventDispatch$supportsEvent(event) {
  4958. var isSupported = false;
  4959. for (var eventName in this._eventHandlers) {
  4960. if (event == eventName) {
  4961. isSupported = true;
  4962. break;
  4963. }
  4964. }
  4965. return isSupported;
  4966. },
  4967. hasEventHandler: function OSF_EventDispatch$hasEventHandler(eventType, handler) {
  4968. var handlers = this._eventHandlers[eventType];
  4969. if (handlers && handlers.length > 0) {
  4970. for (var h in handlers) {
  4971. if (handlers[h] === handler)
  4972. return true;
  4973. }
  4974. }
  4975. return false;
  4976. },
  4977. addEventHandler: function OSF_EventDispatch$addEventHandler(eventType, handler) {
  4978. if (typeof handler != "function") {
  4979. return false;
  4980. }
  4981. var handlers = this._eventHandlers[eventType];
  4982. if (handlers && !this.hasEventHandler(eventType, handler)) {
  4983. handlers.push(handler);
  4984. return true;
  4985. }
  4986. else {
  4987. return false;
  4988. }
  4989. },
  4990. addEventHandlerAndFireQueuedEvent: function OSF_EventDispatch$addEventHandlerAndFireQueuedEvent(eventType, handler) {
  4991. var handlers = this._eventHandlers[eventType];
  4992. var isFirstHandler = handlers.length == 0;
  4993. var succeed = this.addEventHandler(eventType, handler);
  4994. if (isFirstHandler && succeed) {
  4995. this.fireQueuedEvent(eventType);
  4996. }
  4997. return succeed;
  4998. },
  4999. removeEventHandler: function OSF_EventDispatch$removeEventHandler(eventType, handler) {
  5000. var handlers = this._eventHandlers[eventType];
  5001. if (handlers && handlers.length > 0) {
  5002. for (var index = 0; index < handlers.length; index++) {
  5003. if (handlers[index] === handler) {
  5004. handlers.splice(index, 1);
  5005. return true;
  5006. }
  5007. }
  5008. }
  5009. return false;
  5010. },
  5011. clearEventHandlers: function OSF_EventDispatch$clearEventHandlers(eventType) {
  5012. if (typeof this._eventHandlers[eventType] != "undefined" && this._eventHandlers[eventType].length > 0) {
  5013. this._eventHandlers[eventType] = [];
  5014. return true;
  5015. }
  5016. return false;
  5017. },
  5018. getEventHandlerCount: function OSF_EventDispatch$getEventHandlerCount(eventType) {
  5019. return this._eventHandlers[eventType] != undefined ? this._eventHandlers[eventType].length : -1;
  5020. },
  5021. fireEvent: function OSF_EventDispatch$fireEvent(eventArgs) {
  5022. if (eventArgs.type == undefined)
  5023. return false;
  5024. var eventType = eventArgs.type;
  5025. if (eventType && this._eventHandlers[eventType]) {
  5026. var eventHandlers = this._eventHandlers[eventType];
  5027. for (var handler in eventHandlers)
  5028. eventHandlers[handler](eventArgs);
  5029. return true;
  5030. }
  5031. else {
  5032. return false;
  5033. }
  5034. },
  5035. fireOrQueueEvent: function OSF_EventDispatch$fireOrQueueEvent(eventArgs) {
  5036. var eventType = eventArgs.type;
  5037. if (eventType && this._eventHandlers[eventType]) {
  5038. var eventHandlers = this._eventHandlers[eventType];
  5039. var queuedEvents = this._queuedEventsArgs[eventType];
  5040. if (eventHandlers.length == 0) {
  5041. queuedEvents.push(eventArgs);
  5042. }
  5043. else {
  5044. this.fireEvent(eventArgs);
  5045. }
  5046. return true;
  5047. }
  5048. else {
  5049. return false;
  5050. }
  5051. },
  5052. fireQueuedEvent: function OSF_EventDispatch$queueEvent(eventType) {
  5053. if (eventType && this._eventHandlers[eventType]) {
  5054. var eventHandlers = this._eventHandlers[eventType];
  5055. var queuedEvents = this._queuedEventsArgs[eventType];
  5056. if (eventHandlers.length > 0) {
  5057. var eventHandler = eventHandlers[0];
  5058. while (queuedEvents.length > 0) {
  5059. var eventArgs = queuedEvents.shift();
  5060. eventHandler(eventArgs);
  5061. }
  5062. return true;
  5063. }
  5064. }
  5065. return false;
  5066. }
  5067. };
  5068. OSF.DDA.OMFactory = OSF.DDA.OMFactory || {};
  5069. OSF.DDA.OMFactory.manufactureEventArgs = function OSF_DDA_OMFactory$manufactureEventArgs(eventType, target, eventProperties) {
  5070. var args;
  5071. switch (eventType) {
  5072. case Microsoft.Office.WebExtension.EventType.DocumentSelectionChanged:
  5073. args = new OSF.DDA.DocumentSelectionChangedEventArgs(target);
  5074. break;
  5075. case Microsoft.Office.WebExtension.EventType.BindingSelectionChanged:
  5076. args = new OSF.DDA.BindingSelectionChangedEventArgs(this.manufactureBinding(eventProperties, target.document), eventProperties[OSF.DDA.PropertyDescriptors.Subset]);
  5077. break;
  5078. case Microsoft.Office.WebExtension.EventType.BindingDataChanged:
  5079. args = new OSF.DDA.BindingDataChangedEventArgs(this.manufactureBinding(eventProperties, target.document));
  5080. break;
  5081. case Microsoft.Office.WebExtension.EventType.SettingsChanged:
  5082. args = new OSF.DDA.SettingsChangedEventArgs(target);
  5083. break;
  5084. case Microsoft.Office.WebExtension.EventType.ActiveViewChanged:
  5085. args = new OSF.DDA.ActiveViewChangedEventArgs(eventProperties);
  5086. break;
  5087. case Microsoft.Office.WebExtension.EventType.OfficeThemeChanged:
  5088. args = new OSF.DDA.Theming.OfficeThemeChangedEventArgs(eventProperties);
  5089. break;
  5090. case Microsoft.Office.WebExtension.EventType.DocumentThemeChanged:
  5091. args = new OSF.DDA.Theming.DocumentThemeChangedEventArgs(eventProperties);
  5092. break;
  5093. case Microsoft.Office.WebExtension.EventType.AppCommandInvoked:
  5094. args = OSF.DDA.AppCommand.AppCommandInvokedEventArgs.create(eventProperties);
  5095. break;
  5096. case Microsoft.Office.WebExtension.EventType.DataNodeInserted:
  5097. args = new OSF.DDA.NodeInsertedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5098. break;
  5099. case Microsoft.Office.WebExtension.EventType.DataNodeReplaced:
  5100. args = new OSF.DDA.NodeReplacedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NewNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5101. break;
  5102. case Microsoft.Office.WebExtension.EventType.DataNodeDeleted:
  5103. args = new OSF.DDA.NodeDeletedEventArgs(this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.OldNode]), this.manufactureDataNode(eventProperties[OSF.DDA.DataNodeEventProperties.NextSiblingNode]), eventProperties[OSF.DDA.DataNodeEventProperties.InUndoRedo]);
  5104. break;
  5105. case Microsoft.Office.WebExtension.EventType.TaskSelectionChanged:
  5106. args = new OSF.DDA.TaskSelectionChangedEventArgs(target);
  5107. break;
  5108. case Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged:
  5109. args = new OSF.DDA.ResourceSelectionChangedEventArgs(target);
  5110. break;
  5111. case Microsoft.Office.WebExtension.EventType.ViewSelectionChanged:
  5112. args = new OSF.DDA.ViewSelectionChangedEventArgs(target);
  5113. break;
  5114. case Microsoft.Office.WebExtension.EventType.DialogMessageReceived:
  5115. args = new OSF.DDA.DialogEventArgs(eventProperties);
  5116. break;
  5117. case Microsoft.Office.WebExtension.EventType.OlkItemSelectedChanged:
  5118. args = new OSF.DDA.OlkItemSelectedChangedEventArgs(target);
  5119. break;
  5120. default:
  5121. throw OsfMsAjaxFactory.msAjaxError.argument(Microsoft.Office.WebExtension.Parameters.EventType, OSF.OUtil.formatString(Strings.OfficeOM.L_NotSupportedEventType, eventType));
  5122. }
  5123. return args;
  5124. };
  5125. OSF.DDA.AsyncMethodNames.addNames({
  5126. AddHandlerAsync: "addHandlerAsync",
  5127. RemoveHandlerAsync: "removeHandlerAsync"
  5128. });
  5129. OSF.DDA.AsyncMethodCalls.define({
  5130. method: OSF.DDA.AsyncMethodNames.AddHandlerAsync,
  5131. requiredArguments: [{
  5132. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5133. "enum": Microsoft.Office.WebExtension.EventType,
  5134. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5135. },
  5136. {
  5137. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5138. "types": ["function"]
  5139. }
  5140. ],
  5141. supportedOptions: [],
  5142. privateStateCallbacks: []
  5143. });
  5144. OSF.DDA.AsyncMethodCalls.define({
  5145. method: OSF.DDA.AsyncMethodNames.RemoveHandlerAsync,
  5146. requiredArguments: [
  5147. {
  5148. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5149. "enum": Microsoft.Office.WebExtension.EventType,
  5150. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5151. }
  5152. ],
  5153. supportedOptions: [
  5154. {
  5155. name: Microsoft.Office.WebExtension.Parameters.Handler,
  5156. value: {
  5157. "types": ["function", "object"],
  5158. "defaultValue": null
  5159. }
  5160. }
  5161. ],
  5162. privateStateCallbacks: []
  5163. });
  5164. Microsoft.Office.WebExtension.TableData = function Microsoft_Office_WebExtension_TableData(rows, headers) {
  5165. function fixData(data) {
  5166. if (data == null || data == undefined) {
  5167. return null;
  5168. }
  5169. try {
  5170. for (var dim = OSF.DDA.DataCoercion.findArrayDimensionality(data, 2); dim < 2; dim++) {
  5171. data = [data];
  5172. }
  5173. return data;
  5174. }
  5175. catch (ex) {
  5176. }
  5177. }
  5178. ;
  5179. OSF.OUtil.defineEnumerableProperties(this, {
  5180. "headers": {
  5181. get: function () { return headers; },
  5182. set: function (value) {
  5183. headers = fixData(value);
  5184. }
  5185. },
  5186. "rows": {
  5187. get: function () { return rows; },
  5188. set: function (value) {
  5189. rows = (value == null || (OSF.OUtil.isArray(value) && (value.length == 0))) ?
  5190. [] :
  5191. fixData(value);
  5192. }
  5193. }
  5194. });
  5195. this.headers = headers;
  5196. this.rows = rows;
  5197. };
  5198. OSF.DDA.OMFactory = OSF.DDA.OMFactory || {};
  5199. OSF.DDA.OMFactory.manufactureTableData = function OSF_DDA_OMFactory$manufactureTableData(tableDataProperties) {
  5200. return new Microsoft.Office.WebExtension.TableData(tableDataProperties[OSF.DDA.TableDataProperties.TableRows], tableDataProperties[OSF.DDA.TableDataProperties.TableHeaders]);
  5201. };
  5202. Microsoft.Office.WebExtension.CoercionType = {
  5203. Text: "text",
  5204. Matrix: "matrix",
  5205. Table: "table"
  5206. };
  5207. OSF.DDA.DataCoercion = (function OSF_DDA_DataCoercion() {
  5208. return {
  5209. findArrayDimensionality: function OSF_DDA_DataCoercion$findArrayDimensionality(obj) {
  5210. if (OSF.OUtil.isArray(obj)) {
  5211. var dim = 0;
  5212. for (var index = 0; index < obj.length; index++) {
  5213. dim = Math.max(dim, OSF.DDA.DataCoercion.findArrayDimensionality(obj[index]));
  5214. }
  5215. return dim + 1;
  5216. }
  5217. else {
  5218. return 0;
  5219. }
  5220. },
  5221. getCoercionDefaultForBinding: function OSF_DDA_DataCoercion$getCoercionDefaultForBinding(bindingType) {
  5222. switch (bindingType) {
  5223. case Microsoft.Office.WebExtension.BindingType.Matrix: return Microsoft.Office.WebExtension.CoercionType.Matrix;
  5224. case Microsoft.Office.WebExtension.BindingType.Table: return Microsoft.Office.WebExtension.CoercionType.Table;
  5225. case Microsoft.Office.WebExtension.BindingType.Text:
  5226. default:
  5227. return Microsoft.Office.WebExtension.CoercionType.Text;
  5228. }
  5229. },
  5230. getBindingDefaultForCoercion: function OSF_DDA_DataCoercion$getBindingDefaultForCoercion(coercionType) {
  5231. switch (coercionType) {
  5232. case Microsoft.Office.WebExtension.CoercionType.Matrix: return Microsoft.Office.WebExtension.BindingType.Matrix;
  5233. case Microsoft.Office.WebExtension.CoercionType.Table: return Microsoft.Office.WebExtension.BindingType.Table;
  5234. case Microsoft.Office.WebExtension.CoercionType.Text:
  5235. case Microsoft.Office.WebExtension.CoercionType.Html:
  5236. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5237. default:
  5238. return Microsoft.Office.WebExtension.BindingType.Text;
  5239. }
  5240. },
  5241. determineCoercionType: function OSF_DDA_DataCoercion$determineCoercionType(data) {
  5242. if (data == null || data == undefined)
  5243. return null;
  5244. var sourceType = null;
  5245. var runtimeType = typeof data;
  5246. if (data.rows !== undefined) {
  5247. sourceType = Microsoft.Office.WebExtension.CoercionType.Table;
  5248. }
  5249. else if (OSF.OUtil.isArray(data)) {
  5250. sourceType = Microsoft.Office.WebExtension.CoercionType.Matrix;
  5251. }
  5252. else if (runtimeType == "string" || runtimeType == "number" || runtimeType == "boolean" || OSF.OUtil.isDate(data)) {
  5253. sourceType = Microsoft.Office.WebExtension.CoercionType.Text;
  5254. }
  5255. else {
  5256. throw OSF.DDA.ErrorCodeManager.errorCodes.ooeUnsupportedDataObject;
  5257. }
  5258. return sourceType;
  5259. },
  5260. coerceData: function OSF_DDA_DataCoercion$coerceData(data, destinationType, sourceType) {
  5261. sourceType = sourceType || OSF.DDA.DataCoercion.determineCoercionType(data);
  5262. if (sourceType && sourceType != destinationType) {
  5263. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionBegin);
  5264. data = OSF.DDA.DataCoercion._coerceDataFromTable(destinationType, OSF.DDA.DataCoercion._coerceDataToTable(data, sourceType));
  5265. OSF.OUtil.writeProfilerMark(OSF.InternalPerfMarker.DataCoercionEnd);
  5266. }
  5267. return data;
  5268. },
  5269. _matrixToText: function OSF_DDA_DataCoercion$_matrixToText(matrix) {
  5270. if (matrix.length == 1 && matrix[0].length == 1)
  5271. return "" + matrix[0][0];
  5272. var val = "";
  5273. for (var i = 0; i < matrix.length; i++) {
  5274. val += matrix[i].join("\t") + "\n";
  5275. }
  5276. return val.substring(0, val.length - 1);
  5277. },
  5278. _textToMatrix: function OSF_DDA_DataCoercion$_textToMatrix(text) {
  5279. var ret = text.split("\n");
  5280. for (var i = 0; i < ret.length; i++)
  5281. ret[i] = ret[i].split("\t");
  5282. return ret;
  5283. },
  5284. _tableToText: function OSF_DDA_DataCoercion$_tableToText(table) {
  5285. var headers = "";
  5286. if (table.headers != null) {
  5287. headers = OSF.DDA.DataCoercion._matrixToText([table.headers]) + "\n";
  5288. }
  5289. var rows = OSF.DDA.DataCoercion._matrixToText(table.rows);
  5290. if (rows == "") {
  5291. headers = headers.substring(0, headers.length - 1);
  5292. }
  5293. return headers + rows;
  5294. },
  5295. _tableToMatrix: function OSF_DDA_DataCoercion$_tableToMatrix(table) {
  5296. var matrix = table.rows;
  5297. if (table.headers != null) {
  5298. matrix.unshift(table.headers);
  5299. }
  5300. return matrix;
  5301. },
  5302. _coerceDataFromTable: function OSF_DDA_DataCoercion$_coerceDataFromTable(coercionType, table) {
  5303. var value;
  5304. switch (coercionType) {
  5305. case Microsoft.Office.WebExtension.CoercionType.Table:
  5306. value = table;
  5307. break;
  5308. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5309. value = OSF.DDA.DataCoercion._tableToMatrix(table);
  5310. break;
  5311. case Microsoft.Office.WebExtension.CoercionType.SlideRange:
  5312. value = null;
  5313. if (OSF.DDA.OMFactory.manufactureSlideRange) {
  5314. value = OSF.DDA.OMFactory.manufactureSlideRange(OSF.DDA.DataCoercion._tableToText(table));
  5315. }
  5316. if (value == null) {
  5317. value = OSF.DDA.DataCoercion._tableToText(table);
  5318. }
  5319. break;
  5320. case Microsoft.Office.WebExtension.CoercionType.Text:
  5321. case Microsoft.Office.WebExtension.CoercionType.Html:
  5322. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5323. default:
  5324. value = OSF.DDA.DataCoercion._tableToText(table);
  5325. break;
  5326. }
  5327. return value;
  5328. },
  5329. _coerceDataToTable: function OSF_DDA_DataCoercion$_coerceDataToTable(data, sourceType) {
  5330. if (sourceType == undefined) {
  5331. sourceType = OSF.DDA.DataCoercion.determineCoercionType(data);
  5332. }
  5333. var value;
  5334. switch (sourceType) {
  5335. case Microsoft.Office.WebExtension.CoercionType.Table:
  5336. value = data;
  5337. break;
  5338. case Microsoft.Office.WebExtension.CoercionType.Matrix:
  5339. value = new Microsoft.Office.WebExtension.TableData(data);
  5340. break;
  5341. case Microsoft.Office.WebExtension.CoercionType.Text:
  5342. case Microsoft.Office.WebExtension.CoercionType.Html:
  5343. case Microsoft.Office.WebExtension.CoercionType.Ooxml:
  5344. default:
  5345. value = new Microsoft.Office.WebExtension.TableData(OSF.DDA.DataCoercion._textToMatrix(data));
  5346. break;
  5347. }
  5348. return value;
  5349. }
  5350. };
  5351. })();
  5352. OSF.DialogShownStatus = { hasDialogShown: false, isWindowDialog: false };
  5353. OSF.OUtil.augmentList(OSF.DDA.EventDescriptors, { DialogMessageReceivedEvent: "DialogMessageReceivedEvent" });
  5354. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5355. DialogMessageReceived: "dialogMessageReceived",
  5356. DialogEventReceived: "dialogEventReceived"
  5357. });
  5358. OSF.OUtil.augmentList(OSF.DDA.PropertyDescriptors, {
  5359. MessageType: "messageType",
  5360. MessageContent: "messageContent"
  5361. });
  5362. OSF.DDA.DialogEventType = {};
  5363. OSF.OUtil.augmentList(OSF.DDA.DialogEventType, {
  5364. DialogClosed: "dialogClosed",
  5365. NavigationFailed: "naviationFailed"
  5366. });
  5367. OSF.DDA.AsyncMethodNames.addNames({
  5368. DisplayDialogAsync: "displayDialogAsync",
  5369. CloseAsync: "close"
  5370. });
  5371. OSF.DDA.SyncMethodNames.addNames({
  5372. MessageParent: "messageParent",
  5373. AddMessageHandler: "addEventHandler"
  5374. });
  5375. OSF.DDA.UI.ParentUI = function OSF_DDA_ParentUI() {
  5376. var eventDispatch = new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.DialogMessageReceived, Microsoft.Office.WebExtension.EventType.DialogEventReceived]);
  5377. var openDialogName = OSF.DDA.AsyncMethodNames.DisplayDialogAsync.displayName;
  5378. var target = this;
  5379. if (!target[openDialogName]) {
  5380. OSF.OUtil.defineEnumerableProperty(target, openDialogName, {
  5381. value: function () {
  5382. var openDialog = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.OpenDialog];
  5383. openDialog(arguments, eventDispatch, target);
  5384. }
  5385. });
  5386. }
  5387. OSF.OUtil.finalizeProperties(this);
  5388. };
  5389. OSF.DDA.UI.ChildUI = function OSF_DDA_ChildUI() {
  5390. var messageParentName = OSF.DDA.SyncMethodNames.MessageParent.displayName;
  5391. var target = this;
  5392. if (!target[messageParentName]) {
  5393. OSF.OUtil.defineEnumerableProperty(target, messageParentName, {
  5394. value: function () {
  5395. var messageParent = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.MessageParent];
  5396. return messageParent(arguments, target);
  5397. }
  5398. });
  5399. }
  5400. OSF.OUtil.finalizeProperties(this);
  5401. };
  5402. OSF.DialogHandler = function OSF_DialogHandler() { };
  5403. OSF.DDA.DialogEventArgs = function OSF_DDA_DialogEventArgs(message) {
  5404. if (message[OSF.DDA.PropertyDescriptors.MessageType] == OSF.DialogMessageType.DialogMessageReceived) {
  5405. OSF.OUtil.defineEnumerableProperties(this, {
  5406. "type": {
  5407. value: Microsoft.Office.WebExtension.EventType.DialogMessageReceived
  5408. },
  5409. "message": {
  5410. value: message[OSF.DDA.PropertyDescriptors.MessageContent]
  5411. }
  5412. });
  5413. }
  5414. else {
  5415. OSF.OUtil.defineEnumerableProperties(this, {
  5416. "type": {
  5417. value: Microsoft.Office.WebExtension.EventType.DialogEventReceived
  5418. },
  5419. "error": {
  5420. value: message[OSF.DDA.PropertyDescriptors.MessageType]
  5421. }
  5422. });
  5423. }
  5424. };
  5425. OSF.DDA.AsyncMethodCalls.define({
  5426. method: OSF.DDA.AsyncMethodNames.DisplayDialogAsync,
  5427. requiredArguments: [
  5428. {
  5429. "name": Microsoft.Office.WebExtension.Parameters.Url,
  5430. "types": ["string"]
  5431. }
  5432. ],
  5433. supportedOptions: [
  5434. {
  5435. name: Microsoft.Office.WebExtension.Parameters.Width,
  5436. value: {
  5437. "types": ["number"],
  5438. "defaultValue": 99
  5439. }
  5440. },
  5441. {
  5442. name: Microsoft.Office.WebExtension.Parameters.Height,
  5443. value: {
  5444. "types": ["number"],
  5445. "defaultValue": 99
  5446. }
  5447. },
  5448. {
  5449. name: Microsoft.Office.WebExtension.Parameters.RequireHTTPs,
  5450. value: {
  5451. "types": ["boolean"],
  5452. "defaultValue": true
  5453. }
  5454. },
  5455. {
  5456. name: Microsoft.Office.WebExtension.Parameters.DisplayInIframe,
  5457. value: {
  5458. "types": ["boolean"],
  5459. "defaultValue": true
  5460. }
  5461. }
  5462. ],
  5463. privateStateCallbacks: [],
  5464. onSucceeded: function (args, caller, callArgs) {
  5465. var targetId = args[Microsoft.Office.WebExtension.Parameters.Id];
  5466. var eventDispatch = args[Microsoft.Office.WebExtension.Parameters.Data];
  5467. var dialog = new OSF.DialogHandler();
  5468. var closeDialog = OSF.DDA.AsyncMethodNames.CloseAsync.displayName;
  5469. OSF.OUtil.defineEnumerableProperty(dialog, closeDialog, {
  5470. value: function () {
  5471. var closeDialogfunction = OSF._OfficeAppFactory.getHostFacade()[OSF.DDA.DispIdHost.Methods.CloseDialog];
  5472. closeDialogfunction(arguments, targetId, eventDispatch, dialog);
  5473. }
  5474. });
  5475. var addHandler = OSF.DDA.SyncMethodNames.AddMessageHandler.displayName;
  5476. OSF.OUtil.defineEnumerableProperty(dialog, addHandler, {
  5477. value: function () {
  5478. var syncMethodCall = OSF.DDA.SyncMethodCalls[OSF.DDA.SyncMethodNames.AddMessageHandler.id];
  5479. var callArgs = syncMethodCall.verifyAndExtractCall(arguments, dialog, eventDispatch);
  5480. var eventType = callArgs[Microsoft.Office.WebExtension.Parameters.EventType];
  5481. var handler = callArgs[Microsoft.Office.WebExtension.Parameters.Handler];
  5482. return eventDispatch.addEventHandlerAndFireQueuedEvent(eventType, handler);
  5483. }
  5484. });
  5485. return dialog;
  5486. },
  5487. checkCallArgs: function (callArgs, caller, stateInfo) {
  5488. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] <= 0) {
  5489. callArgs[Microsoft.Office.WebExtension.Parameters.Width] = 1;
  5490. }
  5491. if (callArgs[Microsoft.Office.WebExtension.Parameters.Width] > 100) {
  5492. callArgs[Microsoft.Office.WebExtension.Parameters.Width] = 99;
  5493. }
  5494. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] <= 0) {
  5495. callArgs[Microsoft.Office.WebExtension.Parameters.Height] = 1;
  5496. }
  5497. if (callArgs[Microsoft.Office.WebExtension.Parameters.Height] > 100) {
  5498. callArgs[Microsoft.Office.WebExtension.Parameters.Height] = 99;
  5499. }
  5500. return callArgs;
  5501. }
  5502. });
  5503. OSF.DDA.AsyncMethodCalls.define({
  5504. method: OSF.DDA.AsyncMethodNames.CloseAsync,
  5505. requiredArguments: [],
  5506. supportedOptions: [],
  5507. privateStateCallbacks: []
  5508. });
  5509. OSF.DDA.SyncMethodCalls.define({
  5510. method: OSF.DDA.SyncMethodNames.MessageParent,
  5511. requiredArguments: [
  5512. {
  5513. "name": Microsoft.Office.WebExtension.Parameters.MessageToParent,
  5514. "types": ["string", "number", "boolean"]
  5515. }
  5516. ],
  5517. supportedOptions: []
  5518. });
  5519. OSF.DDA.SyncMethodCalls.define({
  5520. method: OSF.DDA.SyncMethodNames.AddMessageHandler,
  5521. requiredArguments: [
  5522. {
  5523. "name": Microsoft.Office.WebExtension.Parameters.EventType,
  5524. "enum": Microsoft.Office.WebExtension.EventType,
  5525. "verify": function (eventType, caller, eventDispatch) { return eventDispatch.supportsEvent(eventType); }
  5526. },
  5527. {
  5528. "name": Microsoft.Office.WebExtension.Parameters.Handler,
  5529. "types": ["function"]
  5530. }
  5531. ],
  5532. supportedOptions: []
  5533. });
  5534. OSF.DDA.SafeArray.Delegate.openDialog = function OSF_DDA_SafeArray_Delegate$OpenDialog(args) {
  5535. try {
  5536. if (args.onCalling) {
  5537. args.onCalling();
  5538. }
  5539. var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  5540. OSF.ClientHostController.openDialog(args.dispId, args.targetId, function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  5541. if (args.onEvent) {
  5542. args.onEvent(payload);
  5543. }
  5544. if (OSF.AppTelemetry) {
  5545. OSF.AppTelemetry.onEventDone(args.dispId);
  5546. }
  5547. }, callback);
  5548. }
  5549. catch (ex) {
  5550. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5551. }
  5552. };
  5553. OSF.DDA.SafeArray.Delegate.closeDialog = function OSF_DDA_SafeArray_Delegate$CloseDialog(args) {
  5554. if (args.onCalling) {
  5555. args.onCalling();
  5556. }
  5557. var callback = OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  5558. try {
  5559. OSF.ClientHostController.closeDialog(args.dispId, args.targetId, callback);
  5560. }
  5561. catch (ex) {
  5562. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  5563. }
  5564. };
  5565. OSF.DDA.SafeArray.Delegate.messageParent = function OSF_DDA_SafeArray_Delegate$MessageParent(args) {
  5566. try {
  5567. if (args.onCalling) {
  5568. args.onCalling();
  5569. }
  5570. var startTime = (new Date()).getTime();
  5571. var result = OSF.ClientHostController.messageParent(args.hostCallArgs);
  5572. if (args.onReceiving) {
  5573. args.onReceiving();
  5574. }
  5575. if (OSF.AppTelemetry) {
  5576. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), result);
  5577. }
  5578. return result;
  5579. }
  5580. catch (ex) {
  5581. return OSF.DDA.SafeArray.Delegate._onExceptionSyncMethod(ex);
  5582. }
  5583. };
  5584. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5585. type: OSF.DDA.EventDispId.dispidDialogMessageReceivedEvent,
  5586. fromHost: [
  5587. { name: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5588. ],
  5589. isComplexType: true
  5590. });
  5591. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5592. type: OSF.DDA.EventDescriptors.DialogMessageReceivedEvent,
  5593. fromHost: [
  5594. { name: OSF.DDA.PropertyDescriptors.MessageType, value: 0 },
  5595. { name: OSF.DDA.PropertyDescriptors.MessageContent, value: 1 }
  5596. ],
  5597. isComplexType: true
  5598. });
  5599. Microsoft.Office.WebExtension.ProjectViewTypes = {
  5600. Gantt: 1,
  5601. NetworkDiagram: 2,
  5602. TaskDiagram: 3,
  5603. TaskForm: 4,
  5604. TaskSheet: 5,
  5605. ResourceForm: 6,
  5606. ResourceSheet: 7,
  5607. ResourceGraph: 8,
  5608. TeamPlanner: 9,
  5609. TaskDetails: 10,
  5610. TaskNameForm: 11,
  5611. ResourceNames: 12,
  5612. Calendar: 13,
  5613. TaskUsage: 14,
  5614. ResourceUsage: 15,
  5615. Timeline: 16,
  5616. Drawing: 18,
  5617. ResourcePlan: 19
  5618. };
  5619. OSF.OUtil.redefineList(Microsoft.Office.WebExtension.CoercionType, {
  5620. Text: "text"
  5621. });
  5622. OSF.OUtil.redefineList(Microsoft.Office.WebExtension.ValueFormat, {
  5623. Unformatted: "unformatted"
  5624. });
  5625. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5626. TaskSelectionChanged: "taskSelectionChanged",
  5627. ResourceSelectionChanged: "resourceSelectionChanged",
  5628. ViewSelectionChanged: "viewSelectionChanged"
  5629. });
  5630. OSF.DDA.AsyncMethodNames.addNames({
  5631. GetSelectedDataAsync: "getSelectedDataAsync",
  5632. SetSelectedDataAsync: "setSelectedDataAsync"
  5633. });
  5634. (function () {
  5635. function processData(dataDescriptor, caller, callArgs) {
  5636. var data = dataDescriptor[Microsoft.Office.WebExtension.Parameters.Data];
  5637. if (OSF.DDA.TableDataProperties && data && (data[OSF.DDA.TableDataProperties.TableRows] != undefined || data[OSF.DDA.TableDataProperties.TableHeaders] != undefined)) {
  5638. data = OSF.DDA.OMFactory.manufactureTableData(data);
  5639. }
  5640. data = OSF.DDA.DataCoercion.coerceData(data, callArgs[Microsoft.Office.WebExtension.Parameters.CoercionType]);
  5641. return data == undefined ? null : data;
  5642. }
  5643. OSF.DDA.AsyncMethodCalls.define({
  5644. method: OSF.DDA.AsyncMethodNames.GetSelectedDataAsync,
  5645. requiredArguments: [
  5646. {
  5647. "name": Microsoft.Office.WebExtension.Parameters.CoercionType,
  5648. "enum": Microsoft.Office.WebExtension.CoercionType
  5649. }
  5650. ],
  5651. supportedOptions: [
  5652. {
  5653. name: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  5654. value: {
  5655. "enum": Microsoft.Office.WebExtension.ValueFormat,
  5656. "defaultValue": Microsoft.Office.WebExtension.ValueFormat.Unformatted
  5657. }
  5658. },
  5659. {
  5660. name: Microsoft.Office.WebExtension.Parameters.FilterType,
  5661. value: {
  5662. "enum": Microsoft.Office.WebExtension.FilterType,
  5663. "defaultValue": Microsoft.Office.WebExtension.FilterType.All
  5664. }
  5665. }
  5666. ],
  5667. privateStateCallbacks: [],
  5668. onSucceeded: processData
  5669. });
  5670. OSF.DDA.AsyncMethodCalls.define({
  5671. method: OSF.DDA.AsyncMethodNames.SetSelectedDataAsync,
  5672. requiredArguments: [
  5673. {
  5674. "name": Microsoft.Office.WebExtension.Parameters.Data,
  5675. "types": ["string", "object", "number", "boolean"]
  5676. }
  5677. ],
  5678. supportedOptions: [
  5679. {
  5680. name: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5681. value: {
  5682. "enum": Microsoft.Office.WebExtension.CoercionType,
  5683. "calculate": function (requiredArgs) {
  5684. return OSF.DDA.DataCoercion.determineCoercionType(requiredArgs[Microsoft.Office.WebExtension.Parameters.Data]);
  5685. }
  5686. }
  5687. },
  5688. {
  5689. name: Microsoft.Office.WebExtension.Parameters.ImageLeft,
  5690. value: {
  5691. "types": ["number", "boolean"],
  5692. "defaultValue": false
  5693. }
  5694. },
  5695. {
  5696. name: Microsoft.Office.WebExtension.Parameters.ImageTop,
  5697. value: {
  5698. "types": ["number", "boolean"],
  5699. "defaultValue": false
  5700. }
  5701. },
  5702. {
  5703. name: Microsoft.Office.WebExtension.Parameters.ImageWidth,
  5704. value: {
  5705. "types": ["number", "boolean"],
  5706. "defaultValue": false
  5707. }
  5708. },
  5709. {
  5710. name: Microsoft.Office.WebExtension.Parameters.ImageHeight,
  5711. value: {
  5712. "types": ["number", "boolean"],
  5713. "defaultValue": false
  5714. }
  5715. }
  5716. ],
  5717. privateStateCallbacks: []
  5718. });
  5719. })();
  5720. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5721. type: OSF.DDA.MethodDispId.dispidGetSelectedDataMethod,
  5722. fromHost: [
  5723. { name: Microsoft.Office.WebExtension.Parameters.Data, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5724. ],
  5725. toHost: [
  5726. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5727. { name: Microsoft.Office.WebExtension.Parameters.ValueFormat, value: 1 },
  5728. { name: Microsoft.Office.WebExtension.Parameters.FilterType, value: 2 }
  5729. ]
  5730. });
  5731. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5732. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  5733. toHost: [
  5734. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  5735. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  5736. { name: Microsoft.Office.WebExtension.Parameters.ImageLeft, value: 2 },
  5737. { name: Microsoft.Office.WebExtension.Parameters.ImageTop, value: 3 },
  5738. { name: Microsoft.Office.WebExtension.Parameters.ImageWidth, value: 4 },
  5739. { name: Microsoft.Office.WebExtension.Parameters.ImageHeight, value: 5 },
  5740. ]
  5741. });
  5742. OSF.DDA.SettingsManager = {
  5743. SerializedSettings: "serializedSettings",
  5744. RefreshingSettings: "refreshingSettings",
  5745. DateJSONPrefix: "Date(",
  5746. DataJSONSuffix: ")",
  5747. serializeSettings: function OSF_DDA_SettingsManager$serializeSettings(settingsCollection) {
  5748. var ret = {};
  5749. for (var key in settingsCollection) {
  5750. var value = settingsCollection[key];
  5751. try {
  5752. if (JSON) {
  5753. value = JSON.stringify(value, function dateReplacer(k, v) {
  5754. return OSF.OUtil.isDate(this[k]) ? OSF.DDA.SettingsManager.DateJSONPrefix + this[k].getTime() + OSF.DDA.SettingsManager.DataJSONSuffix : v;
  5755. });
  5756. }
  5757. else {
  5758. value = Sys.Serialization.JavaScriptSerializer.serialize(value);
  5759. }
  5760. ret[key] = value;
  5761. }
  5762. catch (ex) {
  5763. }
  5764. }
  5765. return ret;
  5766. },
  5767. deserializeSettings: function OSF_DDA_SettingsManager$deserializeSettings(serializedSettings) {
  5768. var ret = {};
  5769. serializedSettings = serializedSettings || {};
  5770. for (var key in serializedSettings) {
  5771. var value = serializedSettings[key];
  5772. try {
  5773. if (JSON) {
  5774. value = JSON.parse(value, function dateReviver(k, v) {
  5775. var d;
  5776. if (typeof v === 'string' && v && v.length > 6 && v.slice(0, 5) === OSF.DDA.SettingsManager.DateJSONPrefix && v.slice(-1) === OSF.DDA.SettingsManager.DataJSONSuffix) {
  5777. d = new Date(parseInt(v.slice(5, -1)));
  5778. if (d) {
  5779. return d;
  5780. }
  5781. }
  5782. return v;
  5783. });
  5784. }
  5785. else {
  5786. value = Sys.Serialization.JavaScriptSerializer.deserialize(value, true);
  5787. }
  5788. ret[key] = value;
  5789. }
  5790. catch (ex) {
  5791. }
  5792. }
  5793. return ret;
  5794. }
  5795. };
  5796. OSF.DDA.Settings = function OSF_DDA_Settings(settings) {
  5797. settings = settings || {};
  5798. var cacheSessionSettings = function (settings) {
  5799. var osfSessionStorage = OSF.OUtil.getSessionStorage();
  5800. if (osfSessionStorage) {
  5801. var serializedSettings = OSF.DDA.SettingsManager.serializeSettings(settings);
  5802. var storageSettings = JSON ? JSON.stringify(serializedSettings) : Sys.Serialization.JavaScriptSerializer.serialize(serializedSettings);
  5803. osfSessionStorage.setItem(OSF._OfficeAppFactory.getCachedSessionSettingsKey(), storageSettings);
  5804. }
  5805. };
  5806. OSF.OUtil.defineEnumerableProperties(this, {
  5807. "get": {
  5808. value: function OSF_DDA_Settings$get(name) {
  5809. var e = Function._validateParams(arguments, [
  5810. { name: "name", type: String, mayBeNull: false }
  5811. ]);
  5812. if (e)
  5813. throw e;
  5814. var setting = settings[name];
  5815. return typeof (setting) === 'undefined' ? null : setting;
  5816. }
  5817. },
  5818. "set": {
  5819. value: function OSF_DDA_Settings$set(name, value) {
  5820. var e = Function._validateParams(arguments, [
  5821. { name: "name", type: String, mayBeNull: false },
  5822. { name: "value", mayBeNull: true }
  5823. ]);
  5824. if (e)
  5825. throw e;
  5826. settings[name] = value;
  5827. cacheSessionSettings(settings);
  5828. }
  5829. },
  5830. "remove": {
  5831. value: function OSF_DDA_Settings$remove(name) {
  5832. var e = Function._validateParams(arguments, [
  5833. { name: "name", type: String, mayBeNull: false }
  5834. ]);
  5835. if (e)
  5836. throw e;
  5837. delete settings[name];
  5838. cacheSessionSettings(settings);
  5839. }
  5840. }
  5841. });
  5842. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.SaveAsync], settings);
  5843. };
  5844. OSF.DDA.RefreshableSettings = function OSF_DDA_RefreshableSettings(settings) {
  5845. OSF.DDA.RefreshableSettings.uber.constructor.call(this, settings);
  5846. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.RefreshAsync], settings);
  5847. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.SettingsChanged]));
  5848. };
  5849. OSF.OUtil.extend(OSF.DDA.RefreshableSettings, OSF.DDA.Settings);
  5850. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.EventType, {
  5851. SettingsChanged: "settingsChanged"
  5852. });
  5853. OSF.DDA.SettingsChangedEventArgs = function OSF_DDA_SettingsChangedEventArgs(settingsInstance) {
  5854. OSF.OUtil.defineEnumerableProperties(this, {
  5855. "type": {
  5856. value: Microsoft.Office.WebExtension.EventType.SettingsChanged
  5857. },
  5858. "settings": {
  5859. value: settingsInstance
  5860. }
  5861. });
  5862. };
  5863. OSF.DDA.AsyncMethodNames.addNames({
  5864. RefreshAsync: "refreshAsync",
  5865. SaveAsync: "saveAsync"
  5866. });
  5867. OSF.DDA.AsyncMethodCalls.define({
  5868. method: OSF.DDA.AsyncMethodNames.RefreshAsync,
  5869. requiredArguments: [],
  5870. supportedOptions: [],
  5871. privateStateCallbacks: [
  5872. {
  5873. name: OSF.DDA.SettingsManager.RefreshingSettings,
  5874. value: function getRefreshingSettings(settingsInstance, settingsCollection) {
  5875. return settingsCollection;
  5876. }
  5877. }
  5878. ],
  5879. onSucceeded: function deserializeSettings(serializedSettingsDescriptor, refreshingSettings, refreshingSettingsArgs) {
  5880. var serializedSettings = serializedSettingsDescriptor[OSF.DDA.SettingsManager.SerializedSettings];
  5881. var newSettings = OSF.DDA.SettingsManager.deserializeSettings(serializedSettings);
  5882. var oldSettings = refreshingSettingsArgs[OSF.DDA.SettingsManager.RefreshingSettings];
  5883. for (var setting in oldSettings) {
  5884. refreshingSettings.remove(setting);
  5885. }
  5886. for (var setting in newSettings) {
  5887. refreshingSettings.set(setting, newSettings[setting]);
  5888. }
  5889. return refreshingSettings;
  5890. }
  5891. });
  5892. OSF.DDA.AsyncMethodCalls.define({
  5893. method: OSF.DDA.AsyncMethodNames.SaveAsync,
  5894. requiredArguments: [],
  5895. supportedOptions: [
  5896. {
  5897. name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale,
  5898. value: {
  5899. "types": ["boolean"],
  5900. "defaultValue": true
  5901. }
  5902. }
  5903. ],
  5904. privateStateCallbacks: [
  5905. {
  5906. name: OSF.DDA.SettingsManager.SerializedSettings,
  5907. value: function serializeSettings(settingsInstance, settingsCollection) {
  5908. return OSF.DDA.SettingsManager.serializeSettings(settingsCollection);
  5909. }
  5910. }
  5911. ]
  5912. });
  5913. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5914. type: OSF.DDA.MethodDispId.dispidLoadSettingsMethod,
  5915. fromHost: [
  5916. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  5917. ]
  5918. });
  5919. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5920. type: OSF.DDA.MethodDispId.dispidSaveSettingsMethod,
  5921. toHost: [
  5922. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  5923. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  5924. ]
  5925. });
  5926. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidSettingsChangedEvent });
  5927. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  5928. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  5929. toHost: [
  5930. { name: Microsoft.Office.WebExtension.CoercionType.Text, value: 0 },
  5931. { name: Microsoft.Office.WebExtension.CoercionType.Matrix, value: 1 },
  5932. { name: Microsoft.Office.WebExtension.CoercionType.Table, value: 2 }
  5933. ]
  5934. });
  5935. Microsoft.Office.WebExtension.ProjectTaskFields = {
  5936. ActualCost: 0,
  5937. ActualDuration: 1,
  5938. ActualFinish: 2,
  5939. ActualOvertimeCost: 3,
  5940. ActualOvertimeWork: 4,
  5941. ActualStart: 5,
  5942. ActualWork: 6,
  5943. Text1: 7,
  5944. Text10: 8,
  5945. Finish10: 9,
  5946. Start10: 10,
  5947. Text11: 11,
  5948. Text12: 12,
  5949. Text13: 13,
  5950. Text14: 14,
  5951. Text15: 15,
  5952. Text16: 16,
  5953. Text17: 17,
  5954. Text18: 18,
  5955. Text19: 19,
  5956. Finish1: 20,
  5957. Start1: 21,
  5958. Text2: 22,
  5959. Text20: 23,
  5960. Text21: 24,
  5961. Text22: 25,
  5962. Text23: 26,
  5963. Text24: 27,
  5964. Text25: 28,
  5965. Text26: 29,
  5966. Text27: 30,
  5967. Text28: 31,
  5968. Text29: 32,
  5969. Finish2: 33,
  5970. Start2: 34,
  5971. Text3: 35,
  5972. Text30: 36,
  5973. Finish3: 37,
  5974. Start3: 38,
  5975. Text4: 39,
  5976. Finish4: 40,
  5977. Start4: 41,
  5978. Text5: 42,
  5979. Finish5: 43,
  5980. Start5: 44,
  5981. Text6: 45,
  5982. Finish6: 46,
  5983. Start6: 47,
  5984. Text7: 48,
  5985. Finish7: 49,
  5986. Start7: 50,
  5987. Text8: 51,
  5988. Finish8: 52,
  5989. Start8: 53,
  5990. Text9: 54,
  5991. Finish9: 55,
  5992. Start9: 56,
  5993. Baseline10BudgetCost: 57,
  5994. Baseline10BudgetWork: 58,
  5995. Baseline10Cost: 59,
  5996. Baseline10Duration: 60,
  5997. Baseline10Finish: 61,
  5998. Baseline10FixedCost: 62,
  5999. Baseline10FixedCostAccrual: 63,
  6000. Baseline10Start: 64,
  6001. Baseline10Work: 65,
  6002. Baseline1BudgetCost: 66,
  6003. Baseline1BudgetWork: 67,
  6004. Baseline1Cost: 68,
  6005. Baseline1Duration: 69,
  6006. Baseline1Finish: 70,
  6007. Baseline1FixedCost: 71,
  6008. Baseline1FixedCostAccrual: 72,
  6009. Baseline1Start: 73,
  6010. Baseline1Work: 74,
  6011. Baseline2BudgetCost: 75,
  6012. Baseline2BudgetWork: 76,
  6013. Baseline2Cost: 77,
  6014. Baseline2Duration: 78,
  6015. Baseline2Finish: 79,
  6016. Baseline2FixedCost: 80,
  6017. Baseline2FixedCostAccrual: 81,
  6018. Baseline2Start: 82,
  6019. Baseline2Work: 83,
  6020. Baseline3BudgetCost: 84,
  6021. Baseline3BudgetWork: 85,
  6022. Baseline3Cost: 86,
  6023. Baseline3Duration: 87,
  6024. Baseline3Finish: 88,
  6025. Baseline3FixedCost: 89,
  6026. Baseline3FixedCostAccrual: 90,
  6027. Basline3Start: 91,
  6028. Baseline3Work: 92,
  6029. Baseline4BudgetCost: 93,
  6030. Baseline4BudgetWork: 94,
  6031. Baseline4Cost: 95,
  6032. Baseline4Duration: 96,
  6033. Baseline4Finish: 97,
  6034. Baseline4FixedCost: 98,
  6035. Baseline4FixedCostAccrual: 99,
  6036. Baseline4Start: 100,
  6037. Baseline4Work: 101,
  6038. Baseline5BudgetCost: 102,
  6039. Baseline5BudgetWork: 103,
  6040. Baseline5Cost: 104,
  6041. Baseline5Duration: 105,
  6042. Baseline5Finish: 106,
  6043. Baseline5FixedCost: 107,
  6044. Baseline5FixedCostAccrual: 108,
  6045. Baseline5Start: 109,
  6046. Baseline5Work: 110,
  6047. Baseline6BudgetCost: 111,
  6048. Baseline6BudgetWork: 112,
  6049. Baseline6Cost: 113,
  6050. Baseline6Duration: 114,
  6051. Baseline6Finish: 115,
  6052. Baseline6FixedCost: 116,
  6053. Baseline6FixedCostAccrual: 117,
  6054. Baseline6Start: 118,
  6055. Baseline6Work: 119,
  6056. Baseline7BudgetCost: 120,
  6057. Baseline7BudgetWork: 121,
  6058. Baseline7Cost: 122,
  6059. Baseline7Duration: 123,
  6060. Baseline7Finish: 124,
  6061. Baseline7FixedCost: 125,
  6062. Baseline7FixedCostAccrual: 126,
  6063. Baseline7Start: 127,
  6064. Baseline7Work: 128,
  6065. Baseline8BudgetCost: 129,
  6066. Baseline8BudgetWork: 130,
  6067. Baseline8Cost: 131,
  6068. Baseline8Duration: 132,
  6069. Baseline8Finish: 133,
  6070. Baseline8FixedCost: 134,
  6071. Baseline8FixedCostAccrual: 135,
  6072. Baseline8Start: 136,
  6073. Baseline8Work: 137,
  6074. Baseline9BudgetCost: 138,
  6075. Baseline9BudgetWork: 139,
  6076. Baseline9Cost: 140,
  6077. Baseline9Duration: 141,
  6078. Baseline9Finish: 142,
  6079. Baseline9FixedCost: 143,
  6080. Baseline9FixedCostAccrual: 144,
  6081. Baseline9Start: 145,
  6082. Baseline9Work: 146,
  6083. BaselineBudgetCost: 147,
  6084. BaselineBudgetWork: 148,
  6085. BaselineCost: 149,
  6086. BaselineDuration: 150,
  6087. BaselineFinish: 151,
  6088. BaselineFixedCost: 152,
  6089. BaselineFixedCostAccrual: 153,
  6090. BaselineStart: 154,
  6091. BaselineWork: 155,
  6092. BudgetCost: 156,
  6093. BudgetWork: 157,
  6094. TaskCalendarGUID: 158,
  6095. ConstraintDate: 159,
  6096. ConstraintType: 160,
  6097. Cost1: 161,
  6098. Cost10: 162,
  6099. Cost2: 163,
  6100. Cost3: 164,
  6101. Cost4: 165,
  6102. Cost5: 166,
  6103. Cost6: 167,
  6104. Cost7: 168,
  6105. Cost8: 169,
  6106. Cost9: 170,
  6107. Date1: 171,
  6108. Date10: 172,
  6109. Date2: 173,
  6110. Date3: 174,
  6111. Date4: 175,
  6112. Date5: 176,
  6113. Date6: 177,
  6114. Date7: 178,
  6115. Date8: 179,
  6116. Date9: 180,
  6117. Deadline: 181,
  6118. Duration1: 182,
  6119. Duration10: 183,
  6120. Duration2: 184,
  6121. Duration3: 185,
  6122. Duration4: 186,
  6123. Duration5: 187,
  6124. Duration6: 188,
  6125. Duration7: 189,
  6126. Duration8: 190,
  6127. Duration9: 191,
  6128. Duration: 192,
  6129. EarnedValueMethod: 193,
  6130. FinishSlack: 194,
  6131. FixedCost: 195,
  6132. FixedCostAccrual: 196,
  6133. Flag10: 197,
  6134. Flag1: 198,
  6135. Flag11: 199,
  6136. Flag12: 200,
  6137. Flag13: 201,
  6138. Flag14: 202,
  6139. Flag15: 203,
  6140. Flag16: 204,
  6141. Flag17: 205,
  6142. Flag18: 206,
  6143. Flag19: 207,
  6144. Flag2: 208,
  6145. Flag20: 209,
  6146. Flag3: 210,
  6147. Flag4: 211,
  6148. Flag5: 212,
  6149. Flag6: 213,
  6150. Flag7: 214,
  6151. Flag8: 215,
  6152. Flag9: 216,
  6153. FreeSlack: 217,
  6154. HasRollupSubTasks: 218,
  6155. ID: 219,
  6156. Name: 220,
  6157. Notes: 221,
  6158. Number1: 222,
  6159. Number10: 223,
  6160. Number11: 224,
  6161. Number12: 225,
  6162. Number13: 226,
  6163. Number14: 227,
  6164. Number15: 228,
  6165. Number16: 229,
  6166. Number17: 230,
  6167. Number18: 231,
  6168. Number19: 232,
  6169. Number2: 233,
  6170. Number20: 234,
  6171. Number3: 235,
  6172. Number4: 236,
  6173. Number5: 237,
  6174. Number6: 238,
  6175. Number7: 239,
  6176. Number8: 240,
  6177. Number9: 241,
  6178. ScheduledDuration: 242,
  6179. ScheduledFinish: 243,
  6180. ScheduledStart: 244,
  6181. OutlineLevel: 245,
  6182. OvertimeCost: 246,
  6183. OvertimeWork: 247,
  6184. PercentComplete: 248,
  6185. PercentWorkComplete: 249,
  6186. Predecessors: 250,
  6187. PreleveledFinish: 251,
  6188. PreleveledStart: 252,
  6189. Priority: 253,
  6190. Active: 254,
  6191. Critical: 255,
  6192. Milestone: 256,
  6193. Overallocated: 257,
  6194. IsRollup: 258,
  6195. Summary: 259,
  6196. RegularWork: 260,
  6197. RemainingCost: 261,
  6198. RemainingDuration: 262,
  6199. RemainingOvertimeCost: 263,
  6200. RemainingWork: 264,
  6201. ResourceNames: 265,
  6202. ResourceNames_deprecated: 266,
  6203. Cost: 267,
  6204. Finish: 268,
  6205. Start: 269,
  6206. Work: 270,
  6207. StartSlack: 271,
  6208. Status: 272,
  6209. Successors: 273,
  6210. StatusManager: 274,
  6211. TotalSlack: 275,
  6212. TaskGUID: 276,
  6213. Type: 277,
  6214. WBS: 278,
  6215. WBSPREDECESSORS: 279,
  6216. WBSSUCCESSORS: 280,
  6217. WSSID: 281,
  6218. FreeformDuration: 282,
  6219. FreeformFinish: 283,
  6220. FreeformStart: 284
  6221. };
  6222. Microsoft.Office.WebExtension.ProjectResourceFields = {
  6223. Accrual: 0,
  6224. ActualCost: 1,
  6225. ActualOvertimeCost: 2,
  6226. ActualOvertimeWork: 3,
  6227. ActualOvertimeWorkProtected: 4,
  6228. ActualWork: 5,
  6229. ActualWorkProtected: 6,
  6230. BaseCalendar: 7,
  6231. Baseline10BudgetCost: 8,
  6232. Baseline10BudgetWork: 9,
  6233. Baseline10Cost: 10,
  6234. Baseline10Work: 11,
  6235. Baseline1BudgetCost: 12,
  6236. Baseline1BudgetWork: 13,
  6237. Baseline1Cost: 14,
  6238. Baseline1Work: 15,
  6239. Baseline2BudgetCost: 16,
  6240. Baseline2BudgetWork: 17,
  6241. Baseline2Cost: 18,
  6242. Baseline2Work: 19,
  6243. Baseline3BudgetCost: 20,
  6244. Baseline3BudgetWork: 21,
  6245. Baseline3Cost: 22,
  6246. Baseline3Work: 23,
  6247. Baseline4BudgetCost: 24,
  6248. Baseline4BudgetWork: 25,
  6249. Baseline4Cost: 26,
  6250. Baseline4Work: 27,
  6251. Baseline5BudgetCost: 28,
  6252. Baseline5BudgetWork: 29,
  6253. Baseline5Cost: 30,
  6254. Baseline5Work: 31,
  6255. Baseline6BudgetCost: 32,
  6256. Baseline6BudgetWork: 33,
  6257. Baseline6Cost: 34,
  6258. Baseline6Work: 35,
  6259. Baseline7BudgetCost: 36,
  6260. Baseline7BudgetWork: 37,
  6261. Baseline7Cost: 38,
  6262. Baseline7Work: 39,
  6263. Baseline8BudgetCost: 40,
  6264. Baseline8BudgetWork: 41,
  6265. Baseline8Cost: 42,
  6266. Baseline8Work: 43,
  6267. Baseline9BudgetCost: 44,
  6268. Baseline9BudgetWork: 45,
  6269. Baseline9Cost: 46,
  6270. Baseline9Work: 47,
  6271. BaselineBudgetCost: 48,
  6272. BaselineBudgetWork: 49,
  6273. BaselineCost: 50,
  6274. BaselineWork: 51,
  6275. BudgetCost: 52,
  6276. BudgetWork: 53,
  6277. ResourceCalendarGUID: 54,
  6278. Code: 55,
  6279. Cost1: 56,
  6280. Cost10: 57,
  6281. Cost2: 58,
  6282. Cost3: 59,
  6283. Cost4: 60,
  6284. Cost5: 61,
  6285. Cost6: 62,
  6286. Cost7: 63,
  6287. Cost8: 64,
  6288. Cost9: 65,
  6289. ResourceCreationDate: 66,
  6290. Date1: 67,
  6291. Date10: 68,
  6292. Date2: 69,
  6293. Date3: 70,
  6294. Date4: 71,
  6295. Date5: 72,
  6296. Date6: 73,
  6297. Date7: 74,
  6298. Date8: 75,
  6299. Date9: 76,
  6300. Duration1: 77,
  6301. Duration10: 78,
  6302. Duration2: 79,
  6303. Duration3: 80,
  6304. Duration4: 81,
  6305. Duration5: 82,
  6306. Duration6: 83,
  6307. Duration7: 84,
  6308. Duration8: 85,
  6309. Duration9: 86,
  6310. Email: 87,
  6311. End: 88,
  6312. Finish1: 89,
  6313. Finish10: 90,
  6314. Finish2: 91,
  6315. Finish3: 92,
  6316. Finish4: 93,
  6317. Finish5: 94,
  6318. Finish6: 95,
  6319. Finish7: 96,
  6320. Finish8: 97,
  6321. Finish9: 98,
  6322. Flag10: 99,
  6323. Flag1: 100,
  6324. Flag11: 101,
  6325. Flag12: 102,
  6326. Flag13: 103,
  6327. Flag14: 104,
  6328. Flag15: 105,
  6329. Flag16: 106,
  6330. Flag17: 107,
  6331. Flag18: 108,
  6332. Flag19: 109,
  6333. Flag2: 110,
  6334. Flag20: 111,
  6335. Flag3: 112,
  6336. Flag4: 113,
  6337. Flag5: 114,
  6338. Flag6: 115,
  6339. Flag7: 116,
  6340. Flag8: 117,
  6341. Flag9: 118,
  6342. Group: 119,
  6343. Units: 120,
  6344. Name: 121,
  6345. Notes: 122,
  6346. Number1: 123,
  6347. Number10: 124,
  6348. Number11: 125,
  6349. Number12: 126,
  6350. Number13: 127,
  6351. Number14: 128,
  6352. Number15: 129,
  6353. Number16: 130,
  6354. Number17: 131,
  6355. Number18: 132,
  6356. Number19: 133,
  6357. Number2: 134,
  6358. Number20: 135,
  6359. Number3: 136,
  6360. Number4: 137,
  6361. Number5: 138,
  6362. Number6: 139,
  6363. Number7: 140,
  6364. Number8: 141,
  6365. Number9: 142,
  6366. OvertimeCost: 143,
  6367. OvertimeRate: 144,
  6368. OvertimeWork: 145,
  6369. PercentWorkComplete: 146,
  6370. CostPerUse: 147,
  6371. Generic: 148,
  6372. OverAllocated: 149,
  6373. RegularWork: 150,
  6374. RemainingCost: 151,
  6375. RemainingOvertimeCost: 152,
  6376. RemainingOvertimeWork: 153,
  6377. RemainingWork: 154,
  6378. ResourceGUID: 155,
  6379. Cost: 156,
  6380. Work: 157,
  6381. Start: 158,
  6382. Start1: 159,
  6383. Start10: 160,
  6384. Start2: 161,
  6385. Start3: 162,
  6386. Start4: 163,
  6387. Start5: 164,
  6388. Start6: 165,
  6389. Start7: 166,
  6390. Start8: 167,
  6391. Start9: 168,
  6392. StandardRate: 169,
  6393. Text1: 170,
  6394. Text10: 171,
  6395. Text11: 172,
  6396. Text12: 173,
  6397. Text13: 174,
  6398. Text14: 175,
  6399. Text15: 176,
  6400. Text16: 177,
  6401. Text17: 178,
  6402. Text18: 179,
  6403. Text19: 180,
  6404. Text2: 181,
  6405. Text20: 182,
  6406. Text21: 183,
  6407. Text22: 184,
  6408. Text23: 185,
  6409. Text24: 186,
  6410. Text25: 187,
  6411. Text26: 188,
  6412. Text27: 189,
  6413. Text28: 190,
  6414. Text29: 191,
  6415. Text3: 192,
  6416. Text30: 193,
  6417. Text4: 194,
  6418. Text5: 195,
  6419. Text6: 196,
  6420. Text7: 197,
  6421. Text8: 198,
  6422. Text9: 199
  6423. };
  6424. Microsoft.Office.WebExtension.ProjectProjectFields = {
  6425. CurrencyDigits: 0,
  6426. CurrencySymbol: 1,
  6427. CurrencySymbolPosition: 2,
  6428. DurationUnits: 3,
  6429. GUID: 4,
  6430. Finish: 5,
  6431. Start: 6,
  6432. ReadOnly: 7,
  6433. VERSION: 8,
  6434. WorkUnits: 9,
  6435. ProjectServerUrl: 10,
  6436. WSSUrl: 11,
  6437. WSSList: 12,
  6438. Name: 13,
  6439. CurrentUser: 14
  6440. };
  6441. OSF.DDA.ProjectDocument = function OSF_DDA_ProjectDocument(officeAppContext) {
  6442. OSF.DDA.ProjectDocument.uber.constructor.call(this, officeAppContext);
  6443. var am = OSF.DDA.AsyncMethodNames;
  6444. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  6445. am.GetSelectedDataAsync,
  6446. am.GetSelectedTask,
  6447. am.GetTask,
  6448. am.GetTaskField,
  6449. am.GetWSSUrl,
  6450. am.GetSelectedResource,
  6451. am.GetResourceField,
  6452. am.GetProjectField,
  6453. am.GetSelectedView,
  6454. am.GetTaskByIndex,
  6455. am.GetResourceByIndex,
  6456. am.SetTaskField,
  6457. am.SetResourceField,
  6458. am.GetMaxTaskIndex,
  6459. am.GetMaxResourceIndex,
  6460. am.CreateTask
  6461. ]);
  6462. OSF.DDA.DispIdHost.addEventSupport(this, new OSF.EventDispatch([Microsoft.Office.WebExtension.EventType.TaskSelectionChanged,
  6463. Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged,
  6464. Microsoft.Office.WebExtension.EventType.ViewSelectionChanged]));
  6465. };
  6466. OSF.OUtil.extend(OSF.DDA.ProjectDocument, OSF.DDA.Document);
  6467. OSF.DDA.TaskSelectionChangedEventArgs = function OSF_DDA_TaskSelectionChangedEventArgs(doc) {
  6468. OSF.OUtil.defineEnumerableProperties(this, {
  6469. "type": {
  6470. value: Microsoft.Office.WebExtension.EventType.TaskSelectionChanged
  6471. },
  6472. "document": {
  6473. value: doc
  6474. }
  6475. });
  6476. };
  6477. OSF.DDA.ResourceSelectionChangedEventArgs = function OSF_DDA_ResourceSelectionChangedEventArgs(doc) {
  6478. OSF.OUtil.defineEnumerableProperties(this, {
  6479. "type": {
  6480. value: Microsoft.Office.WebExtension.EventType.ResourceSelectionChanged
  6481. },
  6482. "document": {
  6483. value: doc
  6484. }
  6485. });
  6486. };
  6487. OSF.DDA.ViewSelectionChangedEventArgs = function OSF_DDA_ViewSelectionChangedEventArgs(doc) {
  6488. OSF.OUtil.defineEnumerableProperties(this, {
  6489. "type": {
  6490. value: Microsoft.Office.WebExtension.EventType.ViewSelectionChanged
  6491. },
  6492. "document": {
  6493. value: doc
  6494. }
  6495. });
  6496. };
  6497. OSF.InitializationHelper.prototype.loadAppSpecificScriptAndCreateOM = function OSF_InitializationHelper$loadAppSpecificScriptAndCreateOM(appContext, appReady, basePath) {
  6498. OSF.DDA.ErrorCodeManager.initializeErrorMessages(Strings.OfficeOM);
  6499. appContext.doc = new OSF.DDA.ProjectDocument(appContext, this._initializeSettings(false));
  6500. appReady();
  6501. };
  6502. OSF.DDA.AsyncMethodNames.addNames({
  6503. GetSelectedTask: "getSelectedTaskAsync",
  6504. GetTask: "getTaskAsync",
  6505. GetWSSUrl: "getWSSUrlAsync",
  6506. GetTaskField: "getTaskFieldAsync",
  6507. GetSelectedResource: "getSelectedResourceAsync",
  6508. GetResourceField: "getResourceFieldAsync",
  6509. GetProjectField: "getProjectFieldAsync",
  6510. GetSelectedView: "getSelectedViewAsync",
  6511. GetTaskByIndex: "getTaskByIndexAsync",
  6512. GetResourceByIndex: "getResourceByIndexAsync",
  6513. SetTaskField: "setTaskFieldAsync",
  6514. SetResourceField: "setResourceFieldAsync",
  6515. GetMaxTaskIndex: "getMaxTaskIndexAsync",
  6516. GetMaxResourceIndex: "getMaxResourceIndexAsync",
  6517. CreateTask: "createTaskAsync"
  6518. });
  6519. OSF.DDA.AsyncMethodCalls.define({
  6520. method: OSF.DDA.AsyncMethodNames.GetSelectedTask,
  6521. onSucceeded: function (taskIdDescriptor) { return taskIdDescriptor[Microsoft.Office.WebExtension.Parameters.TaskId]; }
  6522. });
  6523. OSF.DDA.AsyncMethodCalls.define({
  6524. method: OSF.DDA.AsyncMethodNames.GetTaskByIndex,
  6525. requiredArguments: [
  6526. {
  6527. name: Microsoft.Office.WebExtension.Parameters.TaskIndex,
  6528. types: ["number"]
  6529. }
  6530. ],
  6531. supportedOptions: [],
  6532. privateStateCallbacks: [],
  6533. onSucceeded: function (taskIdDescriptor) { return taskIdDescriptor[Microsoft.Office.WebExtension.Parameters.TaskId]; }
  6534. });
  6535. OSF.DDA.AsyncMethodCalls.define({
  6536. method: OSF.DDA.AsyncMethodNames.GetTask,
  6537. requiredArguments: [
  6538. {
  6539. name: Microsoft.Office.WebExtension.Parameters.TaskId,
  6540. types: ["string"]
  6541. }
  6542. ]
  6543. });
  6544. OSF.DDA.AsyncMethodCalls.define({
  6545. method: OSF.DDA.AsyncMethodNames.GetTaskField,
  6546. requiredArguments: [
  6547. {
  6548. name: Microsoft.Office.WebExtension.Parameters.TaskId,
  6549. types: ["string"]
  6550. },
  6551. { name: Microsoft.Office.WebExtension.Parameters.FieldId,
  6552. types: ["number"]
  6553. }
  6554. ],
  6555. supportedOptions: [
  6556. {
  6557. name: Microsoft.Office.WebExtension.Parameters.GetRawValue,
  6558. value: {
  6559. "types": ["boolean"],
  6560. "defaultValue": false
  6561. }
  6562. },
  6563. {
  6564. name: Microsoft.Office.WebExtension.Parameters.CustomFieldId,
  6565. value: {
  6566. "types": ["string"],
  6567. "calculate": function () { return ""; }
  6568. }
  6569. }
  6570. ]
  6571. });
  6572. OSF.DDA.AsyncMethodCalls.define({
  6573. method: OSF.DDA.AsyncMethodNames.GetResourceField,
  6574. requiredArguments: [
  6575. {
  6576. name: Microsoft.Office.WebExtension.Parameters.ResourceId,
  6577. types: ["string"]
  6578. },
  6579. { name: Microsoft.Office.WebExtension.Parameters.FieldId,
  6580. types: ["number"]
  6581. }
  6582. ],
  6583. supportedOptions: [
  6584. {
  6585. name: Microsoft.Office.WebExtension.Parameters.GetRawValue,
  6586. value: {
  6587. "types": ["boolean"],
  6588. "defaultValue": false
  6589. }
  6590. },
  6591. {
  6592. name: Microsoft.Office.WebExtension.Parameters.CustomFieldId,
  6593. value: {
  6594. "types": ["string"],
  6595. "calculate": function () { return ""; }
  6596. }
  6597. }
  6598. ]
  6599. });
  6600. OSF.DDA.AsyncMethodCalls.define({
  6601. method: OSF.DDA.AsyncMethodNames.GetProjectField,
  6602. requiredArguments: [
  6603. { name: Microsoft.Office.WebExtension.Parameters.FieldId,
  6604. types: ["number"]
  6605. }
  6606. ],
  6607. supportedOptions: [
  6608. {
  6609. name: Microsoft.Office.WebExtension.Parameters.GetRawValue,
  6610. value: {
  6611. "types": ["boolean"],
  6612. "defaultValue": false
  6613. }
  6614. }
  6615. ]
  6616. });
  6617. OSF.DDA.AsyncMethodCalls.define({
  6618. method: OSF.DDA.AsyncMethodNames.GetSelectedResource,
  6619. onSucceeded: function (resourceIdDescriptor) { return resourceIdDescriptor[Microsoft.Office.WebExtension.Parameters.ResourceId]; }
  6620. });
  6621. OSF.DDA.AsyncMethodCalls.define({
  6622. method: OSF.DDA.AsyncMethodNames.GetResourceByIndex,
  6623. requiredArguments: [
  6624. {
  6625. name: Microsoft.Office.WebExtension.Parameters.ResourceIndex,
  6626. types: ["number"]
  6627. }
  6628. ],
  6629. supportedOptions: [],
  6630. privateStateCallbacks: [],
  6631. onSucceeded: function (resourceIdDescriptor) { return resourceIdDescriptor[Microsoft.Office.WebExtension.Parameters.ResourceId]; }
  6632. });
  6633. OSF.DDA.AsyncMethodCalls.define({
  6634. method: OSF.DDA.AsyncMethodNames.GetWSSUrl
  6635. });
  6636. OSF.DDA.AsyncMethodCalls.define({
  6637. method: OSF.DDA.AsyncMethodNames.GetSelectedView
  6638. });
  6639. OSF.DDA.AsyncMethodCalls.define({
  6640. method: OSF.DDA.AsyncMethodNames.SetTaskField,
  6641. requiredArguments: [
  6642. {
  6643. name: Microsoft.Office.WebExtension.Parameters.TaskId,
  6644. types: ["string"]
  6645. },
  6646. { name: Microsoft.Office.WebExtension.Parameters.FieldId,
  6647. types: ["number"]
  6648. },
  6649. {
  6650. "name": Microsoft.Office.WebExtension.Parameters.FieldValue,
  6651. "types": ["object", "string", "number", "boolean"]
  6652. }
  6653. ],
  6654. supportedOptions: [
  6655. {
  6656. name: Microsoft.Office.WebExtension.Parameters.CustomFieldId,
  6657. value: {
  6658. "types": ["string"],
  6659. "calculate": function () { return ""; }
  6660. }
  6661. }
  6662. ]
  6663. });
  6664. OSF.DDA.AsyncMethodCalls.define({
  6665. method: OSF.DDA.AsyncMethodNames.SetResourceField,
  6666. requiredArguments: [
  6667. {
  6668. name: Microsoft.Office.WebExtension.Parameters.ResourceId,
  6669. types: ["string"]
  6670. },
  6671. { name: Microsoft.Office.WebExtension.Parameters.FieldId,
  6672. types: ["number"]
  6673. },
  6674. {
  6675. "name": Microsoft.Office.WebExtension.Parameters.FieldValue,
  6676. "types": ["object", "string", "number", "boolean"]
  6677. }
  6678. ],
  6679. supportedOptions: [
  6680. {
  6681. name: Microsoft.Office.WebExtension.Parameters.CustomFieldId,
  6682. value: {
  6683. "types": ["string"],
  6684. "calculate": function () { return ""; }
  6685. }
  6686. }
  6687. ]
  6688. });
  6689. OSF.DDA.AsyncMethodCalls.define({
  6690. method: OSF.DDA.AsyncMethodNames.GetMaxTaskIndex,
  6691. onSucceeded: function (taskIndexDescriptor) { return taskIndexDescriptor[Microsoft.Office.WebExtension.Parameters.TaskIndex]; }
  6692. });
  6693. OSF.DDA.AsyncMethodCalls.define({
  6694. method: OSF.DDA.AsyncMethodNames.GetMaxResourceIndex,
  6695. onSucceeded: function (resourceIndexDescriptor) { return resourceIndexDescriptor[Microsoft.Office.WebExtension.Parameters.ResourceIndex]; }
  6696. });
  6697. OSF.DDA.AsyncMethodCalls.define({
  6698. method: OSF.DDA.AsyncMethodNames.CreateTask,
  6699. requiredArguments: [],
  6700. supportedOptions: [
  6701. {
  6702. name: Microsoft.Office.WebExtension.Parameters.TaskIndex,
  6703. value: {
  6704. "types": ["number"],
  6705. "defaultValue": 0
  6706. }
  6707. },
  6708. {
  6709. name: Microsoft.Office.WebExtension.Parameters.ItemName,
  6710. value: {
  6711. "types": ["string"],
  6712. "calculate": function () { return ""; }
  6713. }
  6714. }
  6715. ],
  6716. privateStateCallbacks: [],
  6717. onSucceeded: function (taskIdDescriptor) { return taskIdDescriptor[Microsoft.Office.WebExtension.Parameters.TaskId]; }
  6718. });
  6719. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6720. type: OSF.DDA.MethodDispId.dispidGetSelectedTaskMethod,
  6721. fromHost: [
  6722. { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6723. ]
  6724. });
  6725. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6726. type: OSF.DDA.MethodDispId.dispidGetTaskByIndexMethod,
  6727. fromHost: [
  6728. { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6729. ],
  6730. toHost: [
  6731. { name: Microsoft.Office.WebExtension.Parameters.TaskIndex, value: 0 }
  6732. ]
  6733. });
  6734. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6735. type: OSF.DDA.MethodDispId.dispidGetTaskMethod,
  6736. fromHost: [
  6737. { name: "taskName", value: 0 },
  6738. { name: "wssTaskId", value: 1 },
  6739. { name: "resourceNames", value: 2 }
  6740. ],
  6741. toHost: [
  6742. { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: 0 }
  6743. ]
  6744. });
  6745. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6746. type: OSF.DDA.MethodDispId.dispidGetTaskFieldMethod,
  6747. fromHost: [
  6748. { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6749. ],
  6750. toHost: [
  6751. { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: 0 },
  6752. { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 },
  6753. { name: Microsoft.Office.WebExtension.Parameters.GetRawValue, value: 2 },
  6754. { name: Microsoft.Office.WebExtension.Parameters.CustomFieldId, value: 3 }
  6755. ]
  6756. });
  6757. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6758. type: OSF.DDA.MethodDispId.dispidGetWSSUrlMethod,
  6759. fromHost: [
  6760. { name: Microsoft.Office.WebExtension.Parameters.ServerUrl, value: 0 },
  6761. { name: Microsoft.Office.WebExtension.Parameters.ListName, value: 1 }
  6762. ]
  6763. });
  6764. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6765. type: OSF.DDA.MethodDispId.dispidGetSelectedResourceMethod,
  6766. fromHost: [
  6767. { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6768. ]
  6769. });
  6770. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6771. type: OSF.DDA.MethodDispId.dispidGetResourceByIndexMethod,
  6772. fromHost: [
  6773. { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6774. ],
  6775. toHost: [
  6776. { name: Microsoft.Office.WebExtension.Parameters.ResourceIndex, value: 0 }
  6777. ]
  6778. });
  6779. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6780. type: OSF.DDA.MethodDispId.dispidGetResourceFieldMethod,
  6781. fromHost: [
  6782. { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6783. ],
  6784. toHost: [
  6785. { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: 0 },
  6786. { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 },
  6787. { name: Microsoft.Office.WebExtension.Parameters.GetRawValue, value: 2 },
  6788. { name: Microsoft.Office.WebExtension.Parameters.CustomFieldId, value: 3 }
  6789. ]
  6790. });
  6791. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6792. type: OSF.DDA.MethodDispId.dispidGetProjectFieldMethod,
  6793. fromHost: [
  6794. { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6795. ],
  6796. toHost: [
  6797. { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 0 },
  6798. { name: Microsoft.Office.WebExtension.Parameters.GetRawValue, value: 1 }
  6799. ]
  6800. });
  6801. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6802. type: OSF.DDA.MethodDispId.dispidGetSelectedViewMethod,
  6803. fromHost: [
  6804. { name: Microsoft.Office.WebExtension.Parameters.ViewType, value: 0 },
  6805. { name: Microsoft.Office.WebExtension.Parameters.ViewName, value: 1 }
  6806. ]
  6807. });
  6808. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6809. type: OSF.DDA.MethodDispId.dispidSetTaskFieldMethod,
  6810. toHost: [
  6811. { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: 0 },
  6812. { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 },
  6813. { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: 2 },
  6814. { name: Microsoft.Office.WebExtension.Parameters.CustomFieldId, value: 3 }
  6815. ]
  6816. });
  6817. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6818. type: OSF.DDA.MethodDispId.dispidSetResourceFieldMethod,
  6819. toHost: [
  6820. { name: Microsoft.Office.WebExtension.Parameters.ResourceId, value: 0 },
  6821. { name: Microsoft.Office.WebExtension.Parameters.FieldId, value: 1 },
  6822. { name: Microsoft.Office.WebExtension.Parameters.FieldValue, value: 2 },
  6823. { name: Microsoft.Office.WebExtension.Parameters.CustomFieldId, value: 3 }
  6824. ]
  6825. });
  6826. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6827. type: OSF.DDA.MethodDispId.dispidGetMaxTaskIndexMethod,
  6828. fromHost: [
  6829. { name: Microsoft.Office.WebExtension.Parameters.TaskIndex, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6830. ]
  6831. });
  6832. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6833. type: OSF.DDA.MethodDispId.dispidGetMaxResourceIndexMethod,
  6834. fromHost: [
  6835. { name: Microsoft.Office.WebExtension.Parameters.ResourceIndex, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6836. ]
  6837. });
  6838. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  6839. type: OSF.DDA.MethodDispId.dispidCreateTaskMethod,
  6840. fromHost: [
  6841. { name: Microsoft.Office.WebExtension.Parameters.TaskId, value: OSF.DDA.SafeArray.Delegate.ParameterMap.self }
  6842. ],
  6843. toHost: [
  6844. { name: Microsoft.Office.WebExtension.Parameters.TaskIndex, value: 0 },
  6845. { name: Microsoft.Office.WebExtension.Parameters.ItemName, value: 1 }
  6846. ]
  6847. });
  6848. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidTaskSelectionChangedEvent });
  6849. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidResourceSelectionChangedEvent });
  6850. OSF.DDA.SafeArray.Delegate.ParameterMap.define({ type: OSF.DDA.EventDispId.dispidViewSelectionChangedEvent });