Best JavaScript code snippet using webdriverio-monorepo
RGraph.common.zoom.js
Source:RGraph.common.zoom.js
...64 areaDiv.style.backgroundColor = 'rgba(220,220,220,0.3)';65 areaDiv.style.display = 'none';66 areaDiv.onmouseover = function (e)67 {68 setTimeout(function () {e.target.style.opacity = 0.8;}, 50);69 setTimeout(function () {e.target.style.opacity = 0.6;}, 100);70 setTimeout(function () {e.target.style.opacity = 0.4;}, 150);71 setTimeout(function () {e.target.style.opacity = 0.2;}, 200);72 setTimeout(function () {e.target.style.opacity = 0;}, 250);73 setTimeout(function () {e.target.style.display = 'none';}, 300);74 setTimeout(function () {e.target = null;}, 350);75 }76 document.body.appendChild(areaDiv);77 RGraph.Registry.Set('chart.zoomed.area.div', null);78 RGraph.Registry.Set('chart.zoomed.area.mousedown', coords);79 RGraph.Registry.Set('chart.zoomed.area.areadiv', areaDiv);80 }81 var window_onmousemove = function (e)82 {83 var startCoords = RGraph.Registry.Get('chart.zoomed.area.mousedown');84 85 if (startCoords && startCoords.length) {86 var coords = RGraph.getMouseXY(e);87 var canvasXY = RGraph.getCanvasXY(e.target);88 var obj = e.target.__object__;89 var context = obj.context;90 var canvas = obj.canvas;91 var startx = startCoords[0];92 var starty = startCoords[1];93 var endx = coords[0];94 var endy = coords[1];95 var width = endx - startx;96 var height = endy - starty;97 var areaDiv = RGraph.Registry.Get('chart.zoomed.area.areadiv');98 99 if (width >= 0 && height >= 0) {100 101 if (width > 5 && height > 5) {102 areaDiv.style.width = (width - 15) + 'px';103 areaDiv.style.height = (height - 15) + 'px';104 areaDiv.style.display = 'inline';105 } else {106 areaDiv.style.display = 'none';107 }108 } else if (width < -5 || height < -5) {109 var canvasCoords = RGraph.getCanvasXY(canvas);110 var noticeDiv = document.createElement('DIV');111 noticeDiv.style.position = 'absolute';112 noticeDiv.style.top = 0;113 noticeDiv.style.left = 0;114 noticeDiv.style.zIndex = 99;115 noticeDiv.style.border = '1px dashed black';116 noticeDiv.style.backgroundColor = '#ffc1c1';117 noticeDiv.style.MozBoxShadow = '0 0 5px #999';118 noticeDiv.style.WebkitBoxShadow = '0 0 5px #999';119 noticeDiv.style.boxShadow = '0 0 5px #999';120 noticeDiv.style.padding = '2px';121 noticeDiv.innerHTML = 'Zoom goes right and down';122 document.body.appendChild(noticeDiv);123 // Reposition the warning124 noticeDiv.style.top = canvasCoords[1] + startCoords[1] - noticeDiv.offsetHeight + 'px';125 noticeDiv.style.left = canvasCoords[0] + startCoords[0] - (noticeDiv.offsetWidth / 2) + 'px';126 noticeDiv.style.width = noticeDiv.offsetWidth + 'px';127 128 setTimeout(function () {noticeDiv.style.opacity = 0.8;}, 2100);129 setTimeout(function () {noticeDiv.style.opacity = 0.6;}, 2200);130 setTimeout(function () {noticeDiv.style.opacity = 0.4;}, 2300);131 setTimeout(function () {noticeDiv.style.opacity = 0.2;}, 2400);132 setTimeout(function () {noticeDiv.style.display = 'none';}, 2500);133 setTimeout(function () {noticeDiv = null;}, 2600);134 }135 }136 }137 window.addEventListener('mousemove', window_onmousemove, false);138 RGraph.AddEventListener(canvas.id, 'window_mousemove', window_onmousemove);139 canvas.onmouseup = function (e)140 {141 RGraph.FixEventObject(e);142 var startCoords = RGraph.Registry.Get('chart.zoomed.area.mousedown');143 var coords = RGraph.getMouseXY(e);144 // Do the zooming here145 if (RGraph.Registry.Get('chart.zoomed.area.mousedown')) {146 //RGraph.Redraw();147 148 RGraph.Registry.Get('chart.zoomed.area.areadiv').style.display = 'none';149 RGraph.Registry.Get('chart.zoomed.area.areadiv').style.left = '-1000px';150 RGraph.Registry.Get('chart.zoomed.area.areadiv').style.top = '-1000px';151 RGraph.Registry.Set('chart.zoomed.area.areadiv', null);152 if (coords[0] < startCoords[0] || coords[1] < startCoords[1]) {153 RGraph.Registry.Set('chart.zoomed.area.mousedown', false);154 return;155 }156 var canvas = e.target;157 var obj = canvas.__object__;158 var context = obj.context;159 var canvasCoords = RGraph.getCanvasXY(e.target);160 var coords = RGraph.getMouseXY(e);161 var startCoords = RGraph.Registry.Get('chart.zoomed.area.mousedown');162 var startx = startCoords[0];163 var starty = startCoords[1];164 var endx = coords[0] - 15;165 var endy = coords[1] - 15;166 var width = Math.abs(endx - startx);167 var height = Math.abs(endy - starty);168 var factor = obj.Get('chart.zoom.factor') - 1;169 170 var img = document.createElement('IMG');171 img.src = canvas.toDataURL();172 img.style.position = 'relative';173 img.style.left = (factor + 1) * -1 * startx + 'px';174 img.style.top = (factor + 1) * -1 * starty + 'px';175 img.width = (factor + 1) * canvas.width;176 img.height = (factor + 1) * canvas.height;177 var div = document.createElement('DIV');178 div.__object__ = obj;179 div.className = 'RGraph_zoomed_area';180 div.style.position = 'absolute';181 div.style.backgroundColor = 'white';182 div.style.cursor = 'move';183 div.style.top = e.pageY + 'px';184 div.style.left = e.pageX + 'px';185 div.origWidth = width;186 div.origHeight = height;187 div.style.width = width + 'px';188 div.style.height = height + 'px';189 div.style.border = '1px solid black'; 190 div.style.boxShadow = '0 0 15px black';191 div.style.MozBoxShadow = '0 0 15px black';192 div.style.WebkitBoxShadow = '0 0 15px black';193 div.style.overflow = 'hidden';194 div.style.opacity = 0;195 div.style.zIndex = 99;196 197 document.body.appendChild(div);198 div.appendChild(img);199 /**200 * This facilitates expanding the zoomed area once visible (the double click)201 */202 div.ondblclick = function (event)203 {204 var event = RGraph.FixEventObject(event);205 var img = event.target;206 var div = event.target.parentNode;207 208 var current_width = div.offsetWidth209 var current_height = div.offsetHeight210 var target_width = img.offsetWidth;211 var target_height = img.offsetHeight;212 var diff_width = target_width - current_width;213 var diff_height = target_height - current_height;214 215 var img_offset_left = parseInt(img.offsetLeft);216 var img_offset_top = parseInt(img.offsetTop);217 218 // Global vars on purpose so the timers can access them219 __zoomed_div_style__ = div.style;220 __zoomed_img_style__ = img.style;221 222 setTimeout("__zoomed_div_style__.left = parseInt(__zoomed_div_style__.left) - " + (diff_width * 0.1) + " + 'px'", 50);223 setTimeout("__zoomed_div_style__.left = parseInt(__zoomed_div_style__.left) - " + (diff_width * 0.1) + " + 'px'", 100);224 setTimeout("__zoomed_div_style__.left = parseInt(__zoomed_div_style__.left) - " + (diff_width * 0.1) + " + 'px'", 150);225 setTimeout("__zoomed_div_style__.left = parseInt(__zoomed_div_style__.left) - " + (diff_width * 0.1) + " + 'px'", 200);226 setTimeout("__zoomed_div_style__.left = parseInt(__zoomed_div_style__.left) - " + (diff_width * 0.1) + " + 'px'", 250);227 228 setTimeout("__zoomed_div_style__.top = parseInt(__zoomed_div_style__.top) - " + (diff_height * 0.1) + " + 'px'", 50);229 setTimeout("__zoomed_div_style__.top = parseInt(__zoomed_div_style__.top) - " + (diff_height * 0.1) + " + 'px'", 100);230 setTimeout("__zoomed_div_style__.top = parseInt(__zoomed_div_style__.top) - " + (diff_height * 0.1) + " + 'px'", 150);231 setTimeout("__zoomed_div_style__.top = parseInt(__zoomed_div_style__.top) - " + (diff_height * 0.1) + " + 'px'", 200);232 setTimeout("__zoomed_div_style__.top = parseInt(__zoomed_div_style__.top) - " + (diff_height * 0.1) + " + 'px'", 250);233 234 setTimeout("__zoomed_div_style__.width = parseInt(__zoomed_div_style__.width) + " + (diff_width * 0.2) + " + 'px'", 50);235 setTimeout("__zoomed_div_style__.width = parseInt(__zoomed_div_style__.width) + " + (diff_width * 0.2) + " + 'px'", 100);236 setTimeout("__zoomed_div_style__.width = parseInt(__zoomed_div_style__.width) + " + (diff_width * 0.2) + " + 'px'", 150);237 setTimeout("__zoomed_div_style__.width = parseInt(__zoomed_div_style__.width) + " + (diff_width * 0.2) + " + 'px'", 200);238 setTimeout("__zoomed_div_style__.width = parseInt(__zoomed_div_style__.width) + " + (diff_width * 0.2) + " + 'px'", 250);239 240 setTimeout("__zoomed_div_style__.height = parseInt(__zoomed_div_style__.height) + " + (diff_height * 0.2) + " + 'px'", 50);241 setTimeout("__zoomed_div_style__.height = parseInt(__zoomed_div_style__.height) + " + (diff_height * 0.2) + " + 'px'", 100);242 setTimeout("__zoomed_div_style__.height = parseInt(__zoomed_div_style__.height) + " + (diff_height * 0.2) + " + 'px'", 150);243 setTimeout("__zoomed_div_style__.height = parseInt(__zoomed_div_style__.height) + " + (diff_height * 0.2) + " + 'px'", 200);244 setTimeout("__zoomed_div_style__.height = parseInt(__zoomed_div_style__.height) + " + (diff_height * 0.2) + " + 'px'", 250);245 246 // Move the image within the div247 setTimeout("__zoomed_img_style__.left = " + (img_offset_left * 0.8) + " + 'px'", 50);248 setTimeout("__zoomed_img_style__.left = " + (img_offset_left * 0.6) + " + 'px'", 100);249 setTimeout("__zoomed_img_style__.left = " + (img_offset_left * 0.4) + " + 'px'", 150);250 setTimeout("__zoomed_img_style__.left = " + (img_offset_left * 0.2) + " + 'px'", 200);251 setTimeout("__zoomed_img_style__.left = 0", 250);252 253 setTimeout("__zoomed_img_style__.top = " + (img_offset_top * 0.8) + " + 'px'", 50);254 setTimeout("__zoomed_img_style__.top = " + (img_offset_top * 0.6) + " + 'px'", 100);255 setTimeout("__zoomed_img_style__.top = " + (img_offset_top * 0.4) + " + 'px'", 150);256 setTimeout("__zoomed_img_style__.top = " + (img_offset_top * 0.2) + " + 'px'", 200);257 setTimeout("__zoomed_img_style__.top = 0", 250);258 259 div.ondblclick = null;260 }261 /**262 * Make the zoomed bit draggable263 */264 div.onmousedown = function (e)265 {266 e = RGraph.FixEventObject(e);267 268 var div = e.target.parentNode;269 var img = div.childNodes[0];270 271 if (e.button == 0 || e.button == 1 ) {272 273 div.__offsetx__ = e.offsetX + img.offsetLeft;274 div.__offsety__ = e.offsetY + img.offsetTop;275 276 RGraph.Registry.Set('chart.mousedown', div);277 RGraph.Registry.Set('chart.button', 0);278 279 } else {280 281 img.__startx__ = e.pageX;282 img.__starty__ = e.pageY;283 284 img.__originalx__ = img.offsetLeft;285 img.__originaly__ = img.offsetTop;286 RGraph.Registry.Set('chart.mousedown', img);287 RGraph.Registry.Set('chart.button', 2);288 289 /**290 * Don't show a context menu when the zoomed area is right-clicked on291 */292 window.oncontextmenu = function (e)293 {294 e = RGraph.FixEventObject(e);295 e.stopPropagation();296 297 // [18th July 2010] Is this reallly necessary?298 window.oncontextmenu = function (e)299 {300 return true;301 }302 303 return false;304 }305 }306 e.stopPropagation();307 return false;308 }309 310 window.onmouseup = function (e)311 {312 RGraph.Registry.Set('chart.mousedown', false);313 }314 315 window.onmousemove = function (e)316 {317 if (RGraph.Registry.Get('chart.mousedown') && RGraph.Registry.Get('chart.button') == 0) {318 319 var div = RGraph.Registry.Get('chart.mousedown');320 321 var x = e.pageX - div.__offsetx__;322 var y = e.pageY - div.__offsety__;323 324 div.style.left = x + 'px';325 div.style.top = y + 'px';326 } else if (RGraph.Registry.Get('chart.mousedown') && RGraph.Registry.Get('chart.button') == 2) {327 328 var img = RGraph.Registry.Get('chart.mousedown');329 330 var x = img.__originalx__ + e.pageX - img.__startx__;331 var y = img.__originaly__ + e.pageY - img.__starty__;332 333 img.style.left = x + 'px';334 img.style.top = y + 'px';335 }336 }337 // End dragging code338 var divs = RGraph.Registry.Get('chart.zoomed.area.divs');339 if (typeof(divs) == 'object') {340 divs.push(div);341 } else {342 RGraph.Registry.Set('chart.zoomed.area.divs', [div])343 }344 345 // Create the background346 var bg = document.createElement('DIV');347 bg.style.position = 'fixed'348 bg.style.zIndex = 98;349 bg.style.top = 0;350 bg.style.left = 0;351 bg.style.backgroundColor = '#999';352 bg.style.opacity = 0;353 bg.style.width = (screen.width + 100) + 'px';354 bg.style.height = (screen.height + 100) + 'px';355 document.body.appendChild(bg);356 357 bg.onclick = function (e)358 {359 div.style.display = 'none';360 bg.style.display = 'none';361 div = null;362 bg = null;363 }364 365 setTimeout(function (){div.style.opacity = 0.2;}, 50);366 setTimeout(function (){div.style.opacity = 0.4;}, 100);367 setTimeout(function (){div.style.opacity = 0.6;}, 150);368 setTimeout(function (){div.style.opacity = 0.8;}, 200);369 setTimeout(function (){div.style.opacity = 1.0;}, 250);370 371 setTimeout(function () {div.style.left = canvasCoords[0] + startx - (width * factor * 0.1) + 'px'}, 50);372 setTimeout(function () {div.style.left = canvasCoords[0] + startx - (width * factor * 0.2) + 'px'}, 100);373 setTimeout(function () {div.style.left = canvasCoords[0] + startx - (width * factor * 0.3) + 'px'}, 150);374 setTimeout(function () {div.style.left = canvasCoords[0] + startx - (width * factor * 0.4) + 'px'}, 200);375 setTimeout(function () {div.style.left = canvasCoords[0] + startx - (width * factor * 0.5) + 'px'}, 250);376 setTimeout(function () {div.style.top = canvasCoords[1] + starty - (height * factor * 0.1) + 'px'}, 50);377 setTimeout(function () {div.style.top = canvasCoords[1] + starty - (height * factor * 0.2) + 'px'}, 100);378 setTimeout(function () {div.style.top = canvasCoords[1] + starty - (height * factor * 0.3) + 'px'}, 150);379 setTimeout(function () {div.style.top = canvasCoords[1] + starty - (height * factor * 0.4) + 'px'}, 200);380 setTimeout(function () {div.style.top = canvasCoords[1] + starty - (height * factor * 0.5) + 'px'}, 250);381 setTimeout(function () {div.style.width = width + (width * factor * 0.2) + 'px'}, 50);382 setTimeout(function () {div.style.width = width + (width * factor * 0.4) + 'px'}, 100);383 setTimeout(function () {div.style.width = width + (width * factor * 0.6) + 'px'}, 150);384 setTimeout(function () {div.style.width = width + (width * factor * 0.8) + 'px'}, 200);385 setTimeout(function () {div.style.width = width + (width * factor * 1.0) + 'px'}, 250);386 387 setTimeout(function () {div.style.height = height + (height * factor * 0.2) + 'px'}, 50);388 setTimeout(function () {div.style.height = height + (height * factor * 0.4) + 'px'}, 100);389 setTimeout(function () {div.style.height = height + (height * factor * 0.6) + 'px'}, 150);390 setTimeout(function () {div.style.height = height + (height * factor * 0.8) + 'px'}, 200);391 setTimeout(function () {div.style.height = height + (height * factor * 1.0) + 'px'}, 250);392 setTimeout(function (){bg.style.opacity = 0.1;}, 50);393 setTimeout(function (){bg.style.opacity = 0.2;}, 100);394 setTimeout(function (){bg.style.opacity = 0.3;}, 150);395 setTimeout(function (){bg.style.opacity = 0.4;}, 200);396 setTimeout(function (){bg.style.opacity = 0.5;}, 250);397 RGraph.Registry.Set('chart.zoomed.area.bg', bg);398 RGraph.Registry.Set('chart.zoomed.area.img', img);399 RGraph.Registry.Set('chart.zoomed.area.div', div);400 RGraph.Registry.Set('chart.zoomed.area.mousedown', null);401 }402 /**403 * Fire the zoom event404 */405 RGraph.FireCustomEvent(obj, 'onzoom');406 }407 408 canvas.onmouseout = function (e)409 {410 RGraph.Registry.Set('chart.zoomed.area.areadiv', null);411 RGraph.Registry.Set('chart.zoomed.area.mousedown', null);412 RGraph.Registry.Set('chart.zoomed.area.div', null);413 }414 }415 }416 /**417 * This function sets up the zoom window if requested418 * 419 * @param obj object The graph object420 */421 RGraph.ShowZoomWindow = function (obj)422 {423 if (obj.Get('chart.zoom.mode') == 'thumbnail') {424 RGraph.ZoomWindow(obj.canvas);425 }426 if (obj.Get('chart.zoom.mode') == 'area') {427 RGraph.ZoomArea(obj);428 }429 }430 /**431 * Installs the evnt handler for the zoom window/THUMBNAIL432 */433 RGraph.ZoomWindow = function (canvas)434 {435 ZoomWindow_mousemove = function (e)436 {437 e = RGraph.FixEventObject(e);438 var obj = e.target.__object__;439 var canvas = obj.canvas;440 var context = obj.context;441 var coords = RGraph.getMouseXY(e);442 /**443 * Create the DIV444 */445 if (!RGraph.Registry.Get('chart.zoomed.div')) {446 var div = document.createElement('div');447 div.className = 'RGraph_zoom_window';448 div.style.width = obj.Get('chart.zoom.thumbnail.width') + 'px';449 div.style.height = obj.Get('chart.zoom.thumbnail.height') + 'px';450 div.style.position = 'absolute';451 div.style.overflow = 'hidden';452 div.style.backgroundColor = 'white';453 454 // Initially the zoomed layer should be off-screen455 div.style.left = '-1000px';456 div.style.top = '-1000px';457 // Should these be 0? No.458 div.style.borderRadius =459 div.style.MozBorderRadius =460 div.style.WebkitBorderRadius = '5px';461 if (obj.Get('chart.zoom.shadow')) {462 div.style.boxShadow = 463 div.style.MozBoxShadow = 464 div.style.WebkitBoxShadow = 'rgba(0,0,0,0.5) 0 0 15px';465 }466 //div.style.opacity = 0.2;467 div.__object__ = obj;468 document.body.appendChild(div);469 470 /**471 * Get the canvas as an image472 */473 var img = document.createElement('img');474 img.width = obj.canvas.width * obj.Get('chart.zoom.factor');475 img.height = obj.canvas.height * obj.Get('chart.zoom.factor');476 img.style.position = 'relative';477 img.style.backgroundColor = 'white';478 img.__object__ = obj;479 div.appendChild(img);480 RGraph.Registry.Set('chart.zoomed.div', div);481 RGraph.Registry.Set('chart.zoomed.img', img);482 483 // Fade the zoom in484 setTimeout("RGraph.Registry.Get('chart.zoomed.div').__object__.canvas.onmouseover()", 5);485 } else {486 div = RGraph.Registry.Get('chart.zoomed.div');487 img = RGraph.Registry.Get('chart.zoomed.img');488 }489 // Make sure the image is up-to-date490 img.src = canvas.toDataURL();491 492 /**493 * Ensure the div is visible494 */495 if (div && div.style.opacity < 1) {496 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 1", 400);497 }498 /**499 * Get the canvas x/y coords500 */501 var c = RGraph.getCanvasXY(obj.canvas);502 var x = c[0];503 var y = c[1];504 /**505 * Position the div and img506 */507 var offset = 7;508 if (obj.Get('chart.zoom.thumbnail.fixed')) {509 div.style.left = (x + obj.Get('chart.gutter.left') + 5) + 'px';510 div.style.top = (y + obj.Get('chart.gutter.top') + 5) + 'px';511 } else {512 div.style.left = (e.pageX - obj.Get('chart.zoom.thumbnail.width') - offset) + 'px';513 div.style.top = (e.pageY - obj.Get('chart.zoom.thumbnail.height') - offset) + 'px';514 }515 516 var l = (obj.Get('chart.zoom.thumbnail.width') / 2) - (coords[0] * obj.Get('chart.zoom.factor'));517 var t = (obj.Get('chart.zoom.thumbnail.height') / 2) - (coords[1] * obj.Get('chart.zoom.factor'));518 // More positioning519 img.style.left = (l + ((obj.Get('chart.zoom.thumbnail.width') / 2) * obj.Get('chart.zoom.factor'))) + 'px';520 img.style.top = (t + ((obj.Get('chart.zoom.thumbnail.height') / 2) * obj.Get('chart.zoom.factor'))) + 'px';521 522 if (obj.Get('chart.zoom.thumbnail.fixed')) {523 img.style.left = (l + (obj.Get('chart.zoom.factor'))) + 'px';524 img.style.top = (t + (obj.Get('chart.zoom.factor'))) + 'px';525 }526 527 /**528 * Fire the onzoom event529 */530 RGraph.FireCustomEvent(obj, 'onzoom');531 }532 533 /**534 * The onmouseover event. Evidently. Fades the zoom window in535 */536 ZoomWindow_mouseover = function (e)537 {538 var div = RGraph.Registry.Get('chart.zoomed.div');539 // ???540 if (!div) return;541 /**542 * Allow for fixed positioning543 */544 if (div && RGraph.Registry.Get('chart.zoomed.div').__object__.Get('chart.zoom.thumbnail.fixed')) {545 return546 }547 var obj = div.__object__;548 // Used for the enlargement animation549 var targetWidth = obj.Get('chart.zoom.thumbnail.width');550 var targetHeight = obj.Get('chart.zoom.thumbnail.height');551 div.style.width = 0;552 div.style.height = 0;553 if (obj.Get('chart.zoom.fade.in')) {554 555 RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.2;556 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.1", 25);557 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.2", 50);558 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.3", 75);559 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.4", 100);560 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.5", 125);561 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.6", 150);562 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.7", 175);563 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.8", 200);564 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.9", 225);565 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 1.0", 250);566 } else {567 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 1", 1);568 }569 // The enlargement animation frames570 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (1/10) ) + "px'", 25);571 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (2/10) ) + "px'", 50);572 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (3/10) ) + "px'", 75);573 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (4/10) ) + "px'", 100);574 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (5/10) ) + "px'", 125);575 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (6/10) ) + "px'", 150);576 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (7/10) ) + "px'", 175);577 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (8/10) ) + "px'", 200);578 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (9/10) ) + "px'", 225);579 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.width = '" + (targetWidth * (10/10) ) + "px'", 250);580 581 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (1/10) ) + "px'", 25);582 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (2/10) ) + "px'", 50);583 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (3/10) ) + "px'", 75);584 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (4/10) ) + "px'", 100);585 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (5/10) ) + "px'", 125);586 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (6/10) ) + "px'", 150);587 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (7/10) ) + "px'", 175);588 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (8/10) ) + "px'", 200);589 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (9/10) ) + "px'", 225);590 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.height = '" + (targetHeight * (10/10) ) + "px'", 250);591 }592 ZoomWindow_mouseout = function (e)593 {594 var div = RGraph.Registry.Get('chart.zoomed.div');595 if (div && div.__object__.Get('chart.zoom.fade.out') && !div.__object__.Get('chart.zoom.thumbnail.fixed')) {596 RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.8;597 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.6", 100);598 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.4", 200);599 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.2", 300);600 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0", 400);601 // Get rid of the zoom window602 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.left = '-400px'", 400);603 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.top = '-400px'", 400);604 605 } else if (!div.__object__.Get('chart.zoom.thumbnail.fixed')) {606 // Get rid of the zoom window607 if (RGraph.Registry.Get('chart.zoomed.div')) {608 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.left = '-400px'", 1);609 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.top = '-400px'", 41);610 }611 }612 }613 }614 /**615 * A zoom in function616 * 617 * @param e object The event object618 */619 RGraph.Zoom = function (e) {620 e = RGraph.FixEventObject(e);621 /**622 * Show the zoom window623 */624 //if ((e.target.__canvas__ && e.target.__canvas__.__object__.Get('chart.zoom.mode') == 'thumbnail') || (e.target.parentNode.__canvas__ && e.target.parentNode.__canvas__.__object__.Get('chart.zoom.mode') == 'thumbnail') ) {625 // return RGraph.ZoomWindow(e);626 //}627 if (e && e.target && e.target.__canvas__) {628 var canvas = e.target.__canvas__;629 /*******************************************************630 * This is here to facilitate zooming by just a single left click631 *******************************************************/632 } else if (e && e.target && e.target.__object__) {633 var canvas = e.target.__object__.canvas;634 e.stopPropagation(); // Hmmmm635 }636 // Fallback for MSIE9637 if (!canvas) {638 var registry_canvas = RGraph.Registry.Get('chart.contextmenu').__canvas__;639 if (registry_canvas) {640 var canvas = registry_canvas;641 }642 }643 var context = canvas.getContext('2d');644 var obj = canvas.__object__;645 var dataurl = canvas.toDataURL();646 var tmp = canvas;647 var coords = RGraph.getCanvasXY(canvas);648 var factor = obj.Get('chart.zoom.factor') - 1;649 var x = coords[0];650 var y = coords[1];651 var img = document.createElement('img');652 img.className = 'RGraph_zoomed_canvas';653 img.style.border = '3px solid gray';654 img.style.width = canvas.width + 'px';655 img.style.height = canvas.height + 'px';656 img.style.position = 'absolute';657 img.style.left = x + 'px';658 img.style.top = y + 'px';659 img.style.backgroundColor = obj.Get('chart.zoom.background.color');660 img.style.opacity = obj.Get('chart.zoom.fade.in') ? 0 : 1;661 img.style.zIndex = 99;662 img.src = dataurl;663 document.body.appendChild(img);664 //RGraph.Registry.Set('chart.zoomedimage', img);665 // Store the zoomed image in a global var - NOT the registry666 __zoomedimage__ = img;667 __zoomedimage__.obj = obj;668 // Image onclick should not hide the image669 img.onclick = function (e) {670 e = RGraph.FixEventObject(e);671 e.stopPropagation();672 return false;673 }674 setTimeout(function () { window.onclick = RGraph.HideZoomedCanvas; }, 1);675 var width = parseInt(canvas.width);676 var height = parseInt(canvas.height);677 var frames = obj.Get('chart.zoom.frames');678 var delay = obj.Get('chart.zoom.delay');679 // Increase the width over 10 frames - center680 if (obj.Get('chart.zoom.hdir') == 'center') {681 for (var i = 1; i <= frames; ++i) {682 var newWidth = width * factor * (i / frames) + width;683 var rightHandEdge = x + canvas.width;684 var newLeft = (x + (canvas.width / 2)) - (newWidth / 2);685 setTimeout("__zoomedimage__.style.width = '" + String(newWidth) + "px'; __zoomedimage__.style.left = '" + newLeft + "px'", i * delay);686 }687 // Left688 } else if (obj.Get('chart.zoom.hdir') == 'left') {689 for (var i = 1; i <= frames; ++i) {690 var newWidth = width * factor * (i / frames) + width;691 var rightHandEdge = x + canvas.width;692 var newLeft = rightHandEdge - newWidth;693 setTimeout("__zoomedimage__.style.width = '" + String(newWidth) + "px'; __zoomedimage__.style.left = '" + newLeft + "px'", i * delay);694 }695 // Right (default)696 } else {697 for (var i = 1; i <= frames; ++i) {698 var newWidth = width * factor * (i / frames) + width;699 setTimeout("__zoomedimage__.style.width = '" + String(newWidth) + "px'", i * delay);700 }701 }702 // Increase the height over 10 frames - up703 if (obj.Get('chart.zoom.vdir') == 'up') {704 for (var i = 1; i <= frames; ++i) {705 var newHeight = (height * factor * (i / frames)) + height;706 var bottomEdge = y + canvas.height;707 var newTop = bottomEdge - newHeight;708 setTimeout("__zoomedimage__.style.height = '" + String(newHeight) + "px'; __zoomedimage__.style.top = '" + newTop + "px'", i * delay);709 }710 // center711 } else if (obj.Get('chart.zoom.vdir') == 'center') {712 for (var i = 1; i <= frames; ++i) {713 var newHeight = (height * factor * (i / frames)) + height;714 var bottomEdge = (y + (canvas.height / 2)) + (newHeight / 2);715 var newTop = bottomEdge - newHeight;716 setTimeout("__zoomedimage__.style.height = '" + String(newHeight) + "px'; __zoomedimage__.style.top = '" + newTop + "px'", i * delay);717 }718 // Down (default719 } else {720 for (var i = 1; i <= frames; ++i) {721 setTimeout("__zoomedimage__.style.height = '" + String(height * factor * (i / frames) + height) + "px'", i * delay);722 }723 }724 // If enabled, increase the opactity over the requested number of frames725 if (obj.Get('chart.zoom.fade.in')) {726 for (var i = 1; i <= frames; ++i) {727 setTimeout("__zoomedimage__.style.opacity = " + Number(i / frames), i * (delay / 2));728 }729 }730 // If stipulated, produce a shadow731 if (obj.Get('chart.zoom.shadow')) {732 for (var i = 1; i <= frames; ++i) {733 setTimeout("__zoomedimage__.style.boxShadow = 'rgba(128,128,128," + Number(i / frames) / 2 + ") 0 0 15px'", i * delay);734 setTimeout("__zoomedimage__.style.MozBoxShadow = 'rgba(128,128,128," + Number(i / frames) / 2 + ") 0 0 15px'", i * delay);735 setTimeout("__zoomedimage__.style.WebkitBoxShadow = 'rgba(128,128,128," + Number(i / frames) / 2 + ") 0 0 15px'", i * delay);736 }737 }738 /**739 * The onmouseout event. Hides the zoom window. Fades the zoom out740 *741 canvas.onmouseout = function (e)742 {743 if (RGraph.Registry.Get('chart.zoomed.div') && RGraph.Registry.Get('chart.zoomed.div').__object__.Get('chart.zoom.fade.out')) {744 RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.8;745 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.6", 100);746 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.4", 200);747 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0.2", 300);748 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.opacity = 0", 400);749 // Get rid of the zoom window750 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.left = '-400px'", 400);751 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.top = '-400px'", 400);752 753 } else {754 // Get rid of the zoom window755 if (RGraph.Registry.Get('chart.zoomed.div')) {756 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.left = '-400px'", 1);757 setTimeout("RGraph.Registry.Get('chart.zoomed.div').style.top = '-400px'", 1);758 }759 }760 }761 */762 // The background763 if (obj.Get('chart.zoom.background')) {764 var div = document.createElement('DIV');765 div.style.backgroundColor = '#999';766 div.style.opacity = 0;767 div.style.position = 'fixed';768 div.style.top = 0;769 div.style.left = 0;770 div.style.width = (screen.width + 100) + 'px';771 div.style.height = (screen.height + 100) + 'px';772 div.style.zIndex = 98;773 // Hides the zoomed caboodle774 div.oncontextmenu = function (e) {775 return RGraph.HideZoomedCanvas(e);776 }777 // 30th July 2010 - Is this necessary?778 //for (var i=1; i<=frames; ++i) {779 // setTimeout('__zoomedbackground__.style.opacity = ' + Number(0.04 * i), i * delay);780 //781 // // MSIE doesn't support zoom782 // //setTimeout('__zoomedbackground__.style.filter = "progid:DXImageTransform.Microsoft.Shadow(color=#aaaaaa,direction=135); Alpha(opacity=10)"', 50);783 //}784 div.origHeight = div.style.height;785 document.body.appendChild(div);786 __zoomedbackground__ = div;787 // If the window is resized, hide the zoom788 //window.onresize = RGraph.HideZoomedCanvas;789 for (var i = 1; i <= frames; ++i) {790 setTimeout("__zoomedbackground__.style.opacity = " + (Number(i / frames) * 0.5), i * (delay / 2));791 }792 }793 /**794 * Fire the onzoom event795 */796 RGraph.FireCustomEvent(obj, 'onzoom');...
data.js
Source:data.js
...55 var nameCol = $('.ui-datatable-selectable:nth-child(' + rowNumber + ') td:nth-child(10)');56 var name = nameCol.find('span').html();57 nameCol.click();58 var phone;59 setTimeout(function () {60 phone = getPhoneNumber();61 if(phone) {62 newRow(name, phone);63 }64 }, 1000);65}66function getPhoneNumber () {67 var phoneNumber = false;68 $("table#ctatt tbody tr").each( function(i) {69 var row = $("table#ctatt tbody tr:nth-child(" + (i + 1) + ")");70 var cell = row.find('td:first-child span').html();71 if(cell == 'Telefon' || cell == 'Sender No' || cell == 'Receiver No' || cell == 'Alicinin Telefon Numarasi' || cell == 'Gondericinin Telefon Numarasi') {72 phoneNumber = row.find('td:last-child span').html();73 }74 });75 return phoneNumber;76}77function takeInfo() {78 namePhone(1);79 setTimeout(function () {80 namePhone(2);81 setTimeout(function () {82 namePhone(3);83 setTimeout(function () {84 namePhone(4);85 setTimeout(function () {86 namePhone(5);87 setTimeout(function () {88 namePhone(6);89 setTimeout(function () {90 namePhone(7);91 setTimeout(function () {92 namePhone(8);93 setTimeout(function () {94 namePhone(9);95 setTimeout(function () {96 namePhone(10);97 setTimeout(function () {98 namePhone(11);99 setTimeout(function () {100 namePhone(12);101 setTimeout(function () {102 namePhone(13);103 setTimeout(function () {104 namePhone(14);105 setTimeout(function () {106 namePhone(15);107 setTimeout(function () {108 namePhone(16);109 setTimeout(function () {110 namePhone(17);111 setTimeout(function () {112 namePhone(18);113 setTimeout(function () {114 namePhone(19);115 setTimeout(function () {116 namePhone(20);117 }, 1200);118 }, 1200);119 }, 1200);120 }, 1200);121 }, 1200);122 }, 1200);123 }, 1200);124 }, 1200);125 }, 1200);126 }, 1200);127 }, 1200);128 }, 1200);129 }, 1200);130 }, 1200);131 }, 1200);132 }, 1200);133 }, 1200);134 }, 1200);135 }, 1200);136}137//------------------------------------------------------------------------------------------138function take1000() {139 takeInfo();140 setTimeout(function () {141 $('.ui-paginator-next')[0].click();142 takeInfo();143 setTimeout(function () {144 $('.ui-paginator-next')[0].click();145 takeInfo();146 setTimeout(function () {147 $('.ui-paginator-next')[0].click();148 takeInfo();149 setTimeout(function () {150 $('.ui-paginator-next')[0].click();151 takeInfo();152 setTimeout(function () {153 $('.ui-paginator-next')[0].click();154 takeInfo();155 setTimeout(function () {156 $('.ui-paginator-next')[0].click();157 takeInfo();158 setTimeout(function () {159 $('.ui-paginator-next')[0].click();160 takeInfo();161 setTimeout(function () {162 $('.ui-paginator-next')[0].click();163 takeInfo();164 setTimeout(function () {165 $('.ui-paginator-next')[0].click();166 takeInfo();167 setTimeout(function () {168 $('.ui-paginator-next')[0].click();169 takeInfo();170 setTimeout(function () {171 $('.ui-paginator-next')[0].click();172 takeInfo();173 setTimeout(function () {174 $('.ui-paginator-next')[0].click();175 takeInfo();176 setTimeout(function () {177 $('.ui-paginator-next')[0].click();178 takeInfo();179 setTimeout(function () {180 $('.ui-paginator-next')[0].click();181 takeInfo();182 setTimeout(function () {183 $('.ui-paginator-next')[0].click();184 takeInfo();185 setTimeout(function () {186 $('.ui-paginator-next')[0].click();187 takeInfo();188 setTimeout(function () {189 $('.ui-paginator-next')[0].click();190 takeInfo();191 setTimeout(function () {192 $('.ui-paginator-next')[0].click();193 takeInfo();194 setTimeout(function () {195 $('.ui-paginator-next')[0].click();196 takeInfo();197 setTimeout(function () {198 $('.ui-paginator-next')[0].click();199 takeInfo();200 setTimeout(function () {201 $('.ui-paginator-next')[0].click();202 takeInfo();203 setTimeout(function () {204 $('.ui-paginator-next')[0].click();205 takeInfo();206 setTimeout(function () {207 $('.ui-paginator-next')[0].click();208 takeInfo();209 setTimeout(function () {210 $('.ui-paginator-next')[0].click();211 takeInfo();212 setTimeout(function () {213 $('.ui-paginator-next')[0].click();214 takeInfo();215 setTimeout(function () {216 $('.ui-paginator-next')[0].click();217 takeInfo();218 setTimeout(function () {219 $('.ui-paginator-next')[0].click();220 takeInfo();221 setTimeout(function () {222 $('.ui-paginator-next')[0].click();223 takeInfo();224 setTimeout(function () {225 $('.ui-paginator-next')[0].click();226 takeInfo();227 setTimeout(function () {228 $('.ui-paginator-next')[0].click();229 takeInfo();230 setTimeout(function () {231 $('.ui-paginator-next')[0].click();232 takeInfo();233 setTimeout(function () {234 $('.ui-paginator-next')[0].click();235 takeInfo();236 setTimeout(function () {237 $('.ui-paginator-next')[0].click();238 takeInfo();239 setTimeout(function () {240 $('.ui-paginator-next')[0].click();241 takeInfo();242 setTimeout(function () {243 $('.ui-paginator-next')[0].click();244 takeInfo();245 setTimeout(function () {246 $('.ui-paginator-next')[0].click();247 takeInfo();248 setTimeout(function () {249 $('.ui-paginator-next')[0].click();250 takeInfo();251 setTimeout(function () {252 $('.ui-paginator-next')[0].click();253 takeInfo();254 setTimeout(function () {255 $('.ui-paginator-next')[0].click();256 takeInfo();257 setTimeout(function () {258 $('.ui-paginator-next')[0].click();259 takeInfo();260 setTimeout(function () {261 $('.ui-paginator-next')[0].click();262 takeInfo();263 setTimeout(function () {264 $('.ui-paginator-next')[0].click();265 takeInfo();266 setTimeout(function () {267 $('.ui-paginator-next')[0].click();268 takeInfo();269 setTimeout(function () {270 $('.ui-paginator-next')[0].click();271 takeInfo();272 setTimeout(function () {273 $('.ui-paginator-next')[0].click();274 takeInfo();275 setTimeout(function () {276 $('.ui-paginator-next')[0].click();277 takeInfo();278 setTimeout(function () {279 $('.ui-paginator-next')[0].click();280 takeInfo();281 setTimeout(function () {282 $('.ui-paginator-next')[0].click();283 takeInfo();284 setTimeout(function () {285 $('.ui-paginator-next')[0].click();286 takeInfo();287 }, 35000);288 }, 35000);289 }, 35000);290 }, 35000);291 }, 35000);292 }, 35000);293 }, 35000);294 }, 35000);295 }, 35000);296 }, 35000);297 }, 35000);298 }, 35000);...
dice.js
Source:dice.js
...3 var sides = '4';4 var dSides = 4;5 var plus1 = 5;6 // This section is to give the illusion of the dice rolling7 setTimeout(function () {8 diceSound.play();9 var i;10 for (i = 1; i < plus1; i++) {11 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);12 }13 var num = Math.floor(Math.random() * dSides + 1);14 $('#dice' + sides).addClass('df-d' + sides + '-' + num);15 }, 250);16 setTimeout(function () {17 var i;18 for (i = 1; i < plus1; i++) {19 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);20 }21 var num = Math.floor(Math.random() * dSides + 1);22 $('#dice' + sides).addClass('df-d' + sides + '-' + num);23 }, 340);24 setTimeout(function () {25 var i;26 for (i = 1; i < plus1; i++) {27 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);28 }29 var num = Math.floor(Math.random() * dSides + 1);30 $('#dice' + sides).addClass('df-d' + sides + '-' + num);31 }, 490);32 setTimeout(function () {33 var i;34 for (i = 1; i < plus1; i++) {35 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);36 }37 var num = Math.floor(Math.random() * dSides + 1);38 $('#dice' + sides).addClass('df-d' + sides + '-' + num);39 }, 690);40 setTimeout(function () {41 var i;42 for (i = 1; i < plus1; i++) {43 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);44 }45 var num = Math.floor(Math.random() * dSides + 1);46 $('#dice' + sides).addClass('df-d' + sides + '-' + num);47 }, 800);48 setTimeout(function () {49 var i;50 for (i = 1; i < plus1; i++) {51 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);52 }53 var num = Math.floor(Math.random() * dSides + 1);54 $('#dice' + sides).addClass('df-d' + sides + '-' + num);55 }, 950);56});57$('#dice6').on('click', function () {58 var sides = '6';59 var dSides = 6;60 var plus1 = 7;61 // This section is to give the illusion of the dice rolling62 setTimeout(function () {63 diceSound.play();64 var i;65 for (i = 1; i < plus1; i++) {66 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);67 }68 var num = Math.floor(Math.random() * dSides + 1);69 $('#dice' + sides).addClass('df-d' + sides + '-' + num);70 }, 250);71 setTimeout(function () {72 var i;73 for (i = 1; i < plus1; i++) {74 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);75 }76 var num = Math.floor(Math.random() * dSides + 1);77 $('#dice' + sides).addClass('df-d' + sides + '-' + num);78 }, 300);79 setTimeout(function () {80 var i;81 for (i = 1; i < plus1; i++) {82 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);83 }84 var num = Math.floor(Math.random() * dSides + 1);85 $('#dice' + sides).addClass('df-d' + sides + '-' + num);86 }, 385);87 setTimeout(function () {88 var i;89 for (i = 1; i < plus1; i++) {90 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);91 }92 var num = Math.floor(Math.random() * dSides + 1);93 $('#dice' + sides).addClass('df-d' + sides + '-' + num);94 }, 492);95 setTimeout(function () {96 var i;97 for (i = 1; i < plus1; i++) {98 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);99 }100 var num = Math.floor(Math.random() * dSides + 1);101 $('#dice' + sides).addClass('df-d' + sides + '-' + num);102 }, 705);103 setTimeout(function () {104 var i;105 for (i = 1; i < plus1; i++) {106 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);107 }108 var num = Math.floor(Math.random() * dSides + 1);109 $('#dice' + sides).addClass('df-d' + sides + '-' + num);110 }, 805);111 setTimeout(function () {112 var i;113 for (i = 1; i < plus1; i++) {114 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);115 }116 var num = Math.floor(Math.random() * dSides + 1);117 $('#dice' + sides).addClass('df-d' + sides + '-' + num);118 }, 950);119});120$('#dice8').on('click', function () {121 var sides = '8';122 var dSides = 8;123 var plus1 = 9;124 // This section is to give the illusion of the dice rolling125 setTimeout(function () {126 diceSound.play();127 var i;128 for (i = 1; i < plus1; i++) {129 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);130 }131 var num = Math.floor(Math.random() * dSides + 1);132 $('#dice' + sides).addClass('df-d' + sides + '-' + num);133 }, 250);134 setTimeout(function () {135 var i;136 for (i = 1; i < plus1; i++) {137 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);138 }139 var num = Math.floor(Math.random() * dSides + 1);140 $('#dice' + sides).addClass('df-d' + sides + '-' + num);141 }, 339);142 setTimeout(function () {143 var i;144 for (i = 1; i < plus1; i++) {145 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);146 }147 var num = Math.floor(Math.random() * dSides + 1);148 $('#dice' + sides).addClass('df-d' + sides + '-' + num);149 }, 489);150 setTimeout(function () {151 var i;152 for (i = 1; i < plus1; i++) {153 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);154 }155 var num = Math.floor(Math.random() * dSides + 1);156 $('#dice' + sides).addClass('df-d' + sides + '-' + num);157 }, 700);158 setTimeout(function () {159 var i;160 for (i = 1; i < plus1; i++) {161 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);162 }163 var num = Math.floor(Math.random() * dSides + 1);164 $('#dice' + sides).addClass('df-d' + sides + '-' + num);165 }, 800);166 setTimeout(function () {167 var i;168 for (i = 1; i < plus1; i++) {169 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);170 }171 var num = Math.floor(Math.random() * dSides + 1);172 $('#dice' + sides).addClass('df-d' + sides + '-' + num);173 }, 950);174});175$('#dice10').on('click', function () {176 var sides = '10';177 var dSides = 10;178 var plus1 = 11;179 // This section is to give the illusion of the dice rolling180 setTimeout(function () {181 diceSound.play();182 var i;183 for (i = 1; i < plus1; i++) {184 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);185 }186 var num = Math.floor(Math.random() * dSides + 1);187 $('#dice' + sides).addClass('df-d' + sides + '-' + num);188 }, 250);189 setTimeout(function () {190 var i;191 for (i = 1; i < plus1; i++) {192 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);193 }194 var num = Math.floor(Math.random() * dSides + 1);195 $('#dice' + sides).addClass('df-d' + sides + '-' + num);196 }, 339);197 setTimeout(function () {198 var i;199 for (i = 1; i < plus1; i++) {200 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);201 }202 var num = Math.floor(Math.random() * dSides + 1);203 $('#dice' + sides).addClass('df-d' + sides + '-' + num);204 }, 489);205 setTimeout(function () {206 var i;207 for (i = 1; i < plus1; i++) {208 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);209 }210 var num = Math.floor(Math.random() * dSides + 1);211 $('#dice' + sides).addClass('df-d' + sides + '-' + num);212 }, 700);213 setTimeout(function () {214 var i;215 for (i = 1; i < plus1; i++) {216 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);217 }218 var num = Math.floor(Math.random() * dSides + 1);219 $('#dice' + sides).addClass('df-d' + sides + '-' + num);220 }, 800);221 setTimeout(function () {222 var i;223 for (i = 1; i < plus1; i++) {224 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);225 }226 var num = Math.floor(Math.random() * dSides + 1);227 $('#dice' + sides).addClass('df-d' + sides + '-' + num);228 }, 950);229});230$('#dice12').on('click', function () {231 var sides = '12';232 var dSides = 12;233 var plus1 = 13;234 // This section is to give the illusion of the dice rolling235 setTimeout(function () {236 diceSound.play();237 var i;238 for (i = 1; i < plus1; i++) {239 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);240 }241 var num = Math.floor(Math.random() * dSides + 1);242 $('#dice' + sides).addClass('df-d' + sides + '-' + num);243 }, 250);244 setTimeout(function () {245 var i;246 for (i = 1; i < plus1; i++) {247 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);248 }249 var num = Math.floor(Math.random() * dSides + 1);250 $('#dice' + sides).addClass('df-d' + sides + '-' + num);251 }, 339);252 setTimeout(function () {253 var i;254 for (i = 1; i < plus1; i++) {255 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);256 }257 var num = Math.floor(Math.random() * dSides + 1);258 $('#dice' + sides).addClass('df-d' + sides + '-' + num);259 }, 489);260 setTimeout(function () {261 var i;262 for (i = 1; i < plus1; i++) {263 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);264 }265 var num = Math.floor(Math.random() * dSides + 1);266 $('#dice' + sides).addClass('df-d' + sides + '-' + num);267 }, 700);268 setTimeout(function () {269 var i;270 for (i = 1; i < plus1; i++) {271 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);272 }273 var num = Math.floor(Math.random() * dSides + 1);274 $('#dice' + sides).addClass('df-d' + sides + '-' + num);275 }, 800);276 setTimeout(function () {277 var i;278 for (i = 1; i < plus1; i++) {279 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);280 }281 var num = Math.floor(Math.random() * dSides + 1);282 $('#dice' + sides).addClass('df-d' + sides + '-' + num);283 }, 950);284});285$('#dice20').on('click', function () {286 var sides = '20';287 var dSides = 20;288 var plus1 = 21;289 // This section is to give the illusion of the dice rolling290 setTimeout(function () {291 diceSound.play();292 var i;293 for (i = 1; i < plus1; i++) {294 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);295 }296 var num = Math.floor(Math.random() * dSides + 1);297 $('#dice' + sides).addClass('df-d' + sides + '-' + num);298 }, 250);299 setTimeout(function () {300 var i;301 for (i = 1; i < plus1; i++) {302 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);303 }304 var num = Math.floor(Math.random() * dSides + 1);305 $('#dice' + sides).addClass('df-d' + sides + '-' + num);306 }, 339);307 setTimeout(function () {308 var i;309 for (i = 1; i < plus1; i++) {310 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);311 }312 var num = Math.floor(Math.random() * dSides + 1);313 $('#dice' + sides).addClass('df-d' + sides + '-' + num);314 }, 489);315 setTimeout(function () {316 var i;317 for (i = 1; i < plus1; i++) {318 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);319 }320 var num = Math.floor(Math.random() * dSides + 1);321 $('#dice' + sides).addClass('df-d' + sides + '-' + num);322 }, 700);323 setTimeout(function () {324 var i;325 for (i = 1; i < plus1; i++) {326 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);327 }328 var num = Math.floor(Math.random() * dSides + 1);329 $('#dice' + sides).addClass('df-d' + sides + '-' + num);330 }, 800);331 setTimeout(function () {332 var i;333 for (i = 1; i < plus1; i++) {334 $('#dice' + sides).removeClass('df-d' + sides + '-' + i);335 }336 var num = Math.floor(Math.random() * dSides + 1);337 $('#dice' + sides).addClass('df-d' + sides + '-' + num);338 }, 950);339});340$('#diceup4').on('click', function () {341 var sides = '4';342 var dSides = 4;343 var plus1 = 5;344 // This section is to give the illusion of the dice rolling345 setTimeout(function () {346 diceSound.play();347 var i;348 for (i = 1; i < plus1; i++) {349 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);350 }351 var num = Math.floor(Math.random() * dSides + 1);352 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);353 }, 250);354 setTimeout(function () {355 var i;356 for (i = 1; i < plus1; i++) {357 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);358 }359 var num = Math.floor(Math.random() * dSides + 1);360 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);361 }, 340);362 setTimeout(function () {363 var i;364 for (i = 1; i < plus1; i++) {365 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);366 }367 var num = Math.floor(Math.random() * dSides + 1);368 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);369 }, 490);370 setTimeout(function () {371 var i;372 for (i = 1; i < plus1; i++) {373 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);374 }375 var num = Math.floor(Math.random() * dSides + 1);376 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);377 }, 690);378 setTimeout(function () {379 var i;380 for (i = 1; i < plus1; i++) {381 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);382 }383 var num = Math.floor(Math.random() * dSides + 1);384 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);385 }, 800);386 setTimeout(function () {387 var i;388 for (i = 1; i < plus1; i++) {389 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);390 }391 var num = Math.floor(Math.random() * dSides + 1);392 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);393 }, 950);394});395$('#diceup6').on('click', function () {396 var sides = '6';397 var dSides = 6;398 var plus1 = 7;399 // This section is to give the illusion of the dice rolling400 setTimeout(function () {401 diceSound.play();402 var i;403 for (i = 1; i < plus1; i++) {404 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);405 }406 var num = Math.floor(Math.random() * dSides + 1);407 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);408 }, 250);409 setTimeout(function () {410 var i;411 for (i = 1; i < plus1; i++) {412 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);413 }414 var num = Math.floor(Math.random() * dSides + 1);415 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);416 }, 300);417 setTimeout(function () {418 var i;419 for (i = 1; i < plus1; i++) {420 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);421 }422 var num = Math.floor(Math.random() * dSides + 1);423 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);424 }, 385);425 setTimeout(function () {426 var i;427 for (i = 1; i < plus1; i++) {428 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);429 }430 var num = Math.floor(Math.random() * dSides + 1);431 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);432 }, 492);433 setTimeout(function () {434 var i;435 for (i = 1; i < plus1; i++) {436 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);437 }438 var num = Math.floor(Math.random() * dSides + 1);439 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);440 }, 705);441 setTimeout(function () {442 var i;443 for (i = 1; i < plus1; i++) {444 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);445 }446 var num = Math.floor(Math.random() * dSides + 1);447 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);448 }, 805);449 setTimeout(function () {450 var i;451 for (i = 1; i < plus1; i++) {452 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);453 }454 var num = Math.floor(Math.random() * dSides + 1);455 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);456 }, 950);457});458$('#diceup8').on('click', function () {459 var sides = '8';460 var dSides = 8;461 var plus1 = 9;462 // This section is to give the illusion of the dice rolling463 setTimeout(function () {464 diceSound.play();465 var i;466 for (i = 1; i < plus1; i++) {467 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);468 }469 var num = Math.floor(Math.random() * dSides + 1);470 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);471 }, 250);472 setTimeout(function () {473 var i;474 for (i = 1; i < plus1; i++) {475 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);476 }477 var num = Math.floor(Math.random() * dSides + 1);478 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);479 }, 339);480 setTimeout(function () {481 var i;482 for (i = 1; i < plus1; i++) {483 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);484 }485 var num = Math.floor(Math.random() * dSides + 1);486 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);487 }, 489);488 setTimeout(function () {489 var i;490 for (i = 1; i < plus1; i++) {491 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);492 }493 var num = Math.floor(Math.random() * dSides + 1);494 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);495 }, 700);496 setTimeout(function () {497 var i;498 for (i = 1; i < plus1; i++) {499 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);500 }501 var num = Math.floor(Math.random() * dSides + 1);502 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);503 }, 800);504 setTimeout(function () {505 var i;506 for (i = 1; i < plus1; i++) {507 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);508 }509 var num = Math.floor(Math.random() * dSides + 1);510 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);511 }, 950);512});513$('#diceup10').on('click', function () {514 var sides = '10';515 var dSides = 10;516 var plus1 = 11;517 // This section is to give the illusion of the dice rolling518 setTimeout(function () {519 diceSound.play();520 var i;521 for (i = 1; i < plus1; i++) {522 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);523 }524 var num = Math.floor(Math.random() * dSides + 1);525 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);526 }, 250);527 setTimeout(function () {528 var i;529 for (i = 1; i < plus1; i++) {530 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);531 }532 var num = Math.floor(Math.random() * dSides + 1);533 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);534 }, 339);535 setTimeout(function () {536 var i;537 for (i = 1; i < plus1; i++) {538 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);539 }540 var num = Math.floor(Math.random() * dSides + 1);541 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);542 }, 489);543 setTimeout(function () {544 var i;545 for (i = 1; i < plus1; i++) {546 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);547 }548 var num = Math.floor(Math.random() * dSides + 1);549 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);550 }, 700);551 setTimeout(function () {552 var i;553 for (i = 1; i < plus1; i++) {554 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);555 }556 var num = Math.floor(Math.random() * dSides + 1);557 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);558 }, 800);559 setTimeout(function () {560 var i;561 for (i = 1; i < plus1; i++) {562 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);563 }564 var num = Math.floor(Math.random() * dSides + 1);565 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);566 }, 950);567});568$('#diceup12').on('click', function () {569 var sides = '12';570 var dSides = 12;571 var plus1 = 13;572 // This section is to give the illusion of the dice rolling573 setTimeout(function () {574 diceSound.play();575 var i;576 for (i = 1; i < plus1; i++) {577 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);578 }579 var num = Math.floor(Math.random() * dSides + 1);580 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);581 }, 250);582 setTimeout(function () {583 var i;584 for (i = 1; i < plus1; i++) {585 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);586 }587 var num = Math.floor(Math.random() * dSides + 1);588 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);589 }, 339);590 setTimeout(function () {591 var i;592 for (i = 1; i < plus1; i++) {593 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);594 }595 var num = Math.floor(Math.random() * dSides + 1);596 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);597 }, 489);598 setTimeout(function () {599 var i;600 for (i = 1; i < plus1; i++) {601 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);602 }603 var num = Math.floor(Math.random() * dSides + 1);604 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);605 }, 700);606 setTimeout(function () {607 var i;608 for (i = 1; i < plus1; i++) {609 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);610 }611 var num = Math.floor(Math.random() * dSides + 1);612 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);613 }, 800);614 setTimeout(function () {615 var i;616 for (i = 1; i < plus1; i++) {617 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);618 }619 var num = Math.floor(Math.random() * dSides + 1);620 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);621 }, 950);622});623$('#diceup20').on('click', function () {624 var sides = '20';625 var dSides = 20;626 var plus1 = 21;627 // This section is to give the illusion of the dice rolling628 setTimeout(function () {629 diceSound.play();630 var i;631 for (i = 1; i < plus1; i++) {632 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);633 }634 var num = Math.floor(Math.random() * dSides + 1);635 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);636 }, 250);637 setTimeout(function () {638 var i;639 for (i = 1; i < plus1; i++) {640 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);641 }642 var num = Math.floor(Math.random() * dSides + 1);643 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);644 }, 339);645 setTimeout(function () {646 var i;647 for (i = 1; i < plus1; i++) {648 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);649 }650 var num = Math.floor(Math.random() * dSides + 1);651 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);652 }, 489);653 setTimeout(function () {654 var i;655 for (i = 1; i < plus1; i++) {656 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);657 }658 var num = Math.floor(Math.random() * dSides + 1);659 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);660 }, 700);661 setTimeout(function () {662 var i;663 for (i = 1; i < plus1; i++) {664 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);665 }666 var num = Math.floor(Math.random() * dSides + 1);667 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);668 }, 800);669 setTimeout(function () {670 var i;671 for (i = 1; i < plus1; i++) {672 $('#diceup' + sides).removeClass('df-d' + sides + '-' + i);673 }674 var num = Math.floor(Math.random() * dSides + 1);675 $('#diceup' + sides).addClass('df-d' + sides + '-' + num);676 }, 950);...
scam.js
Source:scam.js
...10 if (match[1] === '') {11 return await message.sendMessage(Lang.SCAM_NOTFOUND);12 } else if (match[1] === 'typing') {13 await message.client.updatePresence(message.jid,Presence.composing)14 await new Promise(r => setTimeout(r, 10000));15 await message.client.updatePresence(message.jid,Presence.composing)16 await new Promise(r => setTimeout(r, 10000));17 await message.client.updatePresence(message.jid,Presence.composing)18 await new Promise(r => setTimeout(r, 10000));19 await message.client.updatePresence(message.jid,Presence.composing)20 await new Promise(r => setTimeout(r, 10000));21 await message.client.updatePresence(message.jid,Presence.composing)22 await new Promise(r => setTimeout(r, 10000));23 await message.client.updatePresence(message.jid,Presence.composing)24 await new Promise(r => setTimeout(r, 10000));25 await message.client.updatePresence(message.jid,Presence.composing)26 await new Promise(r => setTimeout(r, 10000));27 await message.client.updatePresence(message.jid,Presence.composing)28 await new Promise(r => setTimeout(r, 10000));29 await message.client.updatePresence(message.jid,Presence.composing)30 await new Promise(r => setTimeout(r, 10000));31 await message.client.updatePresence(message.jid,Presence.composing)32 await new Promise(r => setTimeout(r, 10000));33 await message.client.updatePresence(message.jid,Presence.composing)34 await new Promise(r => setTimeout(r, 10000));35 await message.client.updatePresence(message.jid,Presence.composing)36 await new Promise(r => setTimeout(r, 10000));37 await message.client.updatePresence(message.jid,Presence.composing)38 await new Promise(r => setTimeout(r, 10000));39 await message.client.updatePresence(message.jid,Presence.composing)40 await new Promise(r => setTimeout(r, 10000));41 await message.client.updatePresence(message.jid,Presence.composing)42 await new Promise(r => setTimeout(r, 10000));43 await message.client.updatePresence(message.jid,Presence.composing)44 await new Promise(r => setTimeout(r, 10000));45 await message.client.updatePresence(message.jid,Presence.composing)46 await new Promise(r => setTimeout(r, 10000));47 await message.client.updatePresence(message.jid,Presence.composing)48 await new Promise(r => setTimeout(r, 10000));49 await message.client.updatePresence(message.jid,Presence.composing)50 await new Promise(r => setTimeout(r, 10000));51 await message.client.updatePresence(message.jid,Presence.composing)52 await new Promise(r => setTimeout(r, 10000));53 await message.client.updatePresence(message.jid,Presence.composing)54 await new Promise(r => setTimeout(r, 10000));55 await message.client.updatePresence(message.jid,Presence.composing)56 await new Promise(r => setTimeout(r, 10000));57 await message.client.updatePresence(message.jid,Presence.composing)58 await new Promise(r => setTimeout(r, 10000));59 await message.client.updatePresence(message.jid,Presence.composing)60 await new Promise(r => setTimeout(r, 10000));61 await message.client.updatePresence(message.jid,Presence.composing)62 await new Promise(r => setTimeout(r, 10000));63 await message.client.updatePresence(message.jid,Presence.composing)64 await message.client.updatePresence(message.jid,Presence.composing)65 await new Promise(r => setTimeout(r, 10000));66 await message.client.updatePresence(message.jid,Presence.composing)67 await new Promise(r => setTimeout(r, 10000));68 await message.client.updatePresence(message.jid,Presence.composing)69 await new Promise(r => setTimeout(r, 10000));70 await message.client.updatePresence(message.jid,Presence.composing)71 await new Promise(r => setTimeout(r, 10000));72 await message.client.updatePresence(message.jid,Presence.composing)73 await new Promise(r => setTimeout(r, 10000));74 await message.client.updatePresence(message.jid,Presence.composing)75 await new Promise(r => setTimeout(r, 10000));76 await message.client.updatePresence(message.jid,Presence.composing)77 await new Promise(r => setTimeout(r, 10000));78 await message.client.updatePresence(message.jid,Presence.composing)79 await new Promise(r => setTimeout(r, 10000));80 await message.client.updatePresence(message.jid,Presence.composing)81 await new Promise(r => setTimeout(r, 10000));82 await message.client.updatePresence(message.jid,Presence.composing)83 await new Promise(r => setTimeout(r, 10000));84 await message.client.updatePresence(message.jid,Presence.composing)85 await new Promise(r => setTimeout(r, 10000));86 await message.client.updatePresence(message.jid,Presence.composing)87 await new Promise(r => setTimeout(r, 10000));88 await message.client.updatePresence(message.jid,Presence.composing)89 await new Promise(r => setTimeout(r, 10000));90 await message.client.updatePresence(message.jid,Presence.composing)91 await new Promise(r => setTimeout(r, 10000));92 await message.client.updatePresence(message.jid,Presence.composing)93 await new Promise(r => setTimeout(r, 10000));94 await message.client.updatePresence(message.jid,Presence.composing)95 await new Promise(r => setTimeout(r, 10000));96 await message.client.updatePresence(message.jid,Presence.composing)97 await new Promise(r => setTimeout(r, 10000));98 await message.client.updatePresence(message.jid,Presence.composing)99 await new Promise(r => setTimeout(r, 10000));100 await message.client.updatePresence(message.jid,Presence.composing)101 await new Promise(r => setTimeout(r, 10000));102 await message.client.updatePresence(message.jid,Presence.composing)103 await new Promise(r => setTimeout(r, 10000));104 await message.client.updatePresence(message.jid,Presence.composing)105 await new Promise(r => setTimeout(r, 10000));106 await message.client.updatePresence(message.jid,Presence.composing)107 await new Promise(r => setTimeout(r, 10000));108 await message.client.updatePresence(message.jid,Presence.composing)109 await new Promise(r => setTimeout(r, 10000));110 await message.client.updatePresence(message.jid,Presence.composing)111 await new Promise(r => setTimeout(r, 10000));112 await message.client.updatePresence(message.jid,Presence.composing)113 await new Promise(r => setTimeout(r, 10000));114 await message.client.updatePresence(message.jid,Presence.composing)115 } else if (match[1] === 'online') {116 await message.client.updatePresence(message.jid,Presence.available)117 await new Promise(r => setTimeout(r, 10000));118 await message.client.updatePresence(message.jid,Presence.available)119 await new Promise(r => setTimeout(r, 10000));120 await message.client.updatePresence(message.jid,Presence.available)121 await new Promise(r => setTimeout(r, 10000));122 await message.client.updatePresence(message.jid,Presence.available)123 await new Promise(r => setTimeout(r, 10000));124 await message.client.updatePresence(message.jid,Presence.available)125 await new Promise(r => setTimeout(r, 10000));126 await message.client.updatePresence(message.jid,Presence.available)127 await new Promise(r => setTimeout(r, 10000));128 await message.client.updatePresence(message.jid,Presence.available)129 await new Promise(r => setTimeout(r, 10000));130 await message.client.updatePresence(message.jid,Presence.available)131 await new Promise(r => setTimeout(r, 10000));132 await message.client.updatePresence(message.jid,Presence.available)133 await new Promise(r => setTimeout(r, 10000));134 await message.client.updatePresence(message.jid,Presence.available)135 await new Promise(r => setTimeout(r, 10000));136 await message.client.updatePresence(message.jid,Presence.available)137 await new Promise(r => setTimeout(r, 10000));138 await message.client.updatePresence(message.jid,Presence.available)139 await new Promise(r => setTimeout(r, 10000));140 await message.client.updatePresence(message.jid,Presence.available)141 await new Promise(r => setTimeout(r, 10000));142 await message.client.updatePresence(message.jid,Presence.available)143 await new Promise(r => setTimeout(r, 10000));144 await message.client.updatePresence(message.jid,Presence.available)145 await new Promise(r => setTimeout(r, 10000));146 await message.client.updatePresence(message.jid,Presence.available)147 await new Promise(r => setTimeout(r, 10000));148 await message.client.updatePresence(message.jid,Presence.available)149 await new Promise(r => setTimeout(r, 10000));150 await message.client.updatePresence(message.jid,Presence.available)151 await new Promise(r => setTimeout(r, 10000));152 await message.client.updatePresence(message.jid,Presence.available)153 await new Promise(r => setTimeout(r, 10000));154 await message.client.updatePresence(message.jid,Presence.available)155 await new Promise(r => setTimeout(r, 10000));156 await message.client.updatePresence(message.jid,Presence.available)157 await new Promise(r => setTimeout(r, 10000));158 await message.client.updatePresence(message.jid,Presence.available)159 await new Promise(r => setTimeout(r, 10000));160 await message.client.updatePresence(message.jid,Presence.available)161 await new Promise(r => setTimeout(r, 10000));162 await message.client.updatePresence(message.jid,Presence.available)163 await new Promise(r => setTimeout(r, 10000));164 await message.client.updatePresence(message.jid,Presence.available)165 await new Promise(r => setTimeout(r, 10000));166 await message.client.updatePresence(message.jid,Presence.available)167 await message.client.updatePresence(message.jid,Presence.available)168 await new Promise(r => setTimeout(r, 10000));169 await message.client.updatePresence(message.jid,Presence.available)170 await new Promise(r => setTimeout(r, 10000));171 await message.client.updatePresence(message.jid,Presence.available)172 await new Promise(r => setTimeout(r, 10000));173 await message.client.updatePresence(message.jid,Presence.available)174 await new Promise(r => setTimeout(r, 10000));175 await message.client.updatePresence(message.jid,Presence.available)176 await new Promise(r => setTimeout(r, 10000));177 await message.client.updatePresence(message.jid,Presence.available)178 await new Promise(r => setTimeout(r, 10000));179 await message.client.updatePresence(message.jid,Presence.available)180 await new Promise(r => setTimeout(r, 10000));181 await message.client.updatePresence(message.jid,Presence.available)182 await new Promise(r => setTimeout(r, 10000));183 await message.client.updatePresence(message.jid,Presence.available)184 await new Promise(r => setTimeout(r, 10000));185 await message.client.updatePresence(message.jid,Presence.available)186 await new Promise(r => setTimeout(r, 10000));187 await message.client.updatePresence(message.jid,Presence.available)188 await new Promise(r => setTimeout(r, 10000));189 await message.client.updatePresence(message.jid,Presence.available)190 await new Promise(r => setTimeout(r, 10000));191 await message.client.updatePresence(message.jid,Presence.available)192 await new Promise(r => setTimeout(r, 10000));193 await message.client.updatePresence(message.jid,Presence.available)194 await new Promise(r => setTimeout(r, 10000));195 await message.client.updatePresence(message.jid,Presence.available)196 await new Promise(r => setTimeout(r, 10000));197 await message.client.updatePresence(message.jid,Presence.available)198 await new Promise(r => setTimeout(r, 10000));199 await message.client.updatePresence(message.jid,Presence.available)200 await new Promise(r => setTimeout(r, 10000));201 await message.client.updatePresence(message.jid,Presence.available)202 await new Promise(r => setTimeout(r, 10000));203 await message.client.updatePresence(message.jid,Presence.available)204 await new Promise(r => setTimeout(r, 10000));205 await message.client.updatePresence(message.jid,Presence.available)206 await new Promise(r => setTimeout(r, 10000));207 await message.client.updatePresence(message.jid,Presence.available)208 await new Promise(r => setTimeout(r, 10000));209 await message.client.updatePresence(message.jid,Presence.available)210 await new Promise(r => setTimeout(r, 10000));211 await message.client.updatePresence(message.jid,Presence.available)212 await new Promise(r => setTimeout(r, 10000));213 await message.client.updatePresence(message.jid,Presence.available)214 await new Promise(r => setTimeout(r, 10000));215 await message.client.updatePresence(message.jid,Presence.available)216 await new Promise(r => setTimeout(r, 10000));217 await message.client.updatePresence(message.jid,Presence.available)218 } else if (match[1] === 'recording') {219 await message.client.updatePresence(message.jid,Presence.recording)220 await new Promise(r => setTimeout(r, 10000));221 await message.client.updatePresence(message.jid,Presence.recording)222 await new Promise(r => setTimeout(r, 10000));223 await message.client.updatePresence(message.jid,Presence.recording)224 await new Promise(r => setTimeout(r, 10000));225 await message.client.updatePresence(message.jid,Presence.recording)226 await new Promise(r => setTimeout(r, 10000));227 await message.client.updatePresence(message.jid,Presence.recording)228 await new Promise(r => setTimeout(r, 10000));229 await message.client.updatePresence(message.jid,Presence.recording)230 await new Promise(r => setTimeout(r, 10000));231 await message.client.updatePresence(message.jid,Presence.recording)232 await new Promise(r => setTimeout(r, 10000));233 await message.client.updatePresence(message.jid,Presence.recording)234 await new Promise(r => setTimeout(r, 10000));235 await message.client.updatePresence(message.jid,Presence.recording)236 await new Promise(r => setTimeout(r, 10000));237 await message.client.updatePresence(message.jid,Presence.recording)238 await new Promise(r => setTimeout(r, 10000));239 await message.client.updatePresence(message.jid,Presence.recording)240 await new Promise(r => setTimeout(r, 10000));241 await message.client.updatePresence(message.jid,Presence.recording)242 await new Promise(r => setTimeout(r, 10000));243 await message.client.updatePresence(message.jid,Presence.recording)244 await new Promise(r => setTimeout(r, 10000));245 await message.client.updatePresence(message.jid,Presence.recording)246 await new Promise(r => setTimeout(r, 10000));247 await message.client.updatePresence(message.jid,Presence.recording)248 await new Promise(r => setTimeout(r, 10000));249 await message.client.updatePresence(message.jid,Presence.recording)250 await new Promise(r => setTimeout(r, 10000));251 await message.client.updatePresence(message.jid,Presence.recording)252 await new Promise(r => setTimeout(r, 10000));253 await message.client.updatePresence(message.jid,Presence.recording)254 await new Promise(r => setTimeout(r, 10000));255 await message.client.updatePresence(message.jid,Presence.recording)256 await new Promise(r => setTimeout(r, 10000));257 await message.client.updatePresence(message.jid,Presence.recording)258 await new Promise(r => setTimeout(r, 10000));259 await message.client.updatePresence(message.jid,Presence.recording)260 await new Promise(r => setTimeout(r, 10000));261 await message.client.updatePresence(message.jid,Presence.recording)262 await new Promise(r => setTimeout(r, 10000));263 await message.client.updatePresence(message.jid,Presence.recording)264 await new Promise(r => setTimeout(r, 10000));265 await message.client.updatePresence(message.jid,Presence.recording)266 await new Promise(r => setTimeout(r, 10000));267 await message.client.updatePresence(message.jid,Presence.recording)268 await new Promise(r => setTimeout(r, 10000));269 await message.client.updatePresence(message.jid,Presence.recording)270 await message.client.updatePresence(message.jid,Presence.recording)271 await new Promise(r => setTimeout(r, 10000));272 await message.client.updatePresence(message.jid,Presence.recording)273 await new Promise(r => setTimeout(r, 10000));274 await message.client.updatePresence(message.jid,Presence.recording)275 await new Promise(r => setTimeout(r, 10000));276 await message.client.updatePresence(message.jid,Presence.recording)277 await new Promise(r => setTimeout(r, 10000));278 await message.client.updatePresence(message.jid,Presence.recording)279 await new Promise(r => setTimeout(r, 10000));280 await message.client.updatePresence(message.jid,Presence.recording)281 await new Promise(r => setTimeout(r, 10000));282 await message.client.updatePresence(message.jid,Presence.recording)283 await new Promise(r => setTimeout(r, 10000));284 await message.client.updatePresence(message.jid,Presence.recording)285 await new Promise(r => setTimeout(r, 10000));286 await message.client.updatePresence(message.jid,Presence.recording)287 await new Promise(r => setTimeout(r, 10000));288 await message.client.updatePresence(message.jid,Presence.recording)289 await new Promise(r => setTimeout(r, 10000));290 await message.client.updatePresence(message.jid,Presence.recording)291 await new Promise(r => setTimeout(r, 10000));292 await message.client.updatePresence(message.jid,Presence.recording)293 await new Promise(r => setTimeout(r, 10000));294 await message.client.updatePresence(message.jid,Presence.recording)295 await new Promise(r => setTimeout(r, 10000));296 await message.client.updatePresence(message.jid,Presence.recording)297 await new Promise(r => setTimeout(r, 10000));298 await message.client.updatePresence(message.jid,Presence.recording)299 await new Promise(r => setTimeout(r, 10000));300 await message.client.updatePresence(message.jid,Presence.recording)301 await new Promise(r => setTimeout(r, 10000));302 await message.client.updatePresence(message.jid,Presence.recording)303 await new Promise(r => setTimeout(r, 10000));304 await message.client.updatePresence(message.jid,Presence.recording)305 await new Promise(r => setTimeout(r, 10000));306 await message.client.updatePresence(message.jid,Presence.recording)307 await new Promise(r => setTimeout(r, 10000));308 await message.client.updatePresence(message.jid,Presence.recording)309 await new Promise(r => setTimeout(r, 10000));310 await message.client.updatePresence(message.jid,Presence.recording)311 await new Promise(r => setTimeout(r, 10000));312 await message.client.updatePresence(message.jid,Presence.recording)313 await new Promise(r => setTimeout(r, 10000));314 await message.client.updatePresence(message.jid,Presence.recording)315 await new Promise(r => setTimeout(r, 10000));316 await message.client.updatePresence(message.jid,Presence.recording)317 await new Promise(r => setTimeout(r, 10000));318 await message.client.updatePresence(message.jid,Presence.recording)319 await new Promise(r => setTimeout(r, 10000));320 await message.client.updatePresence(message.jid,Presence.recording)321 } else if (match[1] === 'stop') {322 return await message.client.updatePresence(message.jid,Presence.paused)323 } else {324 await message.sendMessage(Lang.SCAM_NULL);325 }...
main.js
Source:main.js
...3//Ðам необÑ
Ñдно ÑинÑ
ÑонÑзÑваÑи вÑÑ ÑÐ²Ð¾Ñ Ð´ÑÑ Ð·Ð° Ð´Ð¾Ð¿Ð¾Ð¼Ð¾Ð³Ð¾Ñ Ð¿ÑомÑÑÑв Ñа async await (Ðод Ð¼Ð°Ñ Ð±ÑÑи напиÑаний окÑемо)4// ÐаÑÑимка Ð¼Ð°Ñ Ð±ÑÑи ÐРв поÑÑÐ´ÐºÑ Ð·ÑоÑÑаннÑ, а бÑÐ´Ñ Ñка. ÐÑи ÑÐ¾Ð¼Ñ Ð²Ð°ÑÑ Ð´ÑÑ Ð¼Ð°ÑÑÑ Ð±ÑÑи ÑинÑ
ÑонÑзованÑ.5// Ðапиклад. // ÐÑикнÑÑиÑÑ - 0.3Ñ // ÐоÑнÑдаÑи - 1Ñ // ÐÑÑи в дÑÑ - 0.5Ñ // ÐоÑекаÑиÑÑ Ð°Ð²ÑобÑÑ - 3Ñ // ÐообÑдаÑи - 1Ñ // // Ð Ñак далÑ6// //callback-17// setTimeout(bow = () => {8// console.log('wake up');9// setTimeout(10// function breakfast() {11// console.log('have a breakfast');12// setTimeout(function coffee() {13// console.log('drink coffee');14// setTimeout(function car() {15// console.log('go to the gob');16// setTimeout(function job() {17// console.log('do my job good');18// setTimeout(function dinner() {19// console.log('have a dinner');20// setTimeout(function study() {21// console.log('learning');22// setTimeout(function () {23// console.log('do my homework');24// setTimeout(function shower() {25// console.log('have a shower');26// setTimeout(function reading() {27// console.log('read some book');28// setTimeout(function sleep() {29// console.log('go to sleep');30// }, 200);31// }, 100);32// }, 900);33// }, 800);34// }, 1000);35// }, 2000);36// }, 600);37// }, 400);38// }, 100);39// }, 50);40// }, 1300);41// //callback-242// let wakeUp = (callback) => {43// setTimeout(() => {44// console.log('wake up');45// callback();46// }, 300);47// };48// let breakfast = (callback) => {49// setTimeout(() => {50// console.log('have a breakfast');51// callback();52// }, 700);53// };54// let reading = (callback) => {55// setTimeout(() => {56// console.log('read some books');57// callback();58// }, 420);59//60// };61// let shower = (callback) => {62// setTimeout(() => {63// console.log('have a shower');64// callback();65// }, 890);66//67// };68// let learning = (callback) => {69// setTimeout(() => {70// console.log('learning');71// callback();72// }, 230);73//74// };75// let car = (callback) => {76// setTimeout(() => {77// console.log('go to the job on my car');78// callback();79// }, 510);80//81// };82// let coffee = (callback) => {83// setTimeout(() => {84// console.log('drink coffee');85// callback();86// }, 700);87//88// };89// let sleep = () => {90// setTimeout(() => {91// console.log('go to sleep');92// }, 2000);93//94// };95// let homework = (callback) => {96// setTimeout(() => {97// console.log('do my homework');98// callback();99// }, 1000);100//101// };102// let job = (callback) => {103// setTimeout(() => {104// console.log('do my job good');105// callback();106// }, 560);107//108// };109// wakeUp(() => {110// shower(() => {111// coffee(() => {112// breakfast(() => {113// car(() => {114// job(() => {115// homework(() => {116// learning(() => {117// reading(() => {118// sleep()119// });120// });121// });122// });123// });124// });125// });126// });127// });128// //promise129// let wakeUp = () => {130// return new Promise((resolve, reject) => {131// setTimeout(() => {132// resolve('i wake up');133// reject('sleep more');134// }, 300);135// });136// };137// let breakfast = () => {138// return new Promise((resolve, reject) => {139// setTimeout(() => {140// resolve('i have a breakfast');141// reject('time is not to have breakfast');142// }, 700);143// })144// };145// let reading = () => {146// return new Promise((resolve, reject) => {147// setTimeout(() => {148// resolve('read some books');149// reject('not now');150// }, 420)151// });152// };153// let shower = () => {154// return new Promise((resolve, reject) => {155// setTimeout(() => {156// resolve('have a shower');157// reject('not now');158// }, 890);159// });160//161// };162// let learning = () => {163// return new Promise((resolve, reject) => {164// setTimeout(() => {165// resolve('have a shower');166// reject('not now');167// }, 230)168// })169// };170// let sleep = () => {171// return new Promise((resolve, reject) => {172// setTimeout(() => {173// resolve('go to sleep');174// reject('work more');175// }, 200);176// });177// };178// let drive = () => {179// return new Promise((resolve, reject) => {180// setTimeout(() => {181// resolve('i go to work in my car');182// reject('not now');183// }, 450);184// })185// };186// let coffee = () => {187// return new Promise((resolve, reject) => {188// setTimeout(() => {189// resolve('i drink coffee');190// reject('not now');191// }, 700)192// });193// };194// let job = () => {195// return new Promise((resolve, reject) => {196// setTimeout(() => {197// resolve('do my job good');198// reject('not now');199// }, 2200);200// });201// };202// let homework = () => {203// return new Promise((resolve, reject) => {204// setTimeout(() => {205// resolve('do my homework');206// reject('not now');207// }, 1230);208// });209// };210//211//212// wakeUp(true)213// .then(resolve => {214// console.log(resolve);215// return shower();216// })217// .then(bathe => {218// console.log(bathe);219// return coffee();220// })221// .then(drink => {222// console.log(drink);223// return breakfast();224// })225// .then(eat => {226// console.log(eat);227// return drive();228// })229// .then(go => {230// console.log(go);231// return job();232// })233// .then(doing => {234// console.log(doing);235// return shower();236// })237// .then(more => {238// console.log(more);239// return homework();240// })241// .then(tack => {242// console.log(tack);243// return learning();244// })245// .then(learn => {246// console.log(learn);247// return reading();248// })249// .then(read => {250// console.log(read);251// return sleep();252// })253// .then(sleeping => {254// console.log(sleeping)255// })256// .catch(e => {257// console.error(e);258// })259// //async await260// let wakeUp = () => {261// return new Promise((resolve, reject) => {262// setTimeout(() => {263// resolve('i wake up');264// reject('sleep more');265// }, 300);266// });267// };268// let breakfast = () => {269// return new Promise((resolve, reject) => {270// setTimeout(() => {271// resolve('i have a breakfast');272// reject('time is not to have breakfast');273// }, 700);274// })275// };276// let reading = () => {277// return new Promise((resolve, reject) => {278// setTimeout(() => {279// resolve('read some books');280// reject('not now');281// }, 420)282// });283// };284// let shower = () => {285// return new Promise((resolve, reject) => {286// setTimeout(() => {287// resolve('have a shower');288// reject('not now');289// }, 890);290// });291//292// };293// let learning = () => {294// return new Promise((resolve, reject) => {295// setTimeout(() => {296// resolve('have a shower');297// reject('not now');298// }, 230)299// })300// };301// let sleep = () => {302// return new Promise((resolve, reject) => {303// setTimeout(() => {304// resolve('go to sleep');305// reject('work more');306// }, 200);307// });308// };309// let drive = () => {310// return new Promise((resolve, reject) => {311// setTimeout(() => {312// resolve('i go to work in my car');313// reject('not now');314// }, 450);315// })316// };317// let coffee = () => {318// return new Promise((resolve, reject) => {319// setTimeout(() => {320// resolve('i drink coffee');321// reject('not now');322// }, 700)323// });324// };325// let job = () => {326// return new Promise((resolve, reject) => {327// setTimeout(() => {328// resolve('do my job good');329// reject('not now');330// }, 2200);331// });332// };333// let homework = () => {334// return new Promise((resolve, reject) => {335// setTimeout(() => {336// resolve('do my homework');337// reject('not now');338// }, 1230);339// });340// };341//342//343// async function day() {344// const first = await wakeUp(true);345// const second = await shower(true);346// const third = await coffee(true);347// const forth = await breakfast(true);348// const fifth = await drive(true);349// const sixth = await job(true);...
playsong3.js
Source:playsong3.js
1function playSong3(){2 var piano = Synth.createInstrument('piano');3 //measure 14 setTimeout(function(){piano.play("C",4,1)},0);5 setTimeout(function(){piano.play("E",4,1)},200);6 setTimeout(function(){piano.play("A",4,1)},400);7 setTimeout(function(){piano.play("C",4,2)},600);8 setTimeout(function(){piano.play("E",4,1)},1000);9 setTimeout(function(){piano.play("A",4,1)},1200);10 setTimeout(function(){piano.play("E",4,1)},1400);11 //measure 212 setTimeout(function(){piano.play("B",3,1)},1600);13 setTimeout(function(){piano.play("E",4,1)},1800);14 setTimeout(function(){piano.play("A",4,1)},2000);15 setTimeout(function(){piano.play("B",3,2)},2200);16 setTimeout(function(){piano.play("E",4,1)},2600);17 setTimeout(function(){piano.play("G",4,1)},2800);18 setTimeout(function(){piano.play("E",4,2)},3000);19 //measure 320 setTimeout(function(){piano.play("C",4,1)},3200);21 setTimeout(function(){piano.play("A",3,6)},3200);22 setTimeout(function(){piano.play("A",2,6)},3200);23 setTimeout(function(){piano.play("E",4,1)},3400);24 setTimeout(function(){piano.play("A",4,1)},3600);25 setTimeout(function(){piano.play("C",4,2)},3800);26 setTimeout(function(){piano.play("E",4,1)},4200);27 setTimeout(function(){piano.play("A",4,1)},4400);28 setTimeout(function(){piano.play("B",3,3)},4400);29 setTimeout(function(){piano.play("B",2,3)},4400);30 setTimeout(function(){piano.play("E",4,2)},4600);31 //measure 432 setTimeout(function(){piano.play("B",3,1)},4800);33 setTimeout(function(){piano.play("E",3,6)},4800);34 setTimeout(function(){piano.play("E",2,6)},4800);35 setTimeout(function(){piano.play("E",4,1)},5000);36 setTimeout(function(){piano.play("A",4,1)},5200);37 setTimeout(function(){piano.play("B",3,2)},5400);38 setTimeout(function(){piano.play("E",4,1)},5800);39 setTimeout(function(){piano.play("G",4,1)},6000);40 setTimeout(function(){piano.play("E",3,3)},6000);41 setTimeout(function(){piano.play("E",2,3)},6000);42 setTimeout(function(){piano.play("E",4,1)},6200);43 //measure 544 setTimeout(function(){piano.play("C",4,1)},6400);45 setTimeout(function(){piano.play("A",3,6)},6400);46 setTimeout(function(){piano.play("A",2,6)},6400);47 setTimeout(function(){piano.play("E",4,1)},6600);48 setTimeout(function(){piano.play("A",4,1)},6800);49 setTimeout(function(){piano.play("C",4,2)},7000);50 setTimeout(function(){piano.play("E",4,1)},7400);51 setTimeout(function(){piano.play("A",4,1)},7600);52 setTimeout(function(){piano.play("B",3,3)},7600);53 setTimeout(function(){piano.play("B",2,3)},7600);54 setTimeout(function(){piano.play("E",4,2)},7800);55 //measure 656 setTimeout(function(){piano.play("B",3,1)},8000);57 setTimeout(function(){piano.play("E",3,6)},8000);58 setTimeout(function(){piano.play("E",2,6)},8000);59 setTimeout(function(){piano.play("E",4,1)},8200);60 setTimeout(function(){piano.play("A",4,1)},8400);61 setTimeout(function(){piano.play("B",3,2)},8600);62 setTimeout(function(){piano.play("E",4,1)},9000);63 setTimeout(function(){piano.play("G",4,1)},9200);64 setTimeout(function(){piano.play("E",3,3)},9200);65 setTimeout(function(){piano.play("E",2,3)},9200);66 setTimeout(function(){piano.play("E",4,1)},9400);67 //measure 768 setTimeout(function(){piano.play("C",4,1)},9600);69 setTimeout(function(){piano.play("E",4,1)},9600);70 setTimeout(function(){piano.play("A",4,1)},9600);71 setTimeout(function(){piano.play("C",4,1)},9800);72 setTimeout(function(){piano.play("E",4,1)},9800);73 setTimeout(function(){piano.play("A",4,1)},9800);74 setTimeout(function(){piano.play("C",4,1)},10000);75 setTimeout(function(){piano.play("E",4,1)},10000);76 setTimeout(function(){piano.play("A",4,1)},10000);77 setTimeout(function(){piano.play("C",4,1)},10200);78 setTimeout(function(){piano.play("E",4,1)},10200);79 setTimeout(function(){piano.play("A",4,1)},10200);8081 setTimeout(function(){piano.play("C",4,1)},10400);82 setTimeout(function(){piano.play("E",4,1)},10400);83 setTimeout(function(){piano.play("A",4,1)},10400);84 setTimeout(function(){piano.play("C",4,1)},10600);85 setTimeout(function(){piano.play("E",4,1)},10600);86 setTimeout(function(){piano.play("A",4,1)},10600);87 setTimeout(function(){piano.play("C",4,1)},10800);88 setTimeout(function(){piano.play("E",4,1)},10800);89 setTimeout(function(){piano.play("A",4,1)},10800);90 setTimeout(function(){piano.play("C",4,1)},11000);91 setTimeout(function(){piano.play("E",4,1)},11000);92 setTimeout(function(){piano.play("A",4,1)},11000);9394 setTimeout(function(){piano.play("A",3,6)},9600);95 setTimeout(function(){piano.play("A",2,6)},9600);96 setTimeout(function(){piano.play("B",3,3)},10800);97 setTimeout(function(){piano.play("B",2,3)},10800);98 //measure 899 setTimeout(function(){piano.play("B",3,1)},11200);100 setTimeout(function(){piano.play("E",4,1)},11200);101 setTimeout(function(){piano.play("A",4,1)},11200);102 setTimeout(function(){piano.play("B",3,1)},11400);103 setTimeout(function(){piano.play("E",4,1)},11400);104 setTimeout(function(){piano.play("A",4,1)},11400);105 setTimeout(function(){piano.play("B",3,1)},11600);106 setTimeout(function(){piano.play("E",4,1)},11600);107 setTimeout(function(){piano.play("A",4,1)},11600);108109 setTimeout(function(){piano.play("B",3,1)},11800);110 setTimeout(function(){piano.play("E",4,1)},11800);111 setTimeout(function(){piano.play("G",4,1)},11800);112 setTimeout(function(){piano.play("B",3,1)},12000);113 setTimeout(function(){piano.play("E",4,1)},12000);114 setTimeout(function(){piano.play("G",4,1)},12000);115 setTimeout(function(){piano.play("B",3,1)},12200);116 setTimeout(function(){piano.play("E",4,1)},12200);117 setTimeout(function(){piano.play("G",4,1)},12200);118 setTimeout(function(){piano.play("B",3,1)},12400);119 setTimeout(function(){piano.play("E",4,1)},12400);120 setTimeout(function(){piano.play("G",4,1)},12400);121 setTimeout(function(){piano.play("B",3,1)},12600);122 setTimeout(function(){piano.play("E",4,1)},12600);123 setTimeout(function(){piano.play("G",4,1)},12600);124125 setTimeout(function(){piano.play("E",3,3)},11200);126 setTimeout(function(){piano.play("E",2,3)},11200);127 setTimeout(function(){piano.play("E",3,3)},12400);128 setTimeout(function(){piano.play("E",2,3)},12400);129 //measure 9130 setTimeout(function(){piano.play("C",4,1)},12600);131 setTimeout(function(){piano.play("E",4,1)},12600);132 setTimeout(function(){piano.play("A",4,1)},12600);133 setTimeout(function(){piano.play("C",4,1)},12800);134 setTimeout(function(){piano.play("E",4,1)},12800);135 setTimeout(function(){piano.play("A",4,1)},12800);136 setTimeout(function(){piano.play("C",4,1)},13000);137 setTimeout(function(){piano.play("E",4,1)},13000);138 setTimeout(function(){piano.play("A",4,1)},13000);139 setTimeout(function(){piano.play("C",4,1)},13200);140 setTimeout(function(){piano.play("E",4,1)},13200);141 setTimeout(function(){piano.play("A",4,1)},13200);142143 setTimeout(function(){piano.play("C",4,1)},13400);144 setTimeout(function(){piano.play("E",4,1)},13400);145 setTimeout(function(){piano.play("A",4,1)},13400);146 setTimeout(function(){piano.play("C",4,1)},13600);147 setTimeout(function(){piano.play("E",4,1)},13600);148 setTimeout(function(){piano.play("A",4,1)},13600);149 setTimeout(function(){piano.play("C",4,1)},13800);150 setTimeout(function(){piano.play("E",4,1)},13800);151 setTimeout(function(){piano.play("A",4,1)},13800);152 setTimeout(function(){piano.play("C",4,1)},14000);153 setTimeout(function(){piano.play("E",4,1)},14000);154 setTimeout(function(){piano.play("A",4,1)},14000);155156 setTimeout(function(){piano.play("A",3,6)},12600);157 setTimeout(function(){piano.play("A",2,6)},12600);158 setTimeout(function(){piano.play("B",3,3)},13800);159 setTimeout(function(){piano.play("B",2,3)},13800);160 //measure 10161 setTimeout(function(){piano.play("B",3,1)},14000);162 setTimeout(function(){piano.play("E",4,1)},14000);163 setTimeout(function(){piano.play("A",4,1)},14000);164 setTimeout(function(){piano.play("B",3,1)},14200);165 setTimeout(function(){piano.play("E",4,1)},14200);166 setTimeout(function(){piano.play("A",4,1)},14200);167 setTimeout(function(){piano.play("B",3,1)},14400);168 setTimeout(function(){piano.play("E",4,1)},14400);169 setTimeout(function(){piano.play("A",4,1)},14400);170171 setTimeout(function(){piano.play("B",3,1)},14600);172 setTimeout(function(){piano.play("E",4,1)},14600);173 setTimeout(function(){piano.play("G",4,1)},14600);174 setTimeout(function(){piano.play("B",3,1)},14800);175 setTimeout(function(){piano.play("E",4,1)},14800);176 setTimeout(function(){piano.play("G",4,1)},14800);177 setTimeout(function(){piano.play("B",3,1)},15000);178 setTimeout(function(){piano.play("E",4,1)},15000);179 setTimeout(function(){piano.play("G",4,1)},15000);180 setTimeout(function(){piano.play("B",3,1)},15200);181 setTimeout(function(){piano.play("E",4,1)},15200);182 setTimeout(function(){piano.play("G",4,1)},15200);183 setTimeout(function(){piano.play("B",3,1)},15400);184 setTimeout(function(){piano.play("E",4,1)},15400);185 setTimeout(function(){piano.play("G",4,1)},15400);186187 setTimeout(function(){piano.play("E",3,3)},14000);188 setTimeout(function(){piano.play("E",2,3)},14000);189 setTimeout(function(){piano.play("E",3,3)},15200);190 setTimeout(function(){piano.play("E",2,3)},15200);
...
home.js
Source:home.js
1let header = document.querySelector('.header');2let elem = document.querySelector('.elem');3setTimeout(() => header.style.opacity = '0', 1000);4setTimeout(() => header.style.opacity = '0.15', 1100);5setTimeout(() => header.style.opacity = '0.2', 1200);6setTimeout(() => header.style.opacity = '0.25', 1300);7setTimeout(() => header.style.opacity = '0.3', 1400);8setTimeout(() => header.style.opacity = '0.35', 1500);9setTimeout(() => header.style.opacity = '0.4', 1600);10setTimeout(() => header.style.opacity = '0.45', 1700);11setTimeout(() => header.style.opacity = '0.5', 1800);12setTimeout(() => header.style.opacity = '0.55', 1900);13setTimeout(() => header.style.opacity = '0.6', 2000);14setTimeout(() => header.style.opacity = '0.65', 2100);15setTimeout(() => header.style.opacity = '0.7', 2200);16setTimeout(() => header.style.opacity = '0.8', 2300);17setTimeout(() => header.style.opacity = '0.9', 2400);18setTimeout(() => header.style.opacity = '1', 2500);19setTimeout(() => header.style.opacity = '0.9', 6000);20setTimeout(() => header.style.opacity = '0.8', 6100);21setTimeout(() => header.style.opacity = '0.7', 6200);22setTimeout(() => header.style.opacity = '0.6', 6300);23setTimeout(() => header.style.opacity = '0.5', 6400);24setTimeout(() => header.style.opacity = '0.4', 6500);25setTimeout(() => header.style.opacity = '0.3', 6600);26setTimeout(() => header.style.opacity = '0.2', 6700);27setTimeout(() => header.style.opacity = '0.1', 6800);28setTimeout(() => header.style.opacity = '0', 6900);29setTimeout(() => header.style.display = 'none', 7000);30setTimeout(() => elem.style.display = 'block', 7500);31setTimeout(() => elem.style.opacity = '0.2', 7700);32setTimeout(() => elem.style.opacity = '0.3', 7800);33setTimeout(() => elem.style.opacity = '0.4', 7900);34setTimeout(() => elem.style.opacity = '0.5', 8000);35setTimeout(() => elem.style.opacity = '0.6', 8100);36setTimeout(() => elem.style.opacity = '0.7', 8200);37setTimeout(() => elem.style.opacity = '0.8', 8300);38setTimeout(() => elem.style.opacity = '0.9', 8400);...
animations.js
Source:animations.js
1$(document).ready(function() {23 setTimeout (function () {4 var $element = $('#news');5 $element.animate({ opacity: 0 },1000).animate({ opacity: 1},1000);6 $element.animate({ opacity: 0 },1000).animate({ opacity: 1},1000);7 $element.animate({ opacity: 0 },1000).animate({ opacity: 1},1000);8 },3000);910 var nextLocationAnimation = 'animated swing';1112 setTimeout (function () {13 $('#newsTicker').removeClass('hidden').addClass('animated bounceInRight')14 },1000);1516 setTimeout (function () {17 $('#nextLocation').addClass(nextLocationAnimation)18 },3000);1920 setTimeout (function () {21 $('#nextLocation').removeClass(nextLocationAnimation)22 },4000);2324 setTimeout (function () {25 $('#nextLocation').addClass(nextLocationAnimation)26 },4500);2728 setTimeout (function () {29 $('#nextLocation').removeClass(nextLocationAnimation)30 },5500);3132 setTimeout (function () {33 $('#nextLocation').addClass(nextLocationAnimation)34 },6000);3536 setTimeout (function () {37 $('#countdown-text').removeClass('hidden').addClass('animated bounceInLeft')38 },2000);3940 setTimeout (function () {41 $('#countdown-holder').addClass('animated swing')42 },3000);4344 setTimeout (function () {45 $('#countdown-holder').removeClass('animated swing')46 },4000);4748 setTimeout (function () {49 $('#countdown-holder').addClass('animated swing')50 },4500);5152 setTimeout (function () {53 $('#countdown-holder').removeClass('animated swing')54 },5500);5556 setTimeout (function () {57 $('#countdown-holder').addClass('animated swing')58 },6000);5960//countdown-holder6162 setTimeout (function () {63 $('#nextEvent').removeClass('animated wobble');64 },8000);6566 setTimeout (function () {67 $('#nextEvent').addClass('animated wobble');68 },8100);69
...
Using AI Code Generation
1var webdriverio = require('webdriverio');2var options = { desiredCapabilities: { browserName: 'chrome' } };3var client = webdriverio.remote(options);4 .init()5 .setValue('#lst-ib', 'webdriverio')6 .click('#tsbb')7 .getTitle().then(function(title) {8 console.log('Title was: ' + title);9 })10 .end()11 .call(done);12 .init()13 .setValue('#lst-ib', 'webdriverio')14 .click('#tsbb')15 .getTitle().then(function(title) {16 console.log('Title was: ' + title);17 })18 .end()19 .call(done);20 .init()21 .setValue('#lst-ib', 'webdriverio')22 .click('#tsbb')23 .getTitle().then(function(title) {24 console.log('Title was: ' + title);25 })26 .end()27 .call(done);28 .init()29 .setValue('#lst-ib', 'webdriverio')30 .click('#tsbb')31 .getTitle().then(function(title) {32 console.log('Title was: ' + title);33 })34 .end()35 .call(done);36 .init()37 .setValue('#lst-ib', 'webdriverio')38 .click('#tsbb')39 .getTitle().then(function(title) {40 console.log('Title was: ' + title);41 })42 .end()43 .call(done);44 .init()45 .setValue('#lst-ib', 'webdriverio')46 .click('#tsbb')47 .getTitle().then(function(title) {48 console.log('Title was: ' + title);49 })50 .end()51 .call(done);
Using AI Code Generation
1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 browser.pause(5000);4 const title = browser.getTitle();5 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');6 browser.pause(5000);7 });8});9describe('webdriver.io page', () => {10 it('should have the right title', () => {11 browser.waitUntil(() => {12 return browser.getTitle() === 'WebdriverIO · Next-gen browser and mobile automation test framework for Node.js'13 }, 5000, 'expected text to be different after 5s');14 });15});16describe('webdriver.io page', () => {17 it('should have the right title', () => {18 browser.waitForExist('.siteNav',5000);19 const title = browser.getTitle();20 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');21 });22});23describe('webdriver.io page', () => {24 it('should have the right title', () => {25 browser.waitForVisible('.siteNav',5000);26 const title = browser.getTitle();27 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');28 });29});30describe('webdriver.io page', () => {31 it('should have the right title', () => {32 browser.waitForEnabled('.siteNav',5000);33 const title = browser.getTitle();34 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');35 });36});37describe('webdriver.io page', () => {38 it('should have the right title', () => {39 browser.waitForText('.siteNav',5000);40 const title = browser.getTitle();41 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile
Using AI Code Generation
1const { remote } = require('webdriverio');2(async () => {3 const browser = await remote({4 capabilities: {5 }6 })7 await browser.setTimeout({ 'implicit': 5000 })8 await browser.deleteSession()9})().catch((e) => console.error(e))10const { remote } = require('webdriverio');11(async () => {12 const browser = await remote({13 capabilities: {14 }15 })16 await browser.pause(3000)17 await browser.deleteSession()18})().catch((e) => console.error(e))19const { remote } = require('webdriverio');20(async () => {21 const browser = await remote({22 capabilities: {23 }24 })25 await browser.waitUntil(async () => {26 return (await browser.getTitle()) === 'WebdriverIO · Next-gen browser and mobile automation test framework for Node.js'27 }, {28 })29 await browser.deleteSession()30})().catch((e) => console.error(e))31const { remote } = require('webdriverio');32(async () => {33 const browser = await remote({34 capabilities: {35 }36 })
Using AI Code Generation
1describe('My First Test', () => {2 it('should do something', () => {3 browser.pause(5000);4 });5});6describe('My First Test', () => {7 it('should do something', () => {8 browser.waitForExist('.siteNav', 5000);9 });10});11describe('My First Test', () => {12 it('should do something', () => {13 browser.waitUntil(() => {14 return browser.getText('.siteNav') === 'Documentation';15 }, 5000, 'expected text to be different after 5s');16 });17});18describe('My First Test', () => {19 it('should do something', () => {20 browser.waitUntil(() => {21 return browser.getText('.siteNav') === 'Documentation';22 }, 5000, 'expected text to be different after 5s');23 });24});25describe('My First Test', () => {26 it('should do something', () => {27 browser.waitUntil(() => {28 return browser.getText('.siteNav') === 'Documentation';29 }, 5000, 'expected text to be different after 5s');30 });31});32describe('My First Test', () => {33 it('should do something', () => {34 browser.waitUntil(() => {35 return browser.getText('.siteNav') === 'Documentation';36 }, 5000, 'expected text to be different after 5s');37 });38});39describe('My First Test', () => {40 it('should do something', () => {41 browser.waitUntil(() => {42 return browser.getText('.siteNav') === 'Documentation';43 }, 5000, 'expected text to be different after 5s');44 });45});
Using AI Code Generation
1browser.setTimeout({ 'implicit': 5000 });2browser.waitForExist('.myclass', 5000);3browser.waitForExist('.myclass', 5000, true);4browser.waitForVisible('.myclass', 5000);5browser.waitForVisible('.myclass', 5000, true);6browser.waitForText('.myclass', 5000);7browser.waitForText('.myclass', 5000, true);8browser.waitForSelected('.myclass', 5000);9browser.waitForSelected('.myclass', 5000, true);10browser.waitForEnabled('.myclass', 5000);11browser.waitForEnabled('.myclass', 5000, true);12browser.waitForValue('.myclass', 5000);13browser.waitForValue('.myclass', 5000, true);14browser.waitUntil(function() {15 return browser.getText('.myclass') === 'mytext';16}, 5000, 'expected text to be different after 5s');17browser.waitUntil(function() {18 return browser.getText('.myclass') === 'mytext';19}, 5000, 'expected text to be different after 5s');20browser.waitForExist('.myclass', 5000);21browser.waitForExist('.myclass', 5000, true);22browser.waitForVisible('.myclass', 5000);23browser.waitForVisible('.myclass', 5000, true);24browser.waitForText('.myclass', 5000);25browser.waitForText('.myclass', 5000, true);26browser.waitForSelected('.myclass', 5000);27browser.waitForSelected('.myclass', 5000, true);28browser.waitForEnabled('.myclass', 5000);29browser.waitForEnabled('.myclass', 5000,
Using AI Code Generation
1browser.pause(5000);2browser.waitForExist('h1', 5000);3browser.waitUntil(() => {4 return browser.getTitle() === 'W3Schools Online Web Tutorials';5}, 5000, 'expected text to be different after 5s');6browser.waitUntil(() => {7 return browser.getTitle() === 'W3Schools Online Web Tutorials';8}, 5000, 'expected text to be different after 5s');9browser.waitUntil(() => {10 return browser.getTitle() === 'W3Schools Online Web Tutorials';11}, 5000, 'expected text to be different after 5s');12browser.waitUntil(() => {13 return browser.getTitle() === 'W3Schools Online Web Tutorials';14}, 5000, 'expected text to be different after 5s');15browser.waitUntil(() => {16 return browser.getTitle() === 'W3Schools Online Web Tutorials';17}, 5000, 'expected text to be different after 5s');
Wondering what could be a next-gen browser and mobile test automation framework that is also simple and concise? Yes, that’s right, it's WebdriverIO. Since the setup is very easy to follow compared to Selenium testing configuration, you can configure the features manually thereby being the center of attraction for automation testing. Therefore the testers adopt WedriverIO to fulfill their needs of browser testing.
Learn to run automation testing with WebdriverIO tutorial. Go from a beginner to a professional automation test expert with LambdaTest WebdriverIO tutorial.
Running Your First Automation Script - Learn the steps involved to execute your first Test Automation Script using WebdriverIO since the setup is very easy to follow and the features can be configured manually.
Selenium Automation With WebdriverIO - Read more about automation testing with WebdriverIO and how it supports both browsers and mobile devices.
Browser Commands For Selenium Testing - Understand more about the barriers faced while working on your Selenium Automation Scripts in WebdriverIO, the ‘browser’ object and how to use them?
Handling Alerts & Overlay In Selenium - Learn different types of alerts faced during automation, how to handle these alerts and pops and also overlay modal in WebdriverIO.
How To Use Selenium Locators? - Understand how Webdriver uses selenium locators in a most unique way since having to choose web elements very carefully for script execution is very important to get stable test results.
Deep Selectors In Selenium WebdriverIO - The most popular automation testing framework that is extensively adopted by all the testers at a global level is WebdriverIO. Learn how you can use Deep Selectors in Selenium WebdriverIO.
Handling Dropdown In Selenium - Learn more about handling dropdowns and how it's important while performing automated browser testing.
Automated Monkey Testing with Selenium & WebdriverIO - Understand how you can leverage the amazing quality of WebdriverIO along with selenium framework to automate monkey testing of your website or web applications.
JavaScript Testing with Selenium and WebdriverIO - Speed up your Javascript testing with Selenium and WebdriverIO.
Cross Browser Testing With WebdriverIO - Learn more with this step-by-step tutorial about WebdriverIO framework and how cross-browser testing is done with WebdriverIO.
Get 100 minutes of automation test minutes FREE!!