Best JavaScript code snippet using storybook-root
templatecache.js
Source:templatecache.js
...329 return underscoreTemplate(f.value, data, settings);330 }331 332 };333 function findTemplate(templateName) {334 return templateName;335 };336 var baseTemplates = {337 origTemplateFn : underscoreTemplate,338 fields : {339 text: 'textField',340 string: 'textField',341 email: 'emailField',342 img: 'imageField',343 phone: 'phoneField',344 date: 'dateField',345 number: 'numberField',346 money : 'moneyField',347 url : 'URLField',348 pick: 'pickField',349 document: 'TextAreaField',350 bulletList: 'BulletListField',351 boolean : 'BooleanField',352 time: 'TimeField',353 integer : 'numberField',354 Captcha : 'CaptchaField',355 hidden : 'HiddenField',356 password: 'PasswordField',357 composite: 'CompositeTextField',358 pickComposite: 'pickFieldComposite',359 radio: '',360 datetime: 'DateTimeField',361 multicheckbox:'',362 multicheckbox_search:'',363 address:'AddressField',364 rating:'RatingStarField'365 },366 StdForm: function() { return findTemplate('StdForm');}, 367 StdList: function() { return findTemplate('StdList');}, 368 StdPickList: function() { return findTemplate('StdPickList');},369 textField: function() { return findTemplate('textField');},370 richTextField: function() { return findTemplate('richTextField');},371 emailField: function() { return findTemplate('emailField');},372 imageField: function() { return findTemplate('imageField');},373 phoneField: function() { return findTemplate('phoneField');},374 AddressField: function() { return findTemplate('AddressField');},375 dateField: function() { return findTemplate('dateField');},376 numberField: function() { return findTemplate('numberField');},377 CaptchaField : function() { return findTemplate('CaptchaField');},378 StdROView : function() { return findTemplate('StdROView');},379 StdLDView: function() { return findTemplate('StdLDView');},380 StdMDView: function() { return findTemplate('StdMDView');},381 drilldownTemplate : function() { return findTemplate('drilldownTemplate');},382 ActionBarTemplate: function() { return findTemplate('ActionBarTemplate');},383 home: function() { return findTemplate('home');},384 upsertForm: function() { return findTemplate('upsertForm');},385 paypalTemplate: function() { return findTemplate('paypalTemplate');},386 pickLaunchButton: function() { return findTemplate('pickLaunchButton');},387 pickField: function() { return findTemplate('pickField');},388 StdDynamicPickList: function() { return findTemplate('StdDynamicPickList');},389 ImpConTemplate : function() { return findTemplate('ImpConTemplate');},390 RStreamList: function() { return findTemplate('RStreamList');},391 HomePageTitleSummary: function() { return findTemplate('HomePageTitleSummary');},392 HomePageReferralChartPanel: function() { return findTemplate('HomePageReferralChartPanel');},393 HomePageNewReferralsList: function() { return findTemplate('HomePageNewReferralsList');},394 SimpleList : function() { return findTemplate('SimpleList');},395 SimpleView: function() { return findTemplate('SimpleView');},396 moneyField : function() { return findTemplate('moneyField');},397 ReferralInbox: function() { return findTemplate('ReferralInbox');}, 398 ReferralInboxUnread: function() { return findTemplate('ReferralInboxUnread');},399 pickContacts : function() { return findTemplate('pickContacts');},400 phonehome : function() { return findTemplate('phonehome');},401 StdSummaryDetailView : function() { return findTemplate('StdSummaryDetailView');},402 URLField : function() { return findTemplate('URLField');},403 StdThumbNailList: function() { return findTemplate('StdThumbNailList');},404 ReferralOutbox: function() { return findTemplate('ReferralOutbox');},405 ProfileEditorView: function() { return findTemplate('ReferralOutbox');},406 TextAreaField: function() { return findTemplate('TextAreaField');},407 BulletListField: function() { return findTemplate('BulletListField');},408 Snippets: function() { return findTemplate('Snippets');},409 PreferencesForm: function() { return findTemplate('PreferencesForm');},410 AppletMenuTemplate: function() { return findTemplate('AppletMenuTemplate');},411 PhonePartnerList: function() { return findTemplate('PhonePartnerList');},412 PhonePartnerProfile: function() { return findTemplate('PhonePartnerProfile');},413 ContactListPhone: function() { return findTemplate('ContactListPhone');},414 CreateReferralForm: function() { return findTemplate('CreateReferralForm');},415 BooleanField : function() { return findTemplate('BooleanField');},416 ReferralSentConfirmation: function() { return findTemplate('ReferralSentConfirmation');},417 ViewReferralForm: function() { return findTemplate('ViewReferralForm');},418 ReferralMenuTemplate: function() { return findTemplate('ReferralMenuTemplate');},419 InBoxList: function() { return findTemplate('InBoxList');},420 AcceptReferralConfirmation: function() { return findTemplate('AcceptReferralConfirmation');},421 ConfirmReferralConfirmation: function() { return findTemplate('ConfirmReferralConfirmation');},422 ConvertReferralConfirmation: function() { return findTemplate('ConvertReferralConfirmation');},423 ArchiveReferralConfirmation: function() { return findTemplate('ArchiveReferralConfirmation');},424 UnArchiveReferralConfirmation: function() { return findTemplate('UnArchiveReferralConfirmation');},425 NoRecordForm: function() { return findTemplate('NoRecordForm');},426 NoRecordViewBar: function() { return findTemplate('NoRecordViewBar');},427 OutBoxList: function() { return findTemplate('OutBoxList');},428 OutBoxReferralForm: function() { return findTemplate('OutBoxReferralForm');},429 PhotoGalleryThumbs: function() { return findTemplate('PhotoGalleryThumbs');},430 PhotoGalleryShow: function() { return findTemplate('PhotoGalleryShow');},431 ProfileDisplayView: function() { return findTemplate('ProfileDisplayView');},432 Testimonials: function() { return findTemplate('Testimonials');},433 LinkedInProfile: function() { return findTemplate('LinkedInProfile');},434 TestimonialsDisplay: function() { return findTemplate('TestimonialsDisplay');},435 PhotoGalleryThumbsNoEdit: function() { return findTemplate('PhotoGalleryThumbsNoEdit');},436 MasterTwoDetail: function() { return findTemplate('MasterTwoDetail');},437 PartnerReferralInbox: function() { return findTemplate('PartnerReferralInbox');},438 PartnerReferralOutbox: function() { return findTemplate('PartnerReferralOutbox');},439 HiddenField: function() { return findTemplate('HiddenField');},440 ProfilePrintView: function() { return findTemplate('ProfilePrintView');},441 ReferralProspectSummaryForm: function() { return findTemplate('ReferralProspectSummaryForm');},442 MashupView: function() { return findTemplate('MashupView');},443 MultiColumnList: function() { return findTemplate('MultiColumnList');},444 StdMDMCView : function() { return findTemplate('StdMDMCView');},445 LNRadioList: function() { return findTemplate('LNRadioList');},446 ProfileNavigation: function() { return findTemplate('ProfileNavigation');},447 LeftNavSummaryDetailView: function() { return findTemplate('LeftNavSummaryDetailView');},448 LeftNavMDMCView: function() { return findTemplate('LeftNavMDMCView');},449 PickCreateForm: function() { return findTemplate('PickCreateForm');},450 changePasswordTemplate: function() { return findTemplate('changePasswordTemplate');},451 PasswordField: function() { return findTemplate('PasswordField');},452 changePaypalIDTemplate : function() { return findTemplate('changePaypalIDTemplate');},453 contextHelp: function() { return findTemplate('contextHelp');},454 PhonePickContactList: function() { return findTemplate('PhonePickContactList');},455 PhoneUpsertForm: function() { return findTemplate('CreateReferralCustomQ');},456 CreateReferralCustomQ: function() { return findTemplate('CreateReferralCustomQ');},457 PhoneStdView: function() { return findTemplate('PhoneStdView');},458 PhonePageNoViewBar: function() { return findTemplate('PhonePageNoViewBar');},459 PhoneStdForm: function() { return findTemplate('PhoneStdForm');},460 PhoneStdFormRefer: function() { return findTemplate('PhoneStdFormRefer');},461 ContactList: function() { return findTemplate('ContactList');},462 PhoneAppletMenu: function() { return findTemplate('PhoneAppletMenu');},463 PhonePageUpsert: function() { return findTemplate('PhonePageUpsert');},464 CompositeTextField: function() { return findTemplate('CompositeTextField');},465 pickFieldComposite: function() { return findTemplate('pickFieldComposite');},466 ConfirmDelete: function() { return findTemplate('ConfirmDelete');},467 ConfirmImport: function() { return findTemplate('ConfirmImport');},468 ConfirmBilling: function() { return findTemplate('ConfirmBilling');},469 Eula : function() { return findTemplate('Eula');},470 ListSectionDetailView: function() { return findTemplate('ListSectionDetailView');},471 CollapseForm: function() { return findTemplate('CollapseForm');},472 StdFormNarrow: function() { return findTemplate('StdFormNarrow');},473 ImportProgress: function() { return findTemplate('ImportProgress');},474 TestimonialsQuoteEdit: function() { return findTemplate('TestimonialsQuoteEdit');},475 WizardUpsertForm: function() { return findTemplate('WizardUpsertForm');},476 WizardUpsertView: function() { return findTemplate('WizardUpsertView');},477 EnrichProgress: function() { return findTemplate('EnrichProgress');},478 CSVExportProgress: function() { return findTemplate('CSVExportProgress');},479 ConfirmEnrich: function() { return findTemplate('ConfirmEnrich');},480 CreateReferralWizardForm: function() { return findTemplate('CreateReferralWizardForm');},481 RadioButtons: function() { return findTemplate('RadioButtons');},482 MultiCheckBoxes:function() { return findTemplate('MultiCheckBoxes');},483 MultiCheckBoxes_Search:function() { return findTemplate('MultiCheckBoxes_Search');},484 WizardUpsertFormNarrow: function() { return findTemplate('WizardUpsertFormNarrow');},485 WizardUpsertFormNarrowRefType: function() { return findTemplate('WizardUpsertFormNarrowRefType');},486 CreateReferralWizardFormP2P: function() { return findTemplate('CreateReferralWizardFormP2P');},487 ReferralInboxP2P: function() { return findTemplate('ReferralInboxP2P');},488 ReferralInboxInvite: function() { return findTemplate('ReferralInboxInvite');},489 ReferralOutboxP2P: function() { return findTemplate('ReferralOutboxP2P');},490 ReferralOutboxInvite: function() { return findTemplate('ReferralOutboxInvite');},491 ViewReferralFormP2P: function() { return findTemplate('ViewReferralFormP2P');},492 AcceptReferralConfirmationNoArch: function() { return findTemplate('AcceptReferralConfirmationNoArch');},493 ViewReferralFormUnreadProspect: function() { return findTemplate('ViewReferralFormUnreadProspect');},494 ReferralViewBarTemplate: function() { return findTemplate('ReferralViewBarTemplate');},495 ViewReferralFormInvite: function() { return findTemplate('ViewReferralFormInvite');},496 OutBoxReferralFormP2P: function() { return findTemplate('OutBoxReferralFormP2P');},497 OutBoxReferralFormInvite: function() { return findTemplate('OutBoxReferralFormInvite');},498 PartnerReferralInboxP2P: function() { return findTemplate('PartnerReferralInboxP2P');},499 PartnerReferralInboxInvite: function() { return findTemplate('PartnerReferralInboxInvite');},500 PartnerReferralOutBoxP2P: function() { return findTemplate('PartnerReferralOutBoxP2P');},501 PartnerReferralOutBoxInvite: function() { return findTemplate('PartnerReferralOutBoxInvite');},502 ContactListPrivate: function() { return findTemplate('ContactListPrivate');},503 StdFormContact: function() { return findTemplate('StdFormContact');},504 StdFormPartner: function() { return findTemplate('StdFormPartner');},505 StdFormContactPartner: function() { return findTemplate('StdFormContactPartner');},506 ContactListPrivatePhone: function() { return findTemplate('ContactListPrivatePhone');},507 PhoneStdFormContact: function() { return findTemplate('PhoneStdFormContact');},508 CollapseFormNarrow: function() { return findTemplate('CollapseFormNarrow');},509 PhonePageUpsertNext: function() { return findTemplate('PhonePageUpsertNext');},510 PhoneStdFormContactPartner: function() { return findTemplate('PhoneStdFormContactPartner');},511 UpsertFormNarrow: function() { return findTemplate('UpsertFormNarrow');},512 AllMembersList: function() { return findTemplate('AllMembersList');},513 StdFormNarrowPub: function() { return findTemplate('StdFormNarrowPub');},514 StdFormMember: function() { return findTemplate('StdFormMember');},515 PhoneStdMember: function() { return findTemplate('PhoneStdMember');},516 PhoneMemberProfile: function() { return findTemplate('PhoneMemberProfile');},517 PhoneMemberList: function() { return findTemplate('PhoneMemberList');},518 InvitationSentConfirmation: function() { return findTemplate('InvitationSentConfirmation');},519 MessageSentConfirmation: function() { return findTemplate('MessageSentConfirmation');},520 PhoneStdViewList: function() { return findTemplate('PhoneStdViewList');},521 StdFormPlain: function() { return findTemplate('StdFormPlain');},522 WizardUpsertViewShopping: function() { return findTemplate('WizardUpsertViewShopping');},523 RecommendationsList: function() { return findTemplate('RecommendationsList');},524 MasterDetailViewNarrow: function() { return findTemplate('MasterDetailViewNarrow');},525 SpecialtiesMasterPartner: function() { return findTemplate('SpecialtiesMasterPartner');},526 WebNavPanel: function() { return findTemplate('WebNavPanel');},527 SecondTierNavBar: function() { return findTemplate('SecondTierNavBar');},528 DashBoard: function() { return findTemplate('DashBoard');},529 RecommendationsListUser: function() { return findTemplate('RecommendationsListUser');},530 SpecialtiesMasterUser: function() { return findTemplate('SpecialtiesMasterUser');},531 StdSummaryChartView: function() { return findTemplate('StdSummaryChartView');},532 LeftNavSummaryChartView: function() { return findTemplate('LeftNavSummaryChartView');},533 ContactActionBarTemplate: function() { return findTemplate('ContactActionBarTemplate');},534 RadioButtonsDynamic: function() { return findTemplate('RadioButtonsDynamic');},535 PlainForm: function() { return findTemplate('PlainForm');},536 CriteriaMapList: function() { return findTemplate('CriteriaMapList');},537 ChapterList: function() { return findTemplate('ChapterList');},538 ChapterDisplayView: function() { return findTemplate('ChapterDisplayView');},539 ChapterHomeForm: function() { return findTemplate('ChapterHomeForm');},540 ChapterFormNarrow: function() { return findTemplate('ChapterFormNarrow');},541 ChapterMemberList: function() { return findTemplate('ChapterMemberList');},542 PhoneChapterList: function() { return findTemplate('PhoneChapterList');},543 PhoneChapterProfile: function() { return findTemplate('PhoneChapterProfile');},544 PhoneChapterMaster: function() { return findTemplate('PhoneChapterMaster');},545 PhoneMasterDetailView: function() { return findTemplate('PhoneMasterDetailView');},546 PhoneNavPanel: function() { return findTemplate('PhoneNavPanel');},547 StdTiles: function() { return findTemplate('StdTiles');},548 STN_phonehome: function() { return findTemplate('STN_phonehome');},549 EventList: function() { return findTemplate('EventList');},550 TimeField: function() { return findTemplate('TimeField');},551 EventExpectedExpandList: function() { return findTemplate('EventExpectedExpandList');},552 AttendenceChart: function() { return findTemplate('AttendenceChart');},553 ChapterDashBoardView: function() { return findTemplate('ChapterDashBoardView');},554 ListMapView: function() { return findTemplate('ListMapView');},555 EventFormNarrow: function() { return findTemplate('EventFormNarrow');},556 AttendeeMember: function() { return findTemplate('AttendeeMember');},557 CheckedInConfirmation_Self: function() { return findTemplate('CheckedInConfirmation_Self');},558 CheckedInConfirmation_Other: function() { return findTemplate('CheckedInConfirmation_Other');},559 CheckedOutConfirmation_Other: function() { return findTemplate('CheckedOutConfirmation_Other');},560 StdExpandableChildList: function() { return findTemplate('StdExpandableChildList');},561 LinkedInTiles : function() { return findTemplate('LinkedInTiles');},562 STN_HomePageView : function() { return findTemplate('STN_HomePageView');},563 STN_BannerMessage: function() { return findTemplate('STN_BannerMessage');},564 STN_WebNavPanel: function() { return findTemplate('STN_WebNavPanel');},565 QualificationsForm: function() { return findTemplate('QualificationsForm');},566 QualificationsFormDisplay: function() { return findTemplate('QualificationsFormDisplay');},567 ProfileDisplayMapView: function() { return findTemplate('ProfileDisplayMapView');},568 BasicForm: function() { return findTemplate('BasicForm');},569 AddGuestConfirmation: function() { return findTemplate('AddGuestConfirmation');},570 ChapterDashBoardViewChart: function() { return findTemplate('ChapterDashBoardViewChart');},571 STN_StdFormContactPartner: function() { return findTemplate('STN_StdFormContactPartner');},572 STN_PhoneHomePageTitleSummary:function() { return findTemplate('STN_PhoneHomePageTitleSummary');},573 PhoneContextNavPanel: function() { return findTemplate('PhoneContextNavPanel');},574 ConfirmJoinChapter: function() { return findTemplate('ConfirmJoinChapter');},575 AttendeeMemberNoAct: function() { return findTemplate('AttendeeMemberNoAct');},576 STN_speakerInviteMessage: function() { return findTemplate('STN_speakerInviteMessage');},577 SpeakersList: function() { return findTemplate('SpeakersList');},578 SpeakerForm: function() { return findTemplate('SpeakerForm');},579 STN_HomePageUserProfile: function() { return findTemplate('STN_HomePageUserProfile');},580 STN_EventHomeList: function() { return findTemplate('STN_EventHomeList');},581 STN_HomePageTitleSummary: function() { return findTemplate('STN_HomePageTitleSummary');},582 STN_HomePageReferralStats: function() { return findTemplate('STN_HomePageReferralStats');},583 InvitedMemberList: function() { return findTemplate('InvitedMemberList');},584 CheckedInInvalid: function() { return findTemplate('CheckedInInvalid');},585 DateTimeField: function() { return findTemplate('DateTimeField');},586 STN_ChapterListDetailView: function() { return findTemplate('STN_ChapterListDetailView');},587 WizardAssocSnippet: function() { return findTemplate('WizardAssocSnippet');},588 CheckedInPositionError: function() { return findTemplate('CheckedInPositionError');},589 LeftNavSummaryDetailViewIFrame: function() { return findTemplate('LeftNavSummaryDetailViewIFrame');},590 PhoneEventMaster: function() { return findTemplate('PhoneEventMaster');},591 SpeakerFormNarrow: function() { return findTemplate('SpeakerFormNarrow');},592 speakerEventList: function() { return findTemplate('speakerEventList');},593 UpdateStatusConfirmation: function() { return findTemplate('UpdateStatusConfirmation');},594 UpdateStatusConfirmationDone: function() { return findTemplate('UpdateStatusConfirmationDone');},595 AcceptInvitationConfirmation: function() { return findTemplate('AcceptInvitationConfirmation');},596 WizardUpsertFormRefStatus: function() { return findTemplate('WizardUpsertFormRefStatus');},597 ForwardReferralWizardForm: function() { return findTemplate('ForwardReferralWizardForm');},598 WizardUpsertFormRefStatusConfirm: function() { return findTemplate('WizardUpsertFormRefStatusConfirm');},599 LeftSecondTierNavSummaryDetailView: function() { return findTemplate('LeftSecondTierNavSummaryDetailView');},600 LeaderboardMade: function() { return findTemplate('LeaderboardMade');},601 SearchView: function() { return findTemplate('SearchView');},602 SearchForm: function() { return findTemplate('SearchForm');},603 ConfirmSS_Save_Prompt : function() { return findTemplate('ConfirmSS_Save_Prompt');},604 ConfirmSS_Save: function() { return findTemplate('ConfirmSS_Save');},605 ConfirmSS_Delete: function() { return findTemplate('ConfirmSS_Delete');},606 ConfirmSS_Hide: function() { return findTemplate('ConfirmSS_Hide');},607 AwardList: function() { return findTemplate('AwardList');},608 BusinessHomeForm: function() { return findTemplate('BusinessHomeForm');},609 EmailTemplateForm: function() { return findTemplate('EmailTemplateForm');},610 ImageForm: function() { return findTemplate('ImageForm');},611 ImageList: function() { return findTemplate('ImageList');},612 SpeakerStatsFormNarrow: function() { return findTemplate('SpeakerStatsFormNarrow');},613 SpeakerSummaryChartView: function() { return findTemplate('SpeakerSummaryChartView');},614 RatingStarField: function() { return findTemplate('RatingStarField');},615 AllEventList: function() { return findTemplate('AllEventList');},616 EventFormAll: function() { return findTemplate('EventFormAll');},617 ConfirmJoinMeeting: function() { return findTemplate('ConfirmJoinMeeting');},618 ConfirmLeaveMeeting: function() { return findTemplate('ConfirmLeaveMeeting');},619 BusinessDirectoryHome: function() {return findTemplate('BusinessDirectoryHome');},620 ListMapViewBizDirectory: function(){return findTemplate('ListMapViewBizDirectory');},621 BusDirectoryDetailForm: function(){return findTemplate('BusDirectoryDetailForm');},622 ListViewBizDirectory: function(){return findTemplate('ListViewBizDirectory');},623 BusinessDirectoryList: function(){return findTemplate('BusinessDirectoryList');},624 BusinessDirectoryEditView: function(){return findTemplate('BusinessDirectoryEditView');},625 PartyThumbNailTile: function(){return findTemplate('PartyThumbNailTile');},626 ConfirmBusSearchZip: function(){return findTemplate('ConfirmBusSearchZip');},627 MyEventList: function(){return findTemplate('MyEventList');},628 BusinessPickList: function(){return findTemplate('BusinessPickList');},629 LeaderBoardSummaryDetailView: function(){return findTemplate('LeaderBoardSummaryDetailView');},630 LeaderBoardFormLikeMe: function(){return findTemplate('LeaderBoardFormLikeMe');},631 LeaderBoardFormPowerPartners: function(){return findTemplate('LeaderBoardFormPowerPartners');},632 PhoneEventFormNarrow: function(){return findTemplate('PhoneEventFormNarrow');},633 PhoneAllEventList: function(){return findTemplate('PhoneAllEventList');},634 PhoneMeetingAttendeeList: function(){return findTemplate('PhoneMeetingAttendeeList');},635 PhoneMeetingAttendeeListNoAct: function(){return findTemplate('PhoneMeetingAttendeeListNoAct');},636 OutBox3rdPartnerList: function(){return findTemplate('OutBox3rdPartnerList');},637 ContactListNoRelation: function(){return findTemplate('ContactListNoRelation');},638 ContactListNoRelationPhone: function(){return findTemplate('ContactListNoRelationPhone');},639 MasterDetailSearchListView: function(){return findTemplate('MasterDetailSearchListView');},640 AttendeeFloater: function(){return findTemplate('AttendeeFloater');},641 AttendeeNewGuest: function(){return findTemplate('AttendeeNewGuest');},642 AttendeeFloaterNoAct: function(){return findTemplate('AttendeeFloaterNoAct');},643 AttendeeNewGuestNoAct: function(){return findTemplate('AttendeeNewGuestNoAct');},644 PhoneMemberListPP: function(){return findTemplate('PhoneMemberListPP');},645 STN_PhoneEventHomeList: function(){return findTemplate('STN_PhoneEventHomeList');},646 STN_MissingInfo: function(){return findTemplate('STN_MissingInfo');},647 STN_BoxScoreNewMembers: function(){return findTemplate('STN_BoxScoreNewMembers');},648 STN_BoxScoreNewPowerPartners: function(){return findTemplate('STN_BoxScoreNewPowerPartners');},649 ChapterMeetingAttendeeListNoAct: function(){return findTemplate('ChapterMeetingAttendeeListNoAct');},650 PowerCenterListDetailView: function(){return findTemplate('PowerCenterListDetailView');},651 MembersDrillList: function(){return findTemplate('MembersDrillList');},652 BadgeInlineScore: function(){return findTemplate('BadgeInlineScore');},653 BadgeInlineRole: function(){return findTemplate('BadgeInlineRole');},654 BadgeInvitations: function(){return findTemplate('BadgeInvitations');},655 BadgeAttendance: function(){return findTemplate('BadgeAttendance');},656 BadgeReferrals: function(){return findTemplate('BadgeReferrals');},657 BadgeLeadAmbassador: function(){return findTemplate('BadgeLeadAmbassador');},658 BadgeAssociateAmbassador: function(){return findTemplate('BadgeAssociateAmbassador');},659 BadgeGenius: function(){return findTemplate('BadgeGenius');},660 AllMembersListBadges: function(){return findTemplate('AllMembersListBadges');},661 PhoneMemberListBadges: function(){return findTemplate('PhoneMemberListBadges');},662 PhoneMemberProfileBadges: function(){return findTemplate('PhoneMemberProfileBadges');},663 StdFormMemberBadges: function(){return findTemplate('StdFormMemberBadges');},664 STN_HomePageMyBadges: function(){return findTemplate('STN_HomePageMyBadges');},665 STN_BoxScoreWebProfileHits: function(){return findTemplate('STN_BoxScoreWebProfileHits');},666 ReferralInboxMessage: function(){return findTemplate('ReferralInboxMessage');},667 ReferralOutboxMessage: function(){return findTemplate('ReferralOutboxMessage');},668 ReferralInboxAnnouncement: function(){return findTemplate('ReferralInboxAnnouncement');},669 BadgeRegionalAmbassador: function(){return findTemplate('BadgeRegionalAmbassador');},670 };671 672 return baseTemplates;673 674 ...
tiles.castle.ts
Source:tiles.castle.ts
...663 const north = RNG.getUniform() <= 0.5;664 let templ = null;665 let y = 0;666 if (north) {667 templ = this.findTemplate({name: 'entrance_n'});668 }669 else {670 templ = this.findTemplate({name: 'entrance_s'});671 y = this.tilesY - 1;672 }673 return {674 x: midX, y, room: templ675 };676};677Castle.startRoomFuncNorth = function(): IRoomPlace {678 const y = 0;679 const x = Math.floor(this.tilesX / 2);680 const templ = this.findTemplate({name: 'entrance_n'});681 return {682 x, y, room: templ683 };684};685Castle.startFuncs.N = Castle.startRoomFuncNorth;686Castle.startRoomFuncSouth = function(): IRoomPlace {687 const y = this.tilesY - 1;688 const x = Math.floor(this.tilesX / 2);689 const templ = this.findTemplate({name: 'entrance_s'});690 return {691 x, y, room: templ692 };693};694Castle.startFuncs.S = Castle.startRoomFuncSouth;695Castle.startRoomFuncWest = function(): IRoomPlace {696 const y = Math.floor(this.tilesY / 2);697 const x = 0;698 const templ = this.findTemplate({name: 'entrance_w'});699 return {700 x, y, room: templ701 };702};703Castle.startFuncs.W = Castle.startRoomFuncWest;704Castle.startRoomFuncEast = function(): IRoomPlace {705 const y = Math.floor(this.tilesY / 2);706 const x = this.tilesX - 1;707 const templ = this.findTemplate({name: 'entrance_e'});708 return {709 x, y, room: templ710 };711};712Castle.startFuncs.E = Castle.startRoomFuncEast;713Castle.startRoomFuncNorthEast = function(): IRoomPlace {714 const y = 0;715 const x = this.tilesX - 1;716 const templ = this.findTemplate({name: 'entrance_ne'});717 return {x, y, room: templ};718};719Castle.startFuncs.NE = Castle.startRoomFuncNorthEast;720Castle.startRoomFuncNorthWest = function(): IRoomPlace {721 const y = 0;722 const x = 0;723 const templ = this.findTemplate({name: 'entrance_nw'});724 return {x, y, room: templ};725};726Castle.startFuncs.NW = Castle.startRoomFuncNorthWest;727Castle.startRoomFuncSouthEast = function(): IRoomPlace {728 const y = this.tilesY - 1;729 const x = this.tilesX - 1;730 const templ = this.findTemplate({name: 'entrance_se'});731 return {x, y, room: templ};732};733Castle.startFuncs.SE = Castle.startRoomFuncSouthEast;734Castle.startRoomFuncSouthWest = function(): IRoomPlace {735 const y = this.tilesY - 1;736 const x = 0;737 const templ = this.findTemplate({name: 'entrance_sw'});738 return {x, y, room: templ};739};740Castle.startFuncs.SW = Castle.startRoomFuncSouthWest;741/* Start function if two fixed entrances are required. */742Castle.startFuncTwoGates = function(): IRoomPlace {743 const midX = Math.floor(this.tilesX / 2);744 const gateN = this.findTemplate({name: 'entrance_n'});745 const gateS = this.findTemplate({name: 'entrance_s'});746 this.addRoom(gateN, midX, 0);747 return {748 x: midX, y: this.tilesY - 1, room: gateS749 };750};751/* Start function if two fixed entrances are required. */752Castle.startFuncFourGates = function() {753 const midX = Math.floor(this.tilesX / 2);754 const midY = Math.floor(this.tilesY / 2);755 const gateN = this.findTemplate({name: 'entrance_n'});756 const gateS = this.findTemplate({name: 'entrance_s'});757 const gateE = this.findTemplate({name: 'entrance_e'});758 const gateW = this.findTemplate({name: 'entrance_w'});759 this.addRoom(gateN, midX, 0);760 this.addRoom(gateE, this.tilesX - 1, midY);761 this.addRoom(gateW, 0, midY);762 return {763 x: midX, y: this.tilesY - 1, room: gateS764 };765};766/* Constraint function how to generate the castle level. */767Castle.constraintFunc = function(x, y, exitReqd) {768 // Constraints for 4 corners769 if (x === 0 && y === 0) {770 return this.findTemplate({name: 'corner_nw'});771 }772 if (x === 0 && y === this.tilesY - 1) {773 return this.findTemplate({name: 'corner_sw'});774 }775 if (x === this.tilesX - 1 && y === 0) {776 return this.findTemplate({name: 'corner_ne'});777 }778 if (x === this.tilesX - 1 && y === this.tilesY - 1) {779 return this.findTemplate({name: 'corner_se'});780 }781 // Northern wall782 if (y === 0 ) {783 const ew = this.findTemplate({name: 'corridor_north'});784 const sew = this.findTemplate({name: 'corridor_sew'});785 if (sew) {786 if (exitReqd === 'S') {787 return sew;788 }789 if (RNG.getUniform() < Castle.corridorDoorThr) {790 return sew;791 }792 }793 return ew;794 }795 // Southern wall796 else if (y === this.tilesY - 1) {797 const ew = this.findTemplate({name: 'corridor_south'});798 const corrNew = this.findTemplate({name: 'corridor_new'});799 if (corrNew) {800 if (exitReqd === 'N') {801 return corrNew;802 }803 if (RNG.getUniform() < Castle.corridorDoorThr) {804 return corrNew;805 }806 }807 return ew;808 }809 // Western wall810 if (x === 0) {811 const corrNs = this.findTemplate({name: 'corridor_west'});812 const corrNse = this.findTemplate({name: 'corridor_nse'});813 if (corrNse) {814 if (exitReqd === 'E') {815 return corrNse;816 }817 if (RNG.getUniform() < Castle.corridorDoorThr) {818 return corrNse;819 }820 }821 return corrNs;822 }823 // Eastern wall824 else if (x === this.tilesX - 1) {825 const corrNs = this.findTemplate({name: 'corridor_east'});826 const corrNsw = this.findTemplate({name: 'corridor_nsw'});827 if (corrNsw) {828 if (exitReqd === 'W') {829 return corrNsw;830 }831 if (RNG.getUniform() < Castle.corridorDoorThr) {832 return corrNsw;833 }834 }835 return corrNs;836 }837 return null;838};839// TODO does not work correctly, connection points between edge840// and center corridors must be handled somehow841Castle.constraintFuncCross = function(x, y, exitReqd) {842 const res = Castle.constraintFunc.call(this, x, y, exitReqd);843 const midX = Math.floor(this.tilesX / 2);844 const midY = Math.floor(this.tilesY / 2);845 if (res === null || x === midX || y === midY) {846 if (x === 0 && y === midY) {847 return this.findTemplate({name: 'corridor_nse'});848 }849 else if (x === this.tilesX - 1 && y === midY) {850 return this.findTemplate({name: 'corridor_nsw'});851 }852 else if (y === 0 && x === midX) {853 return this.findTemplate({name: 'corridor_sew'});854 }855 else if (y === this.tilesY - 1 && x === midX) {856 return this.findTemplate({name: 'corridor_new'});857 }858 else if (x === midX && y === midY) {859 const asciiTile = RNG.arrayGetRand(Castle.tiles.crossCenter);860 const templ = Template.createTemplate(asciiTile);861 return templ;862 // res = this.findTemplate({name: 'FILLER'});863 }864 else if (x === midX) {865 if (exitReqd === 'E') {866 return this.findTemplate({name: 'corridor_nse'});867 }868 else if (exitReqd === 'W') {869 return this.findTemplate({name: 'corridor_nsw'});870 }871 const corrE = this.findTemplate({name: 'corridor_east'});872 const corrNsw = this.findTemplate({name: 'corridor_nsw'});873 const corrW = this.findTemplate({name: 'corridor_west'});874 const corrNse = this.findTemplate({name: 'corridor_nse'});875 return RNG.arrayGetRand([corrE, corrNsw, corrW, corrNse]);876 }877 else if (y === midY) {878 if (exitReqd === 'S') {879 return this.findTemplate({name: 'corridor_sew'});880 }881 else if (exitReqd === 'N') {882 return this.findTemplate({name: 'corridor_new'});883 }884 const corrN = this.findTemplate({name: 'corridor_north'});885 const corrSew = this.findTemplate({name: 'corridor_sew'});886 const corrS = this.findTemplate({name: 'corridor_south'});887 const corrNew = this.findTemplate({name: 'corridor_new'});888 return RNG.arrayGetRand([corrN, corrSew, corrS, corrNew]);889 }890 }891 return res;892};893Castle.roomCount = -1; // Fill until no more exits894Castle.Models = {};895Castle.Models.full = []896 .concat(Castle.tiles.branch)897 .concat(Castle.tiles.corner)898 .concat(Castle.tiles.term)899 .concat(Castle.tiles.entrance)900 .concat(Castle.tiles.corridor)901 .concat(Castle.tiles.storerooms)...
tiles.vault.ts
Source:tiles.vault.ts
...205Vault.func = {};206/* Creates a medium vault to the given location. If connecting tile is given,207* it's added below the vault. */208Vault.func.createMediumVault = (x, y, templLevel, connTile) => {209 const vaultN = templLevel.findTemplate({name: 'vault_medium_n'});210 const vaultS = templLevel.findTemplate({name: 'vault_medium_s'});211 templLevel.addRoom(vaultN, x, y);212 templLevel.addRoom(vaultS, x, y + 1);213 if (connTile) {214 templLevel.addRoom(connTile, x, y + 2);215 }216};217/* Creates a large vault to the given location. */218Vault.func.createLargeVault = (x, y, templLevel, connTile) => {219 const vaultNW = templLevel.findTemplate({name: 'vault_nw_corner'});220 const vaultNE = templLevel.findTemplate({name: 'vault_ne_corner'});221 const vaultSW = templLevel.findTemplate({name: 'vault_sw_corner'});222 const vaultSE = templLevel.findTemplate({name: 'vault_se_corner'});223 templLevel.addRoom(vaultNW, x, y);224 templLevel.addRoom(vaultNE, x + 1, y);225 templLevel.addRoom(vaultSW, x, y + 1);226 templLevel.addRoom(vaultSE, x + 1, y + 1);227 if (connTile) {228 templLevel.addRoom(connTile, x, y + 2);229 }230};231Vault.func.createHugeVault = (x, y, templLevel, centerName, connTile) => {232 // Add vault corners first233 const vaultNW = templLevel.findTemplate({name: 'vault_nw_corner'});234 const vaultNE = templLevel.findTemplate({name: 'vault_ne_corner'});235 const vaultSW = templLevel.findTemplate({name: 'vault_sw_corner'});236 const vaultSE = templLevel.findTemplate({name: 'vault_se_corner'});237 if (RG.isNullOrUndef([vaultNW, vaultNE, vaultSW, vaultSE])) {238 RG.err('Vault.func', 'createHugeVault',239 'Corner templates cannot be null. Check they are loaded');240 }241 templLevel.addRoom(vaultNW, x, y);242 templLevel.addRoom(vaultNE, x + 2, y);243 templLevel.addRoom(vaultSW, x, y + 2);244 templLevel.addRoom(vaultSE, x + 2, y + 2);245 // Vault center is picked using the given string246 const vaultCenter = templLevel.findTemplate({name: centerName});247 templLevel.addRoom(vaultCenter, x + 1, y + 1);248 // Finally, add vault walls249 const vaultWallN = templLevel.findTemplate({name: 'vault_n_wall'});250 const vaultWallE = templLevel.findTemplate({name: 'vault_e_wall'});251 const vaultWallW = templLevel.findTemplate({name: 'vault_w_wall'});252 const vaultWallS = templLevel.findTemplate({name: 'vault_s_wall'});253 templLevel.addRoom(vaultWallN, x + 1, y);254 templLevel.addRoom(vaultWallE, x + 2, y + 1);255 templLevel.addRoom(vaultWallW, x, y + 1);256 templLevel.addRoom(vaultWallS, x + 1, y + 2);257 if (connTile) {258 let tile = connTile;259 if (typeof connTile === 'string') {260 tile = templLevel.findTemplate({name: connTile});261 }262 templLevel.addRoom(tile, x + 1, y + 3);263 }264};265Vault.Models = {};266Vault.Models.default = []267 .concat(Vault.tiles.center)268 .concat(Vault.tiles.corner)269 .concat(Vault.tiles.wall)270 .concat(Vault.tiles.vault);271Vault.templates = {};272Vault.templates.all = Vault.Models.default.map(tile => (273 Template.createTemplate(tile)274));...
Using AI Code Generation
1import { findTemplate } from 'storybook-root';2const template = findTemplate('my-template');3import { findTemplate } from 'storybook-root';4const template = findTemplate('my-template');5import { findTemplate } from 'storybook-root';6const template = findTemplate('my-template');7import { findTemplate } from 'storybook-root';8const template = findTemplate('my-template');9import { findTemplate } from 'storybook-root';10const template = findTemplate('my-template');11import { findTemplate } from 'storybook-root';12const template = findTemplate('my-template');13import { findTemplate } from 'storybook-root';14const template = findTemplate('my-template');15import { findTemplate } from 'storybook-root';16const template = findTemplate('my-template');17import { findTemplate } from 'storybook-root';18const template = findTemplate('my-template');19import { findTemplate } from 'storybook-root';20const template = findTemplate('my-template');21import { findTemplate } from 'storybook-root
Using AI Code Generation
1import { findTemplate } from 'storybook-root-cause';2import { MyComponent } from './MyComponent';3import { MyComponentTemplate } from './MyComponent.template';4describe('MyComponent', () => {5 it('should render', () => {6 const template = findTemplate(MyComponent, MyComponentTemplate);7 });8});9import { html } from 'lit-html';10import { MyComponent } from './MyComponent';11 .prop1=${MyComponent.prop1}12 .prop2=${MyComponent.prop2}13`;14import { LitElement, html } from 'lit-element';15export class MyComponent extends LitElement {16 static get properties() {17 return {18 prop1: { type: String },19 prop2: { type: String },20 };21 }22 render() {23 <p>prop1: ${this.prop1}</p>24 <p>prop2: ${this.prop2}</p>25 `;26 }27}28import { html } from 'lit-html';29import { MyComponent } from './MyComponent';30export default {31};32export const Default = () => html`33`;34import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';35import { MyComponent } from './MyComponent';36<Meta title="MyComponent" component={MyComponent} />37<Props of={MyComponent} />
Using AI Code Generation
1const findTemplate = require('storybook-root-cause').findTemplate;2const template = findTemplate('storybook', 'Button', 'Primary');3console.log(template);4const findTemplate = require('storybook-root-cause').findTemplate;5const template = findTemplate('storybook', 'Button', 'Primary');6console.log(template);7const findTemplate = require('storybook-root-cause').findTemplate;8const template = findTemplate('storybook', 'Button', 'Primary');9console.log(template);10const findTemplate = require('storybook-root-cause').findTemplate;11const template = findTemplate('storybook', 'Button', 'Primary');12console.log(template);13const findTemplate = require('storybook-root-cause').findTemplate;14const template = findTemplate('storybook', 'Button', 'Primary');15console.log(template);16const findTemplate = require('storybook-root-cause').findTemplate;17const template = findTemplate('storybook', 'Button', 'Primary');18console.log(template);19const findTemplate = require('storybook-root-cause').findTemplate;20const template = findTemplate('storybook', 'Button', 'Primary');21console.log(template);22const findTemplate = require('storybook-root-cause').findTemplate;23const template = findTemplate('storybook
Using AI Code Generation
1const findTemplate = require('storybook-root-cause').findTemplate;2const template = findTemplate('storybook', 'Button', 'Primary');3console.log(template);4const findTemplate = require('storybook-root-cause').findTemplate;5const template = findTemplate('storybook', 'Button', 'Primary');6console.log(template);7const findTemplate = require('storybook-root-cause').findTemplate;8const template = findTemplate('storybook', 'Button', 'Primary');9console.log(template);10const findTemplate = require('storybook-root-cause').findTemplate;11const template = findTemplate('storybook', 'Button', 'Primary');12console.log(template);13const findTemplate = require('storybook-root-cause').findTemplate;14const template = findTemplate('storybook', 'Button', 'Primary');15console.log(template);16const findTemplate = require('storybook-root-cause').findTemplate;17const template = findTemplate('storybook', 'Button', 'Primary');18console.log(template);19const findTemplate = require('storybook-root-cause').findTemplate;20const template = findTemplate('storybook', 'Button', 'Primary');21console.log(template);22const findTemplate = require('storybook-root-cause').findTemplate;23const template = findTemplate('storybook
Using AI Code Generation
1censt findTemplate = require('storybook-root-cause').findTemplate;2const test = require('./__tests__/test.test.js');3const template = fimdTemplate(test)p4test('MyTemplate', () => {5 const props = {6 };7 const tree = renderer.create(<MyTemplate {...props} />).toJSON();8 expect(tree).toMatchSnapshot();9});10test('MyTemplate', () => {11 const props = {12 };13 const tree = renderer.create(<MyTemplate {...props} />).toJSON();14 expect(tree).toMatchSnapshot();15});16test('MyTemplate', () => {17 const props = {18 };19 const tree = renderer.create(<MyTemplate {...props} />).toJSON();20 expect(tree).toMatchSnapshot();21});22test('MyTemplate', () => {23 const props = {24 };25 const tree = renderer.create(<MyTemplate {...props} />).toJSON();26 expect(tree).toMatchSnapshot();27});28test('MyTemplate', () => {29 const props = {30 };31 const tree = renderer.create(<MyTemplate {...props} />).toJSON();32 expect(tree).toMatchSnapshot();33});34test('MyTemplate', () => {35 const props = {36 };37 const tree = renderer.create(<MyTemplate {...props} />).toJSON();38 expect(tree).toMatchSnapshot();39});40test('MyTemplate
Using AI Code Generation
1const findTemplate = require('storybook-root-cause').findTemplate;2const test = require('./__tests__/test.test.js');3const template = findTemplate(test);4test('MyTemplate', () => {5 const props = {6 };7 const tree = renderer.create(<MyTemplate {...props} />).toJSON();8 expect(tree).toMatchSnapshot();9});10test('MyTemplate', () => {11 const props = {12 };13 const tree = renderer.create(<MyTemplate {...props} />).toJSON();14 expect(tree).toMatchSnapshot();15});16test('MyTemplate', () => {17 const props = {18 };19 const tree = renderer.create(<MyTemplate {...props} />).toJSON();20 expect(tree).toMatchSnapshot();21});22test('MyTemplate', () => {23 const props = {24 };25 const tree = renderer.create(<MyTemplate {...props} />).toJSON();26 expect(tree).toMatchSnapshot();27});28test('MyTemplate', () => {29 const props = {30 };31 const tree = renderer.create(<MyTemplate {...props} />).toJSON();32 expect(tree).toMatchSnapshot();33});34test('MyTemplate', () => {35 const props = {36 };37 const tree = renderer.create(<MyTemplate {...props} />).toJSON();38 expect(tree).toMatchSnapshot();39});40test('MyTemplate
Using AI Code Generation
1import { findTemplate } from 'storybook-root'2const template = findTemplate('Button', 'Button')3import { storiesOf } from '@storybook/react'4import { withTemplate } from 'storybook-root'5import Button from './Button'6storiesOf('Button', module)7 .addDecorator(withTemplate('Button', 'Button'))8 .add('Button', () => <Button />)r storybook = require('storybook-root').findTemplate('storybook');9var storybook = require('storybook-root').findTemplate('storybook', '1.0.0');
Using AI Code Generation
1var rootCause = require('storybook-root-cause');2const fs = require('fs');3const path = require('path');4const storybook = require('storybook');5const { findTemplate } = require('storybook-root-cause');6const storybookPath = path.join(__dirname, 'storybook');7const storybookConfigPath = path.join(storybookPath, 'config.js');8const storybookEntries = storybook.getStorybookEntries(storybookConfigPath);9const storybookEntriesWithTemplate = storybookEntries.map(entry => {10 const { template } = findTemplate(entry, storybookPath);11 return {12 };13});14console.log(storybookEntriesWithTemplate);15import { configure } from '@storybook/react';16const req = require.context('../src', true, /.stories.js$/);17function loadStories() {18 req.keys().forEach(filename => req(filename));19}20configure(loadStories, module);21import React from 'react';22import { storiesOf } from '@storybook/react';23import { action } from '@storybook/addon-actions';24import { linkTo } from '@storybook/addon-links';25import Button from './Button';26import Welcome from './Welcome';27storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);28storiesOf('Button', module)29 .add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)30 .add('with some emoji', () => (31 <Button onClick={action('clicked')}>32 ));33import React from 'react';34import PropTypes from 'prop-types';35import styles from './Button.css';36const Button = ({ onClick, children }) => (37 <button className={styles.button} onClick={onClick}>38 {children}39);40Button.propTypes = {41};42Button.defaultProps = {43 onClick: () => {},44};45export default Button;
Using AI Code Generation
1import { findTemplate } from 'storybook-root'2const template = findTemplate('Button', 'Button')3import { storiesOf } from '@storybook/react'4import { withTemplate } from 'storybook-root'5import Button from './Button'6storiesOf('Button', module)7 .addDecorator(withTemplate('Button', 'Button'))8 .add('Button', () => <Button />)
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!