Best JavaScript code snippet using storybook-root
jq2.js
Source:jq2.js
1function scblue() {2 mtlLoader.setPath('model/obj/seat/');3 mtlLoader.load('blue.mtl', function (materials) {4 objLoader.setMaterials(materials);5 objLoader.setPath('model/obj/seat/');6 objLoader.load('seat.obj', function (object) {7 object.position.set(0, -3.5, 0);8 object.rotation.x = -1.5;9 object.rotation.z = -2.3;10 scene.add(object);11 })12 })13}1415function scred() {16 mtlLoader.setPath('model/obj/seat/');17 mtlLoader.load('red.mtl', function (materials) {18 objLoader.setMaterials(materials);19 objLoader.setPath('model/obj/seat/');20 objLoader.load('seat.obj', function (object) {21 object.position.set(0, -3.5, 0);22 object.rotation.x = -1.5;23 object.rotation.z = -2.3;24 scene.add(object);25 })26 })27}2829function scgreen() {30 mtlLoader.setPath('model/obj/seat/');31 mtlLoader.load('green.mtl', function (materials) {32 objLoader.setMaterials(materials);33 objLoader.setPath('model/obj/seat/');34 objLoader.load('seat.obj', function (object) {35 object.position.set(0, -3.5, 0);36 object.rotation.x = -1.5;37 object.rotation.z = -2.3;38 scene.add(object);39 })40 })41}4243function scyellow() {44 mtlLoader.setPath('model/obj/seat/');45 mtlLoader.load('yellow.mtl', function (materials) {46 objLoader.setMaterials(materials);47 objLoader.setPath('model/obj/seat/');48 objLoader.load('seat.obj', function (object) {49 object.position.set(0, -3.5, 0);50 object.rotation.x = -1.5;51 object.rotation.z = -2.3;52 scene.add(object);53 })54 })55}5657function scorange() {58 mtlLoader.setPath('model/obj/seat/');59 mtlLoader.load('orange.mtl', function (materials) {60 objLoader.setMaterials(materials);61 objLoader.setPath('model/obj/seat/');62 objLoader.load('seat.obj', function (object) {63 object.position.set(0, -3.5, 0);64 object.rotation.x = -1.5;65 object.rotation.z = -2.3;66 scene.add(object);67 })68 })69}7071function scwhite() {72 mtlLoader.setPath('model/obj/seat/');73 mtlLoader.load('white.mtl', function (materials) {74 objLoader.setMaterials(materials);75 objLoader.setPath('model/obj/seat/');76 objLoader.load('seat.obj', function (object) {77 object.position.set(0, -3.5, 0);78 object.rotation.x = -1.5;79 object.rotation.z = -2.3;80 scene.add(object);81 })82 })83}8485function scblack() {86 mtlLoader.setPath('model/obj/seat/');87 mtlLoader.load('black2.mtl', function (materials) {88 objLoader.setMaterials(materials);89 objLoader.setPath('model/obj/seat/');90 objLoader.load('seat.obj', function (object) {91 object.position.set(0, -3.5, 0);92 object.rotation.x = -1.5;93 object.rotation.z = -2.3;94 scene.add(object);95 })96 })97}9899function scsilver() {100 mtlLoader.setPath('model/obj/seat/');101 mtlLoader.load('silver.mtl', function (materials) {102 objLoader.setMaterials(materials);103 objLoader.setPath('model/obj/seat/');104 objLoader.load('seat.obj', function (object) {105 object.position.set(0, -3.5, 0);106 object.rotation.x = -1.5;107 object.rotation.z = -2.3;108 scene.add(object);109 })110 })111}112113function sccyan() {114 mtlLoader.setPath('model/obj/seat/');115 mtlLoader.load('cyan.mtl', function (materials) {116 objLoader.setMaterials(materials);117 objLoader.setPath('model/obj/seat/');118 objLoader.load('seat.obj', function (object) {119 object.position.set(0, -3.5, 0);120 object.rotation.x = -1.5;121 object.rotation.z = -2.3;122 scene.add(object);123 })124 })125}126127function scbrown() {128 mtlLoader.setPath('model/obj/seat/');129 mtlLoader.load('brown.mtl', function (materials) {130 objLoader.setMaterials(materials);131 objLoader.setPath('model/obj/seat/');132 objLoader.load('seat.obj', function (object) {133 object.position.set(0, -3.5, 0);134 object.rotation.x = -1.5;135 object.rotation.z = -2.3;136 scene.add(object);137 })138 })139}140141function sccrimson() {142 mtlLoader.setPath('model/obj/seat/');143 mtlLoader.load('crimson.mtl', function (materials) {144 objLoader.setMaterials(materials);145 objLoader.setPath('model/obj/seat/');146 objLoader.load('seat.obj', function (object) {147 object.position.set(0, -3.5, 0);148 object.rotation.x = -1.5;149 object.rotation.z = -2.3;150 scene.add(object);151 })152 })153}154155function scPurple() {156 mtlLoader.setPath('model/obj/seat/');157 mtlLoader.load('Purple.mtl', function (materials) {158 objLoader.setMaterials(materials);159 objLoader.setPath('model/obj/seat/');160 objLoader.load('seat.obj', function (object) {161 object.position.set(0, -3.5, 0);162 object.rotation.x = -1.5;163 object.rotation.z = -2.3;164 scene.add(object);165 })166 })167}168169function scgray() {170 mtlLoader.setPath('model/obj/seat/');171 mtlLoader.load('gray.mtl', function (materials) {172 objLoader.setMaterials(materials);173 objLoader.setPath('model/obj/seat/');174 objLoader.load('seat.obj', function (object) {175 object.position.set(0, -3.5, 0);176 object.rotation.x = -1.5;177 object.rotation.z = -2.3;178 scene.add(object);179 })180 })181}182183function scgold() {184 mtlLoader.setPath('model/obj/seat/');185 mtlLoader.load('gold.mtl', function (materials) {186 objLoader.setMaterials(materials);187 objLoader.setPath('model/obj/seat/');188 objLoader.load('seat.obj', function (object) {189 object.position.set(0, -3.5, 0);190 object.rotation.x = -1.5;191 object.rotation.z = -2.3;192 scene.add(object);193 })194 })195}196197//Handllebar198function hcwhite() {199 mtlLoader.setPath('model/obj/Handllebar/');200 mtlLoader.load('white.mtl', function (materials) {201 objLoader.setMaterials(materials);202 objLoader.setPath('model/obj/Handllebar/');203 objLoader.load('Handllebar1.obj', function (object) {204 object.position.set(0.4, 37, -0.4);205 object.rotation.x = -1.5;206 object.rotation.z = -2.3;207 scene.add(object);208 })209 })210 mtlLoader.setPath('model/obj/Handllebar/');211 mtlLoader.load('white.mtl', function (materials) {212 objLoader.setMaterials(materials);213 objLoader.setPath('model/obj/Handllebar/');214 objLoader.load('Handllebar2.obj', function (object) {215 object.position.set(0, 37, 0);216 object.rotation.x = -1.5;217 object.rotation.z = -2.3;218 scene.add(object);219 })220 })221 mtlLoader.setPath('model/obj/Handllebar/');222 mtlLoader.load('white.mtl', function (materials) {223 objLoader.setMaterials(materials);224 objLoader.setPath('model/obj/');225 objLoader.load('Handllebar1.obj', function (object) {226 object.position.set(0, 37.4, 0);227 object.rotation.x = -1.5;228 object.rotation.z = -2.3;229 scene.add(object);230 })231 })232 mtlLoader.setPath('model/obj/Handllebar/');233 mtlLoader.load('white.mtl', function (materials) {234 objLoader.setMaterials(materials);235 objLoader.setPath('model/obj/Handllebar/');236 objLoader.load('Handllebar1.obj', function (object) {237 object.position.set(0.4, 37.5, -0.4);238 object.rotation.x = -1.5;239 object.rotation.z = -2.3;240 scene.add(object);241 })242 })243 mtlLoader.setPath('model/obj/Handllebar/');244 mtlLoader.load('white.mtl', function (materials) {245 objLoader.setMaterials(materials);246 objLoader.setPath('model/obj/Handllebar/');247 objLoader.load('Handllebar1.obj', function (object) {248 object.position.set(0, 37.5, 0);249 object.rotation.x = -1.5;250 object.rotation.z = -2.3;251 scene.add(object);252 })253 })254 mtlLoader.setPath('model/obj/Handllebar/');255 mtlLoader.load('white.mtl', function (materials) {256 objLoader.setMaterials(materials);257 objLoader.setPath('model/obj/Handllebar/');258 objLoader.load('Handllebar2.obj', function (object) {259 object.position.set(0, 37.5, 0);260 object.rotation.x = -1.5;261 object.rotation.z = -2.3;262 scene.add(object);263 })264 })265}266267function hcblack() {268 mtlLoader.setPath('model/obj/Handllebar/');269 mtlLoader.load('black2.mtl', function (materials) {270 objLoader.setMaterials(materials);271 objLoader.setPath('model/obj/Handllebar/');272 objLoader.load('Handllebar1.obj', function (object) {273 object.position.set(0.4, 37, -0.4);274 object.rotation.x = -1.5;275 object.rotation.z = -2.3;276 scene.add(object);277 })278 })279 mtlLoader.setPath('model/obj/Handllebar/');280 mtlLoader.load('black2.mtl', function (materials) {281 objLoader.setMaterials(materials);282 objLoader.setPath('model/obj/Handllebar/');283 objLoader.load('Handllebar2.obj', function (object) {284 object.position.set(0, 37, 0);285 object.rotation.x = -1.5;286 object.rotation.z = -2.3;287 scene.add(object);288 })289 })290 mtlLoader.setPath('model/obj/Handllebar/');291 mtlLoader.load('black2.mtl', function (materials) {292 objLoader.setMaterials(materials);293 objLoader.setPath('model/obj/');294 objLoader.load('Handllebar1.obj', function (object) {295 object.position.set(0, 37.4, 0);296 object.rotation.x = -1.5;297 object.rotation.z = -2.3;298 scene.add(object);299 })300 })301 mtlLoader.setPath('model/obj/Handllebar/');302 mtlLoader.load('black2.mtl', function (materials) {303 objLoader.setMaterials(materials);304 objLoader.setPath('model/obj/Handllebar/');305 objLoader.load('Handllebar1.obj', function (object) {306 object.position.set(0.4, 37.5, -0.4);307 object.rotation.x = -1.5;308 object.rotation.z = -2.3;309 scene.add(object);310 })311 })312 mtlLoader.setPath('model/obj/Handllebar/');313 mtlLoader.load('black2.mtl', function (materials) {314 objLoader.setMaterials(materials);315 objLoader.setPath('model/obj/Handllebar/');316 objLoader.load('Handllebar1.obj', function (object) {317 object.position.set(0, 37.5, 0);318 object.rotation.x = -1.5;319 object.rotation.z = -2.3;320 scene.add(object);321 })322 })323 mtlLoader.setPath('model/obj/Handllebar/');324 mtlLoader.load('black2.mtl', function (materials) {325 objLoader.setMaterials(materials);326 objLoader.setPath('model/obj/Handllebar/');327 objLoader.load('Handllebar2.obj', function (object) {328 object.position.set(0, 37.5, 0);329 object.rotation.x = -1.5;330 object.rotation.z = -2.3;331 scene.add(object);332 })333 })334}335336function hcred() {337 mtlLoader.setPath('model/obj/Handllebar/');338 mtlLoader.load('red.mtl', function (materials) {339 objLoader.setMaterials(materials);340 objLoader.setPath('model/obj/Handllebar/');341 objLoader.load('Handllebar1.obj', function (object) {342 object.position.set(0.4, 37, -0.4);343 object.rotation.x = -1.5;344 object.rotation.z = -2.3;345 scene.add(object);346 })347 })348 mtlLoader.setPath('model/obj/Handllebar/');349 mtlLoader.load('red.mtl', function (materials) {350 objLoader.setMaterials(materials);351 objLoader.setPath('model/obj/Handllebar/');352 objLoader.load('Handllebar2.obj', function (object) {353 object.position.set(0, 37, 0);354 object.rotation.x = -1.5;355 object.rotation.z = -2.3;356 scene.add(object);357 })358 })359 mtlLoader.setPath('model/obj/Handllebar/');360 mtlLoader.load('red.mtl', function (materials) {361 objLoader.setMaterials(materials);362 objLoader.setPath('model/obj/');363 objLoader.load('Handllebar1.obj', function (object) {364 object.position.set(0, 37.4, 0);365 object.rotation.x = -1.5;366 object.rotation.z = -2.3;367 scene.add(object);368 })369 })370 mtlLoader.setPath('model/obj/Handllebar/');371 mtlLoader.load('red.mtl', function (materials) {372 objLoader.setMaterials(materials);373 objLoader.setPath('model/obj/Handllebar/');374 objLoader.load('Handllebar1.obj', function (object) {375 object.position.set(0.4, 37.5, -0.4);376 object.rotation.x = -1.5;377 object.rotation.z = -2.3;378 scene.add(object);379 })380 })381 mtlLoader.setPath('model/obj/Handllebar/');382 mtlLoader.load('red.mtl', function (materials) {383 objLoader.setMaterials(materials);384 objLoader.setPath('model/obj/Handllebar/');385 objLoader.load('Handllebar1.obj', function (object) {386 object.position.set(0, 37.5, 0);387 object.rotation.x = -1.5;388 object.rotation.z = -2.3;389 scene.add(object);390 })391 })392 mtlLoader.setPath('model/obj/Handllebar/');393 mtlLoader.load('red.mtl', function (materials) {394 objLoader.setMaterials(materials);395 objLoader.setPath('model/obj/Handllebar/');396 objLoader.load('Handllebar2.obj', function (object) {397 object.position.set(0, 37.5, 0);398 object.rotation.x = -1.5;399 object.rotation.z = -2.3;400 scene.add(object);401 })402 })403}404405function hcblue() {406 mtlLoader.setPath('model/obj/Handllebar/');407 mtlLoader.load('blue.mtl', function (materials) {408 objLoader.setMaterials(materials);409 objLoader.setPath('model/obj/Handllebar/');410 objLoader.load('Handllebar1.obj', function (object) {411 object.position.set(0.4, 37, -0.4);412 object.rotation.x = -1.5;413 object.rotation.z = -2.3;414 scene.add(object);415 })416 })417 mtlLoader.setPath('model/obj/Handllebar/');418 mtlLoader.load('blue.mtl', function (materials) {419 objLoader.setMaterials(materials);420 objLoader.setPath('model/obj/Handllebar/');421 objLoader.load('Handllebar2.obj', function (object) {422 object.position.set(0, 37, 0);423 object.rotation.x = -1.5;424 object.rotation.z = -2.3;425 scene.add(object);426 })427 })428 mtlLoader.setPath('model/obj/Handllebar/');429 mtlLoader.load('blue.mtl', function (materials) {430 objLoader.setMaterials(materials);431 objLoader.setPath('model/obj/');432 objLoader.load('Handllebar1.obj', function (object) {433 object.position.set(0, 37.4, 0);434 object.rotation.x = -1.5;435 object.rotation.z = -2.3;436 scene.add(object);437 })438 })439 mtlLoader.setPath('model/obj/Handllebar/');440 mtlLoader.load('blue.mtl', function (materials) {441 objLoader.setMaterials(materials);442 objLoader.setPath('model/obj/Handllebar/');443 objLoader.load('Handllebar1.obj', function (object) {444 object.position.set(0.4, 37.5, -0.4);445 object.rotation.x = -1.5;446 object.rotation.z = -2.3;447 scene.add(object);448 })449 })450 mtlLoader.setPath('model/obj/Handllebar/');451 mtlLoader.load('blue.mtl', function (materials) {452 objLoader.setMaterials(materials);453 objLoader.setPath('model/obj/Handllebar/');454 objLoader.load('Handllebar1.obj', function (object) {455 object.position.set(0, 37.5, 0);456 object.rotation.x = -1.5;457 object.rotation.z = -2.3;458 scene.add(object);459 })460 })461 mtlLoader.setPath('model/obj/Handllebar/');462 mtlLoader.load('blue.mtl', function (materials) {463 objLoader.setMaterials(materials);464 objLoader.setPath('model/obj/Handllebar/');465 objLoader.load('Handllebar2.obj', function (object) {466 object.position.set(0, 37.5, 0);467 object.rotation.x = -1.5;468 object.rotation.z = -2.3;469 scene.add(object);470 })471 })472}473474function hcgreen() {475 mtlLoader.setPath('model/obj/Handllebar/');476 mtlLoader.load('green.mtl', function (materials) {477 objLoader.setMaterials(materials);478 objLoader.setPath('model/obj/Handllebar/');479 objLoader.load('Handllebar1.obj', function (object) {480 object.position.set(0.4, 37, -0.4);481 object.rotation.x = -1.5;482 object.rotation.z = -2.3;483 scene.add(object);484 })485 })486 mtlLoader.setPath('model/obj/Handllebar/');487 mtlLoader.load('green.mtl', function (materials) {488 objLoader.setMaterials(materials);489 objLoader.setPath('model/obj/Handllebar/');490 objLoader.load('Handllebar2.obj', function (object) {491 object.position.set(0, 37, 0);492 object.rotation.x = -1.5;493 object.rotation.z = -2.3;494 scene.add(object);495 })496 })497 mtlLoader.setPath('model/obj/Handllebar/');498 mtlLoader.load('green.mtl', function (materials) {499 objLoader.setMaterials(materials);500 objLoader.setPath('model/obj/');501 objLoader.load('Handllebar1.obj', function (object) {502 object.position.set(0, 37.4, 0);503 object.rotation.x = -1.5;504 object.rotation.z = -2.3;505 scene.add(object);506 })507 })508 mtlLoader.setPath('model/obj/Handllebar/');509 mtlLoader.load('green.mtl', function (materials) {510 objLoader.setMaterials(materials);511 objLoader.setPath('model/obj/Handllebar/');512 objLoader.load('Handllebar1.obj', function (object) {513 object.position.set(0.4, 37.5, -0.4);514 object.rotation.x = -1.5;515 object.rotation.z = -2.3;516 scene.add(object);517 })518 })519 mtlLoader.setPath('model/obj/Handllebar/');520 mtlLoader.load('green.mtl', function (materials) {521 objLoader.setMaterials(materials);522 objLoader.setPath('model/obj/Handllebar/');523 objLoader.load('Handllebar1.obj', function (object) {524 object.position.set(0, 37.5, 0);525 object.rotation.x = -1.5;526 object.rotation.z = -2.3;527 scene.add(object);528 })529 })530 mtlLoader.setPath('model/obj/Handllebar/');531 mtlLoader.load('green.mtl', function (materials) {532 objLoader.setMaterials(materials);533 objLoader.setPath('model/obj/Handllebar/');534 objLoader.load('Handllebar2.obj', function (object) {535 object.position.set(0, 37.5, 0);536 object.rotation.x = -1.5;537 object.rotation.z = -2.3;538 scene.add(object);539 })540 })541}542543function hcyellow() {544 mtlLoader.setPath('model/obj/Handllebar/');545 mtlLoader.load('yellow.mtl', function (materials) {546 objLoader.setMaterials(materials);547 objLoader.setPath('model/obj/Handllebar/');548 objLoader.load('Handllebar1.obj', function (object) {549 object.position.set(0.4, 37, -0.4);550 object.rotation.x = -1.5;551 object.rotation.z = -2.3;552 scene.add(object);553 })554 })555 mtlLoader.setPath('model/obj/Handllebar/');556 mtlLoader.load('yellow.mtl', function (materials) {557 objLoader.setMaterials(materials);558 objLoader.setPath('model/obj/Handllebar/');559 objLoader.load('Handllebar2.obj', function (object) {560 object.position.set(0, 37, 0);561 object.rotation.x = -1.5;562 object.rotation.z = -2.3;563 scene.add(object);564 })565 })566 mtlLoader.setPath('model/obj/Handllebar/');567 mtlLoader.load('yellow.mtl', function (materials) {568 objLoader.setMaterials(materials);569 objLoader.setPath('model/obj/');570 objLoader.load('Handllebar1.obj', function (object) {571 object.position.set(0, 37.4, 0);572 object.rotation.x = -1.5;573 object.rotation.z = -2.3;574 scene.add(object);575 })576 })577 mtlLoader.setPath('model/obj/Handllebar/');578 mtlLoader.load('yellow.mtl', function (materials) {579 objLoader.setMaterials(materials);580 objLoader.setPath('model/obj/Handllebar/');581 objLoader.load('Handllebar1.obj', function (object) {582 object.position.set(0.4, 37.5, -0.4);583 object.rotation.x = -1.5;584 object.rotation.z = -2.3;585 scene.add(object);586 })587 })588 mtlLoader.setPath('model/obj/Handllebar/');589 mtlLoader.load('yellow.mtl', function (materials) {590 objLoader.setMaterials(materials);591 objLoader.setPath('model/obj/Handllebar/');592 objLoader.load('Handllebar1.obj', function (object) {593 object.position.set(0, 37.5, 0);594 object.rotation.x = -1.5;595 object.rotation.z = -2.3;596 scene.add(object);597 })598 })599 mtlLoader.setPath('model/obj/Handllebar/');600 mtlLoader.load('yellow.mtl', function (materials) {601 objLoader.setMaterials(materials);602 objLoader.setPath('model/obj/Handllebar/');603 objLoader.load('Handllebar2.obj', function (object) {604 object.position.set(0, 37.5, 0);605 object.rotation.x = -1.5;606 object.rotation.z = -2.3;607 scene.add(object);608 })609 })610}611612function hcsilver() {613 mtlLoader.setPath('model/obj/Handllebar/');614 mtlLoader.load('silver.mtl', function (materials) {615 objLoader.setMaterials(materials);616 objLoader.setPath('model/obj/Handllebar/');617 objLoader.load('Handllebar1.obj', function (object) {618 object.position.set(0.4, 37, -0.4);619 object.rotation.x = -1.5;620 object.rotation.z = -2.3;621 scene.add(object);622 })623 })624 mtlLoader.setPath('model/obj/Handllebar/');625 mtlLoader.load('silver.mtl', function (materials) {626 objLoader.setMaterials(materials);627 objLoader.setPath('model/obj/Handllebar/');628 objLoader.load('Handllebar2.obj', function (object) {629 object.position.set(0, 37, 0);630 object.rotation.x = -1.5;631 object.rotation.z = -2.3;632 scene.add(object);633 })634 })635 mtlLoader.setPath('model/obj/Handllebar/');636 mtlLoader.load('silver.mtl', function (materials) {637 objLoader.setMaterials(materials);638 objLoader.setPath('model/obj/');639 objLoader.load('Handllebar1.obj', function (object) {640 object.position.set(0, 37.4, 0);641 object.rotation.x = -1.5;642 object.rotation.z = -2.3;643 scene.add(object);644 })645 })646 mtlLoader.setPath('model/obj/Handllebar/');647 mtlLoader.load('silver.mtl', function (materials) {648 objLoader.setMaterials(materials);649 objLoader.setPath('model/obj/Handllebar/');650 objLoader.load('Handllebar1.obj', function (object) {651 object.position.set(0.4, 37.5, -0.4);652 object.rotation.x = -1.5;653 object.rotation.z = -2.3;654 scene.add(object);655 })656 })657 mtlLoader.setPath('model/obj/Handllebar/');658 mtlLoader.load('silver.mtl', function (materials) {659 objLoader.setMaterials(materials);660 objLoader.setPath('model/obj/Handllebar/');661 objLoader.load('Handllebar1.obj', function (object) {662 object.position.set(0, 37.5, 0);663 object.rotation.x = -1.5;664 object.rotation.z = -2.3;665 scene.add(object);666 })667 })668 mtlLoader.setPath('model/obj/Handllebar/');669 mtlLoader.load('silver.mtl', function (materials) {670 objLoader.setMaterials(materials);671 objLoader.setPath('model/obj/Handllebar/');672 objLoader.load('Handllebar2.obj', function (object) {673 object.position.set(0, 37.5, 0);674 object.rotation.x = -1.5;675 object.rotation.z = -2.3;676 scene.add(object);677 })678 })679}680681function hcorange() {682 mtlLoader.setPath('model/obj/Handllebar/');683 mtlLoader.load('orange.mtl', function (materials) {684 objLoader.setMaterials(materials);685 objLoader.setPath('model/obj/Handllebar/');686 objLoader.load('Handllebar1.obj', function (object) {687 object.position.set(0.4, 37, -0.4);688 object.rotation.x = -1.5;689 object.rotation.z = -2.3;690 scene.add(object);691 })692 })693 mtlLoader.setPath('model/obj/Handllebar/');694 mtlLoader.load('orange.mtl', function (materials) {695 objLoader.setMaterials(materials);696 objLoader.setPath('model/obj/Handllebar/');697 objLoader.load('Handllebar2.obj', function (object) {698 object.position.set(0, 37, 0);699 object.rotation.x = -1.5;700 object.rotation.z = -2.3;701 scene.add(object);702 })703 })704 mtlLoader.setPath('model/obj/Handllebar/');705 mtlLoader.load('orange.mtl', function (materials) {706 objLoader.setMaterials(materials);707 objLoader.setPath('model/obj/');708 objLoader.load('Handllebar1.obj', function (object) {709 object.position.set(0, 37.4, 0);710 object.rotation.x = -1.5;711 object.rotation.z = -2.3;712 scene.add(object);713 })714 })715 mtlLoader.setPath('model/obj/Handllebar/');716 mtlLoader.load('orange.mtl', function (materials) {717 objLoader.setMaterials(materials);718 objLoader.setPath('model/obj/Handllebar/');719 objLoader.load('Handllebar1.obj', function (object) {720 object.position.set(0.4, 37.5, -0.4);721 object.rotation.x = -1.5;722 object.rotation.z = -2.3;723 scene.add(object);724 })725 })726 mtlLoader.setPath('model/obj/Handllebar/');727 mtlLoader.load('orange.mtl', function (materials) {728 objLoader.setMaterials(materials);729 objLoader.setPath('model/obj/Handllebar/');730 objLoader.load('Handllebar1.obj', function (object) {731 object.position.set(0, 37.5, 0);732 object.rotation.x = -1.5;733 object.rotation.z = -2.3;734 scene.add(object);735 })736 })737 mtlLoader.setPath('model/obj/Handllebar/');738 mtlLoader.load('orange.mtl', function (materials) {739 objLoader.setMaterials(materials);740 objLoader.setPath('model/obj/Handllebar/');741 objLoader.load('Handllebar2.obj', function (object) {742 object.position.set(0, 37.5, 0);743 object.rotation.x = -1.5;744 object.rotation.z = -2.3;745 scene.add(object);746 })747 })748}749750function hccyan() {751 mtlLoader.setPath('model/obj/Handllebar/');752 mtlLoader.load('cyan.mtl', function (materials) {753 objLoader.setMaterials(materials);754 objLoader.setPath('model/obj/Handllebar/');755 objLoader.load('Handllebar1.obj', function (object) {756 object.position.set(0.4, 37, -0.4);757 object.rotation.x = -1.5;758 object.rotation.z = -2.3;759 scene.add(object);760 })761 })762 mtlLoader.setPath('model/obj/Handllebar/');763 mtlLoader.load('cyan.mtl', function (materials) {764 objLoader.setMaterials(materials);765 objLoader.setPath('model/obj/Handllebar/');766 objLoader.load('Handllebar2.obj', function (object) {767 object.position.set(0, 37, 0);768 object.rotation.x = -1.5;769 object.rotation.z = -2.3;770 scene.add(object);771 })772 })773 mtlLoader.setPath('model/obj/Handllebar/');774 mtlLoader.load('cyan.mtl', function (materials) {775 objLoader.setMaterials(materials);776 objLoader.setPath('model/obj/');777 objLoader.load('Handllebar1.obj', function (object) {778 object.position.set(0, 37.4, 0);779 object.rotation.x = -1.5;780 object.rotation.z = -2.3;781 scene.add(object);782 })783 })784 mtlLoader.setPath('model/obj/Handllebar/');785 mtlLoader.load('cyan.mtl', function (materials) {786 objLoader.setMaterials(materials);787 objLoader.setPath('model/obj/Handllebar/');788 objLoader.load('Handllebar1.obj', function (object) {789 object.position.set(0.4, 37.5, -0.4);790 object.rotation.x = -1.5;791 object.rotation.z = -2.3;792 scene.add(object);793 })794 })795 mtlLoader.setPath('model/obj/Handllebar/');796 mtlLoader.load('cyan.mtl', function (materials) {797 objLoader.setMaterials(materials);798 objLoader.setPath('model/obj/Handllebar/');799 objLoader.load('Handllebar1.obj', function (object) {800 object.position.set(0, 37.5, 0);801 object.rotation.x = -1.5;802 object.rotation.z = -2.3;803 scene.add(object);804 })805 })806 mtlLoader.setPath('model/obj/Handllebar/');807 mtlLoader.load('cyan.mtl', function (materials) {808 objLoader.setMaterials(materials);809 objLoader.setPath('model/obj/Handllebar/');810 objLoader.load('Handllebar2.obj', function (object) {811 object.position.set(0, 37.5, 0);812 object.rotation.x = -1.5;813 object.rotation.z = -2.3;814 scene.add(object);815 })816 })817}818819function hcPurple() {820 mtlLoader.setPath('model/obj/Handllebar/');821 mtlLoader.load('Purple.mtl', function (materials) {822 objLoader.setMaterials(materials);823 objLoader.setPath('model/obj/Handllebar/');824 objLoader.load('Handllebar1.obj', function (object) {825 object.position.set(0.4, 37, -0.4);826 object.rotation.x = -1.5;827 object.rotation.z = -2.3;828 scene.add(object);829 })830 })831 mtlLoader.setPath('model/obj/Handllebar/');832 mtlLoader.load('Purple.mtl', function (materials) {833 objLoader.setMaterials(materials);834 objLoader.setPath('model/obj/Handllebar/');835 objLoader.load('Handllebar2.obj', function (object) {836 object.position.set(0, 37, 0);837 object.rotation.x = -1.5;838 object.rotation.z = -2.3;839 scene.add(object);840 })841 })842 mtlLoader.setPath('model/obj/Handllebar/');843 mtlLoader.load('Purple.mtl', function (materials) {844 objLoader.setMaterials(materials);845 objLoader.setPath('model/obj/');846 objLoader.load('Handllebar1.obj', function (object) {847 object.position.set(0, 37.4, 0);848 object.rotation.x = -1.5;849 object.rotation.z = -2.3;850 scene.add(object);851 })852 })853 mtlLoader.setPath('model/obj/Handllebar/');854 mtlLoader.load('Purple.mtl', function (materials) {855 objLoader.setMaterials(materials);856 objLoader.setPath('model/obj/Handllebar/');857 objLoader.load('Handllebar1.obj', function (object) {858 object.position.set(0.4, 37.5, -0.4);859 object.rotation.x = -1.5;860 object.rotation.z = -2.3;861 scene.add(object);862 })863 })864 mtlLoader.setPath('model/obj/Handllebar/');865 mtlLoader.load('Purple.mtl', function (materials) {866 objLoader.setMaterials(materials);867 objLoader.setPath('model/obj/Handllebar/');868 objLoader.load('Handllebar1.obj', function (object) {869 object.position.set(0, 37.5, 0);870 object.rotation.x = -1.5;871 object.rotation.z = -2.3;872 scene.add(object);873 })874 })875 mtlLoader.setPath('model/obj/Handllebar/');876 mtlLoader.load('Purple.mtl', function (materials) {877 objLoader.setMaterials(materials);878 objLoader.setPath('model/obj/Handllebar/');879 objLoader.load('Handllebar2.obj', function (object) {880 object.position.set(0, 37.5, 0);881 object.rotation.x = -1.5;882 object.rotation.z = -2.3;883 scene.add(object);884 })885 })886}887888function hcgray() {889 mtlLoader.setPath('model/obj/Handllebar/');890 mtlLoader.load('gray.mtl', function (materials) {891 objLoader.setMaterials(materials);892 objLoader.setPath('model/obj/Handllebar/');893 objLoader.load('Handllebar1.obj', function (object) {894 object.position.set(0.4, 37, -0.4);895 object.rotation.x = -1.5;896 object.rotation.z = -2.3;897 scene.add(object);898 })899 })900 mtlLoader.setPath('model/obj/Handllebar/');901 mtlLoader.load('gray.mtl', function (materials) {902 objLoader.setMaterials(materials);903 objLoader.setPath('model/obj/Handllebar/');904 objLoader.load('Handllebar2.obj', function (object) {905 object.position.set(0, 37, 0);906 object.rotation.x = -1.5;907 object.rotation.z = -2.3;908 scene.add(object);909 })910 })911 mtlLoader.setPath('model/obj/Handllebar/');912 mtlLoader.load('gray.mtl', function (materials) {913 objLoader.setMaterials(materials);914 objLoader.setPath('model/obj/');915 objLoader.load('Handllebar1.obj', function (object) {916 object.position.set(0, 37.4, 0);917 object.rotation.x = -1.5;918 object.rotation.z = -2.3;919 scene.add(object);920 })921 })922 mtlLoader.setPath('model/obj/Handllebar/');923 mtlLoader.load('gray.mtl', function (materials) {924 objLoader.setMaterials(materials);925 objLoader.setPath('model/obj/Handllebar/');926 objLoader.load('Handllebar1.obj', function (object) {927 object.position.set(0.4, 37.5, -0.4);928 object.rotation.x = -1.5;929 object.rotation.z = -2.3;930 scene.add(object);931 })932 })933 mtlLoader.setPath('model/obj/Handllebar/');934 mtlLoader.load('gray.mtl', function (materials) {935 objLoader.setMaterials(materials);936 objLoader.setPath('model/obj/Handllebar/');937 objLoader.load('Handllebar1.obj', function (object) {938 object.position.set(0, 37.5, 0);939 object.rotation.x = -1.5;940 object.rotation.z = -2.3;941 scene.add(object);942 })943 })944 mtlLoader.setPath('model/obj/Handllebar/');945 mtlLoader.load('gray.mtl', function (materials) {946 objLoader.setMaterials(materials);947 objLoader.setPath('model/obj/Handllebar/');948 objLoader.load('Handllebar2.obj', function (object) {949 object.position.set(0, 37.5, 0);950 object.rotation.x = -1.5;951 object.rotation.z = -2.3;952 scene.add(object);953 })954 })955}956957function hcgold() {958 mtlLoader.setPath('model/obj/Handllebar/');959 mtlLoader.load('gold.mtl', function (materials) {960 objLoader.setMaterials(materials);961 objLoader.setPath('model/obj/Handllebar/');962 objLoader.load('Handllebar1.obj', function (object) {963 object.position.set(0.4, 37, -0.4);964 object.rotation.x = -1.5;965 object.rotation.z = -2.3;966 scene.add(object);967 })968 })969 mtlLoader.setPath('model/obj/Handllebar/');970 mtlLoader.load('gold.mtl', function (materials) {971 objLoader.setMaterials(materials);972 objLoader.setPath('model/obj/Handllebar/');973 objLoader.load('Handllebar2.obj', function (object) {974 object.position.set(0, 37, 0);975 object.rotation.x = -1.5;976 object.rotation.z = -2.3;977 scene.add(object);978 })979 })980 mtlLoader.setPath('model/obj/Handllebar/');981 mtlLoader.load('gold.mtl', function (materials) {982 objLoader.setMaterials(materials);983 objLoader.setPath('model/obj/');984 objLoader.load('Handllebar1.obj', function (object) {985 object.position.set(0, 37.4, 0);986 object.rotation.x = -1.5;987 object.rotation.z = -2.3;988 scene.add(object);989 })990 })991 mtlLoader.setPath('model/obj/Handllebar/');992 mtlLoader.load('gold.mtl', function (materials) {993 objLoader.setMaterials(materials);994 objLoader.setPath('model/obj/Handllebar/');995 objLoader.load('Handllebar1.obj', function (object) {996 object.position.set(0.4, 37.5, -0.4);997 object.rotation.x = -1.5;998 object.rotation.z = -2.3;999 scene.add(object);1000 })1001 })1002 mtlLoader.setPath('model/obj/Handllebar/');1003 mtlLoader.load('gold.mtl', function (materials) {1004 objLoader.setMaterials(materials);1005 objLoader.setPath('model/obj/Handllebar/');1006 objLoader.load('Handllebar1.obj', function (object) {1007 object.position.set(0, 37.5, 0);1008 object.rotation.x = -1.5;1009 object.rotation.z = -2.3;1010 scene.add(object);1011 })1012 })1013 mtlLoader.setPath('model/obj/Handllebar/');1014 mtlLoader.load('gold.mtl', function (materials) {1015 objLoader.setMaterials(materials);1016 objLoader.setPath('model/obj/Handllebar/');1017 objLoader.load('Handllebar2.obj', function (object) {1018 object.position.set(0, 37.5, 0);1019 object.rotation.x = -1.5;1020 object.rotation.z = -2.3;1021 scene.add(object);1022 })1023 })1024}10251026function hccrimson() {1027 mtlLoader.setPath('model/obj/Handllebar/');1028 mtlLoader.load('crimson.mtl', function (materials) {1029 objLoader.setMaterials(materials);1030 objLoader.setPath('model/obj/Handllebar/');1031 objLoader.load('Handllebar1.obj', function (object) {1032 object.position.set(0.4, 37, -0.4);1033 object.rotation.x = -1.5;1034 object.rotation.z = -2.3;1035 scene.add(object);1036 })1037 })1038 mtlLoader.setPath('model/obj/Handllebar/');1039 mtlLoader.load('crimson.mtl', function (materials) {1040 objLoader.setMaterials(materials);1041 objLoader.setPath('model/obj/Handllebar/');1042 objLoader.load('Handllebar2.obj', function (object) {1043 object.position.set(0, 37, 0);1044 object.rotation.x = -1.5;1045 object.rotation.z = -2.3;1046 scene.add(object);1047 })1048 })1049 mtlLoader.setPath('model/obj/Handllebar/');1050 mtlLoader.load('crimson.mtl', function (materials) {1051 objLoader.setMaterials(materials);1052 objLoader.setPath('model/obj/');1053 objLoader.load('Handllebar1.obj', function (object) {1054 object.position.set(0, 37.4, 0);1055 object.rotation.x = -1.5;1056 object.rotation.z = -2.3;1057 scene.add(object);1058 })1059 })1060 mtlLoader.setPath('model/obj/Handllebar/');1061 mtlLoader.load('crimson.mtl', function (materials) {1062 objLoader.setMaterials(materials);1063 objLoader.setPath('model/obj/Handllebar/');1064 objLoader.load('Handllebar1.obj', function (object) {1065 object.position.set(0.4, 37.5, -0.4);1066 object.rotation.x = -1.5;1067 object.rotation.z = -2.3;1068 scene.add(object);1069 })1070 })1071 mtlLoader.setPath('model/obj/Handllebar/');1072 mtlLoader.load('crimson.mtl', function (materials) {1073 objLoader.setMaterials(materials);1074 objLoader.setPath('model/obj/Handllebar/');1075 objLoader.load('Handllebar1.obj', function (object) {1076 object.position.set(0, 37.5, 0);1077 object.rotation.x = -1.5;1078 object.rotation.z = -2.3;1079 scene.add(object);1080 })1081 })1082 mtlLoader.setPath('model/obj/Handllebar/');1083 mtlLoader.load('crimson.mtl', function (materials) {1084 objLoader.setMaterials(materials);1085 objLoader.setPath('model/obj/Handllebar/');1086 objLoader.load('Handllebar2.obj', function (object) {1087 object.position.set(0, 37.5, 0);1088 object.rotation.x = -1.5;1089 object.rotation.z = -2.3;1090 scene.add(object);1091 })1092 })1093}10941095function hcbrown() {1096 mtlLoader.setPath('model/obj/Handllebar/');1097 mtlLoader.load('brown.mtl', function (materials) {1098 objLoader.setMaterials(materials);1099 objLoader.setPath('model/obj/Handllebar/');1100 objLoader.load('Handllebar1.obj', function (object) {1101 object.position.set(0.4, 37, -0.4);1102 object.rotation.x = -1.5;1103 object.rotation.z = -2.3;1104 scene.add(object);1105 })1106 })1107 mtlLoader.setPath('model/obj/Handllebar/');1108 mtlLoader.load('brown.mtl', function (materials) {1109 objLoader.setMaterials(materials);1110 objLoader.setPath('model/obj/Handllebar/');1111 objLoader.load('Handllebar2.obj', function (object) {1112 object.position.set(0, 37, 0);1113 object.rotation.x = -1.5;1114 object.rotation.z = -2.3;1115 scene.add(object);1116 })1117 })1118 mtlLoader.setPath('model/obj/Handllebar/');1119 mtlLoader.load('brown.mtl', function (materials) {1120 objLoader.setMaterials(materials);1121 objLoader.setPath('model/obj/');1122 objLoader.load('Handllebar1.obj', function (object) {1123 object.position.set(0, 37.4, 0);1124 object.rotation.x = -1.5;1125 object.rotation.z = -2.3;1126 scene.add(object);1127 })1128 })1129 mtlLoader.setPath('model/obj/Handllebar/');1130 mtlLoader.load('brown.mtl', function (materials) {1131 objLoader.setMaterials(materials);1132 objLoader.setPath('model/obj/Handllebar/');1133 objLoader.load('Handllebar1.obj', function (object) {1134 object.position.set(0.4, 37.5, -0.4);1135 object.rotation.x = -1.5;1136 object.rotation.z = -2.3;1137 scene.add(object);1138 })1139 })1140 mtlLoader.setPath('model/obj/Handllebar/');1141 mtlLoader.load('brown.mtl', function (materials) {1142 objLoader.setMaterials(materials);1143 objLoader.setPath('model/obj/Handllebar/');1144 objLoader.load('Handllebar1.obj', function (object) {1145 object.position.set(0, 37.5, 0);1146 object.rotation.x = -1.5;1147 object.rotation.z = -2.3;1148 scene.add(object);1149 })1150 })1151 mtlLoader.setPath('model/obj/Handllebar/');1152 mtlLoader.load('brown.mtl', function (materials) {1153 objLoader.setMaterials(materials);1154 objLoader.setPath('model/obj/Handllebar/');1155 objLoader.load('Handllebar2.obj', function (object) {1156 object.position.set(0, 37.5, 0);1157 object.rotation.x = -1.5;1158 object.rotation.z = -2.3;1159 scene.add(object);1160 })1161 })1162}11631164function bcred() {1165 mtlLoader.setPath('model/obj/body/');1166 mtlLoader.load('red.mtl', function (materials) {1167 objLoader.setMaterials(materials);1168 objLoader.setPath('model/obj/body/');1169 objLoader.load('body.obj', function (object) {1170 object.position.set(0, -35.2, 22.5);1171 object.rotation.set(-1.5, 0, -2.3);1172 scene.add(object);1173 })1174 })1175 mtlLoader.setPath('model/obj/body/');1176 mtlLoader.load('red.mtl', function (materials) {1177 objLoader.setMaterials(materials);1178 objLoader.setPath('model/obj/body/');1179 objLoader.load('body.obj', function (object) {1180 object.position.set(0, -35.50, 22.5);1181 object.rotation.set(-1.5, 0, -2.3);1182 scene.add(object);1183 })1184 })1185 mtlLoader.setPath('model/obj/body/');1186 mtlLoader.load('red.mtl', function (materials) {1187 objLoader.setMaterials(materials);1188 objLoader.setPath('model/obj/body/');1189 objLoader.load('body.obj', function (object) {1190 object.position.set(0, -35.2, 22.2);1191 object.rotation.set(-1.5, 0, -2.3);1192 scene.add(object);1193 })1194 })1195}11961197function bcblue() {1198 mtlLoader.setPath('model/obj/body/');1199 mtlLoader.load('blue.mtl', function (materials) {1200 objLoader.setMaterials(materials);1201 objLoader.setPath('model/obj/body/');1202 objLoader.load('body.obj', function (object) {1203 object.position.set(0, -35.2, 22.5);1204 object.rotation.set(-1.5, 0, -2.3);1205 scene.add(object);1206 })1207 })1208 mtlLoader.setPath('model/obj/body/');1209 mtlLoader.load('blue.mtl', function (materials) {1210 objLoader.setMaterials(materials);1211 objLoader.setPath('model/obj/body/');1212 objLoader.load('body.obj', function (object) {1213 object.position.set(0, -35.50, 22.5);1214 object.rotation.set(-1.5, 0, -2.3);1215 scene.add(object);1216 })1217 })1218 mtlLoader.setPath('model/obj/body/');1219 mtlLoader.load('blue.mtl', function (materials) {1220 objLoader.setMaterials(materials);1221 objLoader.setPath('model/obj/body/');1222 objLoader.load('body.obj', function (object) {1223 object.position.set(0, -35.2, 22.2);1224 object.rotation.set(-1.5, 0, -2.3);1225 scene.add(object);1226 })1227 })1228}12291230function bcgreen() {1231 mtlLoader.setPath('model/obj/body/');1232 mtlLoader.load('green.mtl', function (materials) {1233 objLoader.setMaterials(materials);1234 objLoader.setPath('model/obj/body/');1235 objLoader.load('body.obj', function (object) {1236 object.position.set(0, -35.2, 22.5);1237 object.rotation.set(-1.5, 0, -2.3);1238 scene.add(object);1239 })1240 })1241 mtlLoader.setPath('model/obj/body/');1242 mtlLoader.load('green.mtl', function (materials) {1243 objLoader.setMaterials(materials);1244 objLoader.setPath('model/obj/body/');1245 objLoader.load('body.obj', function (object) {1246 object.position.set(0, -35.50, 22.5);1247 object.rotation.set(-1.5, 0, -2.3);1248 scene.add(object);1249 })1250 })1251 mtlLoader.setPath('model/obj/body/');1252 mtlLoader.load('green.mtl', function (materials) {1253 objLoader.setMaterials(materials);1254 objLoader.setPath('model/obj/body/');1255 objLoader.load('body.obj', function (object) {1256 object.position.set(0, -35.2, 22.2);1257 object.rotation.set(-1.5, 0, -2.3);1258 scene.add(object);1259 })1260 })1261}12621263function bcyellow() {1264 mtlLoader.setPath('model/obj/body/');1265 mtlLoader.load('yellow.mtl', function (materials) {1266 objLoader.setMaterials(materials);1267 objLoader.setPath('model/obj/body/');1268 objLoader.load('body.obj', function (object) {1269 object.position.set(0, -35.2, 22.5);1270 object.rotation.set(-1.5, 0, -2.3);1271 scene.add(object);1272 })1273 })1274 mtlLoader.setPath('model/obj/body/');1275 mtlLoader.load('yellow.mtl', function (materials) {1276 objLoader.setMaterials(materials);1277 objLoader.setPath('model/obj/body/');1278 objLoader.load('body.obj', function (object) {1279 object.position.set(0, -35.50, 22.5);1280 object.rotation.set(-1.5, 0, -2.3);1281 scene.add(object);1282 })1283 })1284 mtlLoader.setPath('model/obj/body/');1285 mtlLoader.load('yellow.mtl', function (materials) {1286 objLoader.setMaterials(materials);1287 objLoader.setPath('model/obj/body/');1288 objLoader.load('body.obj', function (object) {1289 object.position.set(0, -35.2, 22.2);1290 object.rotation.set(-1.5, 0, -2.3);1291 scene.add(object);1292 })1293 })1294}12951296function bcorange() {1297 mtlLoader.setPath('model/obj/body/');1298 mtlLoader.load('orange.mtl', function (materials) {1299 objLoader.setMaterials(materials);1300 objLoader.setPath('model/obj/body/');1301 objLoader.load('body.obj', function (object) {1302 object.position.set(0, -35.2, 22.5);1303 object.rotation.set(-1.5, 0, -2.3);1304 scene.add(object);1305 })1306 })1307 mtlLoader.setPath('model/obj/body/');1308 mtlLoader.load('orange.mtl', function (materials) {1309 objLoader.setMaterials(materials);1310 objLoader.setPath('model/obj/body/');1311 objLoader.load('body.obj', function (object) {1312 object.position.set(0, -35.50, 22.5);1313 object.rotation.set(-1.5, 0, -2.3);1314 scene.add(object);1315 })1316 })1317 mtlLoader.setPath('model/obj/body/');1318 mtlLoader.load('orange.mtl', function (materials) {1319 objLoader.setMaterials(materials);1320 objLoader.setPath('model/obj/body/');1321 objLoader.load('body.obj', function (object) {1322 object.position.set(0, -35.2, 22.2);1323 object.rotation.set(-1.5, 0, -2.3);1324 scene.add(object);1325 })1326 })1327}13281329function bcsilver() {1330 mtlLoader.setPath('model/obj/body/');1331 mtlLoader.load('silver.mtl', function (materials) {1332 objLoader.setMaterials(materials);1333 objLoader.setPath('model/obj/body/');1334 objLoader.load('body.obj', function (object) {1335 object.position.set(0, -35.2, 22.5);1336 object.rotation.set(-1.5, 0, -2.3);1337 scene.add(object);1338 })1339 })1340 mtlLoader.setPath('model/obj/body/');1341 mtlLoader.load('silver.mtl', function (materials) {1342 objLoader.setMaterials(materials);1343 objLoader.setPath('model/obj/body/');1344 objLoader.load('body.obj', function (object) {1345 object.position.set(0, -35.50, 22.5);1346 object.rotation.set(-1.5, 0, -2.3);1347 scene.add(object);1348 })1349 })1350 mtlLoader.setPath('model/obj/body/');1351 mtlLoader.load('silver.mtl', function (materials) {1352 objLoader.setMaterials(materials);1353 objLoader.setPath('model/obj/body/');1354 objLoader.load('body.obj', function (object) {1355 object.position.set(0, -35.2, 22.2);1356 object.rotation.set(-1.5, 0, -2.3);1357 scene.add(object);1358 })1359 })1360}13611362function bcwhite() {1363 mtlLoader.setPath('model/obj/body/');1364 mtlLoader.load('white.mtl', function (materials) {1365 objLoader.setMaterials(materials);1366 objLoader.setPath('model/obj/body/');1367 objLoader.load('body.obj', function (object) {1368 object.position.set(0, -35.2, 22.5);1369 object.rotation.set(-1.5, 0, -2.3);1370 scene.add(object);1371 })1372 })1373 mtlLoader.setPath('model/obj/body/');1374 mtlLoader.load('white.mtl', function (materials) {1375 objLoader.setMaterials(materials);1376 objLoader.setPath('model/obj/body/');1377 objLoader.load('body.obj', function (object) {1378 object.position.set(0, -35.50, 22.5);1379 object.rotation.set(-1.5, 0, -2.3);1380 scene.add(object);1381 })1382 })1383 mtlLoader.setPath('model/obj/body/');1384 mtlLoader.load('white.mtl', function (materials) {1385 objLoader.setMaterials(materials);1386 objLoader.setPath('model/obj/body/');1387 objLoader.load('body.obj', function (object) {1388 object.position.set(0, -35.2, 22.2);1389 object.rotation.set(-1.5, 0, -2.3);1390 scene.add(object);1391 })1392 })1393}13941395function bcblack() {1396 mtlLoader.setPath('model/obj/body/');1397 mtlLoader.load('black2.mtl', function (materials) {1398 objLoader.setMaterials(materials);1399 objLoader.setPath('model/obj/body/');1400 objLoader.load('body.obj', function (object) {1401 object.position.set(0, -35.2, 22.5);1402 object.rotation.set(-1.5, 0, -2.3);1403 scene.add(object);1404 })1405 })1406 mtlLoader.setPath('model/obj/body/');1407 mtlLoader.load('black2.mtl', function (materials) {1408 objLoader.setMaterials(materials);1409 objLoader.setPath('model/obj/body/');1410 objLoader.load('body.obj', function (object) {1411 object.position.set(0, -35.50, 22.5);1412 object.rotation.set(-1.5, 0, -2.3);1413 scene.add(object);1414 })1415 })1416 mtlLoader.setPath('model/obj/body/');1417 mtlLoader.load('black2.mtl', function (materials) {1418 objLoader.setMaterials(materials);1419 objLoader.setPath('model/obj/body/');1420 objLoader.load('body.obj', function (object) {1421 object.position.set(0, -35.2, 22.2);1422 object.rotation.set(-1.5, 0, -2.3);1423 scene.add(object);1424 })1425 })1426}14271428function bccyan() {1429 mtlLoader.setPath('model/obj/body/');1430 mtlLoader.load('cyan.mtl', function (materials) {1431 objLoader.setMaterials(materials);1432 objLoader.setPath('model/obj/body/');1433 objLoader.load('body.obj', function (object) {1434 object.position.set(0, -35.2, 22.5);1435 object.rotation.set(-1.5, 0, -2.3);1436 scene.add(object);1437 })1438 })1439 mtlLoader.setPath('model/obj/body/');1440 mtlLoader.load('cyan.mtl', function (materials) {1441 objLoader.setMaterials(materials);1442 objLoader.setPath('model/obj/body/');1443 objLoader.load('body.obj', function (object) {1444 object.position.set(0, -35.50, 22.5);1445 object.rotation.set(-1.5, 0, -2.3);1446 scene.add(object);1447 })1448 })1449 mtlLoader.setPath('model/obj/body/');1450 mtlLoader.load('cyan.mtl', function (materials) {1451 objLoader.setMaterials(materials);1452 objLoader.setPath('model/obj/body/');1453 objLoader.load('body.obj', function (object) {1454 object.position.set(0, -35.2, 22.2);1455 object.rotation.set(-1.5, 0, -2.3);1456 scene.add(object);1457 })1458 })1459}14601461function bcPurple() {1462 mtlLoader.setPath('model/obj/body/');1463 mtlLoader.load('Purple.mtl', function (materials) {1464 objLoader.setMaterials(materials);1465 objLoader.setPath('model/obj/body/');1466 objLoader.load('body.obj', function (object) {1467 object.position.set(0, -35.2, 22.5);1468 object.rotation.set(-1.5, 0, -2.3);1469 scene.add(object);1470 })1471 })1472 mtlLoader.setPath('model/obj/body/');1473 mtlLoader.load('Purple.mtl', function (materials) {1474 objLoader.setMaterials(materials);1475 objLoader.setPath('model/obj/body/');1476 objLoader.load('body.obj', function (object) {1477 object.position.set(0, -35.50, 22.5);1478 object.rotation.set(-1.5, 0, -2.3);1479 scene.add(object);1480 })1481 })1482 mtlLoader.setPath('model/obj/body/');1483 mtlLoader.load('Purple.mtl', function (materials) {1484 objLoader.setMaterials(materials);1485 objLoader.setPath('model/obj/body/');1486 objLoader.load('body.obj', function (object) {1487 object.position.set(0, -35.2, 22.2);1488 object.rotation.set(-1.5, 0, -2.3);1489 scene.add(object);1490 })1491 })1492}14931494function bcgold() {1495 mtlLoader.setPath('model/obj/body/');1496 mtlLoader.load('gold.mtl', function (materials) {1497 objLoader.setMaterials(materials);1498 objLoader.setPath('model/obj/body/');1499 objLoader.load('body.obj', function (object) {1500 object.position.set(0, -35.2, 22.5);1501 object.rotation.set(-1.5, 0, -2.3);1502 scene.add(object);1503 })1504 })1505 mtlLoader.setPath('model/obj/body/');1506 mtlLoader.load('gold.mtl', function (materials) {1507 objLoader.setMaterials(materials);1508 objLoader.setPath('model/obj/body/');1509 objLoader.load('body.obj', function (object) {1510 object.position.set(0, -35.50, 22.5);1511 object.rotation.set(-1.5, 0, -2.3);1512 scene.add(object);1513 })1514 })1515 mtlLoader.setPath('model/obj/body/');1516 mtlLoader.load('gold.mtl', function (materials) {1517 objLoader.setMaterials(materials);1518 objLoader.setPath('model/obj/body/');1519 objLoader.load('gold.obj', function (object) {1520 object.position.set(0, -35.2, 22.2);1521 object.rotation.set(-1.5, 0, -2.3);1522 scene.add(object);1523 })1524 })1525}15261527function bcbrown() {1528 mtlLoader.setPath('model/obj/body/');1529 mtlLoader.load('brown.mtl', function (materials) {1530 objLoader.setMaterials(materials);1531 objLoader.setPath('model/obj/body/');1532 objLoader.load('body.obj', function (object) {1533 object.position.set(0, -35.2, 22.5);1534 object.rotation.set(-1.5, 0, -2.3);1535 scene.add(object);1536 })1537 })1538 mtlLoader.setPath('model/obj/body/');1539 mtlLoader.load('brown.mtl', function (materials) {1540 objLoader.setMaterials(materials);1541 objLoader.setPath('model/obj/body/');1542 objLoader.load('body.obj', function (object) {1543 object.position.set(0, -35.50, 22.5);1544 object.rotation.set(-1.5, 0, -2.3);1545 scene.add(object);1546 })1547 })1548 mtlLoader.setPath('model/obj/body/');1549 mtlLoader.load('brown.mtl', function (materials) {1550 objLoader.setMaterials(materials);1551 objLoader.setPath('model/obj/body/');1552 objLoader.load('body.obj', function (object) {1553 object.position.set(0, -35.2, 22.2);1554 object.rotation.set(-1.5, 0, -2.3);1555 scene.add(object);1556 })1557 })1558}15591560function bcgray() {1561 mtlLoader.setPath('model/obj/body/');1562 mtlLoader.load('gray.mtl', function (materials) {1563 objLoader.setMaterials(materials);1564 objLoader.setPath('model/obj/body/');1565 objLoader.load('body.obj', function (object) {1566 object.position.set(0, -35.2, 22.5);1567 object.rotation.set(-1.5, 0, -2.3);1568 scene.add(object);1569 })1570 })1571 mtlLoader.setPath('model/obj/body/');1572 mtlLoader.load('gray.mtl', function (materials) {1573 objLoader.setMaterials(materials);1574 objLoader.setPath('model/obj/body/');1575 objLoader.load('body.obj', function (object) {1576 object.position.set(0, -35.50, 22.5);1577 object.rotation.set(-1.5, 0, -2.3);1578 scene.add(object);1579 })1580 })1581 mtlLoader.setPath('model/obj/body/');1582 mtlLoader.load('gray.mtl', function (materials) {1583 objLoader.setMaterials(materials);1584 objLoader.setPath('model/obj/body/');1585 objLoader.load('body.obj', function (object) {1586 object.position.set(0, -35.2, 22.2);1587 object.rotation.set(-1.5, 0, -2.3);1588 scene.add(object);1589 })1590 })1591}15921593function bcsccrimson() {1594 mtlLoader.setPath('model/obj/body/');1595 mtlLoader.load('sccrimson.mtl', function (materials) {1596 objLoader.setMaterials(materials);1597 objLoader.setPath('model/obj/body/');1598 objLoader.load('body.obj', function (object) {1599 object.position.set(0, -35.2, 22.5);1600 object.rotation.set(-1.5, 0, -2.3);1601 scene.add(object);1602 })1603 })1604 mtlLoader.setPath('model/obj/body/');1605 mtlLoader.load('sccrimson.mtl', function (materials) {1606 objLoader.setMaterials(materials);1607 objLoader.setPath('model/obj/body/');1608 objLoader.load('body.obj', function (object) {1609 object.position.set(0, -35.50, 22.5);1610 object.rotation.set(-1.5, 0, -2.3);1611 scene.add(object);1612 })1613 })1614 mtlLoader.setPath('model/obj/body/');1615 mtlLoader.load('sccrimson.mtl', function (materials) {1616 objLoader.setMaterials(materials);1617 objLoader.setPath('model/obj/body/');1618 objLoader.load('body.obj', function (object) {1619 object.position.set(0, -35.2, 22.2);1620 object.rotation.set(-1.5, 0, -2.3);1621 scene.add(object);1622 })1623 })1624}1625//charkh1626function wcblue() {1627 mtlLoader.setPath('model/obj/wheel/');1628 mtlLoader.load('blue.mtl', function (materials) {1629 objLoader.setMaterials(materials);1630 objLoader.setPath('model/obj/wheel/');1631 objLoader.load('o1.obj', function (object) {1632 object.position.set(0, -35.1, 20);1633 object.rotation.set(-1.5, 0, -2.3);1634 scene.add(object);1635 })1636 })1637 mtlLoader.setPath('model/obj/wheel/');1638 mtlLoader.load('blue.mtl', function (materials) {1639 objLoader.setMaterials(materials);1640 objLoader.setPath('model/obj/wheel/');1641 objLoader.load('o3.obj', function (object) {1642 object.position.set(0, -35.1, 20);1643 object.rotation.set(-1.5, 0, -2.3);1644 scene.add(object);1645 })1646 })1647 mtlLoader.setPath('model/obj/wheel/');1648 mtlLoader.load('blue.mtl', function (materials) {1649 objLoader.setMaterials(materials);1650 objLoader.setPath('model/obj/wheel/');1651 objLoader.load('o2.obj', function (object) {1652 object.position.set(0, -35.15, 20);1653 object.rotation.set(-1.5, 0, -2.3);1654 scene.add(object);1655 })1656 })1657}16581659function wcred() {1660 mtlLoader.setPath('model/obj/wheel/');1661 mtlLoader.load('red.mtl', function (materials) {1662 objLoader.setMaterials(materials);1663 objLoader.setPath('model/obj/wheel/');1664 objLoader.load('o1.obj', function (object) {1665 object.position.set(0, -35.1, 20);1666 object.rotation.set(-1.5, 0, -2.3);1667 scene.add(object);1668 })1669 })1670 mtlLoader.setPath('model/obj/wheel/');1671 mtlLoader.load('red.mtl', function (materials) {1672 objLoader.setMaterials(materials);1673 objLoader.setPath('model/obj/wheel/');1674 objLoader.load('o3.obj', function (object) {1675 object.position.set(0, -35.1, 20);1676 object.rotation.set(-1.5, 0, -2.3);1677 scene.add(object);1678 })1679 })1680 mtlLoader.setPath('model/obj/wheel/');1681 mtlLoader.load('red.mtl', function (materials) {1682 objLoader.setMaterials(materials);1683 objLoader.setPath('model/obj/wheel/');1684 objLoader.load('o2.obj', function (object) {1685 object.position.set(0, -35.15, 20);1686 object.rotation.set(-1.5, 0, -2.3);1687 scene.add(object);1688 })1689 })1690}16911692function wcwhite() {1693 mtlLoader.setPath('model/obj/wheel/');1694 mtlLoader.load('white.mtl', function (materials) {1695 objLoader.setMaterials(materials);1696 objLoader.setPath('model/obj/wheel/');1697 objLoader.load('o1.obj', function (object) {1698 object.position.set(0, -35.1, 20);1699 object.rotation.set(-1.5, 0, -2.3);1700 scene.add(object);1701 })1702 })1703 mtlLoader.setPath('model/obj/wheel/');1704 mtlLoader.load('white.mtl', function (materials) {1705 objLoader.setMaterials(materials);1706 objLoader.setPath('model/obj/wheel/');1707 objLoader.load('o3.obj', function (object) {1708 object.position.set(0, -35.1, 20);1709 object.rotation.set(-1.5, 0, -2.3);1710 scene.add(object);1711 })1712 })1713 mtlLoader.setPath('model/obj/wheel/');1714 mtlLoader.load('white.mtl', function (materials) {1715 objLoader.setMaterials(materials);1716 objLoader.setPath('model/obj/wheel/');1717 objLoader.load('o2.obj', function (object) {1718 object.position.set(0, -35.15, 20);1719 object.rotation.set(-1.5, 0, -2.3);1720 scene.add(object);1721 })1722 })1723}17241725function wcblack() {1726 mtlLoader.setPath('model/obj/wheel/');1727 mtlLoader.load('black2.mtl', function (materials) {1728 objLoader.setMaterials(materials);1729 objLoader.setPath('model/obj/wheel/');1730 objLoader.load('o1.obj', function (object) {1731 object.position.set(0, -35.1, 20);1732 object.rotation.set(-1.5, 0, -2.3);1733 scene.add(object);1734 })1735 })1736 mtlLoader.setPath('model/obj/wheel/');1737 mtlLoader.load('black2.mtl', function (materials) {1738 objLoader.setMaterials(materials);1739 objLoader.setPath('model/obj/wheel/');1740 objLoader.load('o3.obj', function (object) {1741 object.position.set(0, -35.1, 20);1742 object.rotation.set(-1.5, 0, -2.3);1743 scene.add(object);1744 })1745 })1746 mtlLoader.setPath('model/obj/wheel/');1747 mtlLoader.load('black2.mtl', function (materials) {1748 objLoader.setMaterials(materials);1749 objLoader.setPath('model/obj/wheel/');1750 objLoader.load('o2.obj', function (object) {1751 object.position.set(0, -35.15, 20);1752 object.rotation.set(-1.5, 0, -2.3);1753 scene.add(object);1754 })1755 })1756}17571758function wcorange() {1759 mtlLoader.setPath('model/obj/wheel/');1760 mtlLoader.load('orange.mtl', function (materials) {1761 objLoader.setMaterials(materials);1762 objLoader.setPath('model/obj/wheel/');1763 objLoader.load('o1.obj', function (object) {1764 object.position.set(0, -35.1, 20);1765 object.rotation.set(-1.5, 0, -2.3);1766 scene.add(object);1767 })1768 })1769 mtlLoader.setPath('model/obj/wheel/');1770 mtlLoader.load('orange.mtl', function (materials) {1771 objLoader.setMaterials(materials);1772 objLoader.setPath('model/obj/wheel/');1773 objLoader.load('o3.obj', function (object) {1774 object.position.set(0, -35.1, 20);1775 object.rotation.set(-1.5, 0, -2.3);1776 scene.add(object);1777 })1778 })1779 mtlLoader.setPath('model/obj/wheel/');1780 mtlLoader.load('orange.mtl', function (materials) {1781 objLoader.setMaterials(materials);1782 objLoader.setPath('model/obj/wheel/');1783 objLoader.load('o2.obj', function (object) {1784 object.position.set(0, -35.15, 20);1785 object.rotation.set(-1.5, 0, -2.3);1786 scene.add(object);1787 })1788 })1789}17901791function wcbrown() {1792 mtlLoader.setPath('model/obj/wheel/');1793 mtlLoader.load('brown.mtl', function (materials) {1794 objLoader.setMaterials(materials);1795 objLoader.setPath('model/obj/wheel/');1796 objLoader.load('o1.obj', function (object) {1797 object.position.set(0, -35.1, 20);1798 object.rotation.set(-1.5, 0, -2.3);1799 scene.add(object);1800 })1801 })1802 mtlLoader.setPath('model/obj/wheel/');1803 mtlLoader.load('brown.mtl', function (materials) {1804 objLoader.setMaterials(materials);1805 objLoader.setPath('model/obj/wheel/');1806 objLoader.load('o3.obj', function (object) {1807 object.position.set(0, -35.1, 20);1808 object.rotation.set(-1.5, 0, -2.3);1809 scene.add(object);1810 })1811 })1812 mtlLoader.setPath('model/obj/wheel/');1813 mtlLoader.load('brown.mtl', function (materials) {1814 objLoader.setMaterials(materials);1815 objLoader.setPath('model/obj/wheel/');1816 objLoader.load('o2.obj', function (object) {1817 object.position.set(0, -35.15, 20);1818 object.rotation.set(-1.5, 0, -2.3);1819 scene.add(object);1820 })1821 })1822}18231824function wccyan() {1825 mtlLoader.setPath('model/obj/wheel/');1826 mtlLoader.load('cyan.mtl', function (materials) {1827 objLoader.setMaterials(materials);1828 objLoader.setPath('model/obj/wheel/');1829 objLoader.load('o1.obj', function (object) {1830 object.position.set(0, -35.1, 20);1831 object.rotation.set(-1.5, 0, -2.3);1832 scene.add(object);1833 })1834 })1835 mtlLoader.setPath('model/obj/wheel/');1836 mtlLoader.load('cyan.mtl', function (materials) {1837 objLoader.setMaterials(materials);1838 objLoader.setPath('model/obj/wheel/');1839 objLoader.load('o3.obj', function (object) {1840 object.position.set(0, -35.1, 20);1841 object.rotation.set(-1.5, 0, -2.3);1842 scene.add(object);1843 })1844 })1845 mtlLoader.setPath('model/obj/wheel/');1846 mtlLoader.load('cyan.mtl', function (materials) {1847 objLoader.setMaterials(materials);1848 objLoader.setPath('model/obj/wheel/');1849 objLoader.load('o2.obj', function (object) {1850 object.position.set(0, -35.15, 20);1851 object.rotation.set(-1.5, 0, -2.3);1852 scene.add(object);1853 })1854 })1855}18561857function wcsilver() {1858 mtlLoader.setPath('model/obj/wheel/');1859 mtlLoader.load('silver.mtl', function (materials) {1860 objLoader.setMaterials(materials);1861 objLoader.setPath('model/obj/wheel/');1862 objLoader.load('o1.obj', function (object) {1863 object.position.set(0, -35.1, 20);1864 object.rotation.set(-1.5, 0, -2.3);1865 scene.add(object);1866 })1867 })1868 mtlLoader.setPath('model/obj/wheel/');1869 mtlLoader.load('silver.mtl', function (materials) {1870 objLoader.setMaterials(materials);1871 objLoader.setPath('model/obj/wheel/');1872 objLoader.load('o3.obj', function (object) {1873 object.position.set(0, -35.1, 20);1874 object.rotation.set(-1.5, 0, -2.3);1875 scene.add(object);1876 })1877 })1878 mtlLoader.setPath('model/obj/wheel/');1879 mtlLoader.load('silver.mtl', function (materials) {1880 objLoader.setMaterials(materials);1881 objLoader.setPath('model/obj/wheel/');1882 objLoader.load('o2.obj', function (object) {1883 object.position.set(0, -35.15, 20);1884 object.rotation.set(-1.5, 0, -2.3);1885 scene.add(object);1886 })1887 })1888}18891890function wcgreen() {1891 mtlLoader.setPath('model/obj/wheel/');1892 mtlLoader.load('green.mtl', function (materials) {1893 objLoader.setMaterials(materials);1894 objLoader.setPath('model/obj/wheel/');1895 objLoader.load('o1.obj', function (object) {1896 object.position.set(0, -35.1, 20);1897 object.rotation.set(-1.5, 0, -2.3);1898 scene.add(object);1899 })1900 })1901 mtlLoader.setPath('model/obj/wheel/');1902 mtlLoader.load('green.mtl', function (materials) {1903 objLoader.setMaterials(materials);1904 objLoader.setPath('model/obj/wheel/');1905 objLoader.load('o3.obj', function (object) {1906 object.position.set(0, -35.1, 20);1907 object.rotation.set(-1.5, 0, -2.3);1908 scene.add(object);1909 })1910 })1911 mtlLoader.setPath('model/obj/wheel/');1912 mtlLoader.load('green.mtl', function (materials) {1913 objLoader.setMaterials(materials);1914 objLoader.setPath('model/obj/wheel/');1915 objLoader.load('o2.obj', function (object) {1916 object.position.set(0, -35.15, 20);1917 object.rotation.set(-1.5, 0, -2.3);1918 scene.add(object);1919 })1920 })1921}19221923function wcyellow() {1924 mtlLoader.setPath('model/obj/wheel/');1925 mtlLoader.load('yellow.mtl', function (materials) {1926 objLoader.setMaterials(materials);1927 objLoader.setPath('model/obj/wheel/');1928 objLoader.load('o1.obj', function (object) {1929 object.position.set(0, -35.1, 20);1930 object.rotation.set(-1.5, 0, -2.3);1931 scene.add(object);1932 })1933 })1934 mtlLoader.setPath('model/obj/wheel/');1935 mtlLoader.load('yellow.mtl', function (materials) {1936 objLoader.setMaterials(materials);1937 objLoader.setPath('model/obj/wheel/');1938 objLoader.load('o3.obj', function (object) {1939 object.position.set(0, -35.1, 20);1940 object.rotation.set(-1.5, 0, -2.3);1941 scene.add(object);1942 })1943 })1944 mtlLoader.setPath('model/obj/wheel/');1945 mtlLoader.load('yellow.mtl', function (materials) {1946 objLoader.setMaterials(materials);1947 objLoader.setPath('model/obj/wheel/');1948 objLoader.load('o2.obj', function (object) {1949 object.position.set(0, -35.15, 20);1950 object.rotation.set(-1.5, 0, -2.3);1951 scene.add(object);1952 })1953 })1954}19551956function wcgold() {1957 mtlLoader.setPath('model/obj/wheel/');1958 mtlLoader.load('gold.mtl', function (materials) {1959 objLoader.setMaterials(materials);1960 objLoader.setPath('model/obj/wheel/');1961 objLoader.load('o1.obj', function (object) {1962 object.position.set(0, -35.1, 20);1963 object.rotation.set(-1.5, 0, -2.3);1964 scene.add(object);1965 })1966 })1967 mtlLoader.setPath('model/obj/wheel/');1968 mtlLoader.load('gold.mtl', function (materials) {1969 objLoader.setMaterials(materials);1970 objLoader.setPath('model/obj/wheel/');1971 objLoader.load('o3.obj', function (object) {1972 object.position.set(0, -35.1, 20);1973 object.rotation.set(-1.5, 0, -2.3);1974 scene.add(object);1975 })1976 })1977 mtlLoader.setPath('model/obj/wheel/');1978 mtlLoader.load('gold.mtl', function (materials) {1979 objLoader.setMaterials(materials);1980 objLoader.setPath('model/obj/wheel/');1981 objLoader.load('o2.obj', function (object) {1982 object.position.set(0, -35.15, 20);1983 object.rotation.set(-1.5, 0, -2.3);1984 scene.add(object);1985 })1986 })1987}19881989function wcPurple() {1990 mtlLoader.setPath('model/obj/wheel/');1991 mtlLoader.load('Purple.mtl', function (materials) {1992 objLoader.setMaterials(materials);1993 objLoader.setPath('model/obj/wheel/');1994 objLoader.load('o1.obj', function (object) {1995 object.position.set(0, -35.1, 20);1996 object.rotation.set(-1.5, 0, -2.3);1997 scene.add(object);1998 })1999 })2000 mtlLoader.setPath('model/obj/wheel/');2001 mtlLoader.load('Purple.mtl', function (materials) {2002 objLoader.setMaterials(materials);2003 objLoader.setPath('model/obj/wheel/');2004 objLoader.load('o3.obj', function (object) {2005 object.position.set(0, -35.1, 20);2006 object.rotation.set(-1.5, 0, -2.3);2007 scene.add(object);2008 })2009 })2010 mtlLoader.setPath('model/obj/wheel/');2011 mtlLoader.load('Purple.mtl', function (materials) {2012 objLoader.setMaterials(materials);2013 objLoader.setPath('model/obj/wheel/');2014 objLoader.load('o2.obj', function (object) {2015 object.position.set(0, -35.15, 20);2016 object.rotation.set(-1.5, 0, -2.3);2017 scene.add(object);2018 })2019 })2020}20212022function wcgray() {2023 mtlLoader.setPath('model/obj/wheel/');2024 mtlLoader.load('gray.mtl', function (materials) {2025 objLoader.setMaterials(materials);2026 objLoader.setPath('model/obj/wheel/');2027 objLoader.load('o1.obj', function (object) {2028 object.position.set(0, -35.1, 20);2029 object.rotation.set(-1.5, 0, -2.3);2030 scene.add(object);2031 })2032 })2033 mtlLoader.setPath('model/obj/wheel/');2034 mtlLoader.load('gray.mtl', function (materials) {2035 objLoader.setMaterials(materials);2036 objLoader.setPath('model/obj/wheel/');2037 objLoader.load('o3.obj', function (object) {2038 object.position.set(0, -35.1, 20);2039 object.rotation.set(-1.5, 0, -2.3);2040 scene.add(object);2041 })2042 })2043 mtlLoader.setPath('model/obj/wheel/');2044 mtlLoader.load('gray.mtl', function (materials) {2045 objLoader.setMaterials(materials);2046 objLoader.setPath('model/obj/wheel/');2047 objLoader.load('o2.obj', function (object) {2048 object.position.set(0, -35.15, 20);2049 object.rotation.set(-1.5, 0, -2.3);2050 scene.add(object);2051 })2052 })2053}20542055function wccrimson() {2056 mtlLoader.setPath('model/obj/wheel/');2057 mtlLoader.load('crimson.mtl', function (materials) {2058 objLoader.setMaterials(materials);2059 objLoader.setPath('model/obj/wheel/');2060 objLoader.load('o1.obj', function (object) {2061 object.position.set(0, -35.1, 20);2062 object.rotation.set(-1.5, 0, -2.3);2063 scene.add(object);2064 })2065 })2066 mtlLoader.setPath('model/obj/wheel/');2067 mtlLoader.load('crimson.mtl', function (materials) {2068 objLoader.setMaterials(materials);2069 objLoader.setPath('model/obj/wheel/');2070 objLoader.load('o3.obj', function (object) {2071 object.position.set(0, -35.1, 20);2072 object.rotation.set(-1.5, 0, -2.3);2073 scene.add(object);2074 })2075 })2076 mtlLoader.setPath('model/obj/wheel/');2077 mtlLoader.load('crimson.mtl', function (materials) {2078 objLoader.setMaterials(materials);2079 objLoader.setPath('model/obj/wheel/');2080 objLoader.load('o2.obj', function (object) {2081 object.position.set(0, -35.15, 20);2082 object.rotation.set(-1.5, 0, -2.3);2083 scene.add(object);2084 })2085 })
...
advanced-open-file-spec.js
Source:advanced-open-file-spec.js
...30 }31 function fixturePath(...parts) {32 return stdPath.join(__dirname, 'fixtures', ...parts);33 }34 function setPath(newPath) {35 pathEditor.setText(newPath);36 }37 function currentPath() {38 return pathEditor.getText();39 }40 function dispatch(command) {41 atom.commands.dispatch(ui[0], command);42 }43 function currentPathList() {44 return ui.find('.list-item:not(.hidden)')45 .map((i, item) => $(item).text().trim())46 .get();47 }48 function currentEditorPaths() {49 return atom.workspace.getTextEditors().map((editor) => editor.getPath());50 }51 function waitsForOpenPaths(count, timeout=2000) {52 waitsFor(53 () => currentEditorPaths().length >= count,54 `${count} paths to be opened`,55 timeout56 );57 }58 function openModal() {59 atom.commands.dispatch(workspaceElement, 'advanced-open-file:toggle');60 waitsForPromise(() => {61 return activationPromise.then(() => {62 ui = $(getUI());63 pathEditor = ui.find('.path-input')[0].getModel();64 });65 });66 }67 function resetConfig() {68 atom.config.unset('advanced-open-file.createFileInstantly');69 atom.config.unset('advanced-open-file.helmDirSwitch');70 atom.config.unset('advanced-open-file.defaultInputValue');71 }72 function fileExists(path) {73 try {74 fs.statSync(path);75 } catch (err) {76 if (err.code === 'ENOENT') {77 return false;78 }79 }80 return true;81 }82 function isDirectory(path) {83 try {84 return fs.statSync(path).isDirectory();85 } catch (err) {}86 return false;87 }88 function clickFile(filename) {89 ui.find(`.list-item[data-file-name$='${filename}']`).click();90 }91 function assertAutocompletesTo(inputPath, autocompletedPath) {92 setPath(inputPath);93 dispatch('advanced-open-file:autocomplete');94 expect(currentPath()).toEqual(autocompletedPath);95 }96 describe('Modal dialog', () => {97 beforeEach(resetConfig);98 it('appears when the toggle command is triggered', () => {99 openModal()100 runs(() => {101 expect(getUI()).not.toBeNull();102 });103 });104 it('disappears if the toggle command is triggered while it is visible', () => {105 openModal();106 runs(() => {107 atom.commands.dispatch(workspaceElement, 'advanced-open-file:toggle');108 expect(getUI()).toBeNull();109 });110 });111 it('disappears if the cancel command is triggered while it is visible', () => {112 openModal();113 runs(() => {114 dispatch('core:cancel');115 expect(getUI()).toBeNull();116 });117 });118 it('disappears if the user clicks outside of the modal', () => {119 openModal();120 runs(() => {121 ui.parent().click();122 expect(getUI()).toBeNull();123 });124 });125 });126 describe('Path listing', () => {127 beforeEach(resetConfig);128 beforeEach(openModal);129 it('lists the directory contents if the path ends in a separator', () => {130 setPath(fixturePath() + stdPath.sep);131 // Also includes the parent directory and is sorted alphabetically132 // grouped by directories and files.133 expect(currentPathList()).toEqual([134 '..',135 'examples',136 'prefix_match.js',137 'prefix_other_match.js',138 'sample.js'139 ]);140 });141 it('lists matching files if the path doesn\'t end in a separator', () => {142 setPath(fixturePath('prefix'));143 // Also shouldn't include the parent.144 expect(currentPathList()).toEqual([145 'prefix_match.js',146 'prefix_other_match.js'147 ]);148 });149 it('excludes files that don\'t have a prefix matching the fragment', () => {150 setPath(fixturePath('prefix_match'));151 expect(currentPathList()).toEqual(['prefix_match.js']);152 });153 it('considers relative paths to be relative to the project root', () => {154 atom.project.setPaths([fixturePath()]);155 setPath(stdPath.join('examples', 'subdir') + stdPath.sep);156 expect(currentPathList()).toEqual(['..', 'subsample.js']);157 });158 it('automatically updates when the path changes', () => {159 setPath(fixturePath('prefix'));160 expect(currentPathList()).toEqual([161 'prefix_match.js',162 'prefix_other_match.js'163 ]);164 setPath(fixturePath('prefix_match'));165 expect(currentPathList()).toEqual(['prefix_match.js']);166 });167 it(`matches files case-insensitively unless the fragment contains a168 capital`, () => {169 setPath(fixturePath('examples', 'caseSensitive', 'prefix_match'));170 expect(currentPathList()).toEqual([171 'prefix_match_lower.js',172 'prefix_Match_upper.js'173 ]);174 setPath(fixturePath('examples', 'caseSensitive', 'prefix_Match'));175 expect(currentPathList()).toEqual(['prefix_Match_upper.js']);176 });177 it(`shows a button next to folders that can be clicked to add them as178 project folders`, () => {179 atom.project.setPaths([]);180 setPath(fixturePath() + stdPath.sep);181 let exampleListItem = ui.find('.list-item[data-file-name$=\'examples\']');182 let addProjectFolderButton = exampleListItem.find('.add-project-folder');183 expect(addProjectFolderButton.length).toEqual(1);184 addProjectFolderButton.click();185 expect(atom.project.getPaths()).toEqual([fixturePath('examples')]);186 // Do not open folder when clicking.187 expect(currentPath()).toEqual(fixturePath() + stdPath.sep);188 // Remove button when clicked.189 addProjectFolderButton = ui.find(190 '.list-item[data-file-name$=\'examples\'] .add-project-folder'191 );192 expect(addProjectFolderButton.length).toEqual(0);193 });194 it(`does not show the add-project-folder button for folders that are195 already project folders`, () => {196 atom.project.setPaths([fixturePath('examples')]);197 setPath(fixturePath() + stdPath.sep);198 let exampleListItem = ui.find('.list-item[data-file-name$=\'examples\']');199 let addProjectFolderButton = exampleListItem.find('.add-project-folder');200 expect(addProjectFolderButton.length).toEqual(0);201 });202 it('expands tildes at the start to the user\'s home directory', () => {203 spyOn(osenv, 'home').andReturn(fixturePath());204 setPath(stdPath.join('~', 'examples', 'subdir') + stdPath.sep);205 expect(currentPathList()).toEqual(['..', 'subsample.js']);206 });207 });208 describe('Path input', () => {209 beforeEach(resetConfig);210 beforeEach(openModal);211 it('can autocomplete the current input', () => {212 assertAutocompletesTo(213 fixturePath('prefix_ma'),214 fixturePath('prefix_match.js')215 );216 });217 it('can autocomplete the shared parts between two matching paths', () => {218 assertAutocompletesTo(219 fixturePath('pre'),220 fixturePath('prefix_')221 );222 });223 it('inserts a trailing separator when autocompleting a directory', () => {224 assertAutocompletesTo(225 fixturePath('exam'),226 fixturePath('examples') + stdPath.sep227 );228 });229 it('beeps if autocomplete finds no matchs', () => {230 spyOn(atom, 'beep');231 setPath(fixturePath('does_not_exist'));232 dispatch('advanced-open-file:autocomplete');233 expect(currentPath()).toEqual(fixturePath('does_not_exist'));234 expect(atom.beep).toHaveBeenCalled();235 });236 it('beeps if autocomplete cannot autocomplete any more shared parts', () => {237 spyOn(atom, 'beep');238 setPath(fixturePath('prefix_'));239 dispatch('advanced-open-file:autocomplete');240 expect(currentPath()).toEqual(fixturePath('prefix_'));241 expect(atom.beep).toHaveBeenCalled();242 });243 it(`is case-sensitive during autocomplete if the fragment has a capital244 letter`, () => {245 setPath(fixturePath('examples', 'caseSensitive', 'prefix_m'));246 dispatch('advanced-open-file:autocomplete');247 expect(currentPath()).toEqual(248 fixturePath('examples', 'caseSensitive', 'prefix_match_')249 );250 setPath(fixturePath('examples', 'caseSensitive', 'prefix_M'));251 dispatch('advanced-open-file:autocomplete');252 expect(currentPath()).toEqual(253 fixturePath('examples', 'caseSensitive', 'prefix_Match_upper.js')254 );255 });256 it(`can autocomplete when the path listing contains two paths where257 one path is the prefix of another`, () => {258 // The example has `planning` and `planning_backend`. The bug arises259 // because the entire `planning` path is a prefix of the other.260 assertAutocompletesTo(261 fixturePath('examples', 'matchPrefix', 'plan'),262 fixturePath('examples', 'matchPrefix', 'planning')263 );264 });265 it('fixes the case of letters in the fragment if necessary', () => {266 assertAutocompletesTo(267 fixturePath('examples', 'caseSensitive', 'prefix_match_up'),268 fixturePath('examples', 'caseSensitive', 'prefix_Match_upper.js')269 );270 });271 it('can remove the current path component', () => {272 setPath(fixturePath('fragment'));273 dispatch('advanced-open-file:delete-path-component');274 // Leaves trailing slash, as well.275 expect(currentPath()).toEqual(fixturePath() + stdPath.sep);276 });277 it(`removes the parent directory when removing a path component with no278 fragment`, () => {279 setPath(fixturePath('subdir') + stdPath.sep);280 dispatch('advanced-open-file:delete-path-component');281 expect(currentPath()).toEqual(fixturePath() + stdPath.sep);282 });283 it('can switch to the user\'s home directory using a shortcut', () => {284 atom.config.set('advanced-open-file.helmDirSwitch', true);285 setPath(fixturePath('subdir') + stdPath.sep + '~' + stdPath.sep);286 expect(currentPath()).toEqual(osenv.home() + stdPath.sep);287 // Also test when the rest of the path is empty.288 setPath('~' + stdPath.sep);289 expect(currentPath()).toEqual(osenv.home() + stdPath.sep);290 });291 it('can switch to the filesystem root using a shortcut', () => {292 // For cross-platformness, we cheat by using Path. Oh well.293 let fsRoot = new Path(fixturePath('subdir')).root().full;294 atom.config.set('advanced-open-file.helmDirSwitch', true);295 setPath(fixturePath('subdir') + stdPath.sep + stdPath.sep);296 expect(currentPath()).toEqual(fsRoot);297 // When the rest of path is empty, some platforms (Windows mainly)298 // can't infer a drive letter, so we can't use fsRoot from above.299 // Instead, we'll use the root of the path we're testing.300 fsRoot = new Path(stdPath.sep + stdPath.sep).root().full;301 // Also test when the rest of the path is empty.302 setPath(stdPath.sep + stdPath.sep);303 expect(currentPath()).toEqual(fsRoot);304 });305 it('can switch to the project root directory using a shortcut', () => {306 atom.config.set('advanced-open-file.helmDirSwitch', true);307 atom.project.setPaths([fixturePath('examples')]);308 setPath(fixturePath('subdir') + stdPath.sep + ':' + stdPath.sep);309 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep);310 // Also test when the rest of the path is empty.311 setPath(':' + stdPath.sep);312 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep);313 });314 it('does not reset the cursor position while typing', () => {315 setPath(fixturePath('subdir'));316 // Set cursor to be between the d and i in subdir.317 let end = pathEditor.getCursorBufferPosition();318 pathEditor.setCursorBufferPosition([end.row, end.column - 2])319 // Insert a new letter and check that the cursor is after it but320 // not at the end of the editor completely.321 pathEditor.insertText('a');322 let newEnd = pathEditor.getCursorBufferPosition();323 expect(newEnd.column).toEqual(end.column - 1);324 });325 });326 describe('Path input default value', () => {327 beforeEach(resetConfig);328 it('can be configured to be the current file\'s directory', () => {329 atom.config.set(330 'advanced-open-file.defaultInputValue',331 DEFAULT_ACTIVE_FILE_DIR332 );333 waitsForPromise(() => {334 return atom.workspace.open(fixturePath('sample.js')).then(() => {335 openModal();336 });337 });338 runs(() => {339 expect(currentPath()).toEqual(fixturePath() + stdPath.sep);340 });341 });342 it('can be configured to be the current project root', () => {343 atom.config.set(344 'advanced-open-file.defaultInputValue',345 DEFAULT_PROJECT_ROOT346 );347 atom.project.setPaths([fixturePath('examples')]);348 openModal();349 runs(() => {350 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep);351 });352 });353 it('can be configured to be blank', () => {354 atom.config.set('advanced-open-file.defaultInputValue', DEFAULT_EMPTY);355 openModal();356 runs(() => {357 expect(currentPath()).toEqual('');358 });359 });360 });361 describe('Undo', () => {362 beforeEach(resetConfig);363 beforeEach(openModal);364 it('can undo tab completion', () => {365 setPath(fixturePath('exam'));366 dispatch('advanced-open-file:autocomplete');367 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep);368 dispatch('advanced-open-file:undo');369 expect(currentPath()).toEqual(fixturePath('exam'));370 });371 it('can undo deleting path components', () => {372 setPath(fixturePath('exam'));373 dispatch('advanced-open-file:delete-path-component');374 expect(currentPath()).toEqual(fixturePath() + stdPath.sep);375 dispatch('advanced-open-file:undo');376 expect(currentPath()).toEqual(fixturePath('exam'));377 });378 it('can undo clicking a folder', () => {379 setPath(fixturePath() + stdPath.sep);380 clickFile('examples');381 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep);382 dispatch('advanced-open-file:undo');383 expect(currentPath()).toEqual(fixturePath() + stdPath.sep);384 });385 it('beeps when it cannot undo any farther', () => {386 spyOn(atom, 'beep');387 dispatch('advanced-open-file:undo');388 expect(atom.beep).toHaveBeenCalled();389 });390 });391 describe('Opening files', () => {392 beforeEach(resetConfig);393 beforeEach(openModal);394 it('opens an existing file if the current path points to one', () => {395 let path = fixturePath('sample.js');396 setPath(path);397 dispatch('core:confirm');398 waitsForOpenPaths(1);399 runs(() => {400 expect(currentEditorPaths()).toEqual([path]);401 });402 });403 it('replaces the path when attempting to open an existing directory', () => {404 setPath(fixturePath('examples'));405 dispatch('core:confirm');406 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep);407 });408 it(`beeps when attempting to open a path ending in a separator (a409 non-existant directory)`, () => {410 spyOn(atom, 'beep');411 setPath(fixturePath('notthere') + stdPath.sep);412 dispatch('core:confirm');413 expect(atom.beep).toHaveBeenCalled();414 });415 it(`creates the directory when opening a path ending a separator if416 configured`, () => {417 let tempDir = fs.realpathSync(temp.mkdirSync());418 let path = stdPath.join(tempDir, 'newdir') + stdPath.sep;419 atom.config.set('advanced-open-file.createDirectories', true);420 setPath(path);421 expect(isDirectory(path)).toEqual(false);422 dispatch('core:confirm');423 expect(isDirectory(path)).toEqual(true);424 });425 it('opens a new file without saving it if opening a non-existant path', () => {426 let path = fixturePath('does.not.exist');427 setPath(path);428 dispatch('core:confirm');429 waitsForOpenPaths(1);430 runs(() => {431 expect(currentEditorPaths()).toEqual([path]);432 expect(fileExists(path)).toEqual(false);433 });434 });435 it('creates a new file when configured to', () => {436 let tempDir = fs.realpathSync(temp.mkdirSync());437 let path = stdPath.join(tempDir, 'newfile.js');438 atom.config.set('advanced-open-file.createFileInstantly', true);439 setPath(path);440 expect(fileExists(path)).toEqual(false);441 dispatch('core:confirm');442 waitsForOpenPaths(1);443 runs(() => {444 expect(currentEditorPaths()).toEqual([path]);445 expect(fileExists(path)).toEqual(true);446 });447 });448 it('creates intermediate directories when necessary', () => {449 let tempDir = fs.realpathSync(temp.mkdirSync());450 let newDir = stdPath.join(tempDir, 'newDir');451 let path = stdPath.join(newDir, 'newFile.js');452 setPath(path);453 expect(fileExists(newDir)).toEqual(false);454 dispatch('core:confirm');455 waitsForOpenPaths(1);456 runs(() => {457 expect(currentEditorPaths()).toEqual([path]);458 expect(fileExists(newDir)).toEqual(true);459 });460 });461 it('can create files from relative paths', () => {462 let tempDir = fs.realpathSync(temp.mkdirSync());463 let path = stdPath.join('newDir', 'newFile.js');464 let absolutePath = stdPath.join(tempDir, path);465 atom.project.setPaths([tempDir]);466 atom.config.set('advanced-open-file.createFileInstantly', true);467 setPath(path);468 expect(fileExists(absolutePath)).toEqual(false);469 dispatch('core:confirm');470 waitsForOpenPaths(1);471 runs(() => {472 expect(currentEditorPaths()).toEqual([absolutePath]);473 expect(fileExists(absolutePath)).toEqual(true);474 });475 });476 it('can open files from tilde-prefixed paths', () => {477 spyOn(osenv, 'home').andReturn(fixturePath());478 setPath(stdPath.join('~', 'examples', 'subdir', 'subsample.js'));479 dispatch('core:confirm');480 waitsForOpenPaths(1);481 runs(() => {482 expect(currentEditorPaths()).toEqual([483 fixturePath('examples', 'subdir', 'subsample.js')484 ]);485 });486 });487 it('can open files in new split panes', () => {488 atom.workspace.open(fixturePath('sample.js'));489 expect(atom.workspace.getPanes().length).toEqual(1);490 setPath(fixturePath('prefix_match.js'));491 dispatch('pane:split-left');492 waitsForOpenPaths(2);493 runs(() => {494 expect(new Set(currentEditorPaths())).toEqual(new Set([495 fixturePath('sample.js'),496 fixturePath('prefix_match.js'),497 ]));498 expect(atom.workspace.getPanes().length).toEqual(2);499 });500 });501 it(`shows an error notification when creating a subdirectory throws an502 error`, () => {503 debugger;504 spyOn(atom.notifications, 'addError');505 spyOn(mkdirp, 'sync').andCallFake(() => {506 throw new Error('OH NO');507 });508 setPath(fixturePath('examples', 'noPermission', 'subdir', 'file.txt'));509 dispatch('core:confirm');510 expect(atom.notifications.addError).toHaveBeenCalled();511 });512 it(`shows an error notification when creating a file in a directory513 throws an error`, () => {514 spyOn(atom.notifications, 'addError');515 spyOn(touch, 'sync').andCallFake(() => {516 throw new Error('OH NO');517 });518 atom.config.set('advanced-open-file.createFileInstantly', true);519 setPath(fixturePath('examples', 'noPermission', 'file.txt'));520 dispatch('core:confirm');521 expect(atom.notifications.addError).toHaveBeenCalled();522 });523 });524 describe('Keyboard navigation', () => {525 beforeEach(resetConfig);526 beforeEach(openModal);527 /*528 For reference, expected listing in fixtures is:529 ..530 examples531 prefix_match.js532 prefix_other_match.js533 sample.js534 */535 function moveDown(times) {536 for (let k = 0; k < times; k++) {537 dispatch('advanced-open-file:move-cursor-down');538 }539 }540 function moveUp(times) {541 for (let k = 0; k < times; k++) {542 dispatch('advanced-open-file:move-cursor-up');543 }544 }545 it('allows moving a cursor to a file and confirming to select a path', () => {546 setPath(fixturePath() + stdPath.sep);547 moveDown(4);548 moveUp(1); // Test movement both down and up.549 dispatch('core:confirm');550 waitsForOpenPaths(1);551 runs(() => {552 expect(currentEditorPaths()).toEqual([fixturePath('prefix_match.js')]);553 });554 });555 it('allows moving a cursor to the top and confirming to select a path', () => {556 setPath(fixturePath() + stdPath.sep);557 moveDown(3);558 dispatch('advanced-open-file:move-cursor-top');559 moveDown(2);560 dispatch('core:confirm');561 waitsForOpenPaths(1);562 runs(() => {563 expect(currentEditorPaths()).toEqual([fixturePath('prefix_match.js')]);564 });565 });566 it('allows moving a cursor to the bottom and confirming to select a path', () => {567 setPath(fixturePath() + stdPath.sep);568 moveDown(2);569 dispatch('advanced-open-file:move-cursor-bottom');570 dispatch('core:confirm');571 waitsForOpenPaths(1);572 runs(() => {573 expect(currentEditorPaths()).toEqual([fixturePath('sample.js')]);574 });575 });576 it('wraps the cursor at the edges', () => {577 setPath(fixturePath() + stdPath.sep);578 moveUp(2);579 moveDown(4);580 moveUp(5);581 dispatch('core:confirm');582 waitsForOpenPaths(1);583 runs(() => {584 expect(currentEditorPaths()).toEqual([fixturePath('prefix_match.js')]);585 });586 });587 it('replaces the current path when selecting a directory', () => {588 setPath(fixturePath() + stdPath.sep);589 moveDown(2);590 dispatch('core:confirm');591 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep)592 });593 it('moves to the parent directory when the .. element is selected', () => {594 setPath(fixturePath('examples') + stdPath.sep);595 moveDown(1);596 dispatch('core:confirm');597 expect(currentPath()).toEqual(fixturePath() + stdPath.sep)598 });599 it('can add folders as project directories using a keyboard command', () => {600 atom.project.setPaths([]);601 setPath(fixturePath() + stdPath.sep);602 moveDown(2); // examples folder603 dispatch('application:add-project-folder');604 expect(atom.project.getPaths()).toEqual([fixturePath('examples')]);605 });606 it('beeps when trying to add the parent folder as a project directory', () => {607 spyOn(atom, 'beep');608 atom.project.setPaths([]);609 setPath(fixturePath() + stdPath.sep);610 moveDown(1); // Parent folder611 dispatch('application:add-project-folder');612 expect(atom.beep).toHaveBeenCalled();613 expect(atom.project.getPaths()).toEqual([]);614 });615 it('beeps when trying to add a file as a project directory', () => {616 spyOn(atom, 'beep');617 atom.project.setPaths([]);618 setPath(fixturePath() + stdPath.sep);619 moveDown(3); // prefix_match.js620 dispatch('application:add-project-folder');621 expect(atom.beep).toHaveBeenCalled();622 expect(atom.project.getPaths()).toEqual([]);623 });624 it(`beeps when trying to add a folder as a project directory that is625 already one`, () => {626 spyOn(atom, 'beep');627 atom.project.setPaths([fixturePath('examples')]);628 setPath(fixturePath() + stdPath.sep);629 moveDown(2); // examples folder630 dispatch('application:add-project-folder');631 expect(atom.beep).toHaveBeenCalled();632 expect(atom.project.getPaths()).toEqual([fixturePath('examples')]);633 });634 it(`can select the first item in the list if none are selected using635 special command`, () => {636 setPath(fixturePath('prefix'));637 dispatch('advanced-open-file:confirm-selected-or-first');638 waitsForOpenPaths(1);639 runs(() => {640 expect(currentEditorPaths()).toEqual([fixturePath('prefix_match.js')]);641 });642 })643 });644 describe('Mouse navigation', () => {645 beforeEach(resetConfig);646 beforeEach(openModal);647 it('opens a path when it is clicked on', () => {648 setPath(fixturePath() + stdPath.sep);649 clickFile('sample.js')650 waitsForOpenPaths(1);651 runs(() => {652 expect(currentEditorPaths()).toEqual([fixturePath('sample.js')]);653 });654 });655 it('replaces the current path when clicking a directory', () => {656 setPath(fixturePath() + stdPath.sep);657 clickFile('examples');658 expect(currentPath()).toEqual(fixturePath('examples') + stdPath.sep)659 });660 it('moves to the parent directory when the .. element is clicked', () => {661 setPath(fixturePath('examples') + stdPath.sep);662 ui.find('.parent-directory').click();663 expect(currentPath()).toEqual(fixturePath() + stdPath.sep)664 });665 });666 describe('Events', () => {667 beforeEach(resetConfig);668 beforeEach(openModal);669 it('allows subscription to events when paths are opened', () => {670 let handler = jasmine.createSpy('handler');671 let sub = provideEventService().onDidOpenPath(handler);672 let path = fixturePath('sample.js');673 setPath(path);674 dispatch('core:confirm');675 expect(handler).toHaveBeenCalledWith(path);676 sub.dispose();677 });678 it('allows subscription to events when paths are created', () => {679 atom.config.set('advanced-open-file.createFileInstantly', true);680 let tempDir = fs.realpathSync(temp.mkdirSync());681 let path = stdPath.join(tempDir, 'newfile.js');682 let handler = jasmine.createSpy('handler');683 let sub = provideEventService().onDidCreatePath(handler);684 setPath(path);685 dispatch('core:confirm');686 expect(handler).toHaveBeenCalledWith(path);687 sub.dispose();688 });689 it('emits the create event when creating a directory', () => {690 atom.config.set('advanced-open-file.createDirectories', true);691 let tempDir = fs.realpathSync(temp.mkdirSync());692 let path = stdPath.join(tempDir, 'newdir') + stdPath.sep;693 let handler = jasmine.createSpy('handler');694 let sub = provideEventService().onDidCreatePath(handler);695 setPath(path);696 dispatch('core:confirm');697 expect(handler).toHaveBeenCalledWith(new Path(path).absolute);698 sub.dispose();699 });700 });701 // Only run Windows-specific tests when enabled.702 let windowsDescribe = process.env.AOF_WINDOWS_TESTS ? describe : xdescribe;703 windowsDescribe('Windows-specific tests', () => {704 // Just as a note, we're assuming C:\ exists and is the root705 // system drive. It is on AppVeyor, and that's good enough.706 it('can read the root directory without failing', () => {707 // This potentially fails because we stat in-use files like708 // pagefile.sys.709 expect(() => {setPath('C:\\')}).not.toThrow();710 });711 it('does not replace drive letters with the project root', () => {712 atom.project.setPaths([fixturePath()]);713 setPath('C:/');714 expect(currentPath()).toEqual('C:/');715 });716 });717 describe('Fuzzy filename matching', () => {718 beforeEach(resetConfig);719 beforeEach(() => {720 atom.config.set('advanced-open-file.fuzzyMatch', true);721 });722 beforeEach(openModal);723 it('lists files and folders as normal when no fragment is being matched', () => {724 setPath(fixturePath() + stdPath.sep);725 expect(currentPathList()).toEqual([726 '..',727 'examples',728 'prefix_match.js',729 'prefix_other_match.js',730 'sample.js'731 ]);732 });733 it('uses a fuzzy algorithm for matching files instead of prefix matching', () => {734 setPath(fixturePath('ix'));735 expect(currentPathList()).toEqual([736 'prefix_match.js',737 'prefix_other_match.js',738 ]);739 });740 it('sorts matches by weight instead of by name', () => {741 setPath(fixturePath('examples', 'fuzzyWeight', 'heavy_'));742 expect(currentPathList()).toEqual([743 'more_heavy_heavy.js',744 'less_heavy.js',745 ]);746 });747 it('chooses the first match for autocomplete when nothing is highlighted', () => {748 assertAutocompletesTo(749 fixturePath('ix'),750 fixturePath('prefix_match.js')751 );752 });753 });...
test.js
Source:test.js
...25 obj = getDefaultObject();26 });27 it('should be able to set and overwrite types', function () {28 var newValue = 'newValue';29 obj = setPath(obj, 'dataUndefined', newValue);30 expect(typeof obj.dataUndefined).toBe('string');31 expect(obj.dataUndefined).toBe(newValue);32 obj = setPath(obj, 'dataDate', newValue);33 expect(typeof obj.dataDate).toBe('string');34 expect(obj.dataDate).toBe(newValue);35 obj = setPath(obj, 'nested', newValue);36 expect(typeof obj.nested).toBe('string');37 expect(obj.nested).toBe(newValue);38 obj = setPath(obj, 'nested.foo', newValue);39 expect(typeof obj.nested).toBe('object');40 expect(typeof obj.nested.foo).toBe('string');41 expect(obj.nested.foo).toBe(newValue);42 });43 it('should covert things to objects', function () {44 expect(setPath(1234, 'a', 42)).toEqual({ a: 42 });45 expect(setPath(null, 'a', 42)).toEqual({ a: 42 });46 expect(setPath(true, 'a', 42)).toEqual({ a: 42 });47 expect(setPath({ a: 123 }, 'a.b', 42)).toEqual({ a: { b: 42 } });48 expect(setPath(null, 'a.b.c.d', null)).toEqual({49 a: { b: { c: { d: null } } }50 });51 });52 it('should be able to use custom delimiters', function () {53 expect(setPath({}, 'a|b|c|d', 42)).toEqual({ 'a|b|c|d': 42 });54 expect(setPath({}, 'a|b|c|d', 42, '|')).toEqual({55 a: { b: { c: { d: 42 } } }56 });57 expect(setPath({}, 'a.b.c.d', 42, '|')).toEqual({ 'a.b.c.d': 42 });58 });59 it('should set the correct values', function () {60 expect(setPath({}, 'a.b', 42)).toEqual({ a: { b: 42 } });61 expect(setPath({}, 'a.b', undefined)).toEqual({ a: { b: undefined } });62 expect(setPath({}, 'a.b', true)).toEqual({ a: { b: true } });63 expect(setPath({}, 'a.b', 'wow')).toEqual({ a: { b: 'wow' } });64 });65 it('should handle arrays as paths', function () {66 expect(setPath({}, ['a', 'b'], 42)).toEqual({ a: { b: 42 } });67 expect(setPath({}, ['a', 'b'], undefined)).toEqual({ a: { c: undefined } });68 expect(setPath({}, ['a', 'b'], true)).toEqual({ a: { b: true } });69 expect(setPath({}, ['a', 'b'], 'wow')).toEqual({ a: { b: 'wow' } });70 });71 it('should be able to be called multiple times', function () {72 obj = {};73 obj = setPath(obj, 'a', 42);74 obj = setPath(obj, 'b', true);75 obj = setPath(obj, 'c.d', {});76 obj = setPath(obj, 'c.d.e', {});77 obj = setPath(obj, 'c.d.f', 'foo');78 expect(obj).toEqual({ a: 42, b: true, c: { d: { e: {}, f: 'foo' } } });79 });80 it('should return the default object when key is not a string or array', function () {81 var defaultValue = Math.random();82 [{}, null, 42, undefined, true].forEach(function (path) {83 expect(setPath(getDefaultObject(), path, defaultValue)).toEqual(84 getDefaultObject()85 );86 });87 });88 it('should return the default object when key is an empty array', function () {89 var defaultValue = Math.random();90 expect(setPath(obj, [], defaultValue)).toEqual(getDefaultObject());91 });92 it('should allow empty strings as a path', function () {93 var defaultValue = Math.random();94 var obj2 = getDefaultObject();95 obj2[''] = defaultValue;96 expect(setPath(obj, '', defaultValue)).toEqual(obj2);97 });98 it('should not pollute __proto__', function () {99 var obj = {};100 expect(obj.polluted).toBeUndefined();101 setPath(obj, '__proto__.polluted', 'yes');102 var obj2 = {};103 expect(obj.polluted).toBeUndefined();104 expect(obj2.polluted).toBeUndefined();105 });106 it('should not pollute __proto__ when using arrays', function () {107 var obj = {};108 expect(obj.polluted).toBeUndefined();109 setPath(obj, [['__proto__'], 'polluted'], 'yes');110 var obj2 = {};111 expect(obj.polluted).toBeUndefined();112 expect(obj2.polluted).toBeUndefined();113 });114 it('should not pollute constructor', function () {115 var obj = {};116 expect(obj.polluted).toBeUndefined();117 setPath(obj, 'constructor.polluted', 'yes');118 var obj2 = {};119 expect(obj.polluted).toBeUndefined();120 expect(obj2.polluted).toBeUndefined();121 });122 it('should not pollute prototype', function () {123 var obj = {};124 expect(obj.polluted).toBeUndefined();125 setPath(obj, 'prototype.polluted', 'yes');126 // eslint-disable-next-line127 var obj2 = new Object();128 expect(obj.polluted).toBeUndefined();129 expect(obj2.polluted).toBeUndefined();130 });...
Using AI Code Generation
1import { setPath } from 'storybook-root';2setPath(__dirname);3import { storiesOf } from 'storybook-root';4storiesOf('Hello World', module)5 .add('Hello', () => <h1>Hello World</h1>);6import { setPath } from 'storybook-root';7setPath(__dirname);8import { storiesOf } from 'storybook-root';9storiesOf('Hello World', module)10 .add('Hello', () => <h1>Hello World</h1>);
Using AI Code Generation
1import { setPath } from 'storybook-root';2setPath(__dirname);3import { setPath } from 'storybook-root';4setPath(__dirname);5import { setPath } from 'storybook-root';6setPath(__dirname);7import { setPath } from 'storybook-root';8setPath(__dirname);9import { setPath } from 'storybook-root';10setPath(__dirname);11import { setPath } from 'storybook-root';12setPath(__dirname);13import { setPath } from 'storybook-root';14setPath(__dirname);15import { setPath } from 'storybook-root';16setPath(__dirname);17import { setPath } from 'storybook-root';18setPath(__dirname);19import { setPath } from 'storybook-root';20setPath(__dirname);21import { setPath } from 'storybook-root';22setPath(__dirname);
Using AI Code Generation
1import { setPath } from 'storybook-root';2setPath(__dirname);3import { storiesOf } from 'storybook';4import { setPath } from 'storybook-root';5setPath(__dirname);6import { storiesOf } from 'storybook';7import { setPath } from 'storybook-root';8setPath(__dirname);9import { storiesOf } from 'storybook';10import { setPath } from 'storybook-root';11setPath(__dirname);12import { storiesOf } from 'storybook';13import { setPath } from 'storybook-root';14setPath(__dirname);15import { storiesOf } from 'storybook';16import { setPath } from 'storybook-root';17setPath(__dirname);18import { storiesOf } from 'storybook';19import { setPath } from 'storybook-root';20setPath(__dirname);21import { storiesOf } from 'storybook';22import { setPath } from 'storybook-root';23setPath(__dirname);24import { storiesOf } from 'storybook';25import { setPath } from 'storybook-root';26setPath(__dirname);27import { storiesOf } from 'storybook';28import { setPath } from 'storybook-root';29setPath(__dirname);30import { storiesOf } from 'storybook';31import { setPath } from 'storybook-root
Using AI Code Generation
1var storybook = require('storybook-root');2storybook.setPath('/path/to/storybook');3storybook.load();4var storybook = require('storybook-root');5storybook.load();6var storybook = require('storybook-root');7storybook.load();8var storybook = require('storybook-root');9storybook.load();
Using AI Code Generation
1import { setPath } from 'storybook-root';2setPath('/storybook');3import { storiesOf } from 'storybook-root';4storiesOf('MyComponent', module)5 .add('with text', () => (6 ));7import { storiesOf } from 'storybook-root';8storiesOf('MyComponent', module)9 .addDecorator((story) => (10 <div style={{ textAlign: 'center' }}>11 {story()}12 .add('with text', () => (13 ));14import { storiesOf } from 'storybook-root';15storiesOf('MyComponent', module)16 .addDecorator((story) => (17 <div style={{ textAlign: 'center' }}>18 {story()}19 .addParameters({20 })21 .add('with text', () => (22 ));23import { storiesOf } from 'storybook-root';24import { withKnobs, text } from '@storybook/addon-knobs';25storiesOf('MyComponent', module)26 .addDecorator((story) => (27 <div style={{ textAlign: 'center' }}>28 {story()}29 .addDecorator(withKnobs)30 .addParameters({31 })32 .add('with text', () => (33 <MyComponent>{text('Label', 'Hello Button')}</MyComponent>34 ));35import { storiesOf } from 'storybook-root';36import { withKnobs, text } from '@storybook/addon-knobs';37import { action } from '@storybook/addon-actions';38storiesOf('MyComponent', module)39 .addDecorator((story) => (40 <div style={{ textAlign: 'center' }}>41 {story()}42 .addDecorator(withKnobs)43 .addParameters({44 })45 .add('with
Using AI Code Generation
1var storybookRoot = require('storybook-root');2storybookRoot.setPath(__dirname);3var storybook = require('storybook');4storybook.setPath(__dirname);5storybook.init();6storybook.loadStories();7var storybook = require('storybook');8storybook.add('My First Story', function() {9 return 'Hello World';10});11var storybook = require('storybook');12storybook.add('My Second Story', function() {13 return 'Hello World';14});15var storybook = require('storybook');16storybook.add('My Third Story', function() {17 return 'Hello World';18});19var storybook = require('storybook');20storybook.add('My Fourth Story', function() {21 return 'Hello World';22});23var storybook = require('storybook');24storybook.add('My Fifth Story', function() {25 return 'Hello World';26});27var storybook = require('storybook');28storybook.add('My Sixth Story', function() {29 return 'Hello World';30});31var storybook = require('storybook');32storybook.add('My Seventh Story', function() {33 return 'Hello World';34});35var storybook = require('storybook');36storybook.add('My Eighth Story', function() {37 return 'Hello World';38});39var storybook = require('storybook');40storybook.add('My Ninth Story', function() {41 return 'Hello World';42});43var storybook = require('storybook');44storybook.add('My Tenth Story', function() {45 return 'Hello World';46});47var storybook = require('storybook');48storybook.add('My Eleventh Story', function() {49 return 'Hello World';50});51var storybook = require('storybook');52storybook.add('My Twelveth Story', function() {53 return 'Hello World';54});55var storybook = require('storybook');56storybook.add('My Thirteenth Story', function() {57 return 'Hello World';58});
Using AI Code Generation
1import { setPath } from 'storybook-root';2setPath(__dirname);3import { setPath } from 'storybook-root';4setPath(__dirname);5import { setPath } from 'storybook-root';6setPath(__dirname);7import { setPath } from 'storybook-root';8setPath(__dirname);9import { setPath } from 'storybook-root';10setPath(__dirname);11import { setPath } from 'storybook-root';12setPath(__dirname);
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!!