Advertisement
BLOCKLY18

w95

Nov 17th, 2021
1,160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $_shutdown = function(){
  2.     $window.current.destroy();
  3.     $audio('boot').pause();
  4.     setTimeout(()=>{
  5.       le._dom.taskbar.classList.add('hide');
  6.       const _icons = document.querySelectorAll('.ui_icon');
  7.       _icons.forEach(function(x){
  8.         x.classList.add('hide');
  9.       });
  10.     },400);
  11.     setTimeout(()=>{
  12.       $audio("/c/files/sounds/shutdown.mp3").play();
  13.     },1000);
  14.     setTimeout(()=>{
  15.       le._dom.desktop.style.background = "#000 !important";
  16.       le._dom.desktop.style['background-color'] = "#000 !important";
  17.       le._dom.desktop.style['background-image'] = "#000 !important";
  18.       const nocursor = document.createElement('style');
  19.       nocursor.innerText = `.nocursor { cursor: none }`;
  20.       document.head.appendChild(nocursor);
  21.       le._dom.desktop.classList.add('nocursor');
  22.     },4300);
  23.     setTimeout(()=>{
  24.       document.body.innerHTML = "<div style='display: table;width: 100%;height: "+window.innerHeight+"px;text-align:center;'><p style='display:table-cell;vertical-align:middle;'>Please wait while your computer<br>shuts down.</p></div>";
  25.       document.body.style.color = "#fb7700";
  26.       document.body.style['font-size'] = "25px";
  27.       document.body.style.background = "#000";
  28.       document.body.style.cursor = "none";
  29.     },5300);
  30.     setTimeout(()=>{
  31.       document.body.innerHTML = "<div style='display: table;width: 100%;height: "+window.innerHeight+"px;text-align:center;'><p style='display:table-cell;vertical-align:middle;'>It's now safe to turn off<br>your computer.</p><br><p></p></div>";
  32.     },8200);
  33.   };
  34. $_reboot = function(){
  35.   location.reload();
  36. };
  37. $_rebootdos = function(){
  38.     $file.save('/a/boot/dosbox.js',`location.hash="!dosbox";setTimeout(()=>{$window.current.maximize();le._dom.taskbar.classList.add('hide');document.querySelector('.ui_window__head').classList.add('hide');$file.delete('/a/boot/dosbox.js')},4000)`);
  39.     setTimeout(()=>{location.reload()},500);
  40. };
  41.  
  42. le._apps.shutdown.exec = function(){
  43.   $confirm({
  44.     title: "Shut Down Windows",
  45.     msg: `<div style="text-align:left !important">Are you sure you want to:<br>
  46.     <button onclick="$_shutdown()"><u>S</u>hut down the computer?</button><br>
  47.     <button onclick="$_reboot()"><u>R</u>estart the computer?</button><br>
  48.     <button onclick="$_rebootdos()">Restart the computer in <u>M</u>S-DOS mode?</button></div>
  49.     `,
  50.     img: "/c/sys/skins/w93/shutdown.png",
  51.     btnCancel: "No",
  52.     btnOk: "",
  53.     animationIn: "",
  54.     animationOut: ""
  55.   });
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement