Best JavaScript code snippet using stryker-parent
menu.js
Source:menu.js
1export const menuItems = [2 {3 id: 1,4 label: "menuitems.menu.text",5 isTitle: true6 },7 {8 id: 2,9 label: "menuitems.shipping.text",10 icon: "uil-truck",11 badge: {12 variant: "primary",13 text: "menuitems.shipping.badge"14 },15 link: "/"16 },17 // {18 // id: 3,19 // label: "menuitems.apps.text",20 // isTitle: true21 // },22 // {23 // id: 4,24 // label: "menuitems.shipping.text",25 // icon: "uil-truck",26 // link: "/shipping"27 // },28 // {29 // id: 4,30 // label: "menuitems.calendar.text",31 // icon: "uil-calender",32 // link: "/calendar"33 // },34 // {35 // id: 5,36 // label: "menuitems.chat.text",37 // icon: "uil-comments-alt",38 // link: "/chat",39 // badge: {40 // variant: "warning",41 // text: "menuitems.chat.badge"42 // }43 // },44 // {45 // id: 6,46 // label: "menuitems.ecommerce.text",47 // icon: "uil-store",48 // subItems: [49 // {50 // id: 7,51 // label: "menuitems.ecommerce.list.products",52 // link: "/ecommerce/products",53 // parentId: 654 // },55 // {56 // id: 8,57 // label: "menuitems.ecommerce.list.productdetail",58 // link: "/ecommerce/product-detail/1",59 // parentId: 660 // },61 // {62 // id: 9,63 // label: "menuitems.ecommerce.list.orders",64 // link: "/ecommerce/orders",65 // parentId: 666 // },67 // {68 // id: 10,69 // label: "menuitems.ecommerce.list.customers",70 // link: "/ecommerce/customers",71 // parentId: 672 // },73 // {74 // id: 11,75 // label: "menuitems.ecommerce.list.cart",76 // link: "/ecommerce/cart",77 // parentId: 678 // },79 // {80 // id: 12,81 // label: "menuitems.ecommerce.list.checkout",82 // link: "/ecommerce/checkout",83 // parentId: 684 // },85 // {86 // id: 13,87 // label: "menuitems.ecommerce.list.shops",88 // link: "/ecommerce/shops",89 // parentId: 690 // },91 // {92 // id: 14,93 // label: "menuitems.ecommerce.list.addproduct",94 // link: "/ecommerce/add-product",95 // parentId: 696 // }97 // ]98 // },99 // {100 // id: 15,101 // label: "menuitems.email.text",102 // icon: "uil-envelope",103 // subItems: [104 // {105 // id: 16,106 // label: "menuitems.email.list.inbox",107 // link: "/email/inbox",108 // parentId: 15109 // },110 // {111 // id: 17,112 // label: "menuitems.email.list.reademail",113 // link: "/email/reademail/1",114 // parentId: 15115 // }116 // ]117 // },118 // {119 // id: 18,120 // label: "menuitems.invoices.text",121 // icon: "uil-invoice",122 // subItems: [123 // {124 // id: 19,125 // label: "menuitems.invoices.list.invoicelist",126 // link: "/invoices/list",127 // parentId: 18128 // },129 // {130 // id: 20,131 // label: "menuitems.invoices.list.invoicedetail",132 // link: "/invoices/detail",133 // parentId: 18134 // }135 // ]136 // },137 // {138 // id: 21,139 // label: "menuitems.contacts.text",140 // icon: "uil-book-alt",141 // subItems: [142 // {143 // id: 22,144 // label: "menuitems.contacts.list.usergrid",145 // link: "/contacts/grid",146 // parentId: 21147 // },148 // {149 // id: 23,150 // label: "menuitems.contacts.list.userlist",151 // link: "/contacts/list",152 // parentId: 21153 // },154 // {155 // id: 24,156 // label: "menuitems.contacts.list.profile",157 // link: "/contacts/profile",158 // parentId: 21159 // }160 // ]161 // },162 // {163 // id: 25,164 // label: "menuitems.pages.text",165 // isTitle: true166 // },167 // {168 // id: 26,169 // label: "menuitems.authentication.text",170 // icon: "uil-user-circle",171 // subItems: [172 // {173 // id: 27,174 // label: "menuitems.authentication.list.login",175 // link: "/auth/login-1",176 // parentId: 26177 // },178 // {179 // id: 28,180 // label: "menuitems.authentication.list.register",181 // link: "/auth/register-1",182 // parentId: 26183 // },184 // {185 // id: 29,186 // label: "menuitems.authentication.list.recoverpwd",187 // link: "/auth/recoverpwd",188 // parentId: 26189 // },190 // {191 // id: 30,192 // label: "menuitems.authentication.list.lockscreen",193 // link: "/auth/lock-screen",194 // parentId: 26195 // }196 // ]197 // },198 // {199 // id: 31,200 // label: "menuitems.utility.text",201 // icon: "uil-file-alt",202 // subItems: [203 // {204 // id: 32,205 // label: "menuitems.utility.list.starter",206 // link: "/utility/starter",207 // parentId: 31208 // },209 // {210 // id: 33,211 // label: "menuitems.utility.list.maintenance",212 // link: "/utility/maintenance",213 // parentId: 31214 // },215 // {216 // id: 35,217 // label: "menuitems.utility.list.comingsoon",218 // link: "/utility/comingsoon",219 // parentId: 31220 // },221 // {222 // id: 36,223 // label: "menuitems.utility.list.timeline",224 // link: "/utility/timeline",225 // parentId: 31226 // },227 // {228 // id: 37,229 // label: "menuitems.utility.list.faqs",230 // link: "/utility/faqs",231 // parentId: 31232 // },233 // {234 // id: 38,235 // label: "menuitems.utility.list.pricing",236 // link: "/utility/pricing",237 // parentId: 31238 // },239 // {240 // id: 39,241 // label: "menuitems.utility.list.error404",242 // link: "/utility/404",243 // parentId: 31244 // },245 // {246 // id: 40,247 // label: "menuitems.utility.list.error500",248 // link: "/utility/500",249 // parentId: 31250 // }251 // ]252 // },253 // {254 // id: 41,255 // label: "menuitems.components.text",256 // isTitle: true257 // },258 // {259 // id: 42,260 // label: "menuitems.uielements.text",261 // icon: "uil-flask",262 // subItems: [263 // {264 // id: 43,265 // label: "menuitems.uielements.list.alerts",266 // link: "/ui/alerts",267 // parentId: 42268 // },269 // {270 // id: 44,271 // label: "menuitems.uielements.list.buttons",272 // link: "/ui/buttons",273 // parentId: 42274 // },275 // {276 // id: 45,277 // label: "menuitems.uielements.list.cards",278 // link: "/ui/cards",279 // parentId: 42280 // },281 // {282 // id: 46,283 // label: "menuitems.uielements.list.carousel",284 // link: "/ui/carousel",285 // parentId: 42286 // },287 // {288 // id: 47,289 // label: "menuitems.uielements.list.dropdowns",290 // link: "/ui/dropdown",291 // parentId: 42292 // },293 // {294 // id: 48,295 // label: "menuitems.uielements.list.grid",296 // link: "/ui/grid",297 // parentId: 42298 // },299 // {300 // id: 49,301 // label: "menuitems.uielements.list.images",302 // link: "/ui/images",303 // parentId: 42304 // },305 // {306 // id: 50,307 // label: "menuitems.uielements.list.lightbox",308 // link: "/ui/lightbox",309 // parentId: 42310 // },311 // {312 // id: 51,313 // label: "menuitems.uielements.list.modals",314 // link: "/ui/modals",315 // parentId: 42316 // },317 // {318 // id: 52,319 // label: "menuitems.uielements.list.rangeslider",320 // link: "/ui/rangeslider",321 // parentId: 42322 // },323 // {324 // id: 53,325 // label: "menuitems.uielements.list.progressbar",326 // link: "/ui/progressbar",327 // parentId: 42328 // },329 // {330 // id: 54,331 // label: "menuitems.uielements.list.sweetalert",332 // link: "/ui/sweet-alert",333 // parentId: 42334 // },335 // {336 // id: 55,337 // label: "menuitems.uielements.list.tabs",338 // link: "/ui/tabs-accordions",339 // parentId: 42340 // },341 // {342 // id: 56,343 // label: "menuitems.uielements.list.typography",344 // link: "/ui/typography",345 // parentId: 42346 // },347 // {348 // id: 57,349 // label: "menuitems.uielements.list.video",350 // link: "/ui/video",351 // parentId: 42352 // },353 // {354 // id: 58,355 // label: "menuitems.uielements.list.general",356 // link: "/ui/general",357 // parentId: 42358 // },359 // {360 // id: 59,361 // label: "menuitems.uielements.list.colors",362 // link: "/ui/colors",363 // parentId: 42364 // },365 // {366 // id: 60,367 // label: "menuitems.uielements.list.rating",368 // link: "/ui/rating",369 // parentId: 42370 // }371 // ]372 // },373 // {374 // id: 62,375 // label: "menuitems.forms.text",376 // icon: "uil-shutter-alt",377 // badge: {378 // variant: "danger",379 // text: 'menuitems.forms.badge'380 // },381 // subItems: [382 // {383 // id: 63,384 // label: "menuitems.forms.list.elements",385 // link: "/form/elements",386 // parentId: 62387 // },388 // {389 // id: 64,390 // label: "menuitems.forms.list.validation",391 // link: "/form/validation",392 // parentId: 62393 // },394 // {395 // id: 65,396 // label: "menuitems.forms.list.advanced",397 // link: "/form/advanced",398 // parentId: 62399 // },400 // {401 // id: 66,402 // label: "menuitems.forms.list.editor",403 // link: "/form/editor",404 // parentId: 62405 // },406 // {407 // id: 67,408 // label: "menuitems.forms.list.fileupload",409 // link: "/form/upload",410 // parentId: 62411 // },412 // {413 // id: 68,414 // label: "menuitems.forms.list.repeater",415 // link: "/form/repeater",416 // parentId: 62417 // },418 // {419 // id: 69,420 // label: "menuitems.forms.list.wizard",421 // link: "/form/wizard",422 // parentId: 62423 // },424 // {425 // id: 70,426 // label: "menuitems.forms.list.mask",427 // link: "/form/mask",428 // parentId: 62429 // }430 // ]431 // },432 // {433 // id: 71,434 // icon: "uil-list-ul",435 // label: "menuitems.tables.text",436 // subItems: [437 // {438 // id: 72,439 // label: "menuitems.tables.list.basic",440 // link: "/tables/basic",441 // parentId: 71442 // },443 // {444 // id: 73,445 // label: "menuitems.tables.list.advanced",446 // link: "/tables/advanced",447 // parentId: 71448 // }449 // ]450 // },451 // {452 // id: 74,453 // icon: "uil-chart",454 // label: "menuitems.charts.text",455 // subItems: [456 // {457 // id: 75,458 // label: "menuitems.charts.list.apex",459 // link: "/charts/apex",460 // parentId: 74461 // },462 // {463 // id: 76,464 // label: "menuitems.charts.list.chartjs",465 // link: "/charts/chartjs",466 // parentId: 74467 // },468 // {469 // id: 77,470 // label: "menuitems.charts.list.chartist",471 // link: "/charts/chartist",472 // parentId: 74473 // },474 // {475 // id: 78,476 // label: "menuitems.charts.list.echart",477 // link: "/charts/echart",478 // parentId: 74479 // }480 // ]481 // },482 // {483 // id: 79,484 // label: "menuitems.icons.text",485 // icon: "uil-streering",486 // subItems: [487 // {488 // id: 80,489 // label: "menuitems.icons.list.unicons",490 // link: "/icons/unicons",491 // parentId: 79492 // },493 // {494 // id: 81,495 // label: "menuitems.icons.list.boxicons",496 // link: "/icons/boxicons",497 // parentId: 79498 // },499 // {500 // id: 82,501 // label: "menuitems.icons.list.materialdesign",502 // link: "/icons/materialdesign",503 // parentId: 79504 // },505 // {506 // id: 83,507 // label: "menuitems.icons.list.dripicons",508 // link: "/icons/dripicons",509 // parentId: 79510 // },511 // {512 // id: 84,513 // label: "menuitems.icons.list.fontawesome",514 // link: "/icons/fontawesome",515 // parentId: 79516 // }517 // ]518 // },519 // {520 // id: 85,521 // label: "menuitems.maps.text",522 // icon: "uil-location-point",523 // subItems: [524 // {525 // id: 86,526 // label: "menuitems.maps.list.googlemap",527 // link: "/maps/google",528 // parentId: 85529 // },530 // {531 // id: 87,532 // label: "menuitems.maps.list.leafletmap",533 // link: "/maps/leaflet",534 // parentId: 85535 // },536 // ]537 // },538 // {539 // id: 88,540 // label: "menuitems.multilevel.text",541 // icon: "uil-share-alt",542 // subItems: [543 // {544 // id: 89,545 // label: "menuitems.multilevel.list.level1.1",546 // link: "#",547 // parentId: 88548 // },549 // {550 // id: 90,551 // label: "menuitems.multilevel.list.level1.2",552 // parentId: 88,553 // subItems: [554 // {555 // id: 91,556 // label: "menuitems.multilevel.list.level1.level2.1",557 // link: "#",558 // parentId: 88559 // },560 // {561 // id: 92,562 // label: "menuitems.multilevel.list.level1.level2.2",563 // link: "#",564 // parentId: 88565 // }566 // ]567 // }568 // ]569 // }...
horizontal-menu.js
Source:horizontal-menu.js
1export const menuItems = [2 {3 id: 1,4 label: 'menuitems.dashboard.text',5 icon: 'uil-home-alt',6 link: '/'7 },8 {9 id: 2,10 label: 'menuitems.uielements.text',11 icon: 'uil-flask',12 subItems: [13 {14 id: 3,15 label: 'menuitems.uielements.list.alerts',16 link: '/ui/alerts'17 },18 {19 id: 4,20 label: 'menuitems.uielements.list.buttons',21 link: '/ui/buttons'22 },23 {24 id: 5,25 label: 'menuitems.uielements.list.cards',26 link: '/ui/cards'27 },28 {29 id: 6,30 label: 'menuitems.uielements.list.carousel',31 link: '/ui/carousel'32 },33 {34 id: 7,35 label: 'menuitems.uielements.list.dropdowns',36 link: '/ui/dropdown'37 },38 {39 id: 8,40 label: 'menuitems.uielements.list.grid',41 link: '/ui/grid'42 },43 {44 id: 9,45 label: 'menuitems.uielements.list.images',46 link: '/ui/images'47 },48 {49 id: 10,50 label: 'menuitems.uielements.list.lightbox',51 link: '/ui/lightbox'52 },53 {54 id: 11,55 label: 'menuitems.uielements.list.modals',56 link: '/ui/modals'57 },58 {59 id: 12,60 label: 'menuitems.uielements.list.rangeslider',61 link: '/ui/rangeslider'62 },63 {64 id: 13,65 label: 'menuitems.uielements.list.progressbar',66 link: '/ui/progressbar'67 },68 {69 id: 15,70 label: 'menuitems.uielements.list.sweetalert',71 link: '/ui/sweet-alert'72 },73 {74 id: 16,75 label: 'menuitems.uielements.list.tabs',76 link: '/ui/tabs-accordions'77 },78 {79 id: 17,80 label: 'menuitems.uielements.list.typography',81 link: '/ui/typography'82 },83 {84 id: 18,85 label: 'menuitems.uielements.list.video',86 link: '/ui/video'87 },88 {89 id: 19,90 label: 'menuitems.uielements.list.general',91 link: '/ui/general'92 },93 {94 id: 20,95 label: "menuitems.uielements.list.colors",96 link: "/ui/colors"97 },98 {99 id: 20,100 label: 'menuitems.uielements.list.rating',101 link: '/ui/rating'102 }103 ]104 },105 {106 id: 22,107 label: 'menuitems.apps.text',108 icon: 'uil-apps',109 subItems: [110 {111 id: 23,112 label: 'menuitems.calendar.text',113 link: '/calendar'114 },115 {116 id: 24,117 label: 'menuitems.chat.text',118 link: '/chat'119 },120 {121 id: 25,122 label: 'menuitems.email.text',123 subItems: [124 {125 id: 26,126 label: 'menuitems.email.list.inbox',127 link: '/email/inbox'128 },129 {130 id: 27,131 label: 'menuitems.email.list.reademail',132 link: '/email/reademail/1'133 }134 ]135 },136 {137 id: 28,138 label: 'menuitems.ecommerce.text',139 subItems: [140 {141 id: 29,142 label: 'menuitems.ecommerce.list.products',143 link: '/ecommerce/products'144 },145 {146 id: 30,147 label: 'menuitems.ecommerce.list.productdetail',148 link: '/ecommerce/product-detail/1'149 },150 {151 id: 31,152 label: 'menuitems.ecommerce.list.orders',153 link: '/ecommerce/orders'154 },155 {156 id: 32,157 label: 'menuitems.ecommerce.list.customers',158 link: '/ecommerce/customers'159 },160 {161 id: 33,162 label: 'menuitems.ecommerce.list.cart',163 link: '/ecommerce/cart'164 },165 {166 id: 34,167 label: 'menuitems.ecommerce.list.checkout',168 link: '/ecommerce/checkout'169 },170 {171 id: 35,172 label: 'menuitems.ecommerce.list.shops',173 link: '/ecommerce/shops'174 },175 {176 id: 36,177 label: 'menuitems.ecommerce.list.addproduct',178 link: '/ecommerce/add-product'179 }180 ]181 },182 {183 id: 37,184 label: 'menuitems.invoices.text',185 subItems: [186 {187 id: 38,188 label: 'menuitems.invoices.list.invoicelist',189 link: '/invoices/list'190 },191 {192 id: 39,193 label: 'menuitems.invoices.list.invoicedetail',194 link: '/invoices/detail'195 },196 ]197 },198 {199 id: 40,200 label: 'menuitems.contacts.text',201 icon: 'bxs-user-detail',202 subItems: [203 {204 id: 41,205 label: 'menuitems.contacts.list.usergrid',206 link: '/contacts/grid'207 },208 {209 id: 42,210 label: 'menuitems.contacts.list.userlist',211 link: '/contacts/list'212 },213 {214 id: 43,215 label: 'menuitems.contacts.list.profile',216 link: '/contacts/profile'217 }218 ]219 },220 ]221 },222 {223 id: 44,224 label: 'menuitems.components.text',225 icon: 'uil-layers',226 subItems: [227 {228 id: 45,229 label: 'menuitems.forms.text',230 subItems: [231 {232 id: 46,233 label: 'menuitems.forms.list.elements',234 link: '/form/elements'235 },236 {237 id: 47,238 label: 'menuitems.forms.list.validation',239 link: '/form/validation'240 },241 {242 id: 48,243 label: 'menuitems.forms.list.advanced',244 link: '/form/advanced'245 },246 {247 id: 49,248 label: 'menuitems.forms.list.editor',249 link: '/form/editor'250 },251 {252 id: 50,253 label: 'menuitems.forms.list.fileupload',254 link: '/form/upload'255 },256 {257 id: 51,258 label: "menuitems.forms.list.repeater",259 link: "/form/repeater",260 parentId: 79261 },262 {263 id: 52,264 label: 'menuitems.forms.list.wizard',265 link: '/form/wizard'266 },267 {268 id: 53,269 label: 'menuitems.forms.list.mask',270 link: '/form/mask'271 }272 ]273 },274 {275 id: 54,276 label: 'menuitems.tables.text',277 subItems: [278 {279 id: 55,280 label: 'menuitems.tables.list.basic',281 link: '/tables/basic'282 },283 {284 id: 56,285 label: 'menuitems.tables.list.advanced',286 link: '/tables/advanced'287 }288 ]289 },290 {291 id: 57,292 label: 'menuitems.charts.text',293 subItems: [294 {295 id: 58,296 label: 'menuitems.charts.list.apex',297 link: '/charts/apex'298 },299 {300 id: 59,301 label: 'menuitems.charts.list.chartjs',302 link: '/charts/chartjs'303 },304 {305 id: 60,306 label: 'menuitems.charts.list.chartist',307 link: '/charts/chartist'308 },309 {310 id: 61,311 label: 'menuitems.charts.list.echart',312 link: '/charts/echart'313 },314 ]315 },316 {317 id: 62,318 label: 'menuitems.icons.text',319 subItems: [320 {321 id: 63,322 label: "menuitems.icons.list.unicons",323 link: "/icons/unicons"324 },325 {326 id: 64,327 label: "menuitems.icons.list.boxicons",328 link: "/icons/boxicons"329 },330 {331 id: 65,332 label: "menuitems.icons.list.materialdesign",333 link: "/icons/materialdesign"334 },335 {336 id: 66,337 label: "menuitems.icons.list.dripicons",338 link: "/icons/dripicons"339 },340 {341 id: 67,342 label: "menuitems.icons.list.fontawesome",343 link: "/icons/fontawesome"344 }345 ]346 },347 {348 id: 68,349 label: 'menuitems.maps.text',350 subItems: [351 {352 id: 69,353 label: 'menuitems.maps.list.googlemap',354 link: '/maps/google'355 },356 {357 id: 70,358 label: 'menuitems.maps.list.leafletmap',359 link: '/maps/leaflet'360 }361 ]362 }363 ]364 },365 {366 id: 71,367 label: 'menuitems.pages.text',368 icon: 'uil-copy',369 subItems: [370 {371 id: 72,372 label: 'menuitems.authentication.text',373 subItems: [374 {375 id: 73,376 label: 'menuitems.authentication.list.login',377 link: '/auth/login-1'378 },379 {380 id: 74,381 label: 'menuitems.authentication.list.register',382 link: '/auth/register-1'383 },384 {385 id: 75,386 label: 'menuitems.authentication.list.recoverpwd',387 link: '/auth/recoverpwd'388 },389 {390 id: 76,391 label: 'menuitems.authentication.list.lockscreen',392 link: '/auth/lock-screen'393 },394 ]395 },396 {397 id: 77,398 label: 'menuitems.utility.text',399 subItems: [400 {401 id: 78,402 label: 'menuitems.utility.list.starter',403 link: '/utility/starter'404 },405 {406 id: 79,407 label: 'menuitems.utility.list.maintenance',408 link: '/utility/maintenance'409 },410 {411 id: 80,412 label: 'menuitems.utility.list.comingsoon',413 link: '/utility/comingsoon'414 },415 {416 id: 81,417 label: 'menuitems.utility.list.timeline',418 link: '/utility/timeline'419 },420 {421 id: 82,422 label: 'menuitems.utility.list.faqs',423 link: '/utility/faqs'424 },425 {426 id: 83,427 label: 'menuitems.utility.list.pricing',428 link: '/utility/pricing'429 },430 {431 id: 84,432 label: 'menuitems.utility.list.error404',433 link: '/utility/404'434 },435 {436 id: 85,437 label: 'menuitems.utility.list.error500',438 link: '/utility/500'439 }440 ]441 }442 ]443 }...
aria.js
Source:aria.js
1// This file is part of Moodle - http://moodle.org/2//3// Moodle is free software: you can redistribute it and/or modify4// it under the terms of the GNU General Public License as published by5// the Free Software Foundation, either version 3 of the License, or6// (at your option) any later version.7//8// Moodle is distributed in the hope that it will be useful,9// but WITHOUT ANY WARRANTY; without even the implied warranty of10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11// GNU General Public License for more details.12//13// You should have received a copy of the GNU General Public License14// along with Moodle. If not, see <http://www.gnu.org/licenses/>.15/**16 * Enhancements to Bootstrap components for accessibility.17 *18 * @module theme_boost/aria19 * @copyright 2018 Damyon Wiese <damyon@moodle.com>20 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later21 */22define(['jquery', 'core/pending'], function($, Pending) {23 return {24 init: function() {25 // Drop downs from bootstrap don't support keyboard accessibility by default.26 var focusEnd = false,27 setFocusEnd = function() {28 focusEnd = true;29 },30 getFocusEnd = function() {31 var result = focusEnd;32 focusEnd = false;33 return result;34 };35 // Special handling for "up" keyboard control.36 $('[data-toggle="dropdown"]').keydown(function(e) {37 var trigger = e.which || e.keyCode,38 expanded;39 // Up key opens the menu at the end.40 if (trigger == 38) {41 // Focus the end of the menu, not the beginning.42 setFocusEnd();43 }44 // Escape key only closes the menu, it doesn't open it.45 if (trigger == 27) {46 expanded = $(e.target).attr('aria-expanded');47 e.preventDefault();48 if (expanded == "false") {49 $(e.target).click();50 }51 }52 // Space key or Enter key opens the menu.53 if (trigger == 32 || trigger == 13) {54 // Cancel random scroll.55 e.preventDefault();56 // Open the menu instead.57 $(e.target).click();58 }59 });60 // Special handling for navigation keys when menu is open.61 var shiftFocus = function(element) {62 var delayedFocus = function(pendingPromise) {63 $(this).focus();64 pendingPromise.resolve();65 }.bind(element);66 setTimeout(delayedFocus, 50, new Pending('core/aria:delayed-focus'));67 };68 $('.dropdown').on('shown.bs.dropdown', function(e) {69 // We need to focus on the first menuitem.70 var menu = $(e.target).find('[role="menu"]'),71 menuItems = false,72 foundMenuItem = false;73 if (menu) {74 menuItems = $(menu).find('[role="menuitem"]');75 }76 if (menuItems && menuItems.length > 0) {77 if (getFocusEnd()) {78 foundMenuItem = menuItems[menuItems.length - 1];79 } else {80 // The first menu entry, pretty reasonable.81 foundMenuItem = menuItems[0];82 }83 }84 if (foundMenuItem) {85 shiftFocus(foundMenuItem);86 }87 });88 // Search for menu items by finding the first item that has89 // text starting with the typed character (case insensitive).90 $('.dropdown [role="menu"] [role="menuitem"]').keypress(function(e) {91 var trigger = String.fromCharCode(e.which || e.keyCode),92 menu = $(e.target).closest('[role="menu"]'),93 i = 0,94 menuItems = false,95 item,96 itemText;97 if (!menu) {98 return;99 }100 menuItems = $(menu).find('[role="menuitem"]');101 if (!menuItems) {102 return;103 }104 trigger = trigger.toLowerCase();105 for (i = 0; i < menuItems.length; i++) {106 item = $(menuItems[i]);107 itemText = item.text().trim().toLowerCase();108 if (itemText.indexOf(trigger) == 0) {109 shiftFocus(item);110 break;111 }112 }113 });114 // Keyboard navigation for arrow keys, home and end keys.115 $('.dropdown [role="menu"] [role="menuitem"]').keydown(function(e) {116 var trigger = e.which || e.keyCode,117 next = false,118 menu = $(e.target).closest('[role="menu"]'),119 i = 0,120 menuItems = false;121 if (!menu) {122 return;123 }124 menuItems = $(menu).find('[role="menuitem"]');125 if (!menuItems) {126 return;127 }128 // Down key.129 if (trigger == 40) {130 for (i = 0; i < menuItems.length - 1; i++) {131 if (menuItems[i] == e.target) {132 next = menuItems[i + 1];133 break;134 }135 }136 if (!next) {137 // Wrap to first item.138 next = menuItems[0];139 }140 } else if (trigger == 38) {141 // Up key.142 for (i = 1; i < menuItems.length; i++) {143 if (menuItems[i] == e.target) {144 next = menuItems[i - 1];145 break;146 }147 }148 if (!next) {149 // Wrap to last item.150 next = menuItems[menuItems.length - 1];151 }152 } else if (trigger == 36) {153 // Home key.154 next = menuItems[0];155 } else if (trigger == 35) {156 // End key.157 next = menuItems[menuItems.length - 1];158 }159 // Variable next is set if we do want to act on the keypress.160 if (next) {161 e.preventDefault();162 shiftFocus(next);163 }164 return;165 });166 $('.dropdown').on('hidden.bs.dropdown', function(e) {167 // We need to focus on the menu trigger.168 var trigger = $(e.target).find('[data-toggle="dropdown"]');169 if (trigger) {170 shiftFocus(trigger);171 }172 });173 // After page load, focus on any element with special autofocus attribute.174 $(function() {175 window.setTimeout(function(pendingPromise) {176 var alerts = $('[role="alert"][data-aria-autofocus="true"]');177 if (alerts.length > 0) {178 $(alerts[0]).attr('tabindex', '0');179 $(alerts[0]).focus();180 }181 pendingPromise.resolve();182 }, 300, new Pending('core/aria:delayed-focus'));183 });184 }185 };...
Using AI Code Generation
1var menuItems = require('stryker-parent').menuItems;2console.log(menuItems);3var menuItems = require('stryker-parent').menuItems;4console.log(menuItems);5var menuItems = require('stryker-parent').menuItems;6console.log(menuItems);7var menuItems = require('stryker-parent').menuItems;8console.log(menuItems);9var menuItems = require('stryker-parent').menuItems;10console.log(menuItems);11var menuItems = require('stryker-parent').menuItems;12console.log(menuItems);13var menuItems = require('stryker-parent').menuItems;14console.log(menuItems);15var menuItems = require('stryker-parent').menuItems;16console.log(menuItems);17var menuItems = require('stryker-parent').menuItems;18console.log(menuItems);19var menuItems = require('stryker-parent').menuItems;20console.log(menuItems);21var menuItems = require('stryker-parent').menuItems;22console.log(menuItems);23var menuItems = require('stryker-parent').menuItems;24console.log(menuItems);25var menuItems = require('stryker-parent').menuItems;26console.log(menuItems);27var menuItems = require('stryker-parent').menuItems;28console.log(menuItems);
Using AI Code Generation
1const menuItems = require('stryker-parent').menuItems;2menuItems();3const menuItems = require('stryker-parent').menuItems;4menuItems();5const menuItems = require('stryker-parent').menuItems;6menuItems();7const menuItems = require('stryker-parent').menuItems;8menuItems();9const menuItems = require('stryker-parent').menuItems;10menuItems();11const menuItems = require('stryker-parent').menuItems;12menuItems();13const menuItems = require('stryker-parent').menuItems;14menuItems();15const menuItems = require('stryker-parent').menuItems;16menuItems();17const menuItems = require('stryker-parent').menuItems;18menuItems();19const menuItems = require('stryker-parent').menuItems;20menuItems();21const menuItems = require('stryker-parent').menuItems;22menuItems();23const menuItems = require('stryker-parent').menuItems;24menuItems();25const menuItems = require('stryker-parent').menuItems;26menuItems();27const menuItems = require('stryker-parent').menuItems;28menuItems();29const menuItems = require('stryker-parent
Using AI Code Generation
1var menuItems = require('stryker-parent').menuItems;2var menuItems = require('stryker-parent').menuItems;3var menuItems = require('stryker-parent').menuItems;4var menuItems = require('stryker-parent').menuItems;5var menuItems = require('stryker-parent').menuItems;6var menuItems = require('stryker-parent').menuItems;7var menuItems = require('stryker-parent').menuItems;8var menuItems = require('stryker-parent').menuItems;9var menuItems = require('stryker-parent').menuItems;10var menuItems = require('stryker-parent').menuItems;11var menuItems = require('stryker-parent').menuItems;12var menuItems = require('stryker-parent').menuItems;13var menuItems = require('stryker-parent').menuItems;14var menuItems = require('stryker-parent').menuItems;15var menuItems = require('stryker-parent').menuItems;16var menuItems = require('stryker-parent').menuItems;17var menuItems = require('stryker-parent').menuItems;18var menuItems = require('stryker-parent
Using AI Code Generation
1const menuItems = require('stryker-parent').menuItems;2console.log(menuItems);3module.exports = {4 menuItems: function() {5 return ['a', 'b', 'c'];6 }7}8const strykerParent = require('stryker-parent');9const menuItems = strykerParent.menuItems;10const { menuItems } = require('stryker-parent');11module.exports = {12 menuItems: function() {13 return ['a', 'b', 'c'];14 }15}16const menuItems = require('stryker-parent').menuItems;17console.log(menuItems);18const menuItems = require('stryker-parent').menuItems;19const menuItems = require('stryker-parent');
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!!