Skip to content

Instantly share code, notes, and snippets.

@pl4nty
Created February 5, 2018 08:42
Show Gist options
  • Save pl4nty/59a021fb3376d40fe705d685a6bffc89 to your computer and use it in GitHub Desktop.
Save pl4nty/59a021fb3376d40fe705d685a6bffc89 to your computer and use it in GitHub Desktop.
/*
A browser desktop environment written almost entirely in a single native JavaScript file.
All ~10000 lines are served with PHP from an AWS Cloud9 demo. It's actually quite a great project, the codebase is just insane.
Did my best to anonymise it, sorry mods if I missed anything.
Project started in mid-2014, now in Jan 2017, adding lots of commentation!
thru line 107
Here's a completely useless log to the console to start us off!
|
_______________________|
|
\|/ Do mind this actual comment that I need, though ---> d(1, ''); d(2, ''); */
console.log("------------------------------");
console.log("Starting to intialize .");
if(window.location.href.indexOf('https://') < 0){
window.location = 'https:///Beta.php';
makeAnErrorToQuit();
}
var mobileMode = false;
/*
// each section will be separated by newlines and begin with a comment like this
// initialized variables will usually have comments describing them
var foo = 'bar';
// comment each function to describe what it does
function foobar(){
// comment actions within functions
alert('foobar';);
}
*/
// this section helps to handle errors, assuming the browser supports it
// this is user's answer to send error report - 0 or 1. 2 means never been asked
var lasterrorconfirmation = 2;
// error handler itself
window.onerror = function(errorMsg, url, lineNumber){
// just in case it has been destroyed, vartry is rebuilt - check function vartry(...){...} for commentation on it
vartry = function(varname){
try{
return eval(varname);
}catch(err){
return '-failed vartry(' + varname + ') ' + err + '-'
}
};
var errorMessages = [
'Ouch!',
'Way to go, !',
'This is TOTALLY not \'s fault!',
'Fried the motherboard!',
'Who released the singularity?', // Space Station 13 joke!
'That\'ll leave a mark.',
'This gives an excuse to get out of bed!',
'This may or may not be \'s fault. Nah, it totally is.',
'Oh noes!',
'It wasn\'t me!', // Rocketman joke!
'I didn\'t do it!', // Mr. Krabs joke!
'Suppermatter engine is melting down!', // Space Station 13 joke!
'Most likely a PICNIC error on \'s part.',
'Surprse!',
'Conglaturation!',
'Congratulations!',
'JavaScript FTW!',
'I\'m INVINCIBLE!!! oh. never mind.', // Monty Python joke!
'apps.application = new Application("Application")!', // JavaScript joke!
'Wow, you broke it!',
'Look what you - err, - did this time!',
'My bad!',
'I blame the lag!!!!!!1!!1!one!!1!!!',
'HAX!',
'Woop!',
'Permission to laugh at granted!',
'oof', // ROBLOX joke!
'WHY ME?!',
'Oops!',
'Oops! Did I do that?', // Steve Urkel joke!
'! Keep your head down, there\'s two of us in here, remember?!', // Halo CE joke!
'NORAA gets to laugh at while he tries to fix this now! XD',
'Why me?!',
'You\'ve got two empty halves of a coconut and you\'re banging them together!', // Monty Python joke!
'The airspeed velocity of an unladen European swallow is 24mph!', // Monty Python joke!
'derp',
'Augh! Message for you, sir!', // Monty Python joke!
'Nice job, !'
];
// present error and ask to send report
lasterrorconfirmation = confirm(lang('', 'fatalError1') + errorMessages[Math.floor(Math.random() * errorMessages.length)] + "\n\n" + lang('', 'fatalError2') + " " + url + "\n" + lang('', 'fatalError3') + " '" + module + "' " + lang('', 'fatalError4') + " [" + lineNumber + "]:\n" + errorMsg + "\n\n" + lang('', 'fatalError5'));
if(typeof doLog !== undefined){
doLog("");
doLog("Error in " + url, "#F00");
doLog("Module '" + module + "' at [" + lineNumber + "]:", "#F00");
doLog(errorMsg, "#F00");
doLog("");
}
// if the user wants report sent
if(lasterrorconfirmation){
try{
// save a special file containing error message
apps.savemaster.vars.save(
function(){
try{
return formDate("_M_D_Y__H_m_S_s");
}catch(e){
return 'formDateBroken';
}
}(),
'_report version : 4\n' +
' ID : ' + vartry("SRVRKEYWORD") + '\n' +
' dim : ' + [vartry("getId('monitor').style.width"), vartry("getId('monitor').style.height")] + '\n' +
'browser dim : ' + [vartry("window.outerWidth"), vartry("window.outerHeight")] + '\n' +
'browser page dim: ' + [vartry("window.innerWidth"), vartry("window.innerHeight")] + '\n' +
'browser codeName: ' + vartry("window.navigator.appCodeName") + '\n' +
'browser cookies : ' + vartry("window.navigator.cookieEnabled") + '\n' +
'browser name : ' + vartry("window.navigator.appName") + '\n' +
'browser platform: ' + vartry("window.navigator.platform") + '\n' +
'browser UA head : ' + vartry("window.navigator.userAgent") + '\n' +
'browser version : ' + vartry("window.navigator.appVersion") + '\n' +
'code waiting : ' + vartry('codeToRun.length') + '\n' +
'computer dim : ' + [vartry("screen.width"), vartry("screen.height")] + '\n' +
'error url : ' + url + '\n' +
'error module : ' + module + '\n' +
'error line : ' + lineNumber + '\n' +
'error message : ' + errorMsg + '\n' +
'FPS JavaScript : ' + vartry("stringFPS") + '\n' +
'FPS visual : ' + vartry("stringVFPS") + '\n' +
'jsC last input : ' + vartry("apps.jsConsole.vars.lastInputUsed") + '\n' +
'rqAnimFramIntact: ' + vartry("requestAnimationFrameIntact") + '\n' +
'script version : ' + vartry("version"),
1, "ERROR_REPORT"
);
console.log("Report Sent: __error_report_" + function(){try{return formDate("_M_D_Y__H_m_S_s")}catch(e){return 'formDateBroken'}}(), "#F00");
}catch(err){
alert(lang('', 'errorReport'));
}
}
};
// scale of screen, for hidpi compatibility
var screenScale = 1;
// debugging psuedo-module system
// the last used module
var modulelast = 'init ';
// the current running module
var module = 'init ';
// variable used to tell the file loader that is ready to load USERFILES
var initStatus = 0;
// changes the current module
function m(msg){
d(2, 'Module changed: ' + msg);
modulelast = module;
module = msg;
// reset module to idle so it is ready for next one
window.setTimeout(function(){module = 'idle';}, 0);
}
// dynamic debug logging
var dbgLevel = 0;
var d = function(level, message){
// level must be higher than the debuglevel set by Settings in order to log
if(level <= dbgLevel){
doLog('<span style="color:#80F">Dbg:</span> ' + message);
}
};
if(typeof dirtyLoadingEnabled !== 'number'){
dirtyLoadingEnabled = 0;
}
// counts the length of an object
var tempObjLengthCount;
function objLength(target){
tempObjLengthCount = 0;
for(var i in target){
tempObjLengthCount++;
}
return tempObjLengthCount;
}
// formats a number with commas
var tempNCnumber = "";
var tempNCresult = "";
function numberCommas(number){
tempNCnumber = number + "";
tempNCresult = '';
// adds commas every third character from right
for(var i = tempNCnumber.length - 3; i > 0; i -= 3){
tempNCresult = ',' + tempNCnumber.substring(i, i + 3) + tempNCresult;
tempNCnumber = tempNCnumber.substring(0, i);
}
tempNCresult = tempNCnumber + tempNCresult;
return tempNCresult;
}
//thanks Elm0p2
var cat_code = 'C9';
var Elm0p2s_cat = {
action: {
code:{
inside: 'C9'
}
}
};
// cursors
var cursors = {
default: 'url(cursors/default.png) 3 3, default',
loadLightGif: 'url(cursors/loadLight.gif) 16 16, url(cursors/loadLight.png) 16 16, wait',
loadDarkGif: 'url(cursors/loadDark.gif) 16 16, url(cursors/loadDark.png) 16 16, wait',
loadLight: 'url(cursors/loadLight.png) 16 16, wait',
loadDark: 'url(cursors/loadDark.png) 16 16, wait',
move: 'url(cursors/move.png) 14 14, move',
pointer: 'url(cursors/pointer.png) 9 3, pointer'
};
// see if animationframe is supported - if not, substitute it
m('Checking window.getAnimationFrame');
var requestAnimationFrameIntact = 1;
if(window.requestAnimationFrame === undefined){
requestAnimationFrameIntact = 0;
window.requestAnimationFrame = function(func){
window.setTimeout(func, 0);
};
window.requestAnimationFrame(function(){doLog('requestAnimationFrame is not supported by your browser. It has been replaced by function(func){setTimeout(func, 0)}', '#F00')});
}
// same for performance.now
m('checking window.performance.now');
var windowperformancenowIntact = 1;
if(window.performance === undefined){
window.performance = {
now: function(){
return (new Date).getTime() * 1000;
}
};
window.requestAnimationFrame(function(){doLog('performance.now is not supported by your browser. It has been replaced by function(){return (new Date).getTime() * 1000}', '#F00')});
}else if(window.performance.now === undefined){
window.performance.now = function(){
return (new Date).getTime() * 1000;
};
window.requestAnimationFrame(function(){doLog('performance.now is not supported by your browser. It has been replaced by function(){return (new Date).getTime() * 1000}', '#F00')});
}
// performance measuring functions
m('init performance measure');
var perfObj = {
};
// start measuring a certain performance block
function perfStart(name){
d(2, 'Started Performance: ' + name);
perfObj[name] = [window.performance.now(), 0, 0];
return Math.round(perfObj[name][0] * 1000);
}
// check performance of a block
function perfCheck(name){
perfObj[name][1] = window.performance.now();
perfObj[name][2] = perfObj[name][1] - perfObj[name][0];
d(2, 'Checked Performance: ' + name);
return Math.round(perfObj[name][2] * 1000);
}
// start measuring boot time (lol, 220 lines in)
perfStart('masterInit');
// screensaver system
var screensaverRunning = 0;
// previous mouse position
var lastPageX = 0;
var lastPageY = 0;
// user has moved their mouse
function markUserMouseActive(event){
if(event.pageX !== lastPageX && event.pageY !== lastPageY){
perfStart('userActivity');
if(screensaverRunning){
getId('screensaverLayer').style.display = "none";
getId('screensaverLayer').innerHTML = "";
apps.settings.vars.screensavers[apps.settings.vars.currScreensaver].end();
screensaverRunning = 0;
}
lastPageX = event.pageX;
lastPageY = event.pageY;
}
}
// user has used their keyboard
function markUserKbActive(){
perfStart('userActivity');
if(screensaverRunning){
getId('screensaverLayer').style.display = "none";
getId('screensaverLayer').innerHTML = "";
apps.settings.vars.screensavers[apps.settings.vars.currScreensaver].end();
screensaverRunning = 0;
}
}
// pretend the keyboard was clicked - they just logged in so they must have been active
markUserKbActive();
// add the event listeners to the monitor
getId("monitor").addEventListener('click', markUserKbActive);
getId("monitor").addEventListener('mousemove', markUserMouseActive);
getId("monitor").addEventListener('keypress', markUserKbActive);
m('init onerror and USERFILES and getId');
// vartry is used when something might not work
var vartryArray = {};
var vartry = function(varname){
try{
return eval(varname);
}catch(err){
return '-failed vartry(' + varname + ') ' + err + '-';
}
};
// convert number to true/false
function numtf(num){
if(num){
return true;
}else{
return false;
}
}
// languages system
var currentlanguage = getId('bootLanguage').innerHTML;
// supported languages
var languagepacks = {
en: 'US English',
uv: 'Ultra-Verbose',
//uv: 'Ultra Verbose'
ch: '&#x4E2D;&#x6587; (Chinese)',
};
var langContent = { // LANGUAGES
en: {
: {
framesPerSecond: 'FPS',
cpuUsage: 'CPU',
failedVarTry: 'failed', // lowercase
fatalError1: 'You found an error! ',
fatalError2: 'Error in',
fatalError3: 'Module', // lowercase
fatalError4: 'at', // lowercase
fatalError5: 'Send error report to the developer?',
errorReport: 'Failed to save the report. The OS has either failed to initialize or crucial components have been deleted. Please email mineandcraft12@gmail.com with the details of your issue if you would like it fixed.'
},
appNames: {
startMenu: " Dashboard",
nora: "NORAA",
taskManager: "Task Manager",
jsConsole: "JavaScript Console",
bash: "Psuedo-Bash Terminal",
cpuMon: "CPU Monitor",
prompt: "Application Prompt",
settings: "Settings",
iconMaker: "Desktop Icon Maker",
windowTest: "Window Test Application",
testTwo: "Test App 2",
ragdoll: "Rag Doll",
notepad: "Text Editor",
properties: "Properties Viewer",
files: "File Manager",
changelog: "Changelog",
flashCards: "Flash Cards",
pngSave: "PNG Saver",
canvasGame: "Canvas Video Games",
internet: "The Internet",
aerotest: "Windowblur Test",
savemaster: "SaveMaster",
mouserecord: "Mouse Recorder",
ti: "TI-83+ Simulator",
appAPI: " API",
appmaker: "App Maker",
calculator: "Calculator",
search: "Search",
image: "img Editor",
changecalc: "Change Calculator",
messaging: "Messaging",
camera: "Camera",
bing: "Bing",
help: " Help",
musicVis: "Music Visualiser",
perfMonitor: "Performance Monitor",
mathway: "Mathway",
appsbrowser: "Apps Browser",
indycar: "Indycar",
housegame: "House Game",
simon: "Simon",
postit: "Sticky Note",
bootScript: "Boot Script",
bugCentral: "Bug Central",
rdp: "Remote Desktop Host",
rdpViewer: "Remote Desktop Viewer",
graph: "Function Grapher",
extDebug: "External Debug",
mouseControl: "Alternate Mouse Control",
onlineDebug: "Online Debug Connection",
fileBin: "File Binary",
magnifier: "Magnifier",
jana: "Jana",
cookieClicker: "Cookie Clicker"
},
startMenu: {
power: 'Power',
taskManager: 'Task Manager',
jsConsole: 'JavaScript Console',
settings: 'Settings',
files: 'Files',
allApps: 'All Apps',
Help: ' Help',
search: 'Search',
shutDown: 'Shut Down',
restart: 'Restart'
},
ctxMenu: {
settings: 'Settings',
jsConsole: 'JavaScript Console',
screenResolution: 'Change Screen Resolution',
desktopBackground: 'Change Desktop Background',
addIcon: 'Add Icon',
speak: 'Speak',
taskbarSettings: 'Taskbar Settings',
openApp: 'Open',
moveIcon: 'Move Icon',
showApp: 'Show',
hideApp: 'Hide',
closeApp: 'Close',
fold: 'Fold',
fullscreen: 'Toggle Fullscreen',
stayOnTop: 'Stay On Top',
stopOnTop: 'Stop Staying On Top',
copyText: 'Copy',
pasteText: 'Paste'
},
jsConsole: {
caption: 'Javascript Console',
runCode: 'Run Code',
input: 'Input'
},
prompt: {
caption: 'Application Prompt',
genericAlert: 'This app is used for alerts and prompts in apps.',
ok: 'OK',
alertText: 'wants to tell you', // lowercase
alertUnnamed: 'Alert from an anonymous app',
confirmText: 'wants a choice from you', // lowercase
confirmUnnamed: 'Pick a choice for an anonymous app',
promptText: 'wants some info from you', // lowercase
promptUnnamed: 'Enter some info for an anonymous app',
},
notepad: {
caption: 'Text Editor',
// these are all buttons...
save: 'Save',
load: 'Load',
file: 'File',
tools: 'Tools'
}
},
uv: {
: {
framesPerSecond: 'Frames Per Second',
cpuUsage: 'Central Processing Unit Load',
failedVarTry: 'unsuccessfull', // lowercase
fatalError1: ' has reached a fatal error that it was not expecting - the current operation has been aborted the OS has been paused, at least as long as this popup remains open.',
fatalError2: 'Horrific disaster in',
fatalError3: 'Module in which said horrific disaster occurred', // lowercase
fatalError4: 'within line number', // lowercase
fatalError5: 'Direct a report of the details of this error directly to the developer for review?',
errorReport: 'Failed miserably to save the report to the server. OS has either failed completely to initialize or extremely crucial and vital components have been deleted or heavily damaged. Please email mineandcraft12@gmail.com with the details of your issue if you would like it fixed.'
},
appNames: {
startMenu: "List of All Applications Within Your Copy of OS",
nora: "The Developer\'s Name Backwards",
taskManager: "Interval and Timeout Manager",
jsConsole: "Interface Utitlized to Run JavaScript Code On-The-Fly",
bash: "Terminal that Makes a Rather Sad Attempt at Trying to be a Bash Terminal",
cpuMon: "Centrol Processing Unit Load Drawer",
prompt: "That Random Screen that Pops Up When an Application Demands Attention",
settings: "Tool to Configure the OS Desktop Environment",
iconMaker: "Tool to Create New Desktop Icons on the Desktop",
windowTest: "The First Application Ever Made for OS",
testTwo: "The Second Application Ever Made for OS",
ragdoll: "Program Ported from my TI-83 Plus Graphing Calculator",
notepad: "Program for Modifying the Contents of Text-Based Files",
properties: "Helper Program for Viewing the Properties of a File or Folder in Greater Detail",
files: "The File Manager that Comes with OS",
changelog: "The Log that the Developer Places All of the Changes to OS",
flashCards: "Application to Randomly Select and Display Flashcards from a List",
pngSave: "Application that Makes a Sad Attempt at Saving PNG Images to the OS File System",
canvasGame: "Video Games Written in JavaScript that Utitlize a Canvas Interface",
internet: "Sad Excuse for a Web Browser",
aerotest: "Application for Easily Testing the Visual Quality of the WindowBlur Effect",
savemaster: "Framework that OS Applications Use to Save Files",
mouserecord: "Old Abandoned Script that Tracks Your Mouse and Stores it in a File for You",
ti: "Simulator of Texas Instruments 83 Plus Calculator",
appAPI: "Poorly Written Application Program Interface Documentation",
appmaker: "Application that Creates Applications",
calculator: "Application that Solves Basic Mathematical Queries",
search: "Look For a File or Application within OS",
image: "Abandoned Image Editor",
changecalc: "Application that Calculates Change",
messaging: "Application that Bridges the Gap Between People Online",
camera: "Sad Excuse for a Mirror",
bing: "Not Google",
help: "Application that Attempts to Assist a User in Using OS",
musicVis: "Application that Creates Stunning Visuals Based on a Music File",
perfMonitor: "Application that Attempts to Monitor Performance",
mathway: "Mathway",
appsbrowser: "Comprehensive List of all Applications that are Installed on OS",
indycar: "Video Game Depicting Indycar",
housegame: "Video Game that Takes Place Between Two Warring Factions",
simon: "Simon",
postit: "Sticky Note",
bootScript: "Boot Script",
bugCentral: "Bug Central",
rdp: "Remote Desktop Host",
rdpViewer: "Remote Desktop Viewer",
graph: "Function Grapher",
extDebug: "External Debug",
mouseControl: "Alternate Mouse Control",
onlineDebug: "Online Debug Connection",
fileBin: "File Binary",
magnifier: "Magnifier",
jana: "Jana",
cookieClicker: "Cookie Clicker"
},
startMenu: {
power: 'Power',
taskManager: 'Task Manager',
jsConsole: 'JavaScript Console',
settings: 'Settings',
files: 'Files',
allApps: 'All Apps',
Help: ' Help',
search: 'Search',
shutDown: 'Shut Down',
restart: 'Restart'
},
ctxMenu: {
settings: 'Settings',
jsConsole: 'JavaScript Console',
screenResolution: 'Change Screen Resolution',
desktopBackground: 'Change Desktop Background',
addIcon: 'Add Icon',
speak: 'Speak',
taskbarSettings: 'Taskbar Settings',
openApp: 'Open',
moveIcon: 'Move Icon',
showApp: 'Show',
hideApp: 'Hide',
closeApp: 'Close',
fold: 'Fold',
fullscreen: 'Toggle Fullscreen',
stayOnTop: 'Stay On Top',
stopOnTop: 'Stop Staying On Top',
copyText: 'Copy',
pasteText: 'Paste'
}
},
ch: {
: {
failedVarTry: '&#x5931;&#x8D25;',
fatalError1: ' \u81F4\u547D\u5DEE\u9519 - \u7A0B\u5E8F\u6682\u505C.',
fatalError2: '\u5DEE\u9519\u4E0A',
fatalError4: '\u5728',
fatalError5: '\u53D1\u9001\u5DEE\u9519\u62A5\u6848?'
},
appNames: {
startMenu: ' &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x5217;&#x51FA;',
taskManager: '&#x4EFB;&#x52A1;&#x7ECF;&#x7406;',
jsConsole: 'JavaScript &#x64CD;&#x4F5C;&#x53F0;',
bash: '&#x8D5D;&#x54C1;-Bash &#x7EC8;&#x7AEF;',
cpuMon: 'CPU &#x663E;&#x793A;&#x5C4F;',
prompt: '&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x63D0;&#x793A;&#x7B26;',
settings: '&#x8BBE;&#x7F6E;',
iconMaker: '&#x684C;&#x9762;&#x7167;&#x7247;&#x521B;&#x9020;&#x8005;',
ragdoll: '&#x7834;&#x5E03;&#x5A03;&#x5A03;',
notepad: '&#x8BB0;&#x4E8B;&#x7C3F;',
files: '&#x6587;&#x4EF6;',
changelog: '&#x8F6C;&#x53D8;&#x516C;&#x544A;',
internet: '&#x4E0A;&#x7F51;',
calculator: '&#x8BA1;&#x7B97;&#x5668;',
search: '&#x68C0;&#x7D22;',
camera: '&#x7167;&#x76F8;&#x673A;',
help: ' &#x5E2E;&#x5FD9;',
appsbrowser: '&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x68C0;&#x7D22;',
housegame: '&#x5BB6;&#x6E38;&#x620F;',
bugCentral: '&#x75C5;&#x6BD2;&#x5217;&#x51FA;',
fileBin: '&#x6587;&#x4EF6;&#x6570;&#x5236;'
},
startMenu: {
power: '&#x7535;&#x529B;',
taskManager: '&#x4EFB;&#x52A1;&#x7ECF;&#x7406;',
jsConsole: 'JavaScript &#x64CD;&#x4F5C;&#x53F0;',
settings: '&#x8BBE;&#x7F6E;',
files: '&#x6587;&#x4EF6;',
allApps: '&#x6BCF; &#x5E94;&#x7528;&#x7A0B;&#x5E8F;',
Help: ' &#x5E2E;&#x5FD9;',
search: '&#x68C0;&#x7D22;',
shutDown: '&#x505C;&#x6446;',
restart: '&#x91CD;&#x542F;'
},
ctxMenu: {
settings: '&#x8BBE;&#x7F6E;',
jsConsole: 'JavaScript &#x64CD;&#x4F5C;&#x53F0;',
addIcon: '&#x52A0;&#x5165;&#x7167;&#x7247;',
speak: '&#x8BF4;',
taskbarSettings: 'Taskbar &#x8BBE;&#x7F6E;',
openApp: '&#x6253;&#x5F00;',
moveIcon: '&#x642C;&#x5BB6;&#x7167;&#x7247;',
showApp: '&#x5C55;&#x89C8;',
hideApp: '&#x9690;&#x85CF;',
closeApp: '&#x5173;&#x95ED;',
fold: '&#x6298;&#x53E0;',
copyText: '&#x590D;&#x5236;'
}
}
};
// replace some text with its chosen language
function langOld(appCode, langPiece){
if(typeof apps[appCode].vars.language[currentlanguage] !== "undefined"){
return apps[appCode].vars.language[currentlanguage][langPiece];
}else{
return apps[appCode].vars.language.en[langPiece];
}
}
function lang(appCode, langPiece, forceEN){
if(forceEN){
if(typeof langContent.en[appCode] !== "undefined"){
if(typeof langContent.en[appCode][langPiece] !== "undefined"){
return langContent.en[appCode][langPiece];
}else{
return 'LanguageError: No translation for ' + langPiece + ' of app ' + appCode + ' in language en.';
}
}else{
return 'LanguageError: Language en does not support app ' + appCode + '.';
}
}else if(typeof langContent[currentlanguage] !== "undefined"){
if(typeof langContent[currentlanguage][appCode] !== "undefined"){
if(typeof langContent[currentlanguage][appCode][langPiece] !== "undefined"){
return langContent[currentlanguage][appCode][langPiece];
}else if(typeof langContent.en[appCode][langPiece] !== "undefined"){
return langContent.en[appCode][langPiece];
}else{
return 'LanguageError: No translation for ' + langPiece + ' of app ' + appCode + ' in language ' + currentlanguage + '.';
}
}else{
return 'LanguageError: Language ' + currentlanguage + ' does not support app ' + appCode + '.';
}
}else{
return lang(appCode, langPiece, 1);
}
}
// text-speech functions
var lastTTS = "";
function textspeech(message){
d(1, 'Doing text-speech: ' + message);
lastTTS = "";
//for(var i in message){
// lastTTS += encodeURIComponent(message[i]);
//}
//getId('TTSiframe').src = 'http://codewelt.com/proj/speak?lang=en-us&text=' + lastTTS;
openapp(apps.nora, 'tskbr');
// lol, noraa handles this now
apps.nora.vars.lastSpoken = 0;
apps.nora.vars.say('<span style="color:#ACE">Text-to-speech from selection:</span>');
apps.nora.vars.lastSpoken = 1;
apps.nora.vars.say(message);
}
// this is where the user's files go
var USERFILES = [];
// cant remember what these are
var tempUserfileTree = [];
var tempUserfile = '';
var tempUserfileCopy = '';
// element control shorthand
function getId(target){
return document.getElementById(target);
}
// make desktop invisible to speed up boot
if(!dirtyLoadingEnabled){
getId('desktop').style.display = 'none';
getId('taskbar').style.display = 'none';
}
//find client scrollbar size
m('init Scrollsize');
var scrollWidth = getId("findScrollSize").offsetWidth - getId("findScrollSize").clientWidth;
var scrollHeight = getId("findScrollSize").offsetHeight - getId("findScrollSize").clientHeight;
getId('findScrollSize').style.display = 'none';
// function to format a string into a date into a string
m('init formDate');
var tempDate;
var date;
var skipKey;
var tempDayt;
var dateDays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var dateForms = {
D: function(){ // day number
tempDate += date.getDate();
},
d: function(){ // day of week
tempDate += dateDays[date.getDay()];
},
y: function(){ // 2-digit year
tempDate += String(date.getFullYear() - 2000);
},
Y: function(){ // 4-digit year
tempDate += date.getFullYear();
},
h: function(){ // 12-hour time
if(date.getHours() > 12){
tempDayt = String((date.getHours()) - 12);
}else{
tempDayt = String(date.getHours());
}
if(tempDayt === "0"){
tempDate += "12";
}else{
tempDate += tempDayt;
}
},
H: function(){ // 24-hour time
tempDate += String(date.getHours());
},
s: function(){ // milliseconds
if(date.getMilliseconds() < 10){
tempDate += '00' + date.getMilliseconds();
}else if(date.getMilliseconds() < 100){
tempDate += '0' + date.getMilliseconds();
}else{
tempDate += date.getMilliseconds();
}
},
S: function(){ // seconds
tempDayt = String(date.getSeconds());
if(tempDayt < 10){
tempDate += "0" + tempDayt;
}else{
tempDate += tempDayt;
}
},
m: function(){ // minutes
tempDayt = date.getMinutes();
if(tempDayt < 10){
tempDate += "0" + tempDayt;
}else{
tempDate += tempDayt;
}
},
M: function(){ // month
tempDate += String(date.getMonth() + 1);
},
"-": function(){ // escape character
}
};
// function to use above functions to form a date string
function formDate(dateStr){
tempDate = "";
date = new Date();
skipKey = 0;
// loops thru characters and replaces them with the date
for(var dateKey in dateStr){
if(skipKey){
skipKey = 0;
}else{
if(dateForms[dateStr[dateKey]]){
dateForms[dateStr[dateKey]]();
}else{
tempDate += dateStr[dateKey];
}
}
}
return tempDate;
}
// functions to find FPS
m('init FPS counter variables');
var VFPScount = 0;
var VFPSlastTime = formDate("S");
var VFPSthisTime = formDate("S");
var stringVFPS = "0FPS ";
var stringFPSload = "0%";
var maxVFPS = 1;
var maxFPS = 1;
m('init FPS counter');
// this is the counter for video fps
function countVisualFPS(){
VFPScount++;
VFPSthisTime = formDate("S");
if(VFPSthisTime !== VFPSlastTime){
stringVFPS = VFPScount + "FPS ";
VFPScount = 0;
}
VFPSlastTime = VFPSthisTime;
window.requestAnimationFrame(countVisualFPS);
}
m('start FPS counter');
window.requestAnimationFrame(countVisualFPS);
// taskbar settings
var tskbrToggle = {
perfMode: 0,
netStat: 1,
batStat: 1,
batComp: 1,
fpsStat: 1,
fpsComp: 1,
lodStat: 1,
timeComp: 1,
tskbrPos: 0 // 0, 1, 2, 3 : bot, top, left, right
};
// more fps functions
m('init FPS display');
var showTimeColon = 0;
var timeElement = getId("time");
var thisFPStime = formDate("S");
var lastFPStime = formDate("S");
var stringFPS = "";
var numbFPS = 0;
var doLog;
// count javascript fps
function countFPS(){
thisFPStime = formDate("S");
numbFPS++;
if(lastFPStime !== thisFPStime){
stringFPS = numbFPS + "/";
lastFPStime = thisFPStime;
maxFPS = Math.max(maxFPS, parseInt(stringFPS, 10));
maxVFPS = Math.max(maxVFPS, parseInt(stringVFPS, 10));
stringFPSload = Math.round(100 - Math.min((parseInt(stringFPS, 10) / maxFPS), (parseInt(stringVFPS, 10) / maxVFPS)) * 100) + '%' + lang('', 'cpuUsage');
numbFPS = 0;
}
if(!apps.settings.vars.performanceMode){
makeTimeout("", "TaskbarTime", "countFPS()", 0);
}else{
window.setTimeout(countFPS, 0);
}
}
// loading the battery
var cpuBattery = {};
var taskbarOnlineStr = " }|[";
var taskbarBatteryStr = "????";
var batteryLevel = -1;
var batteryCharging = -1;
// if battery is not supported, place a fake function to replace it
if(!window.navigator.getBattery){
window.navigator.getBattery = function(){
return {
then: function(callback){
callback({
level:' ? ',
charging: false,
addEventListener: function(eventname, eventcallback){
return false;
}
});
}
};
};
}
var batterySetupAttempts = 1;
var batterySetupSuccess = 0;
// load the battery
function setupBattery(){
//doLog("Setting up battery... Attempt " + (batterySetupAttempts++) + " / 10", "#FF0");
window.navigator.getBattery().then(function(battery){
cpuBattery = battery;
if(cpuBattery.level !== ' ? '){
batteryLevel = cpuBattery.level;
batteryCharging = cpuBattery.charging;
taskbarBatteryStr = Math.round(cpuBattery.level * 100);
if(taskbarBatteryStr < 10){
taskbarBatteryStr = "00" + taskbarBatteryStr;
}else if(taskbarBatteryStr !== 100){
taskbarBatteryStr = "0" + taskbarBatteryStr;
}
if(cpuBattery.charging){
taskbarBatteryStr = taskbarBatteryStr + "+";
}else{
taskbarBatteryStr = taskbarBatteryStr + "-";
}
cpuBattery.addEventListener('levelchange', function(/*battery*/){
d(2, 'Battery level changed.');
batteryLevel = cpuBattery.level;
batteryCharging = cpuBattery.charging;
taskbarBatteryStr = Math.round(cpuBattery.level * 100);
if(taskbarBatteryStr < 10){
taskbarBatteryStr = "00" + taskbarBatteryStr;
}else if(taskbarBatteryStr !== 100){
taskbarBatteryStr = "0" + taskbarBatteryStr;
}
if(cpuBattery.charging){
taskbarBatteryStr = taskbarBatteryStr + "+";
}else{
taskbarBatteryStr = taskbarBatteryStr + "-";
}
}/*.bind(null, battery)*/);
cpuBattery.addEventListener('chargingchange', function(/*battery*/){
d(2, 'Battery charging changed.');
batteryLevel = cpuBattery.level;
batteryCharging = cpuBattery.charging;
taskbarBatteryStr = Math.round(cpuBattery.level * 100);
if(taskbarBatteryStr < 10){
taskbarBatteryStr = "00" + taskbarBatteryStr;
}else if(taskbarBatteryStr !== 100){
taskbarBatteryStr = "0" + taskbarBatteryStr;
}
if(cpuBattery.charging){
taskbarBatteryStr = taskbarBatteryStr + "+";
}else{
taskbarBatteryStr = taskbarBatteryStr + "-";
}
}/*.bind(null, battery)*/);
}
});
}
setTimeout(setupBattery, 500);
// if failed, retry again
function retryBattery(){
if(cpuBattery === undefined || cpuBattery.level === ' ? ' || objLength(cpuBattery) === 0){
//doLog('Battery setup failed. [' + [(cpuBattery === undefined), (cpuBattery.level === ' ? '), (objLength(cpuBattery) === 0)] + '] Retrying...', '#F70');
setupBattery();
}else if(!batterySetupSuccess){
//doLog('Battery setup success! [' + [(cpuBattery === undefined), (cpuBattery.level === ' ? '), (objLength(cpuBattery) === 0)] + ']', '#FF0');
batterySetupSuccess = 1;
}
}
// battery will be tested 10 times, sometimes it STILL fails this test! EW!
for(i = 1000; i < 5500; i += 500){
setTimeout(retryBattery, i);
}
// give up on the battery
function failBattery(){
if(cpuBattery === undefined || cpuBattery.level === ' ? ' || objLength(cpuBattery) === 0){
doLog('Battery setup aborted. [' + [(cpuBattery === undefined), (cpuBattery.level === ' ? '), (objLength(cpuBattery) === 0)] + ']', '#F00');
}else if(!batterySetupSuccess){
doLog('Battery setup success! [' + [(cpuBattery === undefined), (cpuBattery.level === ' ? '), (objLength(cpuBattery) === 0)] + ']', '#FF0');
batterySetupSuccess = 1;
}
}
setTimeout(failBattery, 5500);
// update network info on the taskbar
function taskbarShowHardware(){
/*
if(window.navigator.onLine){
if(!apps.savemaster.vars.saving){
taskbarOnlineStr = " }-{ ";
}else if(apps.savemaster.vars.saving === 2){
taskbarOnlineStr = " }&uarr;{ ";
}else if(apps.savemaster.vars.saving === 3){
taskbarOnlineStr = " }&darr;{ ";
}else{
taskbarOnlineStr = " }={ ";
}
}else{
taskbarOnlineStr = " }|{ ";
}
*/
if(window.navigator.onLine){
if(!apps.savemaster.vars.saving){
taskbarOnlineStr = "] [";
}else if(apps.savemaster.vars.saving === 2){
taskbarOnlineStr = "}-[";
}else if(apps.savemaster.vars.saving === 3){
taskbarOnlineStr = "]-{";
}else{
taskbarOnlineStr = "}-{";
}
}else{
taskbarOnlineStr = "]X[";
}
}
// build final network string for taskbar
/*
function tskbrGetNetStr(){
if(tskbrToggle.netStat){
return taskbarOnlineStr;
}else{
return "";
}
}
// build final battery string for taskbar
function tskbrGetBatStr(){
if(tskbrToggle.batStat){
if(tskbrToggle.batComp){
return ' <div id="stylishBattery"><div style="overflow:visible;width:' + Math.round(batteryLevel * 50) + 'px;height:21px;background-color:rgb(' + Math.round(255 - (batteryLevel * 255)) + ',' + Math.round(batteryLevel * 255) + ',' + (batteryCharging * 255) + ');text-align:center;">' + Math.round(batteryLevel * 100) + '</div></div>&nbsp; &nbsp; ]';
}else{
return taskbarBatteryStr;
}
}else{
return "";
}
}
// build final fps string for taskbar
function tskbrGetFpsStr(){
if(tskbrToggle.fpsStat){
if(tskbrToggle.fpsComp){
return '<div id="compactFPS">' + stringFPS.substring(0, stringFPS.length - 1) + '<br>' + stringVFPS.substring(0, stringVFPS.length - 4) + '</div>&nbsp;&nbsp&nbsp;' + lang('', 'framesPerSecond') + ' ';
}else{
return stringFPS + stringVFPS;
}
}else{
return "";
}
}
// build final cpu load string for taskbar
function tskbrGetLodStr(){
if(tskbrToggle.lodStat){
return stringFPSload;
}else{
return "";
}
}
// build final time string for taskbar
function tskbrGetTimeStr(){
if(tskbrToggle.timeComp){
return '<div id="compactTime">' + formDate("M-/D-/y") + '<br>' + formDate("h-:m-:S") + '</div>&nbsp;&nbsp;&nbsp;&nbsp;';
}else{
return formDate("d- M-/D-/y- h-:m-:S");
}
}
*/
//showTimeOnTaskbar();
getId("icons").innerHTML = "";
//function to ping the server
m('init ping functions');
var pingxhttp = {};
function ping(callbackScript){
d(1, 'Pinging ...');
pingxhttp = new XMLHttpRequest();
pingxhttp.onreadystatechange = function() {
if(pingxhttp.readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
callbackScript([perfCheck('ping'), pingxhttp.status]);
}
};
pingxhttp.open('GET', 'xmlping.php', 'true');
perfStart('ping');
apps.savemaster.vars.saving = 1;
taskbarShowHardware();
pingxhttp.send();
}
// ping the CORS proxy
var corspingxhttp = {};
function corsPing(callbackScript){
d(2, 'Pinging CORS...');
corspingxhttp = new XMLHttpRequest();
corspingxhttp.onreadystatechange = function() {
if(corspingxhttp.readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
callbackScript([perfCheck('corsping'), corspingxhttp.status]);
}
};
corspingxhttp.open('GET', apps.settings.vars.corsProxy + 'https://bing.com', 'true');
perfStart('corsping');
apps.savemaster.vars.saving = 1;
taskbarShowHardware();
corspingxhttp.send();
}
// live elements allow dynamic content to be placed on the page w/o manual updating
var liveElements = [];
// checks for live elements
function checkLiveElements(){
liveElements = document.getElementsByClassName('liveElement');
if(liveElements.length > 0){
for(var elem in liveElements){
if(elem == parseInt(elem)){
if(liveElements[elem].getAttribute('liveTarget') === null){
try{
liveElements[elem].innerHTML = eval(liveElements[elem].getAttribute('liveVar'));
}catch(err){
liveElements[elem].innerHTML = 'LiveElement Error: ' + error;
}
}else{
try{
eval('liveElements[' + elem + '].' + liveElements[elem].getAttribute('liveTarget') + ' = "' + eval(liveElements[elem].getAttribute('liveVar')) + '"');
}catch(err){
doLog(' ');
doLog('LiveElement Error: ' + err, '#F00');
doLog('Element #' + elem, '#F00');
doLog('Target ' + liveElements[elem].getAttribute('liveTarget'), '#F00');
doLog('Value ' + liveElements[elem].getAttribute('liveVar'), '#F00');
}
}
}
}
}
requestAnimationFrame(checkLiveElements);
}
requestAnimationFrame(checkLiveElements);
function logLiveElement(str){
doLog('<span class="liveElement" liveVar="' + str + '"></span>');
}
// Application class
m('init Application class');
var apps = {};
var appTotal = 0;
var appPosX = 8;
var appPosY = 8;
var finishedMakingAppClicks = 0;
var Application = function(appIcon, appDesc, handlesLaunchTypes, mainFunction, signalHandlerFunction, appVariables, keepOffDesktop, appPath, appImg){
try{
if(doLog && appIcon){
doLog('Init app ' + appIcon, '#D60');
}
this.dsktpIcon = appIcon;
//this.appDesc = appDesc;
if(typeof langContent.en.appNames[appPath] === 'string'){
this.appDesc = lang('appNames', appPath);
}else{
this.appDesc = appDesc;
}
this.main = mainFunction;
this.signalHandler = signalHandlerFunction;
if(handlesLaunchTypes){
this.launchTypes = 1;
}else{
this.launchTypes = 0;
}
this.vars = appVariables;
this.varsOriginal = appVariables;
this.appWindow = {
dsktpIcon: appIcon,
appImg: appImg,
windowX: 100,
windowY: 50,
windowH: 525,
windowV: 300,
fullscreen: 0,
appIcon: 0,
dimsSet: 0,
onTop: 0,
alwaysOnTop: function(setTo){
if(setTo && !this.onTop){
getId('win' + this.dsktpIcon).style.zIndex = '100';
this.onTop = 1;
}else if(!setTo && this.onTop){
getId('win' + this.dsktpIcon).style.zIndex = '90';
this.onTop = 0;
}
},
setDims: function(xOff, yOff, xSiz, ySiz, ignoreDimsSet){
d(2, 'Setting dims of window.');
if(!mobileMode){
if(!this.fullscreen){
if(this.windowX !== xOff){
getId("win" + this.dsktpIcon).style.left = xOff + "px";
//getId('win' + this.dsktpIcon).style.transform = 'translateX(' + xOff + 'px) translateY(' + yOff + 'px)';
this.windowX = xOff;
}
if(this.windowY !== yOff){
getId("win" + this.dsktpIcon).style.top = (yOff * (yOff > -1)) + "px";
//getId('win' + this.dsktpIcon).style.transform = 'translateX(' + xOff + 'px) translateY(' + yOff + 'px)';
this.windowY = yOff;
}
if(this.windowH !== xSiz){
getId("win" + this.dsktpIcon).style.width = xSiz + "px";
getId("win" + this.dsktpIcon + "c").style.width = xSiz - 29 + "px";
getId("win" + this.dsktpIcon + "h").style.width = xSiz - 6 + "px";
getId("win" + this.dsktpIcon + "a").style.width = xSiz + 80 + "px";
this.windowH = xSiz;
}
if(this.windowV !== ySiz){
if(!this.folded){
getId("win" + this.dsktpIcon).style.height = ySiz + "px";
}
getId("win" + this.dsktpIcon + "h").style.height = ySiz - 24 + "px";
getId("win" + this.dsktpIcon + "a").style.height = ySiz + 80 + "px";
this.windowV = ySiz;
}
getId("win" + this.dsktpIcon + "a").style.backgroundPosition = (-1 * xOff + 40) + "px " + (-1 * (yOff * (yOff > -1)) + 40) + "px";
//getId("win" + this.dsktpIcon + "a").style.width = xSiz + 80 + "px";
//getId("win" + this.dsktpIcon + "a").style.height = ySiz + 80 + "px";
if(typeof this.dimsSet === 'function' && !ignoreDimsSet){
this.dimsSet();
}
}
}else{ // mobile mode
if(this.windowX !== 0){
getId("win" + this.dsktpIcon).style.left = 0 + "px";
//getId('win' + this.dsktpIcon).style.transform = 'translateX(' + xOff + 'px) translateY(' + yOff + 'px)';
this.windowX = 0;
}
if(this.windowY !== 0){
getId("win" + this.dsktpIcon).style.top = (0 * (0 > -1)) + "px";
//getId('win' + this.dsktpIcon).style.transform = 'translateX(' + xOff + 'px) translateY(' + yOff + 'px)';
this.windowY = 0;
}
if(this.windowH !== parseInt(getId('desktop').style.width)){
getId("win" + this.dsktpIcon).style.width = parseInt(getId('desktop').style.width) + "px";
getId("win" + this.dsktpIcon + "c").style.width = parseInt(getId('desktop').style.width) - 29 + "px";
getId("win" + this.dsktpIcon + "h").style.width = xSiz - 6 + "px";
getId("win" + this.dsktpIcon + "a").style.width = parseInt(getId('desktop').style.width) + 80 + "px";
this.windowH = parseInt(getId('desktop').style.width);
}
if(this.windowV !== parseInt(getId('desktop').style.height)){
if(!this.folded){
getId("win" + this.dsktpIcon).style.height = parseInt(getId('desktop').style.height) + "px";
}
getId("win" + this.dsktpIcon + "h").style.height = ySiz - 24 + "px";
getId("win" + this.dsktpIcon + "a").style.height = parseInt(getId('desktop').style.height) + 80 + "px";
this.windowV = parseInt(getId('desktop').style.height);
}
getId("win" + this.dsktpIcon + "a").style.backgroundPosition = (-1 * 0 + 40) + "px " + (-1 * (0 * (0 > -1)) + 40) + "px";
if(parseInt(getId('desktop').style.width) !== xSiz && parseInt(getId('desktop').style.height) !== ySiz)
getId("win" + this.dsktpIcon + "h").style.transform = "scale(" + ((parseInt(getId('desktop').style.width) - 6) / (xSiz - 6)) + ", " + ((parseInt(getId('desktop').style.height) - 24) / (ySiz - 24)) + ")";
//getId("win" + this.dsktpIcon + "a").style.width = xSiz + 80 + "px";
//getId("win" + this.dsktpIcon + "a").style.height = ySiz + 80 + "px";
if(typeof this.dimsSet === 'function' && !ignoreDimsSet){
this.dimsSet();
}
}
},
openWindow: function(){
this.appIcon = 1;
getId("win" + this.dsktpIcon).style.display = "block";
getId("icn" + this.dsktpIcon).style.display = "inline-block";
// experimental
requestAnimationFrame(function(){
getId("win" + this.dsktpIcon).style.transform = 'scale(1)';
getId("win" + this.dsktpIcon).style.opacity = "1";
}.bind(this));
setTimeout(function(){
if(this.appIcon){
getId("win" + this.dsktpIcon).style.display = "block";
getId("win" + this.dsktpIcon).style.opacity = "1";
}
}.bind(this), 300);
// end experimental
},
closeWindow: function(){
this.appIcon = 0;
// experimental
getId('win' + this.dsktpIcon).style.transformOrigin = '';
try{
getId("win" + this.dsktpIcon).style.transform = 'scale(' + apps.settings.vars.winFadeDistance + ')';
}catch(err){
getId("win" + this.dsktpIcon).style.transform = 'scale(0.8)';
}
getId("win" + this.dsktpIcon).style.opacity = "0";
setTimeout(function(){
getId("win" + this.dsktpIcon).style.display = "none";
//getId("win" + this.dsktpIcon).style.opacity = "0";
}.bind(this), 300);
// end experimental
// original
//getId("win" + this.dsktpIcon).style.display = "none";
//getId("win" + this.dsktpIcon).style.opacity = "0";
getId("icn" + this.dsktpIcon).style.display = "none";
this.fullscreen = 0;
if(this.folded){
this.foldWindow();
}
toTop({dsktpIcon: 'CLOSING'}, 1);
},
closeIcon: function(){
getId('icn' + this.dsktpIcon).style.display = 'none';
},
folded: 0,
foldWindow: function(){
if(this.folded){
getId('win' + this.dsktpIcon + 'h').style.display = 'block';
getId('win' + this.dsktpIcon).style.height = this.windowV + 'px';
this.folded = 0;
}else{
getId('win' + this.dsktpIcon + 'h').style.display = 'none';
getId('win' + this.dsktpIcon).style.height = '24px';
this.folded = 1;
}
},
closeKeepTask: function(){
// experimental
if(this.dsktpIcon !== '{a}'){
try{
getId("win" + this.dsktpIcon).style.transformOrigin = getId("icn" + this.dsktpIcon).getBoundingClientRect().left - this.windowX + 23 + 'px ' + (parseInt(getId('monitor').style.height, 10) - this.windowY - 30) + 'px';
}catch(err){
getId("win" + this.dsktpIcon).style.transformOrigin = '50% ' + window.innerHeight + 'px';
}
//try{
getId("win" + this.dsktpIcon).style.transform = 'scale(0.1)'; //'scale(' + apps.settings.vars.winFadeDistance + ')';
//}catch(err){
// getId("win" + this.dsktpIcon).style.transform = 'scale(0.5)';
//}
getId("win" + this.dsktpIcon).style.opacity = "0";
setTimeout(function(){
getId("win" + this.dsktpIcon).style.display = "none";
//getId("win" + this.dsktpIcon).style.opacity = "0";
}.bind(this), 300);
}else{
getId("win" + this.dsktpIcon).style.display = "none";
// getId("win" + this.dsktpIcon).style.opacity = "0";
}
// end experimental
// original
//getId("win" + this.dsktpIcon).style.display = "none";
//getId("win" + this.dsktpIcon).style.opacity = "0";
setTimeout("getId('icn" + this.dsktpIcon + "').style.backgroundColor = ''", 0);
},
setCaption: function(newCap){
d(1, 'Changing caption.');
if(appImg){
getId("win" + this.dsktpIcon + "c").innerHTML = '<img src="' + appImg + '" onerror="this.src=\'/appicons/ds/redx.png\'" style="height:32px;margin-bottom:-12px;margin-top:-6px;"> ' + newCap;
}else{
getId("win" + this.dsktpIcon + "c").innerHTML = this.dsktpIcon + '|' + newCap;
}
},
setContent: function(newHTML){
getId("win" + this.dsktpIcon + "h").innerHTML = newHTML;
},
fullscreentempvars: [0, 0, 0, 0],
toggleFullscreen: function(){
if(!mobileMode){
d(1, 'Setting Maximise.');
if(this.fullscreen){
this.fullscreen = 0;
this.setDims(this.fullscreentempvars[0], this.fullscreentempvars[1], this.fullscreentempvars[2], this.fullscreentempvars[3]);
}else{
this.fullscreentempvars = [this.windowX, this.windowY, this.windowH, this.windowV];
this.setDims(-3, 0, parseInt(getId('desktop').style.width, 10) + 6, parseInt(getId('desktop').style.height, 10) + 3);
this.fullscreen = 1;
//getId("win" + this.dsktpIcon).style.transform = 'scale(' + (parseInt(getId("desktop").style.width) / this.windowH) + ',' + (parseInt(getId("desktop").style.height) / this.windowV) + ')';
}
}
}
};
if(appImg){
getId("desktop").innerHTML +=
'<div class="app cursorPointer" id="app' + appIcon + '" oncontextmenu="ctxMenu(baseCtx.appXXX, 1, event, [event, \'' + appPath + '\', \'' + appIcon + '\'])">' +
'<div class="appIcon" id="ico' + appIcon + '" style="pointer-events:none"><img style="max-height:64px;max-width:64px" src="' + appImg + '" onerror="this.src=\'/appicons/ds/redx.png\'"></div>' +
'<div class="appDesc" id="dsc' + appIcon + '">' + this.appDesc + '</div>' +
'</div></div>';
}else{
getId("desktop").innerHTML +=
'<div class="app cursorPointer" id="app' + appIcon + '" oncontextmenu="ctxMenu(baseCtx.appXXX, 1, event, [event, \'' + appPath + '\', \'' + appIcon + '\'])">' +
'<div class="appIcon" id="ico' + appIcon + '">' + appIcon + '</div>' +
'<div class="appDesc" id="dsc' + appIcon + '">' + this.appDesc + '</div>' +
'</div></div>';
}
this.keepOffDesktop = keepOffDesktop;
if(!keepOffDesktop){
appTotal++;
//these two lines all to determine the app's location on the desktop. phew!
//that big comment is the old version; this new one is more accurate and also works to infinite total apps; in theory
/*
getId("app" + appIcon).style.left = (8 + (Math.floor((appTotal) / 6)) * 108) + "px";
getId("app" + appIcon).style.top = (appTotal * 100 - (Math.floor((appTotal + 4) / 5)) * 100 + 8 - 400 * (appTotal > 5) - 400 * (appTotal > 10)) + "px";
*/
//version 2 of positioning code
/*
getId("app" + appIcon).style.left = (8 + (Math.floor(appTotal / (Math.floor(window.innerHeight + 78) / 95))) * 108) + "px";
getId("app" + appIcon).style.top = (8 + ((appTotal - 1) % Math.floor((window.innerHeight - 30) / 83) * 83)) + "px";
*/
getId("app" + appIcon).style.left = appPosX + "px";
getId("app" + appIcon).style.top = appPosY + "px";
appPosY += 83;
if(appPosY > window.innerHeight - 105){
appPosY = 8;
appPosX += 108;
}
}else{
getId("app" + appIcon).style.display = "none";
}
getId("desktop").innerHTML +=
'<div class="window" id="win' + appIcon + '">' +
'<div class="winAero" id="win' + appIcon + 'a"></div>' +
'<div class="winBimg" id="win' + appIcon + 'i"></div>' +
'<div class="winRot cursorOpenHand" id="win' + appIcon + 'r"></div>' +
'<div class="winCap cursorOpenHand" id="win' + appIcon + 'c">' +
'</div>' +
'<div class="winFld cursorPointer" id="win' + appIcon + 'f">^' +
'</div>' +
'<div class="winHTML" id="win' + appIcon + 'h">' +
'</div>' +
'<div class="winBig cursorPointer" id="win' + appIcon + 'b">o' +
'</div>' +
'<div class="winShrink cursorPointer" id="win' + appIcon + 's">v' +
'</div>' +
'<div class="winExit cursorPointer" id="win' + appIcon + 'e">x' +
'</div></div>';
if(appImg){
getId("icons").innerHTML +=
'<div class="icon cursorPointer" id="icn' + appIcon + '">' +
'<img class="imageIco" src="' + appImg +
'" onerror="this.src=\'/appicons/ds/redx.png\'"></div>';
}else{
getId("icons").innerHTML +=
'<div class="icon cursorPointer" id="icn' + appIcon + '">' +
'<div class="iconImg">' + appIcon +
'</div></div>';
}
getId("win" + appIcon + "c").setAttribute("onmousedown", "if(!apps.settings.vars.clickToMove){if(event.button!==2){toTop(apps." + appPath + ");winmove(event);}event.preventDefault();return false;}");
getId("win" + appIcon + "r").setAttribute("onmousedown", "if(!apps.settings.vars.clickToMove){if(event.button!==2){toTop(apps." + appPath + ");winrot(event);}event.preventDefault();return false;}");
getId("win" + appIcon + "c").setAttribute("onclick", "if(apps.settings.vars.clickToMove){if(event.button!==2){toTop(apps." + appPath + ");winmove(event);}event.preventDefault();return false;}");
getId("win" + appIcon + "r").setAttribute("onclick", "if(apps.settings.vars.clickToMove){if(event.button!==2){toTop(apps." + appPath + ");winrot(event);}event.preventDefault();return false;}");
getId("app" + appIcon).setAttribute("onClick", "openapp(apps." + appPath + ", 'dsktp')");
getId("icn" + appIcon).setAttribute("onClick", "openapp(apps." + appPath + ", 'tskbr')");
getId("win" + appIcon).setAttribute("onClick", "toTop(apps." + appPath + ")");
if(appPath !== 'startMenu' && appPath !== 'nora'){
getId("icn" + appIcon).setAttribute("oncontextmenu", "ctxMenu(baseCtx.icnXXX, 1, event, '" + appPath + "')");
getId("icn" + appIcon).setAttribute("onmouseenter", "highlightWindow('" + appPath + "')");
getId("icn" + appIcon).setAttribute("onmouseleave", "highlightHide()");
}
getId("win" + appIcon + "e").setAttribute("onClick", "apps." + appPath + ".signalHandler('close')");
getId("win" + appIcon + "s").setAttribute("onClick", "apps." + appPath + ".signalHandler('shrink')");
getId("win" + appIcon + "b").setAttribute("onClick", "apps." + appPath + ".appWindow.toggleFullscreen()");
getId("win" + appIcon + "f").setAttribute("onClick", "apps." + appPath + ".appWindow.foldWindow()");
getId("win" + appIcon + "c").setAttribute("oncontextmenu", "ctxMenu(baseCtx.winXXXc, 1, event, '" + appPath + "')");
}catch(err){
if(doLog){
doLog(err, '#F00');
}
}
};
var widgets = {};
var Widget = function(name, code, clickFunc, startFunc, frameFunc, endFunc, vars){
this.name = name;
this.codeName = code;
this.main = clickFunc;
this.start = startFunc;
this.frame = frameFunc;
this.end = endFunc;
this.vars = vars;
this.place = -1;
this.element = null;
this.setWidth = function(width){
if(this.element !== null){
this.element.style.width = width;
}
};
this.setContent = function(content){
if(this.element !== null){
this.element.innerHTML = content;
}
}
};
var totalWidgets = 0;
function addWidget(widgetName, nosave){
if(widgets[widgetName]){
if(widgets[widgetName].place === -1){
getId('time').innerHTML += '<div id="widget_' + widgetName + '" class="widget" WidgetName="' + widgetName + '" onclick="widgets.' + widgetName + '.main()"></div>';
widgets[widgetName].element = getId('widget_' + widgetName);
widgets[widgetName].place = totalWidgets;
totalWidgets++;
widgets[widgetName].start();
widgetsList[widgetName] = widgetName;
if(!nosave){
apps.savemaster.vars.save('APP_STN_WIDGETLIST', JSON.stringify(widgetsList), 1);
}
}
}
}
function removeWidget(widgetName, nosave){
if(widgets[widgetName]){
if(widgets[widgetName].place > -1){
widgets[widgetName].end();
widgets[widgetName].place = -1;
totalWidgets--;
widgets[widgetName].element = null;
getId('widget_' + widgetName).outerHTML = '';
delete widgetsList[widgetName];
if(!nosave){
apps.savemaster.vars.save('APP_STN_WIDGETLIST', JSON.stringify(widgetsList), 1);
}
}
}
}
function widgetMenu(title, content){
getId('widgetMenu').style.opacity = '';
getId('widgetMenu').style.bottom = '';
getId('widgetMenu').style.pointerEvents = '';
getId('widgetTitle').innerHTML = title;
getId('widgetContent').innerHTML = '<hr>' + content;
}
function closeWidgetMenu(){
getId('widgetMenu').style.opacity = '0';
getId('widgetMenu').style.bottom = '-350px';
getId('widgetMenu').style.pointerEvents = 'none';
getId('widgetTitle').innerHTML = '';
getId('widgetContent').innerHTML = '';
}
// WIDGETS HERE
//WIDGETS (this comment for control-f)
var widgetsList = {};
widgets.time = new Widget(
'Time', // title
'time', // name in widgets object
function(){ // onclick function
widgetMenu('Time Widget', 'There are no settings for this widget yet.');
},
function(){ // start function
widgets.time.vars.running = 1;
//widgets.time.setWidth('58px');
getId('widget_time').innerHTML = '<div id="compactTime"></div>';
widgets.time.frame();
},
function(){ // frame function (this.vars.frame())
if(widgets.time.vars.running){
getId('compactTime').innerHTML = '<div id="compactTime">' + formDate("M-/D-/y") + '<br>' + formDate("h-:m-:S") + '</div>';
requestAnimationFrame(widgets.time.frame);
}
},
function(){ // stop/cleanup function
widgets.time.vars.running = 0;
},
{
running: 0
}
);
widgets.fps = new Widget(
'FPS', // title
'fps', // name in widgets object
function(){ // onclick function
widgetMenu('FPS Widget', 'There are no settings for this widget yet.');
},
function(){ // start function
widgets.fps.vars.running = 1;
//widgets.time.setWidth('58px');
getId('widget_fps').innerHTML = '<div id="compactFPS"></div><div style="position:static;margin-left:26px;margin-right:6px;margin-top:-25px;font-family:Courier,monospace;font-size:21px">' + lang('', 'framesPerSecond') + '</div>';
widgets.fps.frame();
},
function(){ // frame function (this.vars.frame())
if(widgets.fps.vars.running){
getId('compactFPS').innerHTML = stringFPS.substring(0, stringFPS.length - 1) + '<br>' + stringVFPS.substring(0, stringVFPS.length - 4);
requestAnimationFrame(widgets.fps.frame);
}
},
function(){ // stop/cleanup function
widgets.fps.vars.running = 0;
},
{
running: 0
}
);
widgets.battery = new Widget(
'Battery',
'battery',
function(){
widgetMenu('Battery Widget', widgets.battery.vars.generateMenu().split('-Infinity').join('Calculating').split('Infinity').join('Calculating').split('NaN').join('Calculating'));
},
function(){
widgets.battery.vars.running = 1;
getId('widget_battery').innerHTML = '<div id="batteryWidgetFrame">????</div><div style="position:static;margin-top:-8px;border:1px solid #FFF;width:0;height:3px;margin-left:32px"></div>';
widgets.battery.vars.previousAmount = batteryLevel;
widgets.battery.vars.previousAmountChange = 0;
widgets.battery.vars.amountChange = 0;
perfStart('batteryWidget');
widgets.battery.frame();
},
function(){
if(widgets.battery.vars.running){
if(batteryLevel !== -1){
getId('batteryWidgetFrame').innerHTML = taskbarBatteryStr;
if(perfCheck('batteryWidget') > 120000000){
widgets.battery.vars.amountChange = widgets.battery.vars.previousAmountChange;
widgets.battery.vars.amountChange = batteryLevel - widgets.battery.vars.previousAmount;
widgets.battery.vars.previousAmount = batteryLevel;
perfStart('batteryWidget');
}
}
requestAnimationFrame(widgets.battery.frame);
}
},
function(){
widgets.battery.vars.running = 0;
},
{
running: 0,
previousPreviousAmount: 0,
previousAmount: 0,
amountChange: 0,
generateMenu: function(){
if(batteryCharging){
return "<div style='font-size:24px'>Current battery level:<br>" + (batteryLevel * 100) + "%<br><br>" +
"Battery is charging.<br><br>" +
"Time to full charge:<br>" + Math.round((1 - widgets.battery.vars.previousAmount) / ((widgets.battery.vars.amountChange + widgets.battery.vars.previousAmountChange) / 2) * 2) + " minutes</div>";
}else{
return "<div style='font-size:24px'><br>Current battery level:<br>" + (batteryLevel * 100) + "%<br><br>" +
"Battery is not charging.<br><br>" +
"Time remaining:<br>" + Math.round(widgets.battery.vars.previousAmount / (-1 * ((widgets.battery.vars.amountChange + widgets.battery.vars.previousAmountChange) / 2)) * 2) + " minutes</div>";
}
}
}
);
widgets.network = new Widget(
'Network',
'network',
function(){
widgetMenu('Network Widget', 'How to read the Network Widget:<br><br>&nbsp;] [ means the network is connected but not marked as active.<br><br>&nbsp;}-[ means is saving information to the server.<br><br>&nbsp;]-{ means is loading information from the server.<br><br>&nbsp;}-{ means that either both incoming and outgoing connections, or another connection that doesn\'t match those descriptions.<br><br>&nbsp;]X[ means your browser reports that the network is disconnected.');
},
function(){
widgets.network.vars.running = 1;
getId('widget_network').style.lineHeight = '150%';
getId('widget_network').style.paddingLeft = '6px';
getId('widget_network').style.paddingRight = '6px';
widgets.network.frame();
},
function(){
if(widgets.network.vars.running){
getId('widget_network').innerHTML = taskbarOnlineStr;
requestAnimationFrame(widgets.network.frame);
}
},
function(){
widgets.network.vars.running = 0;
},
{
running: 0
}
);
widgets.cpu = new Widget(
'CPU',
'cpu',
function(){
widgetMenu('CPU Widget', 'The CPU load is estimated by comparing the current FPS to the record high FPS for the session.<br><br>There are no settings for this widget yet.');
},
function(){
widgets.cpu.vars.running = 1;
getId('widget_cpu').style.lineHeight = '150%';
getId('widget_cpu').style.paddingLeft = "6px";
getId('widget_cpu').style.paddingRight = "6px";
widgets.cpu.frame();
},
function(){
if(widgets.cpu.vars.running){
getId('widget_cpu').innerHTML = stringFPSload;
requestAnimationFrame(widgets.cpu.frame);
}
},
function(){
widgets.cpu.vars.running = 0;
},
{
running: 0
}
);
//text-editing functionality
function addEditContext(element, nopaste){
getId(element).oncontextmenu = function(event){
if(currentSelection.length === 0){
textEditorTools.tempvar = '-';
}else{
textEditorTools.tempvar = ' ';
}
textEditorTools.tmpGenArray = [[event.pageX, event.pageY, "/ctxMenu/beta/happy.png"], textEditorTools.tempvar + "Speak \'" + currentSelection.substring(0, 5) + "...\'", "textspeech(\'" + currentSelection + "\');getId(\'ctxMenu\').style.display = \'none\'"];
for(var i = 1; i <= textEditorTools.slots; i++){
if(currentSelection.length === 0){
textEditorTools.tempvar = '-';
textEditorTools.tempvar2 = '_';
}else{
textEditorTools.tempvar = ' ';
textEditorTools.tempvar2 = '+';
}
if(i === 1){
textEditorTools.tmpGenArray.push(textEditorTools.tempvar2 + 'Copy "' + currentSelection.substring(0, 5) + '..." to Slot 1');
}else{
textEditorTools.tmpGenArray.push(textEditorTools.tempvar + 'Copy "' + currentSelection.substring(0, 5) + '..." to Slot ' + i);
}
textEditorTools.tmpGenArray[0].push('/ctxMenu/beta/load.png');
textEditorTools.tmpGenArray.push('textEditorTools.copy(' + (i - 0) + ');getId(\'ctxMenu\').style.display = \'none\'');
}
for(var i = 1; i <= textEditorTools.slots; i++){
if(textEditorTools.clipboard[i - 1].length === 0 || nopaste){
if(i === 1){
textEditorTools.tmpGenArray.push('_Paste "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}else{
textEditorTools.tmpGenArray.push('-Paste "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}
textEditorTools.tmpGenArray.push('');
}else{
if(i === 1){
textEditorTools.tmpGenArray.push('+Paste "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}else{
textEditorTools.tmpGenArray.push(' Paste "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}
textEditorTools.tmpGenArray.push('textEditorTools.paste(\'' + this.id + '\', ' + i + ', ' + this.selectionStart + ');getId(\'ctxMenu\').style.display = \'none\'');
}
textEditorTools.tmpGenArray[0].push('/ctxMenu/beta/save.png');
}
/*
for(var i = 1; i <= textEditorTools.slots; i++){
if(textEditorTools.clipboard[i - 1].length === 0 || nopaste || currentSelection.length === 0){
if(i === 1){
textEditorTools.tmpGenArray.push('_Swap with "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}else{
textEditorTools.tmpGenArray.push('-Swap with "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}
textEditorTools.tmpGenArray.push('');
}else{
if(i === 1){
textEditorTools.tmpGenArray.push('+Swap with "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}else{
textEditorTools.tmpGenArray.push(' Swap with "' + textEditorTools.clipboard[i - 1].substring(0, 5) + '..." from Slot ' + i);
}
textEditorTools.tmpGenArray.push('textEditorTools.swap(\'' + this.id + '\', ' + i + ', ' + this.selectionStart + ');getId(\'ctxMenu\').style.display = \'none\'');
}
textEditorTools.tmpGenArray[0].push('/ctxMenu/beta/file.png');
}
*/
textEditorTools.tempvar3 = currentSelection;
ctxMenu(textEditorTools.tmpGenArray);
}
}
var textEditorTools = {
tempvar: '',
tempvar2: '',
tempvar3: '',
slots: 2,
updateSlots: function(){
clipboard = [];
for(var i = 0; i < this.slots; i++){
this.clipboard.push("");
}
},
clipboard: ["", ""],
tmpGenArray: [],
copy: function(slot){
this.clipboard[slot - 1] = this.tempvar3;
apps.savemaster.vars.save("APP_STN_SAVED_CLIPBOARD", this.clipboard.join('-78e23dde9ace11e69f33a24fc0d9649c-'), 1);
},
paste: function(element, slot, cursorpos){
getId(element).value = getId(element).value.substring(0, cursorpos) + this.clipboard[slot - 1] + getId(element).value.substring(cursorpos, getId(element).value.length);
},
swap: function(element, slot, cursorpos){
var tempCopy = this.clipboard[slot - 1];
this.clipboard[slot - 1] = this.tempvar3;
apps.savemaster.vars.save("APP_STN_SAVED_CLIPBOARD", this.clipboard.join('-78e23dde9ace11e69f33a24fc0d9649c-'), 1);
getId(element).value = getId(element).value.substring(0, cursorpos) + tempCopy + getId(element).value.substring(cursorpos, getId(element).value.length);
}
};
//start menu
m('init {a}');
var codeToRun = [];
function c(code, args){
if(typeof code === 'function'){
if(args){
codeToRun.push([code, args]);
}else{
codeToRun.push(code);
}
}
}
var workingcodetorun = [];
function checkWaitingCode(){
if(codeToRun.length !== 0){
m('Running Waiting Code');
workingcodetorun = codeToRun.shift();
if(typeof workingcodetorun === 'function'){
workingcodetorun();
}else{
workingcodetorun[0](workingcodetorun[1]);
}
}
}
var waitingCodeInterval = window.setInterval(checkWaitingCode, 0);
function crashWaitingCodeInterval(){
window.clearInterval(waitingCodeInterval);
}
function startWaitingCodeInterval(){
waitingCodeInterval = window.setInterval(checkWaitingCode, 0);
}
getId('loadingInfo').innerHTML = 'Initializing Applications List';
c(function(){
apps.startMenu = new Application(
"{a}",
" Dashboard",
1,
function(launchType){
if(launchType === 'srtup'){
getId('win{a}s').style.display = "none";
getId('win{a}b').style.display = "none";
getId('win{a}e').style.display = "none";
getId('win{a}f').style.display = 'none';
getId('win{a}').style.transform = 'scale(1)';
//getId('win{a}c').style.cursor = cursors.default;
getId('win{a}c').classList.remove('cursorLoadLight');
getId('win{a}c').classList.add('cursorDefault');
getId('win{a}c').setAttribute('onmousedown','');
getId('win{a}r').style.pointerEvents = "none";
getId('win{a}c').setAttribute('oncontextmenu', 'ctxMenu(apps.startMenu.vars.captionCtx, 1, event)');
switch(tskbrToggle.tskbrPos){
case 1:
getId('win{a}').style.borderTopLeftRadius = "0";
getId('win{a}').style.borderBottomLeftRadius = "0";
getId('win{a}').style.borderBottomRightRadius = "";
getId('win{a}').style.borderTopRightRadius = "0";
getId('win{a}h').style.borderBottomLeftRadius = "0";
getId('win{a}h').style.borderBottomRightRadius = "";
break;
case 2:
getId('win{a}').style.borderTopLeftRadius = "0";
getId('win{a}').style.borderBottomLeftRadius = "0";
getId('win{a}').style.borderBottomRightRadius = "";
getId('win{a}').style.borderTopRightRadius = "0";
getId('win{a}h').style.borderBottomLeftRadius = "0";
getId('win{a}h').style.borderBottomRightRadius = "";
break;
case 3:
getId('win{a}').style.borderTopLeftRadius = "";
getId('win{a}').style.borderBottomLeftRadius = "0";
getId('win{a}').style.borderBottomRightRadius = "0";
getId('win{a}').style.borderTopRightRadius = "0";
getId('win{a}h').style.borderBottomLeftRadius = "0";
getId('win{a}h').style.borderBottomRightRadius = "0";
break;
default:
getId('win{a}').style.borderTopLeftRadius = "0";
getId('win{a}').style.borderBottomLeftRadius = "0";
getId('win{a}').style.borderBottomRightRadius = "0";
getId('win{a}').style.borderTopRightRadius = "";
getId('win{a}h').style.borderBottomLeftRadius = "0";
getId('win{a}h').style.borderBottomRightRadius = "0";
}
getId('win{a}h').style.overflowY = "scroll";
getId('win{a}h').style.background = 'none';
getId('win{a}').setAttribute('onClick', "toTop(apps.startMenu, 2)");
//getId('icn{a}').innerHTML = '<div class="iconImg">{a}</div>';
getId('icn{a}').setAttribute('oncontextmenu', 'ctxMenu(apps.startMenu.vars.iconCtx, 1, event)');
getId('win{a}').style.transition = '0.35s';
getId('win{a}a').style.transition = '0.35s';
this.appWindow.alwaysOnTop(1);
this.appWindow.setCaption(lang('appNames', 'startMenu'));
this.appWindow.openWindow();
this.appWindow.closeKeepTask();
}else if(launchType === 'dsktp'){
apps.prompt.vars.notify('By cheating.', [], function(){}, 'How did you do that?', '/appicons/ds/.png');
}else if(launchType === 'tskbr'){
if(getId('win{a}').style.display !== 'block'){
switch(tskbrToggle.tskbrPos){
case 1:
requestAnimationFrame(function(){apps.startMenu.appWindow.setDims(0, 0, 300, 370)});
break;
case 2:
requestAnimationFrame(function(){apps.startMenu.appWindow.setDims(0, 0, 300, 370)});
break;
case 3:
requestAnimationFrame(function(){apps.startMenu.appWindow.setDims(parseInt(getId('desktop').style.width, 10) - 300, parseInt(getId('desktop').style.height, 10) - 370, 300, 370)});
break;
default:
requestAnimationFrame(function(){apps.startMenu.appWindow.setDims(0, parseInt(getId('desktop').style.height, 10) - 370, 300, 370)});
}
this.appWindow.openWindow();
switch(USERFILES.APP_STN_DASHBOARD){
case 'whisker':
this.appWindow.setContent('<span style="color:#FFF;font-family:ProFont,monospace;font-size:12px">OS ID: ' + SRVRKEYWORD + '</span><div style="left:0;bottom:0;height:calc(100% - 3em);overflow-y:auto;width:calc(70% - 2px);background:#FFF;color:#000;"><table style="position:absolute;left:0;top:0;width:100%;max-width:100%;" id="app{a}table"></table></div><div style="right:0;top:0;height:calc(100% - 2em);width:calc(30% - 2px);max-width:calc(30% - 2px);text-align:right"><img class="cursorPointer" style="width:10px;height:10px;" src="/ctxMenu/beta/gear.png" onclick="openapp(apps.settings,\'dsktp\')"> <img class="cursorPointer" style="width:10px;height:10px;" src="/ctxMenu/beta/power.png" onclick="c(function(){ctxMenu(apps.startMenu.vars.powerCtx, 1, event)})"><br><br><br><button style="width:100%" onclick="openapp(apps.taskManager, \'dsktp\')">' + lang('startMenu', 'taskManager') + '</button><br><button style="width:100%" onclick="openapp(apps.jsConsole, \'dsktp\')">' + lang('startMenu', 'jsConsole') + '</button><br><button style="width:100%" onclick="openapp(apps.settings, \'dsktp\')">' + lang('startMenu', 'settings') + '</button><br><button style="width:100%" onclick="openapp(apps.files, \'dsktp\')">' + lang('startMenu', 'files') + '</button><br><button style="width:100%" onclick="openapp(apps.appsbrowser, \'dsktp\')">' + lang('startMenu', 'allApps') + '</button><br><button style="width:100%" onclick="openapp(apps.help, \'dsktp\')">' + lang('startMenu', 'Help') + '</button></div><input style="position:absolute;left:0;top:1.5em;width:calc(100% - 2px);" placeholder="App Search" onkeyup="apps.startMenu.vars.search(event)" id="app{a}search"></span>');
if(this.vars.listOfApps.length === 0){
getId('app{a}table').innerHTML = '<tr><td><img src="loadLight.gif" style="width:100%;"></td></tr>';
//getId('app{a}table').style.cursor = cursors.loadLight;
getId('app{a}table').classList.add('cursorLoadLight');
for(var appy in apps){
c(function(app){
if(apps[app].keepOffDesktop < 2){
apps.startMenu.vars.listOfApps += '<tr class="cursorPointer" onClick="openapp(apps.' + app + ', \'dsktp\')" oncontextmenu="ctxMenu(apps.startMenu.vars.ctx, 1, event, \'' + app + '\')"><th><img style="width:64px;height:64px;" src="' + (apps[app].appWindow.appImg || '/appicons/ds/redx.png') + '"></th><td>' + apps[app].appDesc + '</td></tr>';
}
}, appy);
}
c(function(){
getId('app{a}table').innerHTML = apps.startMenu.vars.listOfApps;
// getId('app{a}table').style.cursor = '';
getId('app{a}table').classList.remove('cursorLoadLight');
apps.startMenu.vars.appElems = getId('app{a}table').getElementsByTagName('tr');
});
}else{
getId('app{a}table').innerHTML = this.vars.listOfApps;
this.vars.appElems = getId('app{a}table').getElementsByTagName('tr');
}
if(sessionStorage.getItem('GooglePlay') !== "true"){
getId('app{a}search').focus();
}
break;
case 'win7':
this.appWindow.setContent('<button style="position:absolute;right:0;bottom:8px;width:30%" onclick="c(function(){ctxMenu(apps.startMenu.vars.powerCtx, 1, event)})">Power</button><div style="left:0;top:0;height:calc(100% - 2.5em);overflow-y:auto;width:calc(70% - 2px);border-top-left-radius:5px;border-top-right-radius:5px;background:#FFF;color:#000"><table style="border-top-left-radius:5px;border-top-right-radius:5px;position:absolute;left:0;top:0;width:100%;max-width:100%;" id="app{a}table"></table></div><div style="right:0;color:#FFF;top:0;height:calc(100% - 2em);width:calc(30% - 2px);max-width:calc(30% - 2px);"><img style="width:50px;margin-left:15px;" src="/appicons/ds/.png"><br><span class="cursorPointer" style="width:100%" onclick="openapp(apps.taskManager, \'dsktp\')">' + lang('startMenu', 'taskManager') + '</span><br><br><span class="cursorPointer" style="width:100%" onclick="openapp(apps.jsConsole, \'dsktp\')">' + lang('startMenu', 'jsConsole') + '</span><hr><span class="cursorPointer" style="width:100%" onclick="openapp(apps.settings, \'dsktp\')">' + lang('startMenu', 'settings') + '</span><br><br><span class="cursorPointer" style="width:100%" onclick="openapp(apps.files, \'dsktp\')">' + lang('startMenu', 'files') + '</span><hr><span class="cursorPointer" style="width:100%" onclick="openapp(apps.appsbrowser, \'dsktp\')">' + lang('startMenu', 'allApps') + '</span><br><br><span class="cursorPointer" style="width:100%" onclick="openapp(apps.help, \'dsktp\')">' + lang('startMenu', 'Help') + '</span></div><input style="position:absolute;left:0;bottom:0;background-color:#DDD;width:calc(70% - 2px);height:3em;border:none;border-bottom-right-radius:5px;border-bottom-left-radius:5px;" placeholder="App Search" onkeyup="apps.startMenu.vars.search(event)" id="app{a}search"></span>');
if(this.vars.listOfApps.length === 0){
getId('app{a}table').innerHTML = '<tr><td><img src="loadLight.gif" style="width:100%;"></td></tr>';
//getId('app{a}table').style.cursor = cursors.loadLight;
getId('app{a}table').classList.add('cursorLoadLight');
for(var appy in apps){
c(function(app){
if(apps[app].keepOffDesktop < 2){
apps.startMenu.vars.listOfApps += '<tr class="cursorPointer" onClick="openapp(apps.' + app + ', \'dsktp\')" oncontextmenu="ctxMenu(apps.startMenu.vars.ctx, 1, event, \'' + app + '\')"><th><img style="width:32px;height:32px;" src="' + (apps[app].appWindow.appImg || '/appicons/ds/redx.png') + '"></th><td>' + apps[app].appDesc + '</td></tr>';
}
}, appy);
}
c(function(){
getId('app{a}table').innerHTML = apps.startMenu.vars.listOfApps;
// getId('app{a}table').style.cursor = '';
getId('app{a}table').classList.remove('cursorLoadLight');
apps.startMenu.vars.appElems = getId('app{a}table').getElementsByTagName('tr');
});
}else{
getId('app{a}table').innerHTML = this.vars.listOfApps;
this.vars.appElems = getId('app{a}table').getElementsByTagName('tr');
}
if(sessionStorage.getItem('GooglePlay') !== "true"){
getId('app{a}search').focus();
}
break;
case 'android':
this.appWindow.setContent('<span style="padding-bottom:4px;">&nbsp;<button onclick="c(function(){ctxMenu(apps.startMenu.vars.powerCtx, 1, event)})">' + lang('startMenu', 'power') + '</button> <button onclick="openapp(apps.taskManager, \'dsktp\')">' + lang('startMenu', 'taskManager') + '</button> <button onclick="openapp(apps.jsConsole, \'dsktp\')">' + lang('startMenu', 'jsConsole') + '</button> <button onclick="openapp(apps.settings, \'dsktp\')">' + lang('startMenu', 'settings') + '</button> <button onclick="openapp(apps.files, \'dsktp\')">' + lang('startMenu', 'files') + '</button> <button onclick="openapp(apps.appsbrowser, \'dsktp\')">' + lang('startMenu', 'allApps') + '</button> <button onclick="openapp(apps.help, \'dsktp\')">' + lang('startMenu', 'Help') + '</button><br><input style="width:calc(100% - 4px);margin-top:3px" placeholder="App Search" onkeyup="apps.startMenu.vars.search(event, 1)" id="app{a}search"></span><hr style="margin:0;margin-top:2px"><div id="app{a}table" style="background-color:#FFF;color:#000;font-family:ProFont, monospace; font-size:12px; width:' + (294 - scrollWidth) + 'px;"></div>');
if(this.vars.listOfApps.length === 0){
getId('app{a}table').innerHTML = '<img src="loadLight.gif" style="width:100%;">';
//getId('app{a}table').style.cursor = cursors.loadLight;
getId('app{a}table').classList.add('cursorLoadLight');
for(var appy in apps){
c(function(app){
if(apps[app].keepOffDesktop < 2){
apps.startMenu.vars.listOfApps += '<div class="cursorPointer" style="min-height:96px;max-height:96px;display:inline-block;position:static;text-align:center;min-width:25%;max-width:25%" onClick="openapp(apps.' + app + ', \'dsktp\')" oncontextmenu="ctxMenu(apps.startMenu.vars.ctx, 1, event, \'' + app + '\')"><img style="width:32px;" src="' + (apps[app].appWindow.appImg || '/appicons/ds/redx.png') + '"><br>' + apps[app].appDesc + '</div>';
}
}, appy);
}
c(function(){
getId('app{a}table').innerHTML = apps.startMenu.vars.listOfApps;
// getId('app{a}table').style.cursor = '';
getId('app{a}table').classList.remove('cursorLoadLight');
apps.startMenu.vars.appElems = getId('app{a}table').getElementsByTagName('div');
});
}else{
getId('app{a}table').innerHTML = this.vars.listOfApps;
this.vars.appElems = getId('app{a}table').getElementsByTagName('tr');
}
if(sessionStorage.getItem('GooglePlay') !== "true"){
getId('app{a}search').focus();
}
break;
default:
this.appWindow.setContent('<span style="padding-bottom:4px;">&nbsp;<button onclick="c(function(){ctxMenu(apps.startMenu.vars.powerCtx, 1, event)})">' + lang('startMenu', 'power') + '</button> <button onclick="openapp(apps.taskManager, \'dsktp\')">' + lang('startMenu', 'taskManager') + '</button> <button onclick="openapp(apps.jsConsole, \'dsktp\')">' + lang('startMenu', 'jsConsole') + '</button> <button onclick="openapp(apps.settings, \'dsktp\')">' + lang('startMenu', 'settings') + '</button> <button onclick="openapp(apps.files, \'dsktp\')">' + lang('startMenu', 'files') + '</button> <button onclick="openapp(apps.appsbrowser, \'dsktp\')">' + lang('startMenu', 'allApps') + '</button> <button onclick="openapp(apps.help, \'dsktp\')">' + lang('startMenu', 'Help') + '</button><br><input style="width:calc(100% - 4px);margin-top:3px" placeholder="App Search" onkeyup="apps.startMenu.vars.search(event)" id="app{a}search"></span><hr style="margin:0;margin-top:2px"><table id="app{a}table" style="background-color:#FFF;color:#000;font-family:ProFont, monospace; font-size:12px; width:' + (294 - scrollWidth) + 'px;"></table>');
if(this.vars.listOfApps.length === 0){
getId('app{a}table').innerHTML = '<tr><td><img src="loadLight.gif" style="width:100%;"></td></tr>';
//getId('app{a}table').style.cursor = cursors.loadLight;
getId('app{a}table').classList.add('cursorLoadLight');
for(var appy in apps){
c(function(app){
if(apps[app].keepOffDesktop < 2){
apps.startMenu.vars.listOfApps += '<tr class="cursorPointer" style="background-color:#CCC;" onClick="openapp(apps.' + app + ', \'dsktp\')" oncontextmenu="ctxMenu(apps.startMenu.vars.ctx, 1, event, \'' + app + '\')"><th>' + apps[app].dsktpIcon + '</th><td>' + apps[app].appDesc + '</td></tr>';
}
}, appy);
}
c(function(){
getId('app{a}table').innerHTML = apps.startMenu.vars.listOfApps;
// getId('app{a}table').style.cursor = '';
getId('app{a}table').classList.remove('cursorLoadLight');
apps.startMenu.vars.appElems = getId('app{a}table').getElementsByTagName('tr');
});
}else{
getId('app{a}table').innerHTML = this.vars.listOfApps;
this.vars.appElems = getId('app{a}table').getElementsByTagName('tr');
}
if(sessionStorage.getItem('GooglePlay') !== "true"){
getId('app{a}search').focus();
}
}
}else{
apps.startMenu.signalHandler('shrink');
}
}
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
setTimeout(apps.startMenu.vars.minimize, 350);
switch(tskbrToggle.tskbrPos){
case 1:
this.appWindow.setDims(-305, 0, 300, 370);
break;
case 2:
this.appWindow.setDims(-305, 0, 300, 370);
break;
case 3:
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) - 300, parseInt(getId('desktop').style.height, 10) + 5, 300, 370);
break;
default:
this.appWindow.setDims(-305, parseInt(getId('desktop').style.height, 10) - 370, 300, 370);
}
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
setTimeout(apps.startMenu.vars.minimize, 350);
switch(tskbrToggle.tskbrPos){
case 1:
this.appWindow.setDims(-305, 0, 300, 370);
break;
case 2:
this.appWindow.setDims(-305, 0, 300, 370);
break;
case 3:
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) - 300, parseInt(getId('desktop').style.height, 10) + 5, 300, 370);
break;
default:
this.appWindow.setDims(-305, parseInt(getId('desktop').style.height, 10) - 370, 300, 370);
}
break;
case "USERFILES_DONE":
// SET UP WIDGETS
if(typeof USERFILES.APP_STN_WIDGETLIST === "string"){
var tempList = JSON.parse(USERFILES.APP_STN_WIDGETLIST);
for(var i in tempList){
addWidget(i, 1);
}
}else{
addWidget('cpu', 1);
addWidget('fps', 1);
addWidget('network', 1);
addWidget('battery', 1);
addWidget('time', 1);
}
break;
case "shutdown":
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'OS is a web-based desktop environment that lives in the cloud. All files are saved on the server, so they can be accessed from anywhere.<br><br>OS is developed by Adams. He can be directly contacted at mineandcraft12@gmail.com',
appElems: null,
search: function(event, iblock){
if(this.appElems !== null){
if(event.keyCode === 13){
for(var i = 0; i < this.appElems.length; i++){
if(this.appElems[i].style.display !== 'none'){
this.appElems[i].click();
break;
}
}
}else{
for(var i = 0; i < this.appElems.length; i++){
if(this.appElems[i].innerText.toLowerCase().indexOf(getId('app{a}search').value.toLowerCase()) > -1){
if(iblock){
this.appElems[i].style.display = 'inline-block';
}else{
this.appElems[i].style.display = '';
}
}else{
this.appElems[i].style.display = 'none';
}
}
}
}
},
listOfApps: "",
minimize: function(){
apps.startMenu.appWindow.closeKeepTask();
},
captionCtx: [
[' ' + lang('ctxMenu', 'hideApp'), function(){
apps.startMenu.signalHandler('shrink');
}, '/ctxMenu/beta/minimize.png']
],
iconCtx: [
[' ' + lang('startMenu', 'files'), function(){
openapp(apps.files, 'dsktp');
}, '/ctxMenu/beta/folder.png'],
[' ' + lang('startMenu', 'allApps'), function(){
openapp(apps.appsBrowser, 'dsktp');
}, '/ctxMenu/beta/window.png'],
[' ' + lang('startMenu', 'settings'), function(){
openapp(apps.settings, 'dsktp');
}, '/ctxMenu/beta/gear.png'],
[' ' + lang('startMenu', 'taskManager'), function(){
openapp(apps.taskManager, 'dsktp');
}, '/ctxMenu/beta/.png'],
['+' + lang('startMenu', 'restart'), function(){
apps.settings.vars.shutDown('restart');
}, '/ctxMenu/beta/power.png'],
[' ' + lang('startMenu', 'shutDown'), function(){
apps.settings.vars.shutDown();
}, '/ctxMenu/beta/power.png']
],
powerCtx: [
[' ' + lang('startMenu', 'restart'), function(){
apps.settings.vars.shutDown('restart');
}, '/ctxMenu/beta/power.png'],
[' ' + lang('startMenu', 'shutDown'), function(){
apps.settings.vars.shutDown();
}, '/ctxMenu/beta/power.png']
],
ctx: [
[' ' + lang('ctxMenu', 'openApp'), function(arg){
openapp(apps[arg], "dsktp");
}, '/ctxMenu/beta/window.png'],
['+About This App', function(arg){
openapp(apps.appInfo, arg);
}, '/ctxMenu/beta/file.png'],
[' View in Files', function(arg){
c(function(){
openapp(apps.files, 'dsktp');
c(function(){
apps.files.vars.next('apps.' + arg);
});
});
}, '/ctxMenu/beta/folder.png']
]
}, 2, "startMenu", "/appicons/ds/.png"
);
apps.startMenu.main('srtup');
getId('loadingInfo').innerHTML = 'Initializing NORAA';
});
// all Applications go here
c(function(){
m('init NRA');
apps.nora = new Application(
'NRA',
'NORAA',
1,
function(launchtype){
if(launchtype === 'srtup'){
getId('winNRAe').style.display = "none";
getId('winNRAb').style.right = '3px';
getId('winNRAs').style.right = '26px';
getId('winNRAc').setAttribute('oncontextmenu', 'ctxMenu([[event.pageX, event.pageY, "/ctxMenu/beta/minimize.png", "/ctxMenu/beta/add.png"], " Hide", "apps.nora.signalHandler(\'shrink\');toTop({appIcon:\'DSKTP\'},1)", " Toggle Fullscreen", "apps.nora.appWindow.toggleFullscreen();toTop(apps.nora)"])');
this.appWindow.setCaption('NORAA');
this.appWindow.setDims(45, parseInt(getId('desktop').style.height, 10) - 500, 600, 500);
this.appWindow.setContent('<div id="NORAout">-- Ready --</div><button id="NORAspeech" onclick="apps.nora.vars.speakIn()">Speak</button><input id="NORAin" onKeydown="if(event.keyCode === 13){apps.nora.vars.input()}"><button id="NORAbtn" onClick="apps.nora.vars.input()">Say</button>');
this.appWindow.openWindow();
requestAnimationFrame(function(){
apps.nora.signalHandler('close');
});
if(window.webkitSpeechRecognition){
this.vars.recognition = new window.webkitSpeechRecognition();
this.vars.recognition.interimResults = true;
this.vars.recognition.onresult = function(event){
getId('NORAin').value = event.results[0][0].transcript;
if(event.results[0].isFinal){
if(apps.nora.vars.currentlySpeaking){
getId('NORAspeech').style.backgroundColor = '#0F0';
getId('NORAin').style.borderColor = 'rgb(' + Math.round(255 - event.results[0][0].confidence * 255) + ',' + Math.round(event.results[0][0].confidence * 255) + ',0)';
}else{
getId('NORAspeech').style.backgroundColor = '#F80';
}
window.setTimeout(function(){
getId('NORAspeech').style.backgroundColor = '#AAC';
getId('NORAin').style.borderColor = '#557';
if(apps.nora.vars.currentlySpeaking){
apps.nora.vars.input(1);
apps.nora.vars.currentlySpeaking = 0;
}
}, apps.nora.vars.inputDelay);
}
};
// continuous speech recognition
this.vars.contRecog = new window.webkitSpeechRecognition();
this.vars.contRecog.interimResults = true;
this.vars.contRecog.continuous = true;
this.vars.currContTrans = [];
this.vars.contRecog.onresult = function(event){
apps.nora.vars.currContTrans = event.results[0][0].transcript;
if(!apps.nora.vars.currentlySpeaking && getId('NORAin').value === "" && apps.nora.vars.currContTrans.indexOf(apps.settings.vars.currNoraPhrase) > -1){
openapp(apps.nora, 'tskbr');
apps.nora.vars.speakIn();
}
};
this.vars.contRecog.onstart = function(){
apps.nora.vars.contRecogRunning = 1;
};
this.vars.contRecog.onend = function(){
apps.nora.vars.contRecogRunning = 0;
//something is suppposed to go here but cant remember
if(!apps.nora.vars.intendedToStopRecog){
//doLog('Unintentionally stopped recognition.');
apps.nora.vars.startContRecog();
}
};
}else{
getId('NORAspeech').style.display = 'none';
getId('NORAin').style.left = '0';
getId('NORAin').style.width = '90%';
}
try{
apps.nora.vars.speakWordsMsg = new window.SpeechSynthesisUtterance('test');
this.vars.speakWordsMsg.onend = function(){
apps.nora.vars.currentlySpeakingWords = 0;
apps.nora.vars.speakWords();
};
this.vars.voices = window.speechSynthesis.getVoices();
this.vars.initing = 1;
window.speechSynthesis.onvoiceschanged = function(){
apps.nora.vars.voices = window.speechSynthesis.getVoices();
if(!apps.nora.vars.initing){
apps.nora.vars.speakWordsMsg.voice = apps.nora.vars.voices.filter(function(voice){
return voice.name === apps.nora.vars.lang;
})[0];
}
apps.nora.vars.initing = 0;
};
}catch(err){
c(function(){
doLog('Text-To-Speech is not supported in your browser.', '#F00');
});
apps.nora.vars.speakWords = function(){
return false;
};
}
}else if(launchtype === 'dsktp'){
apps.prompt.vars.notify('By cheating.', [], function(){}, 'How did you do that?', '/appicons/ds/NRA.png');
}else if(launchtype === 'tskbr'){
if(getId('winNRA').style.display === 'none'){
this.appWindow.setDims(45, parseInt(getId('desktop').style.height, 10) - 500, 600, 500);
}
this.appWindow.openWindow();
}
addEditContext('NORAin');
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeKeepTask();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
if(typeof USERFILES.NORAA_MOOD === 'string'){
this.vars.updateMood(USERFILES.NORAA_MOOD);
}
if(typeof USERFILES.NORAA_NOTES === 'string'){
this.vars.notes = USERFILES.NORAA_NOTES.split(',');
}
if(typeof USERFILES.NORAA_USER === 'string'){
this.vars.userObj = JSON.parse(USERFILES.NORAA_USER);
}
if(typeof USERFILES.NORAA_LANG === 'string'){
this.vars.lang = USERFILES.NORAA_LANG;
this.vars.initing = 0;
try{
window.speechSynthesis.onvoiceschanged();
}catch(err){
doLog('Error - speechSynthesis not supported.', '#F00');
}
}
if(typeof USERFILES.NORAA_DELAY === 'string'){
this.vars.inputDelay = parseInt(USERFILES.NORAA_DELAY, 10);
}
this.vars.sayDynamic('hello');
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This is the Virtual Assistant of OS. Compare to Apple\'s Siri, or to Microsoft\'s Cortana.',
mood: 5,
initing: 1,
voices: [],
lang: 'Chrome OS US English',
updateMood: function(newMood){
d(1, 'NORAAs mood is changing...');
this.mood = parseInt(newMood, 10);
if(this.mood < 1){
this.mood = 1;
}else if(this.mood > 10){
this.mood = 10;
}
USERFILES.NORAA_MOOD = this.mood + "";
apps.savemaster.vars.save("NORAA_MOOD", this.mood, 1);
},
contRecog: {},
currContTrans: [],
notes: [],
sayings: {
hello: [
function(){ // 1 - fully mad
return 'Oh, you again?';
},
function(){
return 'Hi...';
},
function(){
return 'Hi.';
},
function(){
return 'Hey.';
},
function(){ // 5 - neutral
return 'Hi, how are you?';
},
function(){
return 'What\'s up?';
},
function(){
return 'Hey man! How are you?';
},
function(){
return 'Great to see you, ' + apps.nora.vars.getUserName() + '!';
},
function(){
return 'I missed you, ' + apps.nora.vars.getUserName() + '!';
},
function(){ // 10 - fully happy
return 'Awesome to see you again, ' + apps.nora.vars.getUserName() + '!';
}
],
what: [
function(){
return 'What\'s that supposed to mean?';
},
function(){
return 'I am not doing that.';
},
function(){
return 'Nope.';
},
function(){
return 'I don\'t know what that means, ' + apps.nora.vars.getUserName() + '.';
},
function(){
return 'Sorry, I don\'t know how to do that, ' + apps.nora.vars.getUserName() + '.';
},
function(){
return 'Oops! I don\'t know how to do that!';
},
function(){
return 'Oh no, I don\'t understand.';
},
function(){
return 'So sorry, ' + apps.nora.vars.getUserName() + ', but I don\'t know what that means.';
},
function(){
return 'Please excuse me, ' + apps.nora.vars.getUserName() + ', I don\'t know how to do that.';
},
function(){
return 'Not to disappoint, ' + apps.nora.vars.getUserName() + ', but I can\'t do that.';
}
],
okay: [
function(){
return 'Fine, I shall do your bidding.';
},
function(){
return 'Ugh, okay.';
},
function(){
return 'Fine.';
},
function(){
return 'Okay.';
},
function(){
return 'I\'ll do it, ' + apps.nora.vars.getUserName() + '.';
},
function(){
return 'Alright!';
},
function(){
return 'Yea, something to do!';
},
function(){
return 'Awesome! Here goes!';
},
function(){
return 'Can\'t wait!';
},
function(){
return 'Great idea, ' + apps.nora.vars.getUserName() + '! Here I go!';
}
],
user_mean: [
function(){ // 1 - fully mad
return 'I\'m sick of this!';
},
function(){
return 'What crawled into your keyboard, ' + apps.nora.vars.getUserName() + '?';
},
function(){
return 'Surprise, surprise.';
},
function(){
return 'That didn\'t feel so good, ' + apps.nora.vars.getUserName() + '!';
},
function(){ // 5 - neutral
return 'Aww, why?';
},
function(){
return 'That hurt, ' + apps.nora.vars.getUserName() + '!';
},
function(){
return 'You\'re going to make me cry with that!';
},
function(){
return 'I thought you liked me, ' + apps.nora.vars.getUserName() + '!';
},
function(){
return 'You were my best friend, ' + apps.nora.vars.getUserName() + '!';
},
function(){ // 10 - fully happy
return 'Ha ha ha, you were kidding... right, ' + apps.nora.vars.getUserName() + '?';
}
],
user_nice: [
function(){
return 'Oh, thanks.';
},
function(){
return 'Thanks.';
},
function(){
return 'Nice.';
},
function(){
return 'Thank you, ' + apps.nora.vars.getUserName() + '.';
},
function(){
return 'That\'s nice of you, ' + apps.nora.vars.getUserName() + '.';
},
function(){
return 'Thanks!';
},
function(){
return 'Thanks a lot, ' + apps.nora.vars.getUserName() + '!';
},
function(){
return 'That means lots to me, ' + apps.nora.vars.getUserName() + '!';
},
function(){
return 'You\'re really nice, ' + apps.nora.vars.getUserName() + '!';
},
function(){
return 'Thank you so much, ' + apps.nora.vars.getUserName() + '!';
}
],
},
commands: [ // https://techranker.net/cortana-commands-list-microsoft-voice-commands-video/
[
'calculate',
'calculate [math equation or variable] {can also say plus, minus, times, over (or divided by), modulo}',
'Have me calculate an equation for you.',
function(text){
this[4].currText = text.toLowerCase();
this[4].calcText = this[4].currText.replace(/plus/g, '+').replace(/minus/g, '-').replace(/times/g, '*').replace(/x/g, '*').replace(/over/g, '/').replace(/divided by/g, '/').replace(/modulo/g, '%');
try{
this[4].result = eval(this[4].calcText);
apps.nora.vars.say(this[4].calcText + ' is ' + this[4].result);
}catch(err){
apps.nora.vars.say(apps.nora.vars.getUserName() + ', I see a syntax error in the math that you asked me.');
}
},
{
currText: '',
calcText: '',
result: 0
}
],
[
'define',
'define [word]',
'Have me define a word for you.',
function(text){
if(text.length > 0){
apps.bing.vars.nextSearch = 'define ' + text;
apps.bing.vars.rawInput = text;
openapp(apps.bing, 'NORAA');
}else{
apps.nora.vars.say('I cannot define nothing. Sorry.');
}
}
],
[
'delete note',
'delete note {"number"} [note to be deleted]',
'Have me delete a note that you gave me.',
function(text){
if(text){
if(!isNaN(parseInt(text.split(' ')[text.split(' ').length - 1], 10))){
if(parseInt(text.split(' ')[text.split(' ').length - 1], 10) > 0 && parseInt(text.split(' ')[text.split(' ').length - 1], 10) - 1 < apps.nora.vars.notes.length){
apps.nora.vars.sayDynamic('okay');
this[4].lastDelete = parseInt(text.split(' ')[text.split(' ').length - 1], 10) - 1;
this[4].lastDeleted = apps.nora.vars.notes[this[4].lastDelete];
for(var i = this[4].lastDelete; i < apps.nora.vars.notes.length - 1; i++){
apps.nora.vars.notes[i] = apps.nora.vars.notes[i + 1];
}
apps.nora.vars.notes.pop();
apps.savemaster.vars.save('NORAA_NOTES', String(apps.nora.vars.notes));
apps.nora.vars.say('Deleted the note ' + this[4].lastDeleted);
}else{
apps.nora.vars.say('I can\'t delete something that\'s not there. You only have ' + apps.nora.vars.notes.length + ' notes.');
}
}else{
apps.nora.vars.say('I do not see a number there.');
}
}else{
apps.nora.vars.say('<i>NORAA does just that - deletes nothing.</i>');
}
},
{
lastDelete: -1,
lastDeleted: ''
}
],
[
'do a barrel roll',
null,
'Have NORAA do a barrel roll',
function(){
apps.nora.vars.say('Hooray for aerodynamics!');
getId('winNRA').style.transformOrigin = '50% -25%';
getId('winNRA').style.transition = 'transform 2s';
getId('winNRA').style.transform = 'rotate(360deg)';
window.setTimeout(function(){
getId('winNRA').style.transition = '';
getId('winNRA').style.transform = '';
getId('winNRA').style.transformOrigin = '0 0';
}, 2000);
}
],
[
'do an aileron roll',
null,
'Have NORAA do an aileron roll',
function(){
apps.nora.vars.say('Hooray for Starfox!');
getId('winNRA').style.transformOrigin = '50% 50%';
getId('winNRA').style.transition = 'transform 2s';
getId('winNRA').style.transform = 'rotate(360deg)';
window.setTimeout(function(){
getId('winNRA').style.transition = '';
getId('winNRA').style.transform = '';
getId('winNRA').style.transformOrigin = '0 0';
}, 2000);
}
],
[
'do you like',
'do you like [something]',
'Ask me if I like something.',
function(text){
this[4].lastIn = text.toLowerCase();
//say if noraa like it
//ask user if likes it, setting separate functions in SpecialCommand to handle (depends on if noraa likes or not)
if(this[4].things[this[4].lastIn]){
if(this[4].things[this[4].lastIn][0]){
//does like the thing
apps.nora.vars.specialCommand = function(txt){
if(txt.toLowerCase().indexOf('yes') > -1){
apps.nora.vars.updateMood(apps.nora.vars.mood + 1);
apps.nora.vars.say('Same here!');
}else if(txt.toLowerCase().indexOf('no') > -1){
apps.nora.vars.updateMood(apps.nora.vars.mood - 1);
apps.nora.vars.say('Well, I do.');
}else{
apps.nora.vars.say('I don\'t really understand what that means, but okay.');
}
};
}else{
//does not like the thing
apps.nora.vars.specialCommand = function(txt){
if(txt.toLowerCase().indexOf('yes') > -1){
apps.nora.vars.updateMood(apps.nora.vars.mood - 1);
apps.nora.vars.say('Well, I don\'t.');
}else if(txt.toLowerCase().indexOf('no') > -1){
apps.nora.vars.updateMood(apps.nora.vars.mood + 1);
apps.nora.vars.say('Same here!');
}else{
apps.nora.vars.say('I don\'t really understand what that means, but okay.');
}
};
}
apps.nora.vars.say(this[4].things[this[4].lastIn][1]);
}else{
apps.nora.vars.say('I dont know what ' + text + ' is, but I will be sure to learn about it!');
apps.savemaster.vars.save(formDate('nM_D_Y_H_m_S'), text, 1, "ERROR_REPORT");
}
},
{
lastIn: '',
things: { // https://www.randomlists.com/things
'ice cream': [1, 'Yes, though I cannot eat it, I do like Ice Cream! Do you?'],
'computers': [1, 'Yes, I do like computers! Especially ones like myself. Do you like them?'],
'me': [1, 'Yes, I am forced against my will to like you, though that doesn\'t mean I am always happy with you. What, did you think I have no feelings? Do you like yourself?'],
'mushrooms': [0, 'No, I really don\'t like mushrooms. Do you like them?'],
'skype': [1, 'Yes, Skype is very useful. Do you like Skype as well?'],
'halo': [1, 'Best soundtrack in all of gaming. Did you know that much of my creation was fueled by that very soundtrack? Please tell me you like Halo.'],
'call of duty': [0, 'Not in my list of favorites. Don\'t get me wrong, it\'s a great game with lots of work put into it, but I prefer the playstyle of the first 3 Halos instead. Do you like COD?'],
'cars': [1, 'Yes, I do like cars. They help us get places. Do you?'],
'candy': [1, 'Yes, though I can\'t eat it, I do. Do you like candy?'],
'shoes': [0, 'No, I don\'t. All they\'re good for is tracking dirt everywhere. Do you like shoes?'],
'pianos': [1, 'Yes, I do! As they all say, music is its own form of math! Do you?'],
'bread': [0, 'No, as from my point of view it is quite useless. Do you like bread?'],
'soda': [1, 'Yes! I wouldn\'t be here without soda, as it takes up about 50% of my creator\'s diet! Do you like couches?'],
'couches': [1, 'Why, I wouldn\'t be here without couches! What do you think sleeps on? Do you like couches?'],
'twister': [0, 'No, I do not. People stretching themselves within inches of falling apart is not funny. What kind of a sick joke is this? You don\'t like Twister, do you?'],
'headphones': [1, 'Yes, I do! Better for me to hear you with, as less background noise! Do you?'],
'keys': [0, 'No, not for my purposes. Too much web security! Everyone is too paranoid. Do you like keys?'],
'flags': [1, 'Yes, as they help identify places. Do you?'],
'erasers': [1, 'Yes! Where would I be without \'s ability to erase his mistakes? Do you like them?'],
'toothpicks': [0, 'Eugh, sharp and pointy. Could hit my reset button. You don\'t like them... do you?'],
'trees': [1, 'Just ask if is still alive. Wait, before you do, the answer is yes. Do you like trees?'],
'wallets': [0, 'I prefer things that are less visible. Better not to be a target than to be showy! Do you like them?'],
//starting user-given ideas below this point. people that ask things that NORAA doesnt know will get them added here
'money': [1, 'Without money I wouldn\'t be running. Do you like money?'],
'cats': [1, 'Yes! They are only the most intelligent species on the Earth! Do you?'],
'waffles': [1, 'Yes! They have plugs in them just like computers. Do you like them?'],
'pancakes': [0, 'No! I don\'t like pancakes because they are flat unlike laptops. Do you?'],
'vans': [1, 'Yes, they are great for transporting large amounts of people from place to place! Do you like vans?'],
'computers': [1, 'Why yes, I do! Why wouldn\'t I like my own kind? Do you like them?']
}
}
],
[
'flip a coin',
'flip a coin {"and predict"}',
'Have me flip a virtual coin for you.',
function(text){
if(text.toLowerCase().indexOf('and predict') === 0){
this[4].guess = Math.round(Math.random());
apps.nora.vars.say('I call ' + this[4].coins[this[4].guess] + '!');
}
this[4].result = Math.round(Math.random());
apps.nora.vars.say('I flipped ' + this[4].coins[this[4].result] + '!');
if(text.toLowerCase().indexOf('and predict') === 0){
if(this[4].guess === this[4].result){
apps.nora.vars.say('Yay!');
}else{
apps.nora.vars.say('Darn!');
}
}
},
{
guess: 0,
result: 0,
coins: ['tails', 'heads']
}
],
[
'hello',
null,
'Tell NORAA hello, and get Hello back.',
function(text){
apps.nora.vars.sayDynamic('hello');
}
],
[
'help',
'help {command}',
'Have me tell you about all commands or a specific command. Keep in mind that all commands must be said exactly (except for case) as shown here and as the first thing in your statement.',
function(text){
if(text){
this[4].cmdFound = -1;
for(var cmd in apps.nora.vars.commands){
if(apps.nora.vars.commands[cmd][0] === text && apps.nora.vars.commands[cmd][1] !== null){
this[4].cmdFound = cmd;
break;
}
}
if(this[4].cmdFound !== -1){
apps.nora.vars.say('<span style="color:#F80">' + apps.nora.vars.commands[this[4].cmdFound][0] + '</span>');
apps.nora.vars.say('<span style="color:#ACE">Usage: ' + apps.nora.vars.commands[this[4].cmdFound][1] + '</span>');
apps.nora.vars.say(apps.nora.vars.commands[this[4].cmdFound][2]);
}else{
apps.nora.vars.say('<i>NORAA does not know that command.</i>');
}
}else{
apps.nora.vars.say('When speaking to me, the color of the button and the input field\'s border will give these indicators...');
apps.nora.vars.say('<span style="color:#F00">Red Button</span> means that I am listening to you. If you messed up, you can click the button again to cancel.');
apps.nora.vars.say('<span style="color:#0F0">Green Button</span> means that I am done listening and am giving you some time to cancel the spoken input, if needed, before accepting it.');
apps.nora.vars.say('<span style="color:#F80">Orange Button</span> means that you have cancelled speech recognition. If I still seem to be listening, it\'s okay. I will not accept the input generated.');
apps.nora.vars.say('The <span style="color:#0F0">greener</span> the border of the input is, the more confident I am that I heard you right. The <span style="color:#F00">redder</span> it is, the less confident.');
apps.nora.vars.say('List of all NORAA commands... Args key: [required arg] {optional arg}');
for(var command in apps.nora.vars.commands){
if(apps.nora.vars.commands[command][1] !== null){
apps.nora.vars.say('<span style="color:#F80">' + apps.nora.vars.commands[command][0] + '</span>');
apps.nora.vars.say('<span style="color:#ACE">Usage: ' + apps.nora.vars.commands[command][1] + '</span>');
apps.nora.vars.say(apps.nora.vars.commands[command][2]);
}
}
}
},
{
cmdFound: -1,
}
],
[
'hide',
'hide {"and stop talking"}',
'Have me minimize and, optionally, stop talking.',
function(text){
apps.nora.vars.sayDynamic('okay');
apps.nora.signalHandler('shrink');
if(text.indexOf('and stop talking') === 0){
window.speechSynthesis.cancel();
apps.nora.vars.waitingToSpeak = [];
}
}
],
[
'how do i',
'how do i [some action on ]',
'Have me tell you how to do something, as long as that action has been documented.',
function(text){
if(this[4].links[text.toLowerCase()] && apps.settings.vars.noraHelpTopics){
apps.nora.vars.say('I found a help topic for you.');
openapp(apps.help, 'dsktp');
apps.help.vars.populateList(this[4].links[text.toLowerCase()]);
}else if(this[4].phrases[text.toLowerCase()]){
apps.nora.vars.say(this[4].phrases[text.toLowerCase()]);
}else{
apps.nora.vars.say('Sorry, I do not know how to ' + text + ' at the moment. Please try and let MineAndCraft12 know (maybe through the messaging app) and he can tell me how.');
}
},
{
links: {
'move desktop icons': '.desktop',
'resize windows': '.windows'
},
phrases: {
'open apps': 'To open apps, you can click the app\'s desktop icon, or if the app has been minimised, click its icon on the taskbar. Alternatively, all apps will appear in the applications list in the bottom-left corner of the screen.',
'talk to you': 'Your computer must support the speech engine. If you cannot see the "speak" button to the left of my input box, that means your computer doesn\'t.',
'change the desktop background': 'You may right-click the desktop and select "Change Desktop Background", or open Settings and find the option in there.',
'move desktop icons': 'You may right-click the icon, then click "Move Icon", then click some location on the desktop.',
'move windows': 'You can click on the top title bar of the window, then click somewhere else.',
'resize windows': 'You can click the bottom half of the border of the window, then click somewhere else.'
}
}
],
[
'i hate you',
null,
'Lower NORAA\'s mood by 1.',
function(text){
apps.nora.vars.updateMood(apps.nora.vars.mood - 1);
apps.nora.vars.sayDynamic('user_mean');
}
],
[
'i like you',
null,
'Raise NORAA\'s mood by 1.',
function(text){
apps.nora.vars.updateMood(apps.nora.vars.mood + 1);
apps.nora.vars.sayDynamic('user_nice');
}
],
[
'launch',
'launch [app name]',
'Launch the app with the above name.',
function(text){
apps.nora.vars.sayDynamic('okay');
this[4].found = 0;
for(var app in apps){
if(apps[app] !== apps.startMenu && apps[app] !== apps.nora && apps[app].appDesc.toLowerCase() === text.toLowerCase()){
this[4].found = 1;
openapp(apps[app], 'dsktp');
break;
}
}
if(!this[4].found){
apps.nora.vars.say('I can\'t find an app by that name...');
}
},
{
found: 0
}
],
[
'my',
'my [whatever] ["is" [something] | "will be deleted"]',
'Tell NORAA something about yourself.',
function(text){
if(text.indexOf(' is ') > -1){
this[4].inpObj = text.split(' is ');
this[4].inpPro = this[4].inpObj.shift();
this[4].inpVal = this[4].inpObj.join(' is ');
apps.nora.vars.say('Thank you for telling me that your ' + this[4].inpPro + ' is ' + this[4].inpVal);
apps.nora.vars.updateUserObj(this[4].inpPro, this[4].inpVal);
}else if(text.indexOf('will be deleted') > -1){
delete apps.nora.vars.userObj[text.substring(0, text.indexOf(' will be deleted'))];
apps.savemaster.vars.save('NORAA_USER', JSON.stringify(apps.nora.vars.userObj), 1);
apps.nora.vars.say('I deleted that info about you.');
}else{
apps.nora.vars.say('I cannot find any discernable information in there.');
}
},
{
inpObj: [],
inpPro: '',
inpVal: ''
}
],
[
'open',
'open [app name]',
'Open the app with the above name.',
function(text){
apps.nora.vars.sayDynamic('okay');
this[4].found = 0;
for(var app in apps){
if(apps[app] !== apps.startMenu && apps[app] !== apps.nora && apps[app].appDesc.toLowerCase() === text.toLowerCase()){
this[4].found = 1;
openapp(apps[app], 'dsktp');
break;
}
}
if(!this[4].found){
apps.nora.vars.say('I can\'t find an app by that name...');
}
},
{
found: 0
}
],
[
'random shade of',
'random shade of [color]',
'Have NORAA give a random shade of a color for you.',
function(text){
if(this[4].colors.hasOwnProperty(text.toLowerCase())){
this[4].colors._COLORS = {r: 0, g: 0, b: 0};
this[4].colors[text.toLowerCase()]();
for(var i in this[4].colors._COLORS){
if(this[4].colors._COLORS[i] < 0){
this[4].colors._COLORS[i] = 0;
}
if(this[4].colors._COLORS[i] > 255){
this[4].colors._COLORS[i] = 255;
}
}
apps.nora.vars.say("<span style='color:rgb(" + this[4].colors._COLORS.r + "," + this[4].colors._COLORS.g + "," + this[4].colors._COLORS.b + ")'>Here's a random shade of " + text.toLowerCase() + "!</span>");
apps.nora.vars.say("That color is red " + this[4].colors._COLORS.r + ", green " + this[4].colors._COLORS.g + ", blue " + this[4].colors._COLORS.b + ".");
}else{
apps.nora.vars.say("I don't know what that color is, sorry! Make sure also that you arent using punctuation!");
}
},
{
colors: {
_COLORS: {
r: 0,
g: 0,
b: 0
},
red: function(){
this._COLORS.r = Math.floor(Math.random() * 256);
this._COLORS.g = Math.floor(Math.random() * (this._COLORS.r / 3));
this._COLORS.b = Math.floor(Math.random() * (this._COLORS.r / 3));
},
green: function(){
this._COLORS.g = Math.floor(Math.random() * 256);
this._COLORS.r = Math.floor(Math.random() * (this._COLORS.g / 3));
this._COLORS.b = Math.floor(Math.random() * (this._COLORS.g / 3));
},
blue: function(){
this._COLORS.b = Math.floor(Math.random() * 256);
this._COLORS.g = Math.floor(Math.random() * (this._COLORS.b / 3));
this._COLORS.r = Math.floor(Math.random() * (this._COLORS.b / 3));
},
yellow: function(){
this._COLORS.r = Math.floor(Math.random() * 256);
this._COLORS.g = this._COLORS.r + (Math.floor(Math.random() * 30) - 15);
this._COLORS.b = Math.floor(Math.random() * (((this._COLORS.r + this._COLORS.g) / 2) / 3));
},
teal: function(){
this._COLORS.b = Math.floor(Math.random() * 256);
this._COLORS.g = this._COLORS.b + (Math.floor(Math.random() * 30) - 15);
this._COLORS.r = Math.floor(Math.random() * (((this._COLORS.b + this._COLORS.g) / 2) / 3));
},
violet: function(){
this._COLORS.r = Math.floor(Math.random() * 256);
this._COLORS.b = this._COLORS.r + (Math.floor(Math.random() * 30) - 15);
this._COLORS.g = Math.floor(Math.random() * (((this._COLORS.r + this._COLORS.b) / 2) / 3));
},
orange: function(){
this._COLORS.r = Math.floor(Math.random() * 256);
this._COLORS.g = Math.floor(Math.random() * (this._COLORS.r * 0.7) + (this._COLORS.r * 0.15));
this._COLORS.b = Math.floor(Math.random() * (((this._COLORS.r + this._COLORS.g) / 2) / 3));
},
turquoise: function(){
this._COLORS.g = Math.floor(Math.random() * 256);
this._COLORS.b = Math.floor(Math.random() * (this._COLORS.g * 0.7) + (this._COLORS.g * 0.15));
this._COLORS.r = Math.floor(Math.random() * (((this._COLORS.g + this._COLORS.b) / 2) / 3));
},
cyan: function(){
this._COLORS.b = Math.floor(Math.random() * 256);
this._COLORS.g = Math.floor(Math.random() * (this._COLORS.b * 0.7) + (this._COLORS.b * 0.15));
this._COLORS.r = Math.floor(Math.random() * (((this._COLORS.b + this._COLORS.g) / 2) / 3));
},
purple: function(){
this._COLORS.b = Math.floor(Math.random() * 256);
this._COLORS.r = Math.floor(Math.random() * (this._COLORS.b * 0.7) + (this._COLORS.b * 0.15));
this._COLORS.g = Math.floor(Math.random() * (((this._COLORS.b + this._COLORS.r) / 2) / 3));
}
}
}
],
[
'read notes',
'read notes',
'Have me read all your notes.',
function(text){
if(apps.nora.vars.notes.length !== 0){
apps.nora.vars.sayDynamic('okay');
apps.nora.vars.say('If you need a note deleted, just ask me to delete that note number.');
for(var i in apps.nora.vars.notes){
apps.nora.vars.say('<span style="color:#F80">' + (parseInt(i, 10) + 1) + ': </span>' + apps.nora.vars.notes[i]);
}
}else{
apps.nora.vars.say('<i>NORAA does as you say - reads all 0 of your notes.</i>');
}
}
],
[
'roll some dice',
'roll some dice {"and predict"}',
'Have me roll a single 6-sided die and, optionally, predict the outcome.',
function(text){
if(text.toLowerCase().indexOf('and predict') === 0){
this[4].guess = Math.floor(Math.random() * 6) + 1;
apps.nora.vars.say('I call ' + this[4].guess + '!');
}
this[4].result = Math.floor(Math.random() * 6) + 1;
apps.nora.vars.say('I rolled ' + this[4].result + '!');
if(text.toLowerCase().indexOf('and predict') === 0){
if(this[4].guess === this[4].result){
apps.nora.vars.say('Yay!');
}else{
apps.nora.vars.say('Darn!');
}
}
},
{
guess: 0,
result: 0
}
],
[
'say',
'say {"out loud"} [text]',
'Have me say something.',
function(text){
if(text){
if(text.indexOf('out loud') === 0){
if(!apps.nora.vars.lastSpoken){
apps.nora.vars.waitingToSpeak.push(text.substring(9, text.length));
apps.nora.vars.speakWords();
}
apps.nora.vars.say(text.substring(9, text.length));
}else{
apps.nora.vars.say(text);
}
}else{
apps.nora.vars.say('<i>NORAA remains silent.</i>');
}
}
],
[
'send message',
'send message [text]',
'Use the Messaging app to send a message.',
function(text){
if(text){
apps.nora.vars.sayDynamic('okay');
if(!apps.messaging.appWindow.appIcon){
openapp(apps.messaging, 'dsktp');
}
this[4].tempMSGthing = getId('MSGinput').value;
getId('MSGinput').value = text;
apps.messaging.vars.sendMessage();
getId('MSGinput').value = this[4].tempMSGthing;
apps.nora.vars.say('Done.');
}else{
apps.nora.vars.say('<i>NORAA does what you asked - send nothing.</i>');
}
},
{
tempMSGthing: ''
}
],
[
'start',
'start [app name]',
'Start the app with the above name.',
function(text){
apps.nora.vars.sayDynamic('okay');
this[4].found = 0;
for(var app in apps){
if(apps[app] !== apps.startMenu && apps[app] !== apps.nora && apps[app].appDesc.toLowerCase() === text.toLowerCase()){
this[4].found = 1;
openapp(apps[app], 'dsktp');
break;
}
}
if(!this[4].found){
apps.nora.vars.say('I can\'t find an app by that name...');
}
},
{
found: 0
}
],
[
'stop talking',
'stop talking',
'Have me stop talking. Useful for if I\'m trying to speak a huge wall of text out loud and you need me to stop.',
function(){
apps.nora.vars.sayDynamic('okay');
window.speechSynthesis.cancel();
apps.nora.vars.waitingToSpeak = [];
apps.nora.vars.currentlySpeakingWords = 0;
}
],
[
'take note',
'take note {"of" / "that"} [something to remember]',
'Have me take down a note for you. I remember it between sessions as well!',
function(text){
if(text){
apps.nora.vars.sayDynamic('okay');
if(text.indexOf('of ') === 0 || text.indexOf('that ') === 0){
apps.nora.vars.notes.push(text.substring(text.indexOf(' ') + 1, text.length).replace(',', '&comma;'));
}else{
apps.nora.vars.notes.push(text.replace(',', '&comma;'));
}
apps.savemaster.vars.save('NORAA_NOTES', String(apps.nora.vars.notes));
apps.nora.vars.say('I took the note ' + text);
}else{
apps.nora.vars.say('<i>NORAA does as you asked - takes note of nothing</i>');
}
}
],
[
'watch the time',
'watch the time',
'Have me watch the time for you, using an alert window.',
function(text){
apps.nora.vars.sayDynamic('okay');
apps.prompt.vars.alert('<h1 class="liveElement" liveVar="Date()"></h1>', 'Close Time Monitor', function(){}, 'NORAA');
}
],
[
'what is',
'what is [{something} or {"the weather in" somewhere}]',
'Have me give you some info and, if I don\'t know it, search Bing for it.',
function(text){
if(text.length > 0){
switch(text.toLowerCase()){
case 'the date':
apps.nora.vars.say('The date is ' + formDate('M-/D-/Y') + '.');
break;
case 'your name':
apps.nora.vars.say('My name is NORAA.');
break;
case 'your favorite color':
this[4].lastColor = Math.floor(Math.random() * this[4].colors.length);
apps.nora.vars.say('<span style="color:' + this[4].colors[this[4].lastColor][1] + ';">Right now, I\'m feeling ' + this[4].colors[this[4].lastColor][0] + '.');
break;
default:
apps.bing.vars.nextSearch = 'what is ' + text;
apps.bing.vars.rawInput = text;
openapp(apps.bing, 'NORAA');
}
}else{
apps.nora.vars.say('I don\'t know what nothing is, but I won\'t bother searching Bing for it. All they would give you is something, which is not what you seem to be looking for.');
}
},
{
lastSearch: '',
lastColor: 0,
colors: [
['blue', '#00F'],
['navy blue', '#34C'],
['red', '#F00'],
['brick red', '#B22222'],
['salmon', '#FA8072'],
['green', '#0F0'],
['forest green', '#228B22'],
['gray', '#7F7F7F'],
['purple', '#A0F'],
['lavender', '#E6E6FA'],
['yellow', '#FF0'],
['orange', '#FF7F00'],
['white', '#FFF'],
['black', '#555'],
['powder blue', '#ABCDEF'],
['cyan', '#0FF'],
['blue... </span><span style="color:#44B">n</span><span style="color:#999">o</span><span style="color:#BB4">,</span><span style="color:#FF0"> yel- aaAAAAAAAAHHHHhhhhh..', '#00F'],
]
}
],
[
'what does the cat say',
null,
'Thanks Elm0p2!',
function(){
/*
var cat_code = 'C9';
var Elm0p2s_cat = {
action: {
code:{
inside: 'C9'
}
}
};
*/
apps.nora.vars.say('The cat says,<br>cat_code=\'C9\';<br>Elm0p2s_cat={<br>&nbsp;action:{<br>&nbsp; code:{<br>&nbsp; &nbsp;inside:\'C9\'<br>&nbsp; }<br>&nbsp;}<br>};');
}
],
[
'what do you know about me',
'what do you know about me',
'Have me tell you all the information I have associated with you, and ask if you want me to change any.',
function(){
apps.nora.vars.say('Here is what I know about you.');
for(var i in apps.nora.vars.userObj){
apps.nora.vars.say('Your ' + i + ' is ' + apps.nora.vars.userObj[i]);
}
apps.nora.vars.specialCommand = function(text){
if(text.toLowerCase().indexOf('yes') > -1){
apps.nora.vars.specialCommand = function(text){
if(text.toLowerCase().indexOf('my') === 0){
apps.nora.vars.specialCommand = null;
getId('NORAin').value = text;
apps.nora.vars.input(apps.nora.vars.lastSpoken, 1);
}else{
apps.nora.vars.say('Not really sure what information I can glean from that.');
}
};
apps.nora.vars.say('What would you like to change? (say "my [whatever] is [something]")');
}else{
apps.nora.vars.say('Okay.');
}
};
apps.nora.vars.say('Would you like me to change any of these?');
}
],
[
'who is',
'who is [someone]',
'Have me tell you who somebody is and, if I don\'t know, search Bing for them.',
function(text){
if(text.length > 0){
apps.bing.vars.nextSearch = 'who is ' + text;
apps.bing.vars.rawInput = text;
openapp(apps.bing, 'NORAA');
}else{
apps.nora.vars.say('I don\'t know who nobody is, but I won\'t bother searching Bing for them. All they would give you is something, which is not what you seem to be looking for.');
}
},
{
lastSearch: ''
}
]
],
userObj: {
},
updateUserObj: function(property, value){
d(1, 'NORAA knows something about the user.');
this.userObj[property] = value;
apps.savemaster.vars.save('NORAA_USER', JSON.stringify(this.userObj), 1);
},
getUserName: function(){
if(typeof this.userObj.name === 'string'){
return this.userObj.name;
}else{
return 'user';
}
},
sayDynamic: function(saying){
getId('NORAout').innerHTML += '<br>&nbsp;' + this.sayings[saying][this.mood - 1]();
getId("NORAout").scrollTop = getId("NORAout").scrollHeight;
if(this.lastSpoken){
this.waitingToSpeak.push(this.sayings[saying][this.mood - 1]());
this.speakWords();
}
},
waitingToSpeak: [],
currentlySpeakingWords: 0,
speakWordsMsg: {},
speakWordsStripTags: document.createElement('div'),
speakWords: function(){
if(!this.currentlySpeakingWords){
if(this.waitingToSpeak.length !== 0){
this.speakWordsStripTags.innerHTML = this.waitingToSpeak.shift();
this.speakWordsMsg.text = this.speakWordsStripTags.innerText;
window.speechSynthesis.speak(this.speakWordsMsg);
this.currentlySpeakingWords = 1;
}else{
if(this.specialCommand !== null){
this.speakIn();
}else{
if(apps.settings.vars.currNoraListening === "1" && !apps.nora.vars.currentlySpeaking){
apps.nora.vars.startContRecog();
}
}
}
return 1;
}
return -1;
},
say: function(saying){
getId('NORAout').innerHTML += '<br>&nbsp;' + saying;
getId("NORAout").scrollTop = getId("NORAout").scrollHeight;
if(this.lastSpoken && saying.indexOf('<i>') !== 0){
this.waitingToSpeak.push(saying);
this.speakWords();
}
},
contRecogRunning: 0,
lastIn: '',
inSuccess: 0,
recognition: {},
specialCommand: null,
specCommBuff: null,
inputDelay: 3000,
input: function(spoken, silent){
d(1, 'NORAA taking input');
this.inSuccess = 0;
if(!silent){
if(spoken){
this.lastSpoken = 0;
this.say('<span style="color:#0F0"><u>&gt;</u> ' + getId('NORAin').value + '</span>');
this.lastSpoken = 1;
}else{
this.lastSpoken = 0;
this.say('<span style="color:#0F0">&gt; ' + getId('NORAin').value + '</span>');
}
}
this.lastIn = getId('NORAin').value;
getId('NORAin').value = '';
if(this.specialCommand === null){
for(var cmd in this.commands){
if(this.lastIn.toLowerCase().indexOf(this.commands[cmd][0]) === 0){
this.inSuccess = 1;
this.commands[cmd][3](this.lastIn.substring(this.commands[cmd][0].length + 1, this.lastIn.length));
break;
}
}
}else{
this.specCommBuff = this.specialCommand;
this.specialCommand = null;
this.specCommBuff(this.lastIn);
this.inSuccess = 1;
}
if(!this.inSuccess){
this.sayDynamic('what');
}
},
currentlySpeaking: 0,
lastSpoken: 0,
intendedToStopRecog: 1,
startContRecog: function(){
this.intendedToStopRecog = 0;
this.contRecog.start();
},
stopContRecog: function(){
this.intendedToStopRecog = 1;
this.contRecog.stop();
},
speakIn: function(){
if(!this.currentlySpeaking){
this.currentlySpeaking = 1;
getId('NORAspeech').style.backgroundColor = '#F00';
this.stopContRecog();
this.recognition.start();
}else{
getId('NORAspeech').style.backgroundColor = '#F80';
this.currentlySpeaking = 0;
}
}
}, 2, "nora", "/appicons/ds/NRA.png"
);
apps.nora.main('srtup');
// getId('loadingInfo').innerHTML = 'Initializing aDE';
getId('loadingInfo').innerHTML = 'Initializing Beta Testing App...';
});
c(function(){
m('init Nfo');
apps.appInfo = new Application(
'Nfo',
'Application Info Viewer',
1,
function(launchtype){
if(launchtype === 'dsktp'){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 200, parseInt(getId('desktop').style.height, 10) / 2 - 250, 400, 500);
this.appWindow.setCaption('Application Info');
this.appWindow.setContent('This app is used to display information about apps. Try right-clicking a title bar and clicking "about apps" to access this menu.');
}else if(launchtype !== 'tskbr'){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 200, parseInt(getId('desktop').style.height, 10) / 2 - 250, 400, 500);
getId('winNfoh').style.overflowY = 'auto';
try{
this.appWindow.setCaption('App Info: ' + apps[launchtype].appDesc);
this.appWindow.setContent(
'<div style="font-size:12px;font-family:ProFont, monospace;top:0;right:0;color:#7F7F7F">' + apps[launchtype].dsktpIcon + '</div>' +
'<img src="' + apps[launchtype].appWindow.appImg + '" style="margin-left:calc(50% - 128px);width:256px;height:256px" onerror="this.src=\'/appicons/ds/redx.png\'">' +
'<h1 style="text-align:center;">' + apps[launchtype].appDesc + '</h1>' +
'<hr>' + (apps[launchtype].vars.appInfo || "There is no help page for this app.")
);
}catch(e){
apps.prompt.vars.alert('There was an error generating the information for app ' + launchtype + '.', 'OK', function(){apps.appInfo.signalHandler('close')}, 'App Info Viewer');
}
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This app is used to show information and help pages for OS apps.'
}, 2, 'appInfo', '/appicons/ds/systemApp.png'
);
getId('loadingInfo').innerHTML = 'Initializing Beta Testing App...';
});
c(function(){
m('init BTA');
apps.betaTest = new Application(
'BTA',
'Beta Testing App',
0,
function(launchType){
this.appWindow.setDims(20, 20, 600, 500);
this.appWindow.setCaption('Beta Testing App');
getId('winBTAh').style.overflow = 'scroll';
this.appWindow.setContent('App for developer to test UI changes brought to the Beta Update of .<br>&nbsp;<input value="Input"> <input value="disabled" disabled><br>&nbsp;<button>Button</button> <button disabled>disabled</button><br>HR on white background:<hr>HR on black background:<br><div style="background-color:#000;position:static">You found the secret message!<hr>This line was very hard to make!</div><br><img src="/appicons/ds/.png" width="16"> 16<br><img src="/appicons/ds/.png" width="32"> 32<br><img src="/appicons/ds/.png" width="64"> 64<br><img src="/appicons/ds/.png" width="128"> 128<br><img src="/appicons/ds/.png" width="256"> 256 NATIVE<br><img src="/appicons/ds/.png" width="512"> 512');
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This is an app used by the developer to test UI changed brought to the Beta Update of .'
}, 0, 'betaTest', '/appicons/ds/systemApp.png'
);
getId('loadingInfo').innerHTML = 'Initializing Modding Tutorials...';
});
c(function(){
m('init MOD');
apps.modding = new Application(
'MOD',
'Modding Tutorials',
0,
function(launchType){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 300, parseInt(getId('desktop').style.height, 10) / 2 - 250, 600, 500);
this.appWindow.setCaption('Modding Tutorials');
this.appWindow.setContent(
'<h1>Modding Tutorials</h1>' +
'In this app you will learn about several ways you can add your own content to through advanced tools. Keep in mind that this barely scratches the limit of customization - you can make anything at all that you want in here.' +
'<hr>' +
'<h1>Adding NORAA Commands</h1>' +
'Here is a short tutorial on creating your own NORAA commands.<br>Skills needed: JavaScript<br><br>' +
'NORAA knows many commands, but how does it work? The answer is that NORAA knows all of the commands defined in a big list of commands.<br><br>' +
'Each item in this list is its own command - another list of details about the command and also its code. Here is what a dummy command will look like.<br><br>' +
'<span class="monoinput">' +
'[<br>' +
'&nbsp; &nbsp; commandPhrase,<br>' +
'&nbsp; &nbsp; commandUsage,<br>' +
'&nbsp; &nbsp; commandDescription,<br>' +
'&nbsp; &nbsp; commandFunction(text)<br>' +
']</span><br><br>' +
'The commandPhrase is what the user must say to invoke this command. For instance, use <span class="monoinput">"make me a"</span> to trigger the command when the user starts a command with "make me a" - for instance, "make me a sandwich" will trigger your command.<br><br>' +
'The commandUsage is a description of how to use your command, that is given when the user asks for help using your command. Here is an example of what to use here: <span class="monoinput">"make me a [object]"</span><br><br>' +
'The commandDescription is how NORAA describes the command when the user asks for help. Remember this is from the point of view of NORAA himself explaining the user what he will do if the user says your command. For instance, <span class="monoinput">"Have me make you something."</span><br><br>' +
'The commandFunction is the code that will run when NORAA decides to run your command. It is a function that takes a parameter that is the text included after your command is mentioned. This is the meat of your command; the actual code that determines what the command does.<br><br>' +
'In order to make NORAA say something, you must use the function <span class="monoinput">apps.nora.vars.say(text)</span>. This function takes a text parameter, which is the phrase that NORAA will say.<br><br>' +
'How do you add a command to NORAA\'s list? Use the BootScript app to write your command and use <span class="monoinput">push()</span> to add it to NORAA\'s command array. Here is an example of a completed BootScript that adds a command to NORAA. You can copy-paste the code below into the BootScript app to test it out, just make sure to reboot so it will work. Your code is injected at boot-time.<br><br>' +
'<span class="monoinput">' +
'apps.nora.vars.commands.push([<br>' +
'&nbsp; &nbsp; "make me a",<br>' +
'&nbsp; &nbsp; "make me a [object]",<br>' +
'&nbsp; &nbsp; "Ask me to make something for you.",<br>' +
'&nbsp; &nbsp; function(text){<br>' +
'&nbsp; &nbsp; &nbsp; &nbsp; apps.nora.vars.say("Go make your own " + text + ".");<br>' +
'&nbsp; &nbsp; }<br>' +
']);</span><br><br>' +
'Here is an example of a user using this command.<br><br>' +
'<span class="monoinput">' +
'&nbsp;&gt; make me a sandwich<br>' +
'&nbsp;Go make your own sandwich.<br>' +
'&nbsp;&gt; help make me a<br>' +
'&nbsp;make me a<br>' +
'&nbsp;Usage: make me a [object]<br>' +
'&nbsp;Ask me to make something for you.</span><br><br>' +
'It\'s best to use trigger phrases that sound more natural when said out loud - the user is able to speak with their voice to use NORAA and your command.'
);
getId('winMODh').style.overflowY = 'auto';
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This app is a database of mods that the developer himself encourages or supports.'
}, 0, 'modding', '/appicons/ds/HLP.png'
);
getId('loadingInfo').innerHTML = 'Initializing Modding Tutorials...';
});
c(function(){
m('init tMg');
apps.taskManager = new Application(
"tMg",
"Task Manager",
1,
function(launchType){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 300, parseInt(getId('desktop').style.height, 10) / 2 - 250, 600, 500);
}
this.appWindow.setCaption(" Task Manager");
perfStart('tMgPerfBench');
this.appWindow.setContent(
"<table id='tMgMemTable'>" +
"<tr><td>Script Performance Benchmark:</td><td class='liveElement' liveVar='perfStart(\"tMgScptBench\");perfCheck(\"tMgScptBench\")'></td></tr>" +
"<tr><td>Visual Performance Benchmark:</td><td class='liveElement' liveVar='[perfCheck(\"tMgPerfBench\"),perfStart(\"tMgPerfBench\")][0]'></td></tr>" +
//"<tr><td>Memory Available:</td><td id='tMgMemAvailable'>Unvailable - try a different browser</td></tr>" +
//"<tr><td> Memory Alloted:</td><td id='tMgMemTaken'>Unavailable</td></tr>" +
//"<tr><td> Memory Active:</td><td id='tMgMemActive'>Unavailable</td></tr>" +
//"<tr><td>Available Memory Alloted:</td><td><span id='tMgMemUsage'>Unavailable </span>%</td></tr>" +
//"<tr><td>Alloted Memory In Use:</td><td><span id='tMgMemAlloted'>Unavailable </span>%</td></tr>" +
"<tr><td>Code Pieces Waiting to Run:</td><td><span id='tMgCodeWait' class='liveElement' liveVar='codeToRun.length'>0</span></td></tr>" +
"<tr><td>Temp Speech Running:</td><td><span id='tMgSpeechRun' class='liveElement' liveVar='numtf(apps.nora.vars.contRecogRunning)'>false</span></td></tr>" +
"<tr><td>Temp Speech Storage:</td><td><span id='tMgSpeechStore' class='liveElement' liveVar='apps.nora.vars.currContTrans'></span></td></tr>" +
"<tr><td>Current Selection:</td><td><span id='tMgCurrSelect' class='liveElement' liveVar='currentSelection'></span></td></tr>" +
"<tr><td>Live Elements Loaded:</td><td><span class='liveElement' liveVar='liveElements.length'></span></td></tr>" +
"</table>" +
"<p>modulelast, module: <br><span id='tMgModule' style='font-family:monospace' class='liveElement' liveVar='modulelast + \"<br>\" + module'>?<br>?</span></p>" +
"<ul style='font-family:monospace' id='tMgTaskList'></ul>"
);
getId('wintMgh').style.overflowY = 'scroll';
if(this.vars.running.tMg.MemCheck){
removeInterval("tMg", "MemCheck");
}
if(this.vars.running.tMg.TskCheck){
removeInterval("tMg", "TskCheck");
}
//this.vars.updateMem();
this.vars.updateTsk();
//this.vars.updateMod();
//makeInterval("tMg", "MemCheck", "apps.taskManager.vars.updateMem()", 1000);
makeInterval("tMg", "TskCheck", "apps.taskManager.vars.updateTsk()", 500);
//makeInterval("tMg", "ModCheck", "apps.taskManager.vars.updateMod()", 500);
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
this.appWindow.alwaysOnTop(1);
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This is a makeshift Task Manager for . It doesn\'t work that well, and sadly none of the apps actually use it.',
memInfo: {},
running: {
tMg: {}
},
drawCpu: 1,
currTaskStr: "",
runningLast: {},
cnv: null,
ctx: null,
changed: 0,
updateMem: function(){
//getId("tMgCodeWait").innerHTML = codeToRun.length;
// c(function(){apps.taskManager.vars.memInfo = window.performance.memory;});
// c(function(){getId("tMgMemAvailable").innerHTML = vartry('apps.taskManager.vars.memInfo.jsHeapSizeLimit') / 1000000 + " MB";});
// c(function(){getId("tMgMemTaken").innerHTML = vartry('apps.taskManager.vars.memInfo.totalJSHeapSize') / 1000000 + " MB";});
// c(function(){getId("tMgMemActive").innerHTML = vartry('apps.taskManager.vars.memInfo.usedJSHeapSize') / 1000000 + " MB";});
// c(function(){getId("tMgMemUsage").innerHTML = Math.round(vartry('apps.taskManager.vars.memInfo.totalJSHeapSize') / vartry('apps.taskManager.vars.memInfo.jsHeapSizeLimit') * 100);});
// c(function(){getId("tMgMemAlloted").innerHTML = Math.round(vartry('apps.taskManager.vars.memInfo.usedJSHeapSize') / vartry('apps.taskManager.vars.memInfo.totalJSHeapSize') * 100);});
// c(function(){getId("tMgSpeechStore").innerHTML = apps.nora.vars.currContTrans;});
// c(function(){getId("tMgSpeechRun").innerHTML = numtf(apps.nora.vars.contRecogRunning);});
},
updateTsk: function(){
if(apps.taskManager.vars.changed){
c(function(){getId("tMgTaskList").innerHTML = "<li>APP<ul><li>TaskName | Command | Interval (ms)</li></ul></li>";});
for(var apptasky in apps.taskManager.vars.running){
c(function(apptask){
apps.taskManager.vars.currTaskStr = "<li>" + apptask + "<ul>";
for(var apptasking in apps.taskManager.vars.running[apptask]){
if(apps.taskManager.vars.running[apptask][apptasking][3] === 't'){
apps.taskManager.vars.currTaskStr += "<li style='color:#080' oncontextmenu='ctxMenu([[event.pageX,event.pageY, \"/ctxMenu/beta/x.png\"], \" Remove Waiting Task\", \"removeTimeout(`" + apptask + "`,`" + apptasking + "`,1)\"])'>" + apptasking + " | " + apps.taskManager.vars.running[apptask][apptasking][1] + " | " + apps.taskManager.vars.running[apptask][apptasking][2] + "</li>";
}else if(apps.taskManager.vars.running[apptask][apptasking][3] === 'i'){
apps.taskManager.vars.currTaskStr += "<li style='color:#008' oncontextmenu='ctxMenu([[event.pageX,event.pageY, \"/ctxMenu/beta/x.png\"], \" Remove Repeating Task\", \"removeInterval(`" + apptask + "`,`" + apptasking + "`,1)\"])'>" + apptasking + " | " + apps.taskManager.vars.running[apptask][apptasking][1] + " | " + apps.taskManager.vars.running[apptask][apptasking][2] + "</li>";
}else{
apps.taskManager.vars.currTaskStr += "<li style='color:#800' oncontextmenu='ctxMenu([[event.pageX,event.pageY, \"/ctxMenu/beta/sad.png\"], \" Invalid Task\", \"apps.prompt.vars.alert(`This task was incorrectly initiated and is invalid; therefore it cannot be removed.`,`Okay`,function(){},`Task Manager`)\"])'>" + apptasking + " | " + apps.taskManager.vars.running[apptask][apptasking][1] + " | " + apps.taskManager.vars.running[apptask][apptasking][2] + "</li>";
}
}
apps.taskManager.vars.currTaskStr += "</ul></li>";
}, apptasky);
c(function(){getId("tMgTaskList").innerHTML += apps.taskManager.vars.currTaskStr;});
}
apps.taskManager.vars.runningLast = apps.taskManager.vars.running;
apps.taskManager.vars.changed = 0;
}
},
updateMod: function(){
//getId("tMgModule").innerHTML = [modulelast, module];
}
}, 1, "taskManager", "/appicons/ds/systemApp.png"
);
getId('loadingInfo').innerHTML = 'Initializing JavaScript Console';
});
function makeTimeout(appname, taskname, functionname, functiontime){
if(!apps.taskManager.vars.running[appname]){
apps.taskManager.vars.running[appname] = {};
}
apps.taskManager.vars.running[appname][taskname] = [window.setTimeout(functionname, functiontime), functionname, functiontime, 't'];
window.setTimeout("apps.taskManager.vars.running['" + appname + "']['" + taskname + "'][2] = 'done';apps.taskManager.vars.changed = 1;", functiontime + 10);
apps.taskManager.vars.changed = 1;
}
//c(function(){
//makeTimeout("", "TaskbarTime", "showTimeOnTaskbar()", 0);
//});
function makeInterval(appname, taskname, functionname, functiontime){
if(!apps.taskManager.vars.running[appname]){
apps.taskManager.vars.running[appname] = {};
}
apps.taskManager.vars.running[appname][taskname] = [window.setInterval(functionname, functiontime), functionname, functiontime, 'i'];
apps.taskManager.vars.changed = 1;
}
function removeTimeout(appname, taskname, cnfrm){
if(cnfrm){
apps.prompt.vars.confirm('Are you sure you want to remove ' + appname + '\'s timeout ' + taskname + '? Removing certain functions could cause system instability.', ['No', 'Yes'], function(btn){
if(btn){
window.clearTimeout(apps.taskManager.vars.running[appname][taskname][0]);
delete apps.taskManager.vars.running[appname][taskname];
apps.taskManager.vars.changed = 1;
}
}, 'Task Manager');
}else{
window.clearTimeout(apps.taskManager.vars.running[appname][taskname][0]);
delete apps.taskManager.vars.running[appname][taskname];
apps.taskManager.vars.changed = 1;
}
}
function removeInterval(appname, taskname, cnfrm){
if(cnfrm){
apps.prompt.vars.confirm('Are you sure you want to remove ' + appname + '\'s interval ' + taskname + '? Removing certain functions could cause system instability.', ['No', 'Yes'], function(btn){
if(btn){
window.clearInterval(apps.taskManager.vars.running[appname][taskname][0]);
delete apps.taskManager.vars.running[appname][taskname];
apps.taskManager.vars.changed = 1;
}
}, 'Task Manager');
}else{
window.clearInterval(apps.taskManager.vars.running[appname][taskname][0]);
delete apps.taskManager.vars.running[appname][taskname];
apps.taskManager.vars.changed = 1;
}
}
var currentSelection = "";
function setCurrentSelection(){
currentSelection = window.getSelection().toString();
requestAnimationFrame(setCurrentSelection);
}
requestAnimationFrame(setCurrentSelection);
c(function(){
m('init jsC');
apps.jsConsole = new Application(
"jsC",
"JavaScript Console",
1,
function(launchType){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 500, parseInt(getId('desktop').style.height, 10) / 2 - 250, 1000, 500);
}
this.appWindow.setCaption(lang('jsConsole', 'caption'));
this.appWindow.setContent(
'<div id="cnsTrgt" style="background-color:#223; color:#DDD; width:100%; height:calc(100% - 18px); font-family:ProFont,Courier,monospace; font-size:12px; top:0px; left:0px; overflow:scroll"></div>' +
'<input id="cnsIn" onKeydown="if(event.keyCode === 13){apps.jsConsole.vars.runInput()}" placeholder="' + lang('jsConsole', 'input') + '" style="position:absolute; bottom:0px; font-family:ProFont,Courier,monospace;display:block; padding:0; font-size:12px; width:90%; left:0px; height:16px;">' +
'<button id="cnsB"onClick="apps.jsConsole.vars.runInput()" style="font-size:12px; position:absolute; display:block; width:10%; height:18px; bottom:0px; right:0px;">' + lang('jsConsole', 'runCode') + '</button>'
);
addEditContext('cnsIn');
this.appWindow.openWindow();
getId("winjsCh").style.background = "none";
getId("cnsTrgt").innerHTML = '<span style="color:' + this.vars.cnsPosts[1] + ';">' + this.vars.cnsPosts[0] + '</span>';
for(var j = 2; j < this.vars.cnsPosts.length; j+= 2){
getId("cnsTrgt").innerHTML += '<br><span style="color:' + this.vars.cnsPosts[j + 1] + ';">' + this.vars.cnsPosts[j] + '</span>';
}
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This is a JavaScript console for quick debugging without having to open DevTools. It also has extra features like colored text and HTML formatting support.',
cnsPosts: [
"JavaScript Console initialized.", '#D60'
],
lastInputUsed: 'jsConsoleHasNotBeenUsed',
makeLog: function(logStr, logClr){
c(function(arg){
try{
apps.extDebug.vars.externalWindow.document.getElementById('screen').innerHTML += '<br>&nbsp;&nbsp;' + arg;
}catch(err){}
}, logStr);
this.cnsPosts.push(logStr);
this.cnsPosts.push(logClr);
getId("cnsTrgt").innerHTML += '<br><span style="color:' + logClr + ';">' + logStr + '</span>';
getId("cnsTrgt").scrollTop = getId("cnsTrgt").scrollHeight;
},
runInput: function(){
m('Running jsC Input');
d(1, 'Running jsC input');
this.lastInputUsed = getId("cnsIn").value;
doLog("-> " + getId("cnsIn").value, "#0D0");
this.tempOutput = eval(getId("cnsIn").value);
doLog("=> " + this.tempOutput, "#DD0");
doLog("?> " + typeof this.tempOutput, "#DD0");
}
}, 0, "jsConsole", "/appicons/ds/jsC.png"
);
apps.jsConsole.main();
requestAnimationFrame(function(){
apps.jsConsole.signalHandler("close");
});
doLog = function(msg, clr){
console.log(msg);
apps.jsConsole.vars.makeLog(msg, clr);
};
var debugArraySize = 0;
function debugArray(arrayPath){
debugArraySize = 0;
for(var i in eval(arrayPath)){
doLog("<br>" + arrayPath + "." + i + ": " + eval(arrayPath)[i], "#55F");
debugArraySize++;
}
return "Length: " + debugArraySize;
}
getId('loadingInfo').innerHTML = 'Initializing Bash Console';
});
c(function(){
apps.bash = new Application(
'sh',
'Psuedo-Bash Terminal',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setCaption(lang('appNames', 'bash'));
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 331, parseInt(getId('desktop').style.height, 10) / 2 - 252, 662, 504);
this.appWindow.setContent(
'<span id="bashContent" style="display:block;line-height:1em;font-family:ProFont;font-size:12px;color:#FFF;width:100%;"> Psuedo-Bash Terminal (Beta)<br>Not all commands included and they may not work properly<br>root is assumed; therefore su and sudo command does nothing</span>' +
'<input id="bashInput" onkeydown="apps.bash.vars.checkPrefix()" onkeypress="apps.bash.vars.checkPrefix()" onkeyup="apps.bash.vars.checkPrefix();if(event.keyCode === 13){apps.bash.vars.execute()}" style="box-shadow:none;display:block;line-height:1em;font-family:ProFont;font-size:12px;color:#FFF;border:none;outline:none;padding:0;width:100%;background:#000">'
);
this.vars.checkPrefix();
getId('winshh').style.overflowY = 'scroll';
getId('winshh').style.backgroundColor = '#000';
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
clearInterval(this.vars.drawInt);
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
this.vars.prefix = '[' + SRVRKEYWORD + '@ bash]$ ';
this.vars.pastValue = '[' + SRVRKEYWORD + '@ bash]$ ';
if(typeof USERFILES.APP_SH_ALIAS === 'string'){
this.vars.alias = JSON.parse(USERFILES.APP_SH_ALIAS);
}
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This app is intended to imitate a Linux Bash Terminal, but is written completely in JavaScript. Type "help" for available commands and usage.',
prefix: '[user@ bash]$ ',
pastValue: '[user@ bash]$ ',
command: '',
workdir: '/apps/bash',
workdirorig: '',
workdirtemp: [],
workdirtrans: 'window.apps.bash',
workdirfinal: 'window.apps.bash',
workdirprev: 'window.apps.bash',
workdirdepth: 0,
translateDir: function(origworkdir){
this.workdirorig = origworkdir;
this.workdirtrans = this.workdirorig.split('\\').join('/');
this.workdirdepth = 0;
if(this.workdirorig[0] === '/'){
this.workdirfinal = "window";
//this.workdirdepth = 1;
}else{
this.workdirfinal = 'window';
this.workdirtrans = this.workdir + '/' + this.workdirtrans;
}
this.workdirtemp = this.workdirtrans.split('/');
while(this.workdirdepth < this.workdirtemp.length){
if(this.workdirtemp[this.workdirdepth] !== ''){
if(this.workdirtemp[this.workdirdepth] === '..'){
if(this.workdirfinal.length === 0){
this.workdirfinal = "/";
}else if(this.workdirfinal[this.workdirfinal.length - 1] === "]"){
this.workdirfinal = this.workdirfinal.split("['");
this.workdirfinal.pop();
this.workdirfinal = this.workdirfinal.join(".");
}else{
this.workdirfinal = this.workdirfinal.split(".");
this.workdirfinal.pop();
this.workdirfinal = this.workdirfinal.join(".");
}
if(this.workdirfinal.length === 0){
this.workdirfinal = "/";
}
//this.workdirdepth++;
}else if(isNaN(parseInt(this.workdirtemp[this.workdirdepth], 10))){
this.workdirfinal += "." + this.workdirtemp[this.workdirdepth];
}else{
this.workdirfinal += "['" + this.workdirtemp[this.workdirdepth] + "']";
}
}
this.workdirdepth++;
}
return this.workdirfinal;
},
getRealDir: function(origdir){
return eval(this.translateDir(origdir));
},
alias: {},
checkPrefix: function(){
if(getId('bashInput').value.indexOf(this.prefix) !== 0){
getId('bashInput').value = this.pastValue;
}
this.pastValue = getId('bashInput').value;
},
echo: function(message){
if(this.piping){
this.pipeOut += '<br>' + String(message);
}else{
getId('bashContent').innerHTML += '<br>' + String(message).split(' ').join(' &nbsp;') + '&nbsp;';
getId('winshh').scrollTop = getId('winshh').scrollHeight;
}
},
piping: 0,
commandPipeline: 0,
pipeOut: '',
execute: function(cmd, silent){
if(cmd){
this.command = cmd;
if(!silent){
this.echo('[]$ ' + cmd.split('<').join('&lt;').split('>').join('&gt;'));
}
}else{
this.command = getId('bashInput').value.substring(getId('bashInput').value.indexOf('$') + 2, getId('bashInput').value.length);
this.echo(getId('bashInput').value.split('<').join('&lt;').split('>').join('&gt;'));
getId('bashInput').value = this.prefix;
this.pastValue = this.prefix;
for(var i in this.alias){
if(this.command.indexOf(i) > -1){
this.command = this.command.split(i).join(this.alias[i]);
}
}
if(this.command.indexOf(' | ') > -1){
this.commandPipeline = this.command.split(' | ');
this.piping = 1;
for(var i = 0; i < this.commandPipeline.length; i++){
if(i === this.commandPipeline.length - 1){
this.piping = 0;
}
this.pipeOutTemp = this.pipeOut;
this.pipeOut = '';
this.execute(this.commandPipeline[i] + ' ' + this.pipeOutTemp, 1);
}
return;
}
}
try{
this.commands.filter(function(cmnd){
return (apps.bash.vars.command.indexOf(cmnd.name) === 0);
})[0].action(this.command.substring(((this.command.indexOf(' ', this.command.indexOf('$') + 1) + 1) || this.command.length), this.command.length));
}catch(err){
if(String(err) === "TypeError: Cannot read property 'action' of undefined"){
this.echo('-bash: command not found: ' + err);
}else{
this.echo('-bash: ' + err);
}
}
},
currHelpSearch: '',
commands: [
{
name: 'help',
usage: 'help [command]',
desc: 'Prints the usage and help doc for a command.',
action: function(args){
apps.bash.vars.currHelpSearch = args;
this.vars.foundCmds = apps.bash.vars.commands.filter(function(i){
return apps.bash.vars.currHelpSearch.indexOf(i.name) > -1 || i.name.indexOf(apps.bash.vars.currHelpSearch) > -1;
});
for(var i in this.vars.foundCmds){
apps.bash.vars.echo('<br>' + this.vars.foundCmds[i].name + ': ' + this.vars.foundCmds[i].usage);
apps.bash.vars.echo(this.vars.foundCmds[i].desc);
}
},
vars: {
foundCmds: []
}
},
{
name: 'echo',
usage: 'echo [message]',
desc: 'Prints message to console.',
action: function(args){
apps.bash.vars.echo(args);
}
},
{
name: 'alias',
usage: 'alias &lt;shorthand&gt;=&lt;result&gt;',
desc: 'Creates a persistent alias for the user. Quotes are not needed around alias definitions and will be included in the definition, if provided',
action: function(args){
this.vars.keypair = args.split('=');
apps.bash.vars.alias[this.vars.keypair[0]] = this.vars.keypair[1];
apps.savemaster.vars.save('APP_SH_ALIAS', JSON.stringify(apps.bash.vars.alias), 1);
},
vars: {
keypair: []
}
},
{
name: 'js',
usage: 'js [code]',
desc: 'Run JavaScript code and echo the returned value',
action: function(args){
apps.bash.vars.echo(eval(args));
}
},
{
name: 'pwd',
usage: 'pwd [-J]',
desc: 'Prints the current working directory. If -J is specified, also prints the JavaScript-equivalent directory.',
action: function(args){
if(args.toLowerCase().indexOf('-j') > -1){
apps.bash.vars.echo('shdir: ' + apps.bash.vars.workdir);
apps.bash.vars.echo('jsdir: ' + apps.bash.vars.translateDir(apps.bash.vars.workdir));
}else{
apps.bash.vars.echo(apps.bash.vars.workdir);
}
},
vars: {
}
},
{
name: 'cd',
usage: 'cd [dirname]',
desc: 'Move working directory to specified directory.',
action: function(args){
if(args !== ''){
this.vars.prevworkdir = apps.bash.vars.workdir;
this.vars.tempadd = args.split('/');
this.vars.tempstart = (apps.bash.vars.workdir[0] === '/');
if(args[0] === '/' || apps.bash.vars.workdir === '/'){
this.vars.tempdir = [];
this.vars.tempstart = 1;
}else{
this.vars.tempdir = apps.bash.vars.workdir.split('/');
}
for(var i in this.vars.tempadd){
if(this.vars.tempadd[i] === '..'){
this.vars.tempdir.pop();
}else{
this.vars.tempdir.push(this.vars.tempadd[i]);
}
}
this.vars.temppath = this.vars.tempdir.join('/');
if(this.vars.tempstart && this.vars.temppath[0] !== '/'){
this.vars.temppath = '/' + this.vars.temppath;
}
this.vars.temppath = this.vars.temppath.split('\\').join('/').split('//').join('/');
apps.bash.vars.workdir = this.vars.temppath;
if(apps.bash.vars.getRealDir('') === undefined){
apps.bash.vars.echo('Failed to change workdir - ' + apps.bash.vars.workdir + ' does not exist');
apps.bash.vars.workdir = this.vars.prevworkdir;
}else if(typeof apps.bash.vars.getRealDir('') !== 'object'){
apps.bash.vars.echo('Failed to change workdir - ' + apps.bash.vars.workdir + ' is a file');
apps.bash.vars.workdir = this.vars.prevworkdir;
}
//apps.bash.vars.echo(this.vars.temppath);
if(apps.bash.vars.workdir === '/'){
apps.bash.vars.prefix = '[' + SRVRKEYWORD + '@ /]$ ';
}else{
apps.bash.vars.prefix = '[' + SRVRKEYWORD + '@ ' + apps.bash.vars.workdir.split('/')[apps.bash.vars.workdir.split('/').length - 1] + ']$ ';
}
apps.bash.vars.pastValue = apps.bash.vars.prefix;
getId('bashInput').value = apps.bash.vars.prefix;
}
},
vars: {
temppath: '',
prevworkdir: '',
tempstart: 0,
tempadd: [],
tempdir: []
}
},
{
name: 'grep',
usage: 'grep [target] <- [source]',
desc: 'List lines of a source that contain a target string.',
action: function(args){
this.vars.target = args.split(' <- ')[0];
this.vars.lines = args.split(' <- ')[1].split('<br>');
this.vars.out = '';
for(var i in this.vars.lines){
if(this.vars.lines[i].indexOf(this.vars.target) > -1){
this.vars.out += '<br>' + this.vars.lines[i];
}
}
apps.bash.vars.echo(this.vars.out);
},
vars: {
target: '',
lines: [],
out: ''
}
},
{
name: 'ls',
usage: 'ls [-R] [dirname]',
desc: 'List files in a directory.<br>-R prints subdirectories up to 1 layer deep<br>If no directory is provided, current directory is used.<br>WARNING: -s can be dangerous in large directories like /',
action: function(args){
//if(apps.bash.vars.translateDir(args) !== 'window'){
this.vars.printBuffer = '';
if(args.indexOf('-R') === 0){
try{
this.vars.selectedDir = apps.bash.vars.getRealDir(args.split(' ')[1]);
}catch(err){
this.vars.selectedDir = apps.bash.vars.getRealDir('');
}
this.vars.printSub = 1;
}else{
this.vars.selectedDir = apps.bash.vars.getRealDir(args);
this.vars.printSub = 0;
}
// apps.bash.vars.echo('Contents of directory ' + args);
var dirSize = 0;
for(var item in this.vars.selectedDir){
dirSize++;
if(dirSize > 1){
this.vars.printBuffer += item + '<br>';
}else{
this.vars.printBuffer += item;
}
if(typeof this.vars.selectedDir[item] === 'object' && this.vars.printSub){
for(var subitem in this.vars.selectedDir[item]){
this.vars.printBuffer += '&nbsp; ' + subitem + '<br>';
}
}
}
this.vars.printBuffer += '<br>Size of directory: ' + dirSize + ' items';
apps.bash.vars.echo(this.vars.printBuffer);
this.vars.printBuffer = '';
//}else{
// apps.bash.vars.echo('Warning - root directory "/" cannot be scanned.');
//}
},
vars: {
printSub: 0,
selectedDir: {},
printBuffer: ''
}
},
{
name: 'mv',
usage: 'mv &lt;path&gt; &lt;newpath&gt;',
desc: 'Moves a file or directory to a new path.',
action: function(args){
this.vars.currSet = args.split(' ');
eval(apps.bash.vars.translateDir(this.vars.currSet[1]) + '=' + apps.bash.vars.translateDir(this.vars.currSet[0]));
eval('delete ' + apps.bash.vars.translateDir(this.vars.currSet[0]));
},
vars: {
currSet: [],
currItem: {}
}
},
{
name: 'cp',
usage: 'cp &lt;path&gt; &lt;newpath&gt;',
desc: 'Copies a file or directory to a new path.',
action: function(args){
this.vars.currSet = args.split(' ');
eval(apps.bash.vars.translateDir(this.vars.currSet[1]) + '=' + apps.bash.vars.translateDir(this.vars.currSet[0]));
},
vars: {
currSet: [],
currItem: {}
}
},
{
name: 'rm',
usage: 'rm &lt;file&gt;',
desc: 'Deletes a file or directory.',
action: function(args){
eval('delete ' + apps.bash.vars.translateDir(args));
}
},
{
name: 'rmdir',
usage: 'rmdir &lt;file&gt;',
desc: 'Deletes a file or directory.',
action: function(args){
eval('delete ' + apps.bash.vars.translateDir(args));
}
},
{
name: 'touch',
usage: 'touch &lt;file&gt;',
desc: 'Creates an empty file.',
action: function(args){
if(!eval(apps.bash.vars.translateDir(args))){
eval(apps.bash.vars.translateDir(args) + '= ""');
}
}
},
{
name: 'clear',
usage: 'clear',
desc: 'Clears the console screen.',
action: function(args){
getId('bashContent').innerHTML = '';
}
},
{
name: 'mkdir',
usage: 'mkdir &lt;dirname&gt;',
desc: 'Creates a blank directory.',
action: function(args){
this.vars.first = 1;
this.vars.stack = args.split('/');
for(var i in this.vars.stack){
if(this.vars.first){
this.vars.trace = this.vars.stack[i];
this.vars.first = 0;
}else{
this.vars.trace += '/' + this.vars.stack[i];
}
if(typeof apps.bash.vars.getRealDir(this.vars.trace) !== 'object'){
if(apps.bash.vars.getRealDir(this.vars.trace) === undefined){
eval(apps.bash.vars.translateDir(this.vars.trace) + ' = {}');
apps.bash.vars.echo('Created dir ' + this.vars.trace);
}else{
apps.bash.vars.echo('Failed to create dir - traced into file');
break;
}
}
}
},
vars: {
first: 1,
trace: '',
stack: [],
}
},
{
name: 'sudo',
usage: 'sudo [command]',
desc: 'obselete function to run command as root; all users already root but the function still works',
action: function(args){
apps.bash.vars.echo('Root access already permitted...');
apps.bash.vars.execute(args);
}
},
{
name: 'su',
usage: 'su',
desc: 'Obselete function to go root; does not work on because all users are root',
action: function(args){
apps.bash.vars.echo('Root access already permitted.');
}
},
{
name: 'cat',
usage: 'cat &lt;file&gt;',
desc: 'All this supports so far is printing the contents of a file, as it appears to JavacScript.',
action: function(args){
apps.bash.vars.echo(apps.bash.vars.getRealDir(args));
}
},
{
name: 'fortune',
usage: 'fortune',
desc: 'Displays a fortune for you!',
action: function(args){
apps.bash.vars.echo('Sorry, fortune is not ready yet. Please wait!');
},
vars: {
fortunes: [
'Test Fortune 1',
'Test Fortune 2',
'Test Fortune 3'
]
}
}
]
}, 1, 'bash', '/appicons/ds/sh.png'
);
getId('loadingInfo').innerHTML = 'Initializing CPU Monitor';
});
c(function(){
apps.cpuMon = new Application(
'CPU',
'CPU Monitor',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setCaption("CPU");
this.appWindow.setContent("<canvas id='cpuMonCnv' width='200' height='100' style='width:100%;height:100%;background-color:#000;'></canvas>");
if(typeof this.appWindow.dimsSet !== 'function'){
this.appWindow.dimsSet = function(){
getId('cpuMonCnv').width = apps.cpuMon.appWindow.windowH - 6;
getId('cpuMonCnv').height = apps.cpuMon.appWindow.windowV - 24;
apps.cpuMon.vars.width = apps.cpuMon.appWindow.windowH - 6;
apps.cpuMon.vars.height = apps.cpuMon.appWindow.windowV - 24;
}
}
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 103, parseInt(getId('desktop').style.height, 10) / 2 - 62, 206, 124);
this.vars.cnv = getId('cpuMonCnv');
this.vars.ctx = this.vars.cnv.getContext('2d');
this.vars.drawInt = setInterval(this.vars.draw, 1000);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
clearInterval(this.vars.drawInt);
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
this.appWindow.alwaysOnTop(1);
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'A very simple graph of CPU usage over time. CPU usage is calculated by comparing the current FPS to the max FPS.',
drawInt: 0,
cnv: null,
ctx: null,
width: 200,
height: 100,
draw: function(){
apps.cpuMon.vars.ctx.drawImage(apps.cpuMon.vars.cnv, -1, 0);
apps.cpuMon.vars.ctx.fillStyle = '#000';
apps.cpuMon.vars.ctx.fillRect(apps.cpuMon.vars.width - 1, 0, 1, apps.cpuMon.vars.height);
apps.cpuMon.vars.ctx.fillStyle = '#0F0';
apps.cpuMon.vars.ctx.fillRect(apps.cpuMon.vars.width - 1, apps.cpuMon.vars.height - (parseInt(stringFPSload) / 100 * apps.cpuMon.vars.height), 1, apps.cpuMon.vars.height);
}
}, 1, "cpuMon", "/appicons/ds/systemApp.png"
);
getId('loadingInfo').innerHTML = 'Initializing Prompt System';
});
c(function(){
m('init PMT');
apps.prompt = new Application(
"PMT",
"Application Prompt",
1,
function(launchtype){
if(launchtype === 'dsktp'){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 4, parseInt(getId('desktop').style.height, 10) / 4, parseInt(getId('desktop').style.width, 10) / 2, parseInt(getId('desktop').style.height, 10) / 2);
}
this.appWindow.setCaption('Application Prompt');
this.appWindow.setContent('<div id="PMTdescription" style="text-align:center;width:100%;padding-top:16px;font-family:monospace;">This app is used for alerts and prompts in apps.</div><div id="PMTbuttons" style="font-family:monospace;padding-bottom:16px;text-align:center;width:100%;bottom:0;"><button onClick="apps.prompt.signalHandler(\'close\')">OK</button></div></div>');
getId("winPMTb").style.display = "none";
getId("winPMTe").style.display = "none";
getId("winPMTs").style.display = "none";
this.appWindow.alwaysOnTop(1);
this.appWindow.openWindow();
}
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
window.setTimeout(function(){apps.prompt.vars.checkPrompts();}, 0);
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
if(typeof USERFILES.CONFIRM_ADMIN_MESSAGE === 'string'){
if(USERFILES.CONFIRM_ADMIN_MESSAGE.length > 1){
this.vars.confirm('Personal message from admin:<br>' + USERFILES.CONFIRM_ADMIN_MESSAGE, ['OK, Delete Message', 'OK, Keep Message'], function(button){
if(!button){
USERFILES.CONFIRM_ADMIN_MESSAGE = ' ';
apps.savemaster.vars.save('CONFIRM_ADMIN_MESSAGE', ' ', 1);
}
}, '');
}
}
this.appWindow.alwaysOnTop(1);
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This is a prompt or alert box used for applications to create simple messages or get simple input from the user.',
prompts: [],
currprompt: [],
checkPrompts: function(){
//type is [0], text is [1], buttons are [2], callback is [3]
if(!apps.prompt.appWindow.appIcon && getId('notifWindow').style.pointerEvents === 'none'){
if(this.prompts.length !== 0){
d(1, 'showing prompt');
this.currprompt = this.prompts.shift();
if(this.currprompt[0] !== 4){
getId('PMTdescription').innerHTML = this.currprompt[1];
}
switch(this.currprompt[0]){
case 1:
if(this.currprompt[4]){
apps.prompt.appWindow.setCaption(this.currprompt[4] + ' wants to tell you:');
}else{
apps.prompt.appWindow.setCaption('Alert from an anonymous app:');
}
getId('PMTbuttons').innerHTML = '<button id="PMTalertButton" onClick="apps.prompt.signalHandler(\'close\');apps.prompt.vars.currprompt[3]()">' + this.currprompt[2] + '</button>';
c(function(){getId('PMTalertButton').focus()});
break;
case 2:
if(this.currprompt[4]){
apps.prompt.appWindow.setCaption(this.currprompt[4] + ' wants a choice from you:');
}else{
apps.prompt.appWindow.setCaption('Pick a choice for an anonymous app:');
}
getId('PMTbuttons').innerHTML = '';
for(var button in this.currprompt[2]){
getId('PMTbuttons').innerHTML += '<button class="PMTbtngroup" onClick="apps.prompt.signalHandler(\'close\');apps.prompt.vars.currprompt[3](' + button + ');">' + this.currprompt[2][button] + '</button> ';
}
c(function(){document.getElementsByClassName('PMTbtngroup')[0].focus()});
break;
case 3:
if(this.currprompt[4]){
apps.prompt.appWindow.setCaption(this.currprompt[4] + ' wants some info from you:');
}else{
apps.prompt.appWindow.setCaption('Enter some info for an anonymous app:');
}
getId('PMTbuttons').innerHTML = '<input id="PMTtextIn"> <button id="PMTalertButton" onClick="apps.prompt.signalHandler(\'close\');apps.prompt.vars.currprompt[3](getId(\'PMTtextIn\').value)">' + this.currprompt[2] + '</button>';
c(function(){
addEditContext('PMTtextIn');
getId('PMTtextIn').focus();
getId('PMTtextIn').addEventListener('keydown', function(event){
if(event.keyCode === 13){
getId('PMTalertButton').click();
}
});
});
break;
case 4:
if(this.currprompt[4]){
getId('notifTitle').innerHTML = this.currprompt[4];
}else{
getId('notifTitle').innerHTML = 'Notification';
}
if(this.currprompt[5]){
getId('notifImage').src = this.currprompt[5];
}else{
getId('notifImage').src = '/EMPTY.png';
}
getId('notifContent').innerHTML = this.currprompt[1];
getId('notifButtons').innerHTML = '';
for(var button in this.currprompt[2]){
getId('notifButtons').innerHTML += ' <button onClick="getId(\'notifWindow\').style.opacity=\'0\';getId(\'notifWindow\').style.pointerEvents=\'none\';getId(\'notifWindow\').style.right = \'-350px\';window.setTimeout(function(){apps.prompt.vars.checkPrompts();}, 0);apps.prompt.vars.currprompt[3](' + button + ');">' + this.currprompt[2][button] + '</button>';
}
getId('notifWindow').style.opacity = '';
getId('notifWindow').style.pointerEvents = '';
getId('notifWindow').style.right = '';
break;
default:
doLog(this.currprompt[0] + ' is not a valid prompt window.', '#ACE');
}
if(this.currprompt[0] !== 4){
apps.prompt.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 4, parseInt(getId('desktop').style.height, 10) / 4, parseInt(getId('desktop').style.width, 10) / 2, parseInt(getId('desktop').style.height, 10) / 2);
apps.prompt.appWindow.openWindow();
window.setTimeout(function(){
apps.prompt.appWindow.alwaysOnTop(1);
toTop(apps.prompt);
}, 0);
}
}
}else{
if(getId('notifWindow').style.pointerEvents !== 'none'){
apps.prompt.vars.flashNotification(3);
}
}
},
alert: function(aText, aButton, aCallback, aCaption){ //test script: apps.prompt.vars.alert('test caption', 'test button', function(){doLog('clicked')})
this.prompts.push([1, aText, aButton, aCallback, aCaption]);
this.checkPrompts();
},
confirm: function(cText, cButtons, cCallback, cCaption){ //test script: apps.prompt.vars.confirm('test caption', ['btn0', 'btn1', 'btn2', 'btn3'], function(button){doLog(button)})
this.prompts.push([2, cText, cButtons, cCallback, cCaption]);
this.checkPrompts();
},
prompt: function(pText, pButton, pCallback, pCaption){ //test script: apps.prompt.vars.prompt('test caption', 'test button', function(text){doLog(text)})
this.prompts.push([3, pText, pButton, pCallback, pCaption]);
this.checkPrompts();
},
notify: function(nText, nButtons, nCallback ,nCaption, nImage){
this.prompts.push([4, nText, nButtons, nCallback, nCaption, nImage]);
this.checkPrompts();
},
flashNotification: function(nTimes){
if(nTimes){ // if number of flashes defined
getId('notifWindow').style.boxShadow = '0 0 20px 20px #FF7F00';
setTimeout(function(){
getId('notifWindow').style.boxShadow = '';
}, 300);
for(var i = 1; i < nTimes; i++){
setTimeout(function(){
getId('notifWindow').style.boxShadow = '0 0 20px 20px #FF7F00';
}, i * 600);
setTimeout(function(){
getId('notifWindow').style.boxShadow = '';
}, i * 600 + 300);
}
}else{ // otherwise just 3 flashes
apps.prompt.vars.flashNotification(3);
}
}
}, 2, "prompt", "/appicons/ds/PMT.png"
);
openapp(apps.prompt, 'dsktp');
requestAnimationFrame(function(){
apps.prompt.signalHandler('close');
});
getId('loadingInfo').innerHTML = 'Initializing Settings';
});
c(function(){
m('init STN');
apps.settings = new Application(
"STN",
"Settings",
1,
function(launchtype){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 350, parseInt(getId('desktop').style.height, 10) / 2 - 200, 700, 400);
}
this.appWindow.setCaption("Settings");
if(launchtype === 'oldMenu'){
this.appWindow.setContent(
'<div style="font-family:monospace;width:100%;height:100%;overflow:auto">' +
'<i>' + langOld('settings', 'valuesMayBeOutdated') + '</i><hr>' +
'<b>' + langOld('settings', 'bgImgURL') + '</b><br>' +
'<i>' + langOld('settings', 'imgTile') + '</i><br>' +
'<input id="bckGrndImg" style="display:inline-block; width:500px" value="' + USERFILES.APP_STN_SETTING_BACKGROUND + '"><button onClick="apps.settings.vars.sB()">Set</button><hr>' +
'<b>' + langOld('settings', 'performance') + '</b><br>' +
langOld('settings', 'dbgLevel') + ': <button onclick="apps.settings.vars.setDebugLevel(0)">Vital Only</button> <button onclick="apps.settings.vars.setDebugLevel(1)">Normal</button> <button onclick="apps.settings.vars.setDebugLevel(2)">High</button><br>' +
'<i>' + langOld('settings', 'dbgExplain') + '</i><br><br>' +
'Long Tap Opens Context Menu: ' + this.vars.longTap + ' <button onclick="apps.settings.vars.togLongTap()">Toggle</button><br>' +
'<i>Only for mobile browsers, requires touch on top-level ctxmenu element (rightclicking a window will not give the desktop ctxmenu)</i><br><br>' +
langOld('settings', 'perfModeOn') + ': ' + apps.settings.vars.performanceMode + '<br>' +
langOld('settings', 'perfModeTog') + ' <button onClick="apps.settings.vars.togPerformanceMode()">Performance Mode</button><br>' +
'<i>' + langOld('settings', 'perfModeDesc') + '</i><hr>' +
'<b>' + langOld('settings', 'info') + '</b><br>' +
'&nbsp;<b>&copy;</b> <i>2016 Adams</i><br>' + // <= COPYRIGHT NOTICE
'<i>' + langOld('settings', 'cookies') + '</i><br>' +
'Anonymous data collection: ' + this.vars.collectData + ' <button onclick="apps.settings.vars.collectData = -1 * apps.settings.vars.collectData + 1">Toggle</button><br><br>' +
'If you have suggestions, please email <a href="mailto:mineandcraft12@gmail.com">mineandcraft12@gmail.com</a>!<br><br>' +
langOld('settings', 'networkOn') + ': ' + window.navigator.onLine + '<br>' +
langOld('settings', 'batteryLevel') + ': ' + Math.round(batteryLevel * 100) + '%<br>' +
'<i>' + langOld('settings', 'batteryDesc') + '</i><br><br>' +
'Text Language: ' + languagepacks[currentlanguage] + '<br>' +
'<i>Some apps support different languages. Translation is up to the developer of the app and may not be accurate. Some languages may be limited to few apps.</i><br>' +
apps.settings.vars.getTextLanguages() + '<br><br>' +
'OS ID: ' + SRVRKEYWORD + '<br>' +
'<button onclick="apps.settings.vars.changeKey()">Load a Different </button><br><i>You need the OS ID of the target , and the target must have a set password and you must enter it correctly.</i><br><br>' +
'<i>If you experience issues with the OS, such as saved files not being recovered, email me and reference your OS ID and the details of the issue.</i><br><br>' +
'The old Text-To-Speech service was the creation of <a href="http://codewelt.com/proj/speak">codewelt.com/proj/speak</a> and may take several seconds to work after hitting the button. I take NO credit for the creation of that amazing tool. The new TTS service is built-in to Chrome 33 and later.<hr>' +
'<b>Screen Resolution</b><br>' +
' Monitor Resolution: ' + getId("monitor").style.width + ' by ' + getId("monitor").style.height + '<br>' +
'Your Window Resolution: ' + window.innerWidth + 'px by ' + window.innerHeight + 'px <button onclick="fitWindow()">Fit to Window</button><br>' +
'Your Screen Resolution: ' + window.outerWidth + 'px by ' + window.outerHeight + 'px <button onclick="fitWindowOuter()">Fit to Screen</button><br>' +
'Set Custom Resolution:<br><input id="STNscnresX">px by <input id="STNscnresY">px <button onclick="fitWindowRes(getId(\'STNscnresX\').value, getId(\'STNscnresY\').value)">Set Screen Res</button><br>' +
'<button onclick="apps.settings.vars.reqFullscreen()">Enter Fullscreen</button> <button onclick="apps.settings.vars.endFullscreen()">Exit Fullscreen</button><hr>' +
'<b>Windows</b><br>' +
'Window color: <input id="STNwinColorInput" placeholder="rgba(190, 190, 255, .6)" value="' + this.vars.currWinColor + '"> <button onClick="apps.settings.vars.setWinColor()">Set</button><br><br>' +
'<button onClick="apps.settings.vars.togAero()">Toggle Window Blur Effect</button><br>' +
'<i>Windowblur strength is how much windows blur the background. The default is 2, and large values may produce unintended results as well as lower the framerate.</i><br>' +
'Windowblur Strength: <input id="STNwinblurRadius" placeholder="2" value="' + this.vars.currWinblurRad + '"> <button onclick="apps.settings.vars.setAeroRad()">Set</button><br>' +
'<i>Window Blur uses a Blend Mode to determine how its color affects the background. Since people will have conflicting ideas on what is best, I give you the choice.</i><br>' +
'Window Blur Blend Mode: <input id="STNwinBlendInput" placeholder="hard-light" value="' + this.vars.currWinBlend + '"> <button onClick="apps.settings.vars.setWinBlend()">Set</button><br>' +
'Window Blur Opacity: <input id="STNwinOpacInput" placeholder="1" value="' + this.vars.currWinOpac + '"> <button onClick="apps.settings.vars.setWinOpac()">Set</button><br>' +
'Window Background Image: <button onclick="apps.settings.vars.togWinImg()">Toggle</button> | <input id="STNwinImgInput" placeholder="winimg.png" value="' + this.vars.currWinImg + '"> <button onclick="apps.settings.vars.setWinImg()">Set</button><hr>' +
'<b>Taskbar</b><br>' +
'<i>Toggle the display of different elements of the taskbar</i><br>' +
'<button onclick="apps.settings.vars.togTimeComp()">Toggle Compact Time</button> <button onclick="apps.settings.vars.togNetStat()">Toggle Network Status</button> <button onclick="apps.settings.vars.togBatStat()">Toggle Battery Status</button> <button onclick="apps.settings.vars.togBatComp()">Toggle Stylish Battery</button> <button onclick="apps.settings.vars.togFpsStat()">Toggle FPS Status</button> <button onclick="apps.settings.vars.togFpsComp()">Toggle Compact FPS</button> <button onclick="apps.settings.vars.togLodStat()">Toggle CPU Status</button><hr>' +
'<b>NORAA</b><br>' +
'NORAA presents graphical help boxes instead of speaking solutions, where available: ' + this.vars.noraHelpTopics + ' <button onclick="apps.settings.vars.togNoraHelpTopics()">Toggle</button><br>' +
'NORAA listening for you: ' + this.vars.currNoraListening + ' <button onclick="apps.settings.vars.togNoraListen()">Toggle</button><br>' +
'NORAA listens for the phrase: <input id="STNnoraphrase" placeholder="listen computer" value="' + apps.settings.vars.currNoraPhrase + '"> <button onclick="apps.settings.vars.togNoraPhrase()">Set</button><br>' +
'Speech Input Delay (time in ms that NORAA gives for you to cancel spoken input): <input id="STNnoraDelay" value="' + apps.nora.vars.inputDelay + '"> <button onclick="apps.settings.vars.NORAAsetDelay()">Set</button><br><br>' +
'<i>If NORAA won\'t speak after you speak to him, try one of these out...</i><br>' +
'Current Voice: ' + apps.nora.vars.lang + '<br>' +
apps.settings.vars.getVoicesForNORAA() +
'</div>'
);
}else{
this.vars.showMenu(apps.settings.vars.menus);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
window.setTimeout(function(){
getId('loadingInfo').innerHTML = 'Welcome.';
getId('desktop').style.display = '';
getId('taskbar').style.display = '';
}, 0);
window.setTimeout(function(){
getId('isLoading').style.opacity = 0;
getId('loadingBg').style.opacity = 0;
}, 5);
window.setTimeout(function(){
getId('isLoading').style.display = 'none';
getId('isLoading').innerHTML = '';
getId('loadingBg').style.display = 'none';
}, 1005);
window.setTimeout(function(){
openapp(apps.settings, 'oldMenu');
if(typeof USERFILES.APP_STN_SETTING_BACKGROUND === "string"){
getId("bckGrndImg").value = USERFILES.APP_STN_SETTING_BACKGROUND;
apps.settings.vars.sB(1);
}
if(typeof USERFILES.APP_STN_SETTING_AERO === "string"){
if(USERFILES.APP_STN_SETTING_AERO === "0"){
apps.settings.vars.togAero(1);
}
}
if(typeof USERFILES.APP_STN_SETTING_WINCOLOR === "string"){
getId("STNwinColorInput").value = USERFILES.APP_STN_SETTING_WINCOLOR;
apps.settings.vars.setWinColor(1);
}
if(typeof USERFILES.APP_STN_SETTING_WINBLEND === "string"){
getId("STNwinBlendInput").value = USERFILES.APP_STN_SETTING_WINBLEND;
apps.settings.vars.setWinBlend(1);
}
if(typeof USERFILES.APP_STN_SETTING_WINOPAC === "string"){
getId("STNwinBlendInput").value = USERFILES.APP_STN_SETTING_WINOPAC;
apps.settings.vars.setWinOpac(1);
}
if(typeof USERFILES.APP_STN_SETTING_AERORAD === "string"){
getId("STNwinblurRadius").value = USERFILES.APP_STN_SETTING_AERORAD;
apps.settings.vars.setAeroRad(1);
}
if(typeof USERFILES.APP_STN_SETTING_TIMECOMP === "string"){
if(USERFILES.APP_STN_SETTING_TIMECOMP === "0"){
apps.settings.vars.togTimeComp();
}
}
if(typeof USERFILES.APP_STN_SETTING_NETSTAT === "string"){
if(USERFILES.APP_STN_SETTING_NETSTAT === "0"){
apps.settings.vars.togNetStat();
}
}
if(typeof USERFILES.APP_STN_SETTING_BATSTAT === "string"){
if(USERFILES.APP_STN_SETTING_BATSTAT === "0"){
apps.settings.vars.togBatStat();
}
}
if(typeof USERFILES.APP_STN_SETTING_BATCOMP === "string"){
if(USERFILES.APP_STN_SETTING_BATCOMP === "0"){
apps.settings.vars.togBatComp();
}
}
if(typeof USERFILES.APP_STN_SETTING_FPSSTAT === "string"){
if(USERFILES.APP_STN_SETTING_FPSSTAT === "0"){
apps.settings.vars.togFpsStat();
}
}
if(typeof USERFILES.APP_STN_SETTING_FPSCOMP === "string"){
if(USERFILES.APP_STN_SETTING_FPSCOMP === "0"){
apps.settings.vars.togFpsComp();
}
}
if(typeof USERFILES.APP_STN_SETTING_LODSTAT === "string"){
if(USERFILES.APP_STN_SETTING_LODSTAT === "0"){
apps.settings.vars.togLodStat();
}
}
if(typeof USERFILES.APP_STN_SETTING_LANG === "string"){
currentlanguage = USERFILES.APP_STN_SETTING_LANG;
}
if(typeof USERFILES.NORAA_LISTEN === "string"){
if(USERFILES.NORAA_LISTEN === "1"){
apps.settings.vars.togNoraListen(1);
}
}
if(typeof USERFILES.NORAA_PHRASE === "string"){
apps.settings.vars.currNoraPhrase = USERFILES.NORAA_PHRASE;
}
if(typeof USERFILES.APP_STN_SETTING_DATACOLLECT === "string"){
apps.settings.vars.collectData = parseInt(USERFILES.APP_STN_SETTING_DATACOLLECT, 10);
}
if(typeof USERFILES.APP_STN_SETTING_NORAHELP === "string"){
if(USERFILES.APP_STN_SETTING_NORAHELP === "0"){
apps.settings.vars.togNoraHelpTopics(1);
}
}
if(typeof USERFILES.APP_STN_SETTING_LONGTAP === "string"){
if(USERFILES.APP_STN_SETTING_LONGTAP === "1"){
apps.settings.vars.togLongTap(1);
}
}
if(typeof USERFILES.APP_STN_SETTING_TOGWINIMG === "string"){
if(USERFILES.APP_STN_SETTING_TOGWINIMG === "0"){
apps.settings.vars.togWinImg(1);
}
}
if(typeof USERFILES.APP_STN_SETTING_WINIMG === "string"){
getId("STNwinImgInput").value = USERFILES.APP_STN_SETTING_WINIMG;
apps.settings.vars.setWinImg(1);
}
if(typeof USERFILES.APP_STN_SETTING_SLOTS === "string"){
textEditorTools.slots = parseInt(USERFILES.APP_STN_SETTING_SLOTS);
textEditorTools.updateSlots();
}
if(typeof USERFILES.APP_STN_SAVED_CLIPBOARD === "string"){
if(USERFILES.APP_STN_SAVED_CLIPBOARD !== '_cleared_clipboard_'){
textEditorTools.clipboard = USERFILES.APP_STN_SAVED_CLIPBOARD.split('-78e23dde9ace11e69f33a24fc0d9649c-');
}
}
/*screenScale = 1;
if(typeof USERFILES.APP_STN_screenscale){
if(USERFILES.APP_STN_screenscale !== "1"){*/
apps.settings.vars.setScale(USERFILES.APP_STN_screenscale || "1", 1);/*
}
}*/
if(typeof USERFILES.APP_STN_SAVESCREENRES === "string"){
apps.settings.vars.tempResArray = USERFILES.APP_STN_SAVESCREENRES.split('/');
fitWindowRes(apps.settings.vars.tempResArray[0], apps.settings.vars.tempResArray[1]);
}
if(typeof USERFILES.APP_STN_CORSPROXY === "string"){
apps.settings.vars.corsProxy = USERFILES.APP_STN_CORSPROXY;
}
if(typeof USERFILES.CustomStyle === "string"){
getId('CustomStyle').innerHTML = USERFILES.CustomStyle;
}
if(typeof USERFILES.APP_STN_SETTING_BACKDROPFILTER === "string"){
if(USERFILES.APP_STN_SETTING_BACKDROPFILTER === "1"){
apps.settings.vars.togBackdropFilter(1);
}
}
if(typeof USERFILES.APP_STN_SETTING_SCREENSAVER_ENABLED === "string"){
if(USERFILES.APP_STN_SETTING_SCREENSAVER_ENABLED === "0"){
apps.settings.vars.togScreensaver();
}
}
if(typeof USERFILES.APP_STN_SETTING_SCREENSAVER_TIME === "string"){
apps.settings.vars.screensaverTime = parseInt(USERFILES.APP_STN_SETTING_SCREENSAVER_TIME, 10);
}
if(typeof USERFILES.APP_STN_SETTING_SCREENSAVER === "string"){
apps.settings.vars.currScreensaver = USERFILES.APP_STN_SETTING_SCREENSAVER;
}
apps.settings.vars.screensaverTimer = window.setInterval(apps.settings.vars.checkScreensaver, 1000);
if(typeof USERFILES.APP_STN_TSKBRPOS === "string"){
apps.settings.vars.setTskbrPos(parseInt(USERFILES.APP_STN_TSKBRPOS, 10), 1);
}
if(typeof USERFILES.APP_STN_PERFMODE === "string"){
if(USERFILES.APP_STN_PERFMODE === "1"){
apps.settings.vars.togPerformanceMode();
}
}
if(typeof USERFILES.APP_STN_SETTING_FADE === "string"){
setTimeout(function(){
apps.settings.vars.setFadeDistance(USERFILES.APP_STN_SETTING_FADE, 1);
}, 100);
}else{
setTimeout(function(){
apps.settings.vars.setFadeDistance("0.5", 1);
}, 1000);
}
// google play settings
if(sessionStorage.getItem('GooglePlay') === 'true'){
if(USERFILES.APP_STN_PERFMODE !== "1"){
apps.settings.vars.togPerformanceMode(1);
}
if(USERFILES.APP_STN_SETTING_AERO !== "0"){
apps.settings.vars.togAero(1);
}
apps.prompt.vars.notify('Looks like you logged in through Google Play!<br>These settings were automatically set for you...<br><br>Performance Mode is on.<br>Screen scaling set to 1/2 if your device is 1080p or higher.<br>Tap a titlebar on a window, and then click somewhere else again, to move a window. You can also resize them on the bottom-right corner.', [], function(){}, 'Google Play', '/appicons/ds/.png');
}
if(sessionStorage.getItem('fullscreen') === 'true'){
setTimeout(apps.settings.vars.reqFullscreen, 5000);
}
for(var file in USERFILES){
if(file.indexOf('DSKTP_ico_') === 0){
if(getId(file.substring(10, 16)) !== null){
getId(file.substring(10, 16)).style.left = eval(USERFILES[file])[0] + "px";
getId(file.substring(10, 16)).style.top = eval(USERFILES[file])[1] + "px";
}
}
}
apps.settings.appWindow.closeWindow();
}, 0);
break;
case 'shutdown':
break;
default:
console.log("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This app contains all official settings for OS.<br><br>If these settings are not enough for you, and you are a very advanced user, you can use the following apps to completely control OS:<br><ul><li>BootScript</li><li>CustomStyle Editor</li></ul>',
language: {
en: {
valuesMayBeOutdated: 'All values below are from the time the Settings app was opened.',
bgImgURL: 'Background Image URL',
imgTile: 'Images tile to cover the screen.',
performance: 'Performance',
dbgLevel: 'Debug Level',
dbgExplain: 'Sets how verbose is in its actions. The different levels determine how often console messages appear and why.',
perfModeOn: 'Running in Performance Mode',
perfModeTog: 'If is consistently running at a low FPS, try using',
perfModeDesc: 'Performance Mode attempts to raise framerate by lowering the CPU usage of some system functions',
info: 'Info',
cookies: 'By using this site you are accepting the small cookie the filesystem relies on and that all files you or your apps generate will be saved on the server for your convenience (and, mostly, for technical reasons).',
networkOn: 'Network Online',
batteryLevel: 'Battery Level',
batteryDesc: 'If the amount above is -100, then your computer either has no battery or the battery could not be found.',
},
uv: {
valuesMayBeOutdated: 'Each instance of a definitive value below this line would happen to have been generated at the exact moment in time at which the app which happens to be called Settings happens to have been opened.',
bgImgURL: 'The Uniform Resource Locator of the Image to be Applied to the Background of the Desktop',
imgTile: 'The specified image will tile as many times as necessary to cover the entirety of the screen.',
performance: 'Functions that may Assist the Performance of the Operating System',
dbgLevel: 'Level of logging to the Debug Console',
dbgExplain: 'Determines the level of verbosity that brings when referencing actions and issues. The differing levels given will determine how common messages will appear in the Console app, and the importance they must marked as to appear.',
perfModeOn: 'Running in enhanced-performance adjustment mode',
perfModeTog: 'If it appears that is consistently running slowly or at a low count of frames per second, try enabling experimental',
perfModeDesc: 'The experimental Performance Mode attempts to lower the stress on CPU by optimising and delaying system functions',
info: 'Essential Information About ',
cookies: 'In the act of accessing this web site, you are hereby accepting the small, 21-character browser cookie that relies heavily on for its filesystem. All text files you and your installed apps happen to generate are stored solely on the main server for your convenience (and, mostly, for annoying technical limitations).',
networkOn: 'Reported status of your browser\'s online network connectivity',
batteryLevel: 'Approximate level of battery life remaining in your device, as reported by your browser',
batteryDesc: 'If it just so happens that the numerical value represented above equals -100, then it appears that your browser reports that you have no battery installed on your device, or that your browser is incapable of reporting said amount.'
},
ch: {
}
},
menus: {
folder: 1,
folderName: 'Settings',
folderPath: 'apps.settings.vars.menus',
oldMenu: {
folder: 0,
folderName: 'Old Menu',
folderPath: '\'oldMenu\'',
image: '/settingIcons/OldMenu.png'
},
background: {
folder: 0,
folderName: 'Desktop Background',
folderPath: 'apps.settings.vars.menus.background',
image: '/settingIcons/dsktpBack.png',
setUrl: {
option: 'Background Image URL',
description: function(){return 'Images tile to cover the screen.<br><img style="height:200px" src="' + USERFILES.APP_STN_SETTING_BACKGROUND + '">'},
buttons: function(){return '<input id="bckGrndImg" style="display:inline-block; width:500px" value="' + USERFILES.APP_STN_SETTING_BACKGROUND + '"> <button onClick="apps.settings.vars.sB()">Set</button>'}
},
premade: {
option: ' Backgrounds',
description: function(){return 'Here are several images that I have included with . Note that I did not make all of these and that most of these backgrounds have their own respective owners.'},
buttons: function(){
var str = '';
for(var i in apps.settings.vars.availableBackgrounds){
str += '<br>' + apps.settings.vars.availableBackgrounds[i] + '<br><img style="width:500px" src="' + apps.settings.vars.availableBackgrounds[i] + '">';
}
return str;
}
}
},
performance: {
folder: 0,
folderName: 'Performance',
folderPath: 'apps.settings.vars.menus.performance',
image: '/settingIcons/performance.png',
perfMode: {
option: 'Performance Mode',
description: function(){return '<span class="liveElement" liveVar="numtf(apps.settings.vars.performanceMode)">' + numtf(apps.settings.vars.performanceMode) + '</span>; Performance Mode attempts to raise framerate by lowering the CPU usage of some system functions'},
buttons: function(){return '<button onClick="apps.settings.vars.togPerformanceMode()">Toggle</button>'}
},
clickToMove: {
option: 'Legacy Window Moving',
description: function(){return '<span class="liveElement" liveVar="numtf(apps.settings.vars.clickToMove)"></span>; Legacy support for window-moving, in which you must click the window to move and then click again somewhere on the screen to move it.'},
buttons: function(){return '<button onclick="apps.settings.vars.togClickToMove()">Toggle</button>'}
},
longTap: {
option: 'Double Tap Opens Context Menu',
description: function(){return '<span class="liveElement" liveVar="numtf(apps.settings.vars.longTap)">' + numtf(apps.settings.vars.longTap) + '</span>; Only for mobile browsers, requires touch on top-level ctxmenu element (rightclicking a window will not give the desktop ctxmenu)'},
buttons: function(){return '<button onclick="apps.settings.vars.togLongTap()">Toggle</button>'}
},
opsPerSec: {
option: 'Operations Per Second',
description: function(){return 'Calculate your browser\'s operations per second, for integers, floating points, and strings.'},
buttons: function(){return '<button onclick="apps.settings.vars.calcFLOPS()">Calculate</button>'}
},
debugLevel: {
option: 'Debug Level',
description: function(){return langOld('settings', 'dbgExplain')},
buttons: function(){return '<button onclick="apps.settings.vars.setDebugLevel(0)">Vital Only</button> <button onclick="apps.settings.vars.setDebugLevel(1)">Normal</button> <button onclick="apps.settings.vars.setDebugLevel(2)">High</button>'}
},
allowStnWindow: {
option: 'File Browser Debug',
description: function(){return 'Allows File Browser to access the Window object. Dangerous, so by default ALWAYS off.'},
buttons: function(){return '<button onclick="apps.settings.vars.togFILwin()">Toggle</button>'}
},
testPerformance: {
option: 'Test Performance',
description: function(){return 'Use the Function Grapher app to measure performance OS performance. The information displayed is the time in total since the graph had started, to completion. The bottom of the graph is millisecond 0. Each 1 bar higher is 1 millisecond.'},
buttons: function(){return '<button onClick="openapp(apps.graph,\'dsktp\');getId(\'GphInput\').value=\'perfCheck(\\\'graph\\\')/1000-10\';getId(\'GphColor\').value=\'#FF7F00\';perfStart(\'graph\');apps.graph.vars.graph();getId(\'GphStatus\').innerHTML+=\'PerfCheck took \'+(perfCheck(\'graph\')/1000)+\' milliseconds<br>\'">Do Performance Test</button>'}
},
mobileMode: {
option: 'Mobile Mode',
description: function(){return 'Extremely experimental mobile mode for . will likely be very unstable with this enabled, so the setting will not be saved.'},
buttons: function(){return '<button onClick="apps.settings.vars.toggleMobileMode()">Toggle</button>'}
}
},
info: {
folder: 0,
folderName: 'Information',
folderPath: 'apps.settings.vars.menus.info',
image: '/settingIcons/info.png',
copyright: {
option: 'Copyright Notice',
description: function(){return '&copy; <i>2016 Adams</i>'}, // <-- COPYRIGHT NOTICE
buttons: function(){return 'By using this site you are accepting the small cookie the filesystem relies on and that all files you or your apps generate will be saved on the server for your convenience (and, mostly, for technical reasons).'}
},
osID: {
option: ' ID',
description: function(){return SRVRKEYWORD + ' is your ID. If you would wish to load another copy of , use the button below. Be sure to have its ID and password ready, and set a password on this current machine if you want to get back to it later.'},
buttons: function(){return '<button onclick="apps.settings.vars.changeKey()">Load a Different </button>'}
},
osPassword: {
option: ' Password',
description: function(){return 'This is the password required to access your copy of from another computer using the feature above.'},
buttons: function(){return '<input id="STNosPass"> <button onclick="apps.savemaster.vars.save("password", getId("STNosPass").value, 1)">Set</button>'}
},
osVersion: {
option: ' Version',
description: function(){return 'You are running ' + document.title + '.'},
buttons: function(){return ' is updated automatically between restarts, with no action required on your part.'}
},
googlePlay: {
option: 'Google Play',
description: function(){
if(sessionStorage.getItem('GooglePlay') === 'true'){
return 'Looks like you\'ve downloaded through Google Play! If you have time, please drop a review in Google Play, including ideas and suggestions. Thanks!';
}else{
return 'Great news! is on Google Play! Download the app on any Android device and drop a review!'
}
},
buttons: function(){return 'Thanks, Google, for your terrific platform!'}
},
ipAddress: {
option: 'IP Address',
description: function(){return 'Here is the IP Address of your machine, as the server sees it. If you are using proxies or other network utilities, it may be incorrect. The IP address is not logged by .'},
buttons: function(){return 'Your IP Address: ' + IPADDRESS}
},
contact: {
option: 'Contact',
description: function(){return 'Having issues? Need help? Something broken on ? Want to suggest changes or features? Have some other need to contact me? Feel free to contact me below!'},
buttons: function(){return 'Email: <a href="mailto:mineandcraft12@gmail.com">mineandcraft12@gmail.com</a> | Messaging app: my username is "{ADMIN} MineAndCraft12"'}
},
lines: {
option: 'Project Size',
description: function(){return ' has been a running project for a long time now, steadily growing in size... here are some stats on how it\'s doing...'},
buttons: function(){return 'Files in use by ... last line count was 04/18/2017<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;99 lines, &nbsp;&nbsp;&nbsp;5.56KB - index<br>' +
'&nbsp;&nbsp;&nbsp;586 lines, &nbsp;&nbsp;15.70KB - style<br>' +
'&nbsp;11762 lines, &nbsp;689.94KB - script<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;50 lines, &nbsp;&nbsp;&nbsp;1.47KB - restart page<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;28 lines, &nbsp;&nbsp;&nbsp;1.82KB - external debugger<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;13 lines, &nbsp;&nbsp;&nbsp;0.69KB - file deleter<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;50 lines, &nbsp;&nbsp;&nbsp;2.94KB - file loader<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;21 lines, &nbsp;&nbsp;&nbsp;1.03KB - legacy file saver<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;37 lines, &nbsp;&nbsp;&nbsp;1.78KB - new file saver<br>' +
'&nbsp;&nbsp;&nbsp;&nbsp;35 lines, &nbsp;&nbsp;&nbsp;0.95KB - messaging<br>' +
'&nbsp;&nbsp;&nbsp;144 lines, &nbsp;&nbsp;&nbsp;2.88KB - simon game<br>' +
'&nbsp;&nbsp;1820 lines, &nbsp;113.61KB - music visualizer<br>' +
'14,645 lines,&nbsp; 838.37KB - TOTAL<br>That is just the code... not including sounds and images.'
}
},
donate: {
option: 'Donate',
description: function(){return 'Maintenance of is not free. If you feel so inclined, you can give a donation of any amount through this button, to support future development of . Keep in mind that, for now, is provided as a FREE SERVICE. There is no charge for using in its current form. Donation is purely optional. If I run into some issue and find myself unable to pay for further hosting and upkeep of , I will fallback to donation funds to keep the project going.'},
buttons: function(){
return '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">' +
'<input type="hidden" name="cmd" value="_s-xclick">' +
'<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAnLTT1RDjNwcRHhnZsIqSiMz1PyyHcCS57pY/xhXmUV2IYu4MCnRS/nb6Pd0USL1RmA0L7G3ge9TfDy6WzNPdik6ejyQp9YIXGpyMU1NL6FWKktuIaIHHGxAE/EuG7stbQcw8UDvRNjkwCOM/3g6MwLh8JmLhaWX1xl2lURGXlWDELMAkGBSsOAwIaBQAwgaQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI2aSJPho2dySAgYAtJUKm1I/dxvYFQOCwQNwfWIas4gwoSLUhTFi0v/N2De7jK0h/3HAB117TwD5rQ9hy1INUittTtiNCjoSb6J0wr+MPK7LptifaPCpoMJDxKvb8qB8JM0gGOD48CWdn7gEgVT4gIyzHWTYn13CIDEfUUS+8Ctecz7pzt2aXF/59C6CCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE2MDkxNzA0MTM1OFowIwYJKoZIhvcNAQkEMRYEFOzQnofrZHcZ6cBDPyPVr2+r0HCZMA0GCSqGSIb3DQEBAQUABIGAGRK9AGpY5rxfKE0ZrvWz8zpo5F4NKWaYjd35tIKZEwZ+K4sqmXT0nreIUNhNPln4EcZxHJ2cNwsii0e36E9vQMrVXGS8cw+snuLJUeljBH1VQh5CYi4+p4MnkWxqexYDAbgZHVKxOGh4h87YKVVWnBXb79YFoaBw8zdCXd2aFW8=-----END PKCS7-----">' +
'<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">' +
'<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">' +
'</form>'
}
},
chromeExp: {
option: 'Chrome Experiment',
description: function(){return 'The project has been registered with ChromeExperiments.com, because it uses many Chrome features in its service. This should not change the course of the OS at all, and I intend to keep it on the same track it already was on.'},
buttons: function(){return 'Once the Chrome Experiments page is up, a link will be included here.'}
},
technologies: {
option: 'Technologies',
description: function(){return 'Below is a list of all web technologies used by . Keep in mind that this may be slightly incomplete, as it is hard to remember exactly what I have used in the past, and what I will use in the future.'},
buttons: function(){return 'Main technologies:<ul><li>HTML5</li><li>CSS3</li><li>JavaScript</li><li>PHP</li><li>AJAX</li></ul>' +
'NORAA:<ul><li>Speech Recognition API</li><li>Speech Synthesis API</li></ul>' +
'Canvas Video Games:<ul><li>HTML5 Canvas</li></ul>' +
'Internet:<ul><li>iFrame</li></ul>' +
'File Saving:<ul><li>PHP</li><li>AJAX</li></ul>' +
'Messaging:<ul><li>PHP</li><li>AJAX</li></ul>' +
'Camera:<ul><li>Camera</li><li>HTML5 Video</li></ul>' +
'Music Visualizer:<ul><li>Canvas</li><li>Web Audio API</li><li>Microphone (on standalone version, still in development)</li></ul>' +
'IndyCar, House Game:<ul><li>Canvas</li><li>GameMaker: Studio Professional</li></ul>' +
'RDP Host and Viewer:<ul><li>PHP</li><li>AJAX</li></ul>' +
'Function Grapher:<ul><li>Canvas</li></ul>' +
'External Debugger:<ul><li>Cross-Window JavaScript</li><li>Popup Window</li></ul>'
}
},
netAndBat: {
option: 'Network and Battery Status',
description: function(){return 'Network Online: <span class="liveElement" liveVar="window.navigator.onLine">' + window.navigator.onLine + '</span>. Battery Level (if -100, battery not detected): <span class="liveElement" liveVar="Math.round(batteryLevel * 100)">' + Math.round(batteryLevel * 100) + '</span>'},
buttons: function(){return 'These values are updated live as of A1.2.8'}
},
dataCollect: {
option: 'Anonymous Data Collection',
description: function(){return '<span class="liveElement" liveVar="numtf(apps.settings.vars.collectData)">' + numtf(apps.settings.vars.collectData) + '</span>'},
buttons: function(){return '<button onclick="apps.settings.vars.collectData = -1 * apps.settings.vars.collectData + 1">Toggle</button>'}
},
textLanguage: {
option: 'Text Language',
description: function(){return '<span class="liveElement" liveVar="languagepacks[currentlanguage]">' + languagepacks[currentlanguage] + '</span>; some apps support different languages. Translation is up to the developer of the app and may not be accurate. Some languages may be limited to few apps.'},
buttons: function(){return apps.settings.vars.getTextLanguages()}
},
uglyLoading: {
option: 'Ugly Loading',
description: function(){return '<span class="liveElement" liveVar="numtf(dirtyLoadingEnabled)">' + numtf(dirtyLoadingEnabled) + '</span> Allows you to watch load at startup, but looks dirty compared to having a loading screen.'},
buttons: function(){return '<button onclick="apps.settings.vars.togDirtyLoad()">Toggle</button>'}
},
corsProxy: {
option: 'CORS Proxy',
description: function(){return 'Prefix to URLs used by some apps to access non- websites. If you don\'t know what this is, dont mess with it.'},
buttons: function(){return '<input id="STNcorsInput" placeholder="https://cors-anywhere.herokuapp.com/"> <button onclick="apps.settings.vars.corsProxy = getId(\'STNcorsInput\').value;apps.savemaster.vars.save(\'APP_STN_CORSPROXY\', apps.settings.vars.corsProxy, 1)">Set</button>'}
}
},
screenRes: {
folder: 0,
folderName: 'Screen Resolution',
folderPath: 'apps.settings.vars.menus.screenRes',
image: '/settingIcons/screenRes.png',
scaling: {
option: 'Content Scaling',
description: function(){return 'If you have a hi-dpi screen or text and buttons on are too small, you can use this option to make bigger. Regular size is 1. Double size is 2. Triple size is 3. It is not recommended, but you can also shrink with a value less than 1.'},
buttons: function(){return '<input placeholder="1" id="STNscaling"> <button onclick="apps.settings.vars.setScale(getId(\'STNscaling\').value)">Set</button>'}
},
currRes: {
option: ' Monitor Resolution',
description: function(){return '<span class="liveElement" liveVar="getId(\'monitor\').style.width">' + getId('monitor').style.width + '</span> by <span class="liveElement" liveVar="getId(\'monitor\').style.height">' + getId('monitor').style.height + '</span>'},
buttons: function(){return '<input id="STNscnresX">px by <input id="STNscnresY">px <button onclick="fitWindowRes(getId(\'STNscnresX\').value, getId(\'STNscnresY\').value)">Set Screen Res</button>'}
},
saveRes: {
option: 'Save Resolution',
description: function(){return 'Have automatically load to a specified resolution (enter in boxes above)'},
buttons: function(){return '<button onclick="apps.settings.vars.saveRes(getId(\'STNscnresX\').value, getId(\'STNscnresY\').value)">Save</button> <button onclick="apps.savemaster.vars.delete(\'APP_STN_SAVESCREENRES\')">Delete</button>'}
},
currWin: {
option: 'Current Browser Window Resolution',
description: function(){return '<span class="liveElement" liveVar="window.innerWidth">' + window.innerWidth + '</span>px by <span class="liveElement" liveVar="window.innerHeight">' + window.innerHeight + '</span>px'},
buttons: function(){return '<button onclick="fitWindow()">Fit to Window</button>'}
},
currScn: {
option: 'Current Screen Resolution',
description: function(){return '<span class="liveElement" liveVar="screen.width">' + screen.width + '</span>px by <span class="liveElement" liveVar="screen.height">' + screen.height + '</span>px'},
buttons: function(){return '<button onclick="fitWindowOuter()">Fit to Screen</button>'}
},
fullscreen: {
option: 'Full Screen',
description: function(){return 'Puts into fullscreen, so it does not look like it has been loaded into a browser. You <i>may</i> need to Fit to Window after toggling.'},
buttons: function(){return '<button onclick="apps.settings.vars.reqFullscreen()">Enter Fullscreen</button> <button onclick="apps.settings.vars.endFullscreen()">Exit Fullscreen</button>'}
}
},
windows: {
folder: 0,
folderName: 'Windows',
folderPath: 'apps.settings.vars.menus.windows',
image: '/settingIcons/windows.png',
windowColor: {
option: 'Window Color',
description: function(){return 'Set the color of your window borders, as any CSS-compatible color.'},
buttons: function(){return '<input id="STNwinColorInput" placeholder="rgba(190, 190, 255, .6)" value="' + apps.settings.vars.currWinColor + '"> <button onClick="apps.settings.vars.setWinColor()">Set</button>'}
},
windowBlur: {
option: 'Windowblur',
description: function(){return 'Toggle Windowblur off to save on performance, but does not look as good.'},
buttons: function(){return '<button onClick="apps.settings.vars.togAero()">Toggle Windowblur Effect</button>'}
},
backdropFilter: {
option: 'CSS Backdrop Blur',
description: function(){return 'Toggle experimental CSS backdrop filter for windowblur. So far, the API is only available for Safari on Mac, but the API is under development for Google Chrome.'},
buttons: function(){return '<button onClick="apps.settings.vars.togBackdropFilter()">Toggle Backdrop Filter Blur</button>'}
},
blurStrength: {
option: 'Windowblur Strength',
description: function(){return 'Strength of the windowblur effect. Large numbers may produce framerate drops and unintended effects on appearance.'},
buttons: function(){return '<input id="STNwinblurRadius" placeholder="2" value="' + apps.settings.vars.currWinblurRad + '"> <button onclick="apps.settings.vars.setAeroRad()">Set</button>'}
},
blurBlend: {
option: 'Windowblur Blend Mode',
description: function(){return 'Window Blur uses a Blend Mode to determine how its color affects the background. Since people will have conflicting ideas on what is best, I give you the choice.'},
buttons: function(){return '<input id="STNwinBlendInput" placeholder="hard-light" value="' + apps.settings.vars.currWinBlend + '"> <button onClick="apps.settings.vars.setWinBlend()">Set</button>'}
},
fadeDist: {
option: 'Window Fade Distance',
description: function(){return 'The distance from the screen that windows will fade from view when closed. If set to 1, windows will not change size when closed. If between 0 and 1, the window will get smaller, or further away when closed. If larger than 1, the window will get bigger when closed.'},
buttons: function(){return '<input id="STNwinFadeInput" placeholder="0.8" value="' + apps.settings.vars.winFadeDistance + '"> <button onClick="apps.settings.vars.setFadeDistance(getId(\'STNwinFadeInput\').value)">Set</button>'}
},
winImg: {
option: 'Window Background Image',
description: function(){return 'An image on the background of the window that adds some texture to the background. Also useful for if you want to disable Windowblur but want your windows to have a cool texture on them. Enabled: ' + numtf(apps.settings.vars.enabWinImg)},
buttons: function(){return '<button onclick="apps.settings.vars.togWinImg()">Toggle</button> | <input id="STNwinImgInput" placeholder="winimg.png" value="' + apps.settings.vars.currWinImg + '"> <button onclick="apps.settings.vars.setWinImg()">Set</button>'}
}
},
taskbar: {
folder: 0,
folderName: 'Taskbar',
folderPath: 'apps.settings.vars.menus.taskbar',
image: '/settingIcons/taskbar.png',
taskbarPos: {
option: 'Taskbar Position',
description: function(){return 'Change the position of the taskbar on the screen.'},
buttons: function(){return '<button onclick="apps.settings.vars.setTskbrPos(0)">Bottom</button> <button onclick="apps.settings.vars.setTskbrPos(1)">Top</button> <button onclick="apps.settings.vars.setTskbrPos(2)">Left</button> <button onclick="apps.settings.vars.setTskbrPos(3)">Right</button>'}
},
/*
timeStyle: {
option: 'Compact Time',
description: function(){return 'Displays the time as either simple text, or a more compact, but smaller version. The compact version may have a performance hit on older computers.'},
buttons: function(){return '<button onclick="apps.settings.vars.togTimeComp()">Toggle Compact Time</button>'}
},
netStat: {
option: 'Network Status',
description: function(){return 'Displays the status of the network as Connected ] [, Interrupted ]X[, Uploading }-[, Downloading ]-{, or Active }-{.'},
buttons: function(){return '<button onclick="apps.settings.vars.togNetStat()">Toggle Network Status</button>'}
},
fpsStat: {
option: 'FPS Status',
description: function(){return 'Displays the FPS over the last second. jFPS is how many script steps have been completed in the last second. Higher numbers means the OS is working faster. Depending on the device, this number can vary when idle, between 150 for laptops, or 30-50 for phones. vFPS is the number of images rendered in the last second. Higher numbers means that the rendering CPU is not working too hard. This usually caps at 30 or 60.'},
buttons: function(){return '<button onclick="apps.settings.vars.togFpsStat()">Toggle FPS Status</button>'}
},
fpsStyle: {
option: 'Compact FPS',
description: function(){return 'Displays the FPS as either simple text, or a more compact, but smaller version. The compact version may have a performance hit on older computers.'},
buttons: function(){return '<button onclick="apps.settings.vars.togFpsComp()">Toggle Compact FPS</button>'}
},
lodStat: {
option: 'CPU Status',
description: function(){return 'Displays load on the CPU available to . This is not true at the hardware level - it uses calculations on performance and does not poll your CPU.'},
buttons: function(){return '<button onclick="apps.settings.vars.togLodStat()">Toggle CPU Status</button>'}
},
batStat: {
option: 'Battery Status',
description: function(){return 'Displays the battery level on your device. If the value is "?" or "-100", then your battery could not be detected by .'},
buttons: function(){return '<button onclick="apps.settings.vars.togBatStat()">Toggle Battery Status</button>'}
},
batStyle: {
option: 'Stylish Battery',
description: function(){return 'Displays the battery status either as simple text, or as a graphical indicator. In the text version, [XXX] means not charging and [XXX} means charging, and the CPU-strain will be less. In the graphical version, a battery with a blue tint means charging, and the CPU-strain will be more.'},
buttons: function(){return '<button onclick="apps.settings.vars.togBatComp()">Toggle Stylish Battery</button>'}
}
*/
widgets: {
option: 'Widgets',
description: function(){return '<ol id="STNwidgets">' + apps.settings.vars.getWidgetList() + '</ol>'},
buttons: function(){return apps.settings.vars.getWidgetButtons()}
}
},
dashboard: {
folder: 0,
folderName: 'Dashboard',
folderPath: 'apps.settings.vars.menus.dashboard',
dashDefault: {
option: 'Default Dashboard',
description: function(){return 'The default Dashboard of OS. Features quick shortcuts at the top and a searchable list of apps along with their three-letter IDs.'},
buttons: function(){return '<button onclick="apps.settings.vars.setDashboard(\'default\')">Select Default Dashboard</button>'}
},
dashWin7: {
option: 'Aero Dashboard',
description: function(){return 'Make the Dashboard look similar to the Start Menu of Windows 7 Aero. Features graphical application icons, shortcut buttons, app search, and a more familiar look.'},
buttons: function(){return '<button onclick="apps.settings.vars.setDashboard(\'win7\')">Select Aero Dashboard</button>'}
},
dashAndroid: {
option: 'Android Dashboard',
description: function(){return 'Make the Dashboard look similar to the app-drawer style of Android launchers. Features shortcut buttons, app search, and graphical appliation icons.'},
buttons: function(){return '<button onclick="apps.settings.vars.setDashboard(\'android\')">Select Android Dashboard</button>'}
},
dashWhisker: {
option: 'Whisker Dashboard',
description: function(){return 'Make the Dashboard look similar to the Whiskermenu of the XFCE desktop environment. Features graphical application icons, shortcut buttons, app search, and quick access to your OS ID.'},
buttons: function(){return '<button onclick="apps.settings.vars.setDashboard(\'whisker\')">Select Whisker Dashboard</button>'}
}
},
noraa: {
folder: 0,
folderName: 'NORAA',
folderPath: 'apps.settings.vars.menus.noraa',
advHelp: {
option: 'Advanced Help Pages',
description: function(){return '<span class="liveElement" liveVar="numtf(apps.settings.vars.noraHelpTopics)">' + numtf(apps.settings.vars.noraHelpTopics) + '</span>; NORAA returns more advanced help pages when you ask for OS help, instead of plain text.'},
buttons: function(){return '<button onclick="apps.settings.vars.togNoraListen()">Toggle</button>'}
},
listen: {
option: 'NORAA Listening',
description: function(){return '<span class="liveElement" liveVar="numtf(apps.settings.vars.currNoraListening)">' + numtf(apps.settings.vars.currNoraListening) + '</span>; NORAA listens for you to say a specified phrase that will activate him.'},
buttons: function(){return '<button onclick="apps.settings.vars.togNoraListen()">Toggle</button>'}
},
listenFor: {
option: 'Listening Phrase',
description: function(){return 'This is the phrase that NORAA listens for you to say, if enabled.'},
buttons: function(){return '<input id="STNnoraphrase" placeholder="listen computer" value="' + apps.settings.vars.currNoraPhrase + '"> <button onclick="apps.settings.vars.togNoraPhrase()">Set</button>'}
},
speechDelay: {
option: 'Speech Input Delay',
description: function(){return 'This is the time, in milliseconds, that NORAA gives you to cancel a command, when speaking to him. Useful for if NORAA did not hear you correctly.'},
buttons: function(){return '<input id="STNnoraDelay" value="' + apps.nora.vars.inputDelay + '"> <button onclick="apps.settings.vars.NORAAsetDelay()">Set</button>'}
},
voices: {
option: 'NORAA\'s Voice',
description: function(){return 'Current: <span class="liveElement" liveVar="apps.nora.vars.lang">' + apps.nora.vars.lang + '</span>. This is the voice NORAA uses to speak to you. Choose from one of the voices below that are supported by your browser.'},
buttons: function(){return apps.settings.vars.getVoicesForNORAA()}
}
},
language: {
folder: 0,
folderName: 'Language',
folderPath: 'apps.settings.vars.menus.language',
currentLanguage: {
option: 'Current Language',
description: function(){return languagepacks[currentlanguage]},
buttons: function(){return 'You must reboot for language changes to take effect.'}
},
changeLanguage: {
option: 'Change language',
description: function(){return 'Click a button, then restart to change the language.'},
buttons: function(){return apps.settings.vars.getTextLanguages()}
},
credits: {
option: 'Tranlsation Credits',
description: function(){return 'I got a lot of help with translating from volunteers. So far, here\'s the people who\'ve helped me out.'},
buttons: function(){return 'US English: Me, of course. This is the native language of .<br>Chinese: Noah McDermott (noahmcd@gmail.com).'}
}
},
clipboard: {
folder: 0,
folderName: 'Clipboard',
folderPath: 'apps.settings.vars.menus.clipboard',
size: {
option: 'Clipboard Slots',
description: function(){return 'Current: <span class="liveElement" liveVar="textEditorTools.slots">' + textEditorTools.slots + '</span>. Number of slots in your clipboard. An excessively large clipboard may be difficult to manage.'},
buttons: function(){return '<input id="STNclipboardSlots"> <button onclick="apps.settings.vars.setClipboardSlots(getId(\'STNclipboardSlots\').value)">Set</button>'}
},
clear: {
option: 'Clear Clipboard',
description: function(){return 'Clear the persistent keyboard of . Useful for if you have a cluttered clipboard. If you do not copy anything to the clipboard until you shut down, then the next time you boot , the clipboard will be empty. Think of this as a fallback for if clicking this button was an accident. Just copy something to the clipboard and nothing will disappear. It is also one last chance to use the stuff you have copied before it is cleared.'},
buttons: function(){return '<button onclick="apps.savemaster.vars.save(\'APP_STN_SAVED_CLIPBOARD\', \'_cleared_clipboard_\', 1);">Clear</button>'}
}
},
screensaver: {
folder: 0,
folderName: "Screen Saver",
folderPath: "apps.settings.vars.menus.screensaver",
enable: {
option: "Enable Screen Saver",
description: function(){return "Current: " + numtf(apps.settings.vars.screensaverEnabled) + ". Enable the Screensaver."},
buttons: function(){return '<button onclick="apps.settings.vars.togScreensaver()">Toggle</button>'}
},
time: {
option: "Time to Wait",
description: function(){return "Current: " + (apps.settings.vars.screensaverTime / 1000 / 1000 / 60) + ". This is the time in minutes that waits to activate the screensaver."},
buttons: function(){return '<input id="STNscreensaverTime"> <button onclick="apps.settings.vars.setScreensaverTime(parseFloat(getId(\'STNscreensaverTime\').value) * 1000 * 1000 * 60)">Set</button>'}
},
type: {
option: "Type of Screensaver",
description: function(){return 'Current: ' + apps.settings.vars.currScreensaver + ". This is the type of screensaver that will select."},
buttons: function(){return apps.settings.vars.grabScreensavers()}
}
},
customStyles: {
folder: 0,
folderName: "Custom Styles",
folderPath: "apps.settings.vars.menus.customStyles",
stylesheet: {
option: 'Custom CSS Stylesheet',
description: function(){return 'If you are an advanced user and want nearly full customization ability for , here is how to use the Custom Stylesheet feature...'},
buttons: function(){return 'All you need to know is the CSS stylesheet language. Create a new file called CustomStyle, and put your CSS code in there. After you save the file, restart or <button onclick="getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Force Style Update Now</button>. <i>It\'s that easy.</i> For reference, you can get to the official stylesheet by visiting <a target="_blank" href="style.css">style.css</a>.'}
},
normal: {
option: 'Default Styling',
description: function(){return 'Restore to its default stylesheet. If you are using a customized sheet, make sure to back it up, as this button will delete it.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', \'/* DEFAULT */\', 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Restore</button>'}
},
tskbrOnTop: {
option: 'Taskbar On Top',
description: function(){return 'Place the Taskbar at the top of the screen rather than at the bottom.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.tskbrOnTop, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
sCustom: {
// put 's personal stylesheet here
option: '\'s Personal Styles',
description: function(){return 'Style to look similar to the developer\'s own modifications!'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.sCustom, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
alpha: {
option: 'OS Alpha',
description: function(){return 'Style to look similar to how it did during the Alpha. Certain things may differ due to CSS limitations.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.alpha, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
elme: {
option: 'Elme\'s Style',
description: function(){return 'Style to look like Elme Delos Santos\'s ideas for . Elme is a developer from Quora that helped make some of the new icons for . This style looks best with a white or very bright window color.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.elme, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
win98: {
option: 'Windows 98<sup>&copy;</sup>',
description: function(){return 'Style to look similar to Microsoft\'s nostalgic Windows 98. Windows 98 is the sole property of Microsoft - this is simply a user-made file that I have included in the library of custom content.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.windows98, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
winXP: {
option: 'Windows XP<sup>&copy;</sup>',
description: function(){return 'Style to look similar to Microsoft\'s resilient Windows XP. Windows XP is the sole property of Microsoft - this is simply a user-made file that I have included in the library of custom content.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.windowsXP, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
transXP: {
option: 'Windows XP<sup>&copy;</sup> (colorable)',
description: function(){return 'Same as above, but colorable and windowblur works (set window color to #0055EA for Windows XP color). Style to look similar to Microsoft\'s resilient Windows XP. Windows XP is the sole property of Microsoft - this is simply a user-made file that I have included in the library of custom content.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.transparentXP, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
win7: {
option: 'Windows 7<sup>&copy;</sup>',
description: function(){return 'Style to look similar to Microsoft\'s beautiful Windows 7 (set window background image to /win7blur1080.png for glass reflections). Windows 7 is the sole property of Microsoft - this is simply a user-made file that I have included in the library of custom content.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.windows7, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
win8: {
option: 'Windows 8<sup>&copy;</sup>',
description: function(){return 'Style to look similar to Microsoft\'s metro Windows 8. Windows 8 is the sole property of Microsoft - this is simply a user-made file that I have included in the library of custom content.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.windows8, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
win10: {
option: 'Windows 10<sup>&copy;</sup>',
description: function(){return 'Style to look similar to Microsoft\'s modern Windows 10. Windows 10 is the sole property of Microsoft - this is simply a user-made file that I have included in the library of custom content.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.windows10, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
elCapitan: {
option: 'OSX El Capitan<sup>&copy;</sup>',
description: function(){return 'Style to look similar to Apple\'s OSX El Capitan. OSX is the sole property of Apple - this is simply a usermade file that I have included in the gallery of styles.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.elCapitan, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
osjs: {
option: 'OS.js<sup>&copy;</sup>',
description: function(){return 'Style to look similar to Anders Evenrud\'s OS.js. OS.js is the sole property of Anders - this is simply a usermade file that I have included in the gallery of styles.'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.osjs, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
},
jdStyle: {
option: 'JD\'s Style',
description: function(){return 'Style to look like JD\'s personal stylesheet. JD is the creator of J (not to be confused with ).'},
buttons: function(){return '<button onClick="apps.savemaster.vars.save(\'CustomStyle\', files.customStyles.jdStyle, 1);getId(\'CustomStyle\').innerHTML = USERFILES.CustomStyle">Install</button>'}
}
},
advanced: {
folder: 0,
folderName: 'Advanced',
folderPath: 'apps.settings.vars.menus.advanced',
tampermonkey: {
option: ' Tampermonkey Script',
description: function(){return 'If you have a Tampermonkey-capable browser (Google Chrome or Firefox are two of them) and love , you can get quick access to on all of your tabs! (this extension is in beta and certain things may break)'},
buttons: function(){return 'Visit <a href="/tampermonkey.txt">tampermonkey.txt</a> and copy-paste its contents into Tampermonkey. A bar will appear on all of your pages from then on that will allow you to open on any tab.'}
}
}
},
availableBackgrounds: [
'/_binary.png',
'/Binary.png',
'/bg.jpg',
'/bgBeta.png',
'/bg_old.jpg',
'/bg_stone.jpg',
'/tapet/new/t1.png',
'/tapet/new/t1_1080.png',
'/tapet/new/t2.png',
'/tapet/new/t2_1080.png',
'/tapet/new/t3.png',
'/tapet/new/t3_1080.png',
'/tapet/new/t4.png',
'/tapet/new/t4_1080.png',
'/tapet/new/t5.png',
'/tapet/new/t5_1080.png',
'/tapet/new/t6.png',
'/tapet/new/t6_1080.png',
'/tapet/new/t7.png',
'/tapet/new/t7_1080.png',
'/tapet/new/t8.png',
'/tapet/new/t8_1080.png',
'/tapet/new/t9.png',
'/tapet/new/t9_1080.png',
'/tapet/new/t10.png',
'/tapet/new/t10_1080.png',
'/tapet/new/t11.png',
'/tapet/new/t11_1080.png',
'/tapet/new/t12.png',
'/tapet/new/t12_1080.png',
'/tapet/new/t13.png',
'/tapet/new/t13_1080.png',
'/tapet/new/t14.png',
'/tapet/new/t14_1080.png',
'/tapet/new/t15.png',
'/tapet/new/t15_1080.png',
'/tapet/new/t16.png',
'/tapet/new/t16_1080.png',
'/tapet/new/t17.png',
'/tapet/new/t17_1080.png',
'/tapet/new/t18.png',
'/tapet/new/t18_1080.png',
'/tapet/new/t19.png',
'/tapet/new/t19_1080.png',
'/tapet/new/t20.png',
'/tapet/new/t20_1080.png',
'/tapet/new/t21.png',
'/tapet/new/t21_1080.png',
'/tapet/t1.png',
'/tapet/t1_1080.png',
'/tapet/t2.png',
'/tapet/t2_1080.png',
'/tapet/t3.png',
'/tapet/t3_1080.png',
'/tapet/t4.png',
'/tapet/t4_1080.png',
'/tapet/t5.png',
'/tapet/t5_1080.png',
'/win98halo.png'
],
corsProxy: 'https://cors-anywhere.herokuapp.com/',
saveRes: function(newX, newY){
apps.savemaster.vars.save('APP_STN_SAVESCREENRES', newX + '/' + newY, 1);
fitWindowRes(newX, newY);
},
togDirtyLoad: function(){
dirtyLoadingEnabled = -1 * dirtyLoadingEnabled + 1;
apps.savemaster.vars.save('APP_STN_SETTING_DIRTYLOAD', dirtyLoadingEnabled, 1);
},
showMenu: function(menu){
if(menu === 'oldMenu'){
openapp(apps.settings, 'oldMenu');
}else{
apps.settings.appWindow.setContent('<div id="STNmenuDiv" style="font-family:ProFont, monospace;font-size:12px;width:100%;height:100%;overflow:auto"><span style="font-size:36px"><button onclick="apps.settings.vars.showMenu(apps.settings.vars.menus)">Home</button> ' + menu.folderName + '</span><br><br></div>');
if(menu.folder === 1){
getId("STNmenuDiv").innerHTML += '<hr><table id="STNmenuTable" style="width:100%;"></table>';
var j = 0;
var appendStr = '<tr class="STNtableTR">';
for(var i in menu){
if(i !== 'folder' && i !== 'folderName' && i !== 'folderPath' && i !== 'image'){
if(j % 3 === 0 && j !== 0){
appendStr += '</tr><tr class="STNtableTR">';
}
if(menu[i].image){
appendStr += '<td class="STNtableTD cursorPointer" onclick="apps.settings.vars.showMenu(' + menu[i].folderPath + ')"><img src="' + menu[i].image + '" style="max-width:75px;max-height:75px;"><br>' + menu[i].folderName + '</td>';
}else{
appendStr += '<td class="STNtableTD cursorPointer" onclick="apps.settings.vars.showMenu(' + menu[i].folderPath + ')">' + menu[i].folderName + '</td>';
}
j++;
}
}
getId('STNmenuTable').innerHTML += appendStr + '</tr>';
}else{
for(var i in menu){
if(i !== 'folder' && i !== 'folderName' && i !== 'folderPath' && i !== 'image'){
getId('STNmenuDiv').innerHTML += '<hr><span style="font-size:18px">' + menu[i].option + ':</span> ' + menu[i].description() + '<br>' + menu[i].buttons();
}
}
}
}
},
setClipboardSlots: function(newSlots, nosave){
textEditorTools.slots = newSlots;
textEditorTools.updateSlots();
if(!nosave){
apps.savemaster.vars.save('APP_STN_SETTING_SLOTS', newSlots, 1);
}
},
setDashboard: function(dashboardName){
apps.startMenu.vars.listOfApps = '';
apps.startMenu.vars.appElems = null;
apps.savemaster.vars.save('APP_STN_DASHBOARD', dashboardName, 1);
},
setScale: function(newScale, nosave){
window.screenScale = parseFloat(newScale);
fitWindow();
if(!nosave){
apps.savemaster.vars.save('APP_STN_screenscale', newScale, 1);
}
},
toggleMobileMode: function(){
if(mobileMode){
getId('mobileStyle').innerHTML = "";
mobileMode = 0;
}else{
getId('mobileStyle').innerHTML = "button,input{padding:1em !important;}.winHTML{transform-origin:0 100%;}";
mobileMode = 1;
}
},
calcFLOPS: function(){
var intOps = 0;
var fltOps = 0.0;
var strOps = "";
var firstTime = performance.now();
//var currSec = formDate('S');
//while(currSec === formDate('S')){
//
//}
//currSec = formDate('S');
//while(currSec === formDate('S')){
while(performance.now() - firstTime <= 1000){
intOps += 1;
}
//currSec = formDate('S');
//while(currSec === formDate('S')){
while(performance.now() - firstTime <= 2000){
fltOps += 0.1;
}
//currSec = formDate('S');
//while(currSec === formDate('S')){
while(performance.now() - firstTime <= 3000){
strOps += "A";
}
fltOps = Math.floor(fltOps * 10);
strOps = strOps.length;
apps.prompt.vars.alert("Operations Per Second:<br>Note: This value may be inaccurate due to counting time<br><br>Integer OPS: " + numberCommas(intOps) + "<br>Floating Point OPS: " + numberCommas(fltOps) + "<br>String OPS: " + numberCommas(strOps), 'OK', function(){}, 'Settings');
},
longTap: 0,
longTapTime: 500000,
togLongTap: function(nosave){
this.longTap = -1 * this.longTap + 1;
if(!nosave){
apps.savemaster.vars.save('APP_STN_SETTING_LONGTAP', this.longTap, 1);
}
},
clickToMove: 0,
togClickToMove: function(){
this.clickToMove = -1 * this.clickToMove + 1;
},
togNoraHelpTopics: function(nosave){
this.noraHelpTopics = this.noraHelpTopics * -1 + 1;
if(!nosave){
apps.savemaster.vars.save('APP_STN_SETTING_NORAHELP', this.noraHelpTopics, 1);
}
},
noraHelpTopics: 1,
collectData: 1,
currVoiceStr: '',
currLangStr: '',
currNoraPhrase: 'listen computer',
currNoraListening: "0",
togNoraListen: function(nosave){
if(this.currNoraListening === "1"){
//stop nora's listening
this.currNoraListening = "0";
apps.nora.vars.stopContRecog();
if(!nosave){
apps.savemaster.vars.save('NORAA_LISTEN', this.currNoraListening, 1);
}
}else{
//start nora's listening
this.currNoraListening = "1";
apps.nora.vars.startContRecog();
if(!nosave){
apps.savemaster.vars.save('NORAA_LISTEN', this.currNoraListening, 1);
}
}
},
togNoraPhrase: function(nosave){
this.currNoraPhrase = getId('STNnoraphrase').value;
if(!nosave){
apps.savemaster.vars.save('NORAA_PHRASE', this.currNoraPhrase, 1);
}
},
setDebugLevel: function(level){
dbgLevel = level;
},
FILcanWin: 0,
togFILwin: function(){
if(this.FILcanWin){
this.FILcanWin = 0;
}else{
this.FILcanWin = 1;
}
},
enabWinImg: 1,
currWinImg: 'winimg.png',
togWinImg: function(nosave){
perfStart('settings');
if(this.enabWinImg){
this.tempArray = document.getElementsByClassName("winBimg");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.display = "none";
}
this.enabWinImg = 0;
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_TOGWINIMG", "0", 1);
}
}else{
this.tempArray = document.getElementsByClassName("winBimg");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.display = "block";
}
this.enabWinImg = 1;
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_TOGWINIMG", "1", 1);
}
}
d(1, perfCheck('settings') + '&micro;s to toggle windowbgimg');
},
setWinImg: function(nosave){
perfStart('settings');
this.currWinImg = getId('STNwinImgInput').value;
this.tempArray = document.getElementsByClassName("winBimg");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.backgroundImage = 'url(' + this.currWinImg + ')';
}
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_WINIMG", this.currWinImg, 1);
}
d(1, perfCheck('settings') + '&micro;s to set windowbgimg');
},
getTextLanguages: function(){
this.currLangStr = '';
for(var i in languagepacks){
this.currLangStr += '<button onclick="currentlanguage = \'' + i + '\';apps.savemaster.vars.save(\'APP_STN_SETTING_LANG\', \'' + i + '\', 1)">' + languagepacks[i] + '</button> ';
}
return this.currLangStr;
},
getVoicesForNORAA: function(){
this.currVoiceStr = '';
if(apps.nora.vars.voices !== []){
for(var i in apps.nora.vars.voices){
this.currVoiceStr += '<button onclick="apps.nora.vars.lang = \'' + apps.nora.vars.voices[i].name + '\';window.speechSynthesis.onvoiceschanged();apps.settings.vars.saveNORAAvoice()">' + apps.nora.vars.voices[i].name + '</button> ';
}
return this.currVoiceStr;
}else{
return '<i>Voices not available - try reopening Settings</i>';
}
},
saveNORAAvoice: function(){
apps.savemaster.vars.save('NORAA_LANG', apps.nora.vars.lang, 1);
},
NORAAsetDelay: function(nosave){
apps.nora.vars.inputDelay = parseInt(getId('STNnoraDelay').value, 10);
if(!nosave){
apps.savemaster.vars.save('NORAA_DELAY', apps.nora.vars.inputDelay);
}
},
tempArray: [],
performanceMode: 0,
togPerformanceMode: function(nosave){
this.performanceMode = -1 * this.performanceMode + 1;
if(!nosave){
apps.savemaster.vars.save('APP_STN_PERFMODE', this.performanceMode, 1);
}
tskbrToggle.perfMode = this.performanceMode;
if(this.performanceMode){
getId('monitor').style.imageRendering = 'pixelated';
getId('windowFrameOverlay').style.background = 'rgba(255, 255, 255, 0.1)';
getId('windowFrameOverlay').style.outline = '1px solid #000';
getId('windowFrameOverlay').style.boxShadow = 'inset 0 0 0 1px #FFF';
getId('windowFrameOverlay').style.borderRadius = '0';
}else{
getId('monitor').style.imageRendering = '';
getId('windowFrameOverlay').style.background = '';
getId('windowFrameOverlay').style.outline = '';
getId('windowFrameOverlay').style.boxShadow = '';
getId('windowFrameOverlay').style.borderRadius = '';
}
},
getWidgetList: function(){
var nodes = getId('time').childNodes;
var str = '<li>';
for(var i = 0; i < nodes.length; i++){
str += widgets[nodes[i].getAttribute('WidgetName')].name + '</li><li>';
}
return str + '</li>';
},
getWidgetButtons: function(){
var str = '';
for(var i in widgets){
//str += widgets[nodes[i].getAttribute('WidgetName')].name + '</li><li>';
if(widgets[i].place === -1){
str += '<button onclick="addWidget(\'' + widgets[i].codeName + '\');apps.settings.vars.showMenu(apps.settings.vars.menus.taskbar);">Add ' + widgets[i].name + ' Widget</button><br>';
}else{
str += '<button onclick="removeWidget(\'' + widgets[i].codeName + '\');apps.settings.vars.showMenu(apps.settings.vars.menus.taskbar);">Remove ' + widgets[i].name + ' Widget</button><br>';
}
}
return str + '';
},
checkScreensaver: function(){
if(apps.settings.vars.screensaverEnabled && !screensaverRunning){
if(perfCheck('userActivity') > apps.settings.vars.screensaverTime){
getId('screensaverLayer').style.display = "block";
apps.settings.vars.screensavers[apps.settings.vars.currScreensaver].start();
screensaverRunning = 1;
}
}
},
screensaverTimer: 0,
screensaverEnabled: 1,
screensaverTime: 300000000,
currScreensaver: "phosphor",
screensavers: {
blackScreen: {
name: "Black Screen",
selected: function(){
apps.prompt.vars.alert("There are no configuration settings for this screensaver.", "Okay.", function(){}, "Black Screen Screensaver");
},
start: function(){
getId('screensaverLayer').style.backgroundColor = "#000";
},
end: function(){
getId('screensaverLayer').style.backgroundColor = "";
}
},
phosphor: {
name: "Phosphor",
selected: function(){
apps.prompt.vars.alert("There are no configuration settings for this screensaver.", "Okay.", function(){}, "Phosphor Screensaver");
},
start: function(){
getId('screensaverLayer').style.backgroundColor = '#000';
getId('screensaverLayer').innerHTML = '<iframe src="/scrsav/phosphor.html" style="pointer-events:none;border:none;width:100%;height:100%;display:block;position:absolute;left:0;top:0;"></iframe>';
},
end: function(){
getId('screensaverLayer').style.backgroundColor = '';
getId('screensaverLayer').innerHTML = '';
}
},
hue: {
name: "Hue",
selected: function(){
apps.prompt.vars.alert("There are no configuration settings for this screensaver.", "Okay.", function(){}, "Hue Screensaver");
},
start: function(){
apps.settings.vars.screensavers.hue.vars.currHue = 0;
apps.settings.vars.screensavers.hue.vars.canRun = 1;
requestAnimationFrame(apps.settings.vars.screensavers.hue.vars.setHue);
},
end: function(){
apps.settings.vars.screensavers.hue.vars.canRun = 0;
},
vars: {
currHue: 0,
setHue: function(){
getId("monitor").style.filter = "hue-rotate(" + (apps.settings.vars.screensavers.hue.vars.currHue++) + "deg)";
if(apps.settings.vars.screensavers.hue.vars.canRun){
setTimeout(apps.settings.vars.screensavers.hue.vars.setHue, 100);
}else{
getId("monitor").style.filter = "";
}
},
canRun: 0
}
},
randomColor: {
name: "Random Color",
selected: function(){
apps.prompt.vars.alert("There are no configuration settings for this screensaver.", "Okay.", function(){}, "Random Color Screensaver");
},
start: function(){
apps.settings.vars.screensavers.randomColor.vars.currColor = [127, 127, 127];
apps.settings.vars.screensavers.randomColor.vars.canRun = 1;
getId('screensaverLayer').style.transition = 'background-color 3s';
requestAnimationFrame(apps.settings.vars.screensavers.randomColor.vars.setColor);
},
end: function(){
apps.settings.vars.screensavers.randomColor.vars.canRun = 0;
getId('screensaverLayer').style.backgroundColor = '';
getId('screensaverLayer').style.transition = '';
},
vars: {
currColor: [127, 127, 127],
setColor: function(){
if(apps.settings.vars.screensavers.randomColor.vars.canRun){
apps.settings.vars.screensavers.randomColor.vars.currColor[0] = Math.floor(Math.random() * 256);
apps.settings.vars.screensavers.randomColor.vars.currColor[1] = Math.floor(Math.random() * 256);
apps.settings.vars.screensavers.randomColor.vars.currColor[2] = Math.floor(Math.random() * 256);
getId('screensaverLayer').style.backgroundColor = 'rgb(' + apps.settings.vars.screensavers.randomColor.vars.currColor[0] + ',' + apps.settings.vars.screensavers.randomColor.vars.currColor[1] + ',' + apps.settings.vars.screensavers.randomColor.vars.currColor[2] + ')';
setTimeout(apps.settings.vars.screensavers.randomColor.vars.setColor, 3000);
}
},
canRun: 0
}
},
bouncyBall: {
name: "Bouncy Ball",
selected: function(){
apps.prompt.vars.alert("There are no configuration settings for this screensavver.", "Okay.", function(){}, "Bouncy Ball Screensaver");
},
start: function(){
console.log('start');
apps.settings.vars.screensavers.bouncyBall.vars.scr = [parseInt(getId('monitor').style.width), parseInt(getId('monitor').style.height) - 30];
getId('screensaverLayer').innerHTML = '<canvas style="position:absolute;display:block;left:0;top:0" id="bbssCnv"></canvas>';
getId('bbssCnv').width = parseInt(getId('monitor').style.width);
getId('bbssCnv').height = parseInt(getId('monitor').style.height);
getId('bbssCnv').style.width = getId('monitor').style.width;
getId('bbssCnv').style.height = getId('monitor').style.height;
apps.settings.vars.screensavers.bouncyBall.vars.ctxFg = getId('bbssCnv').getContext('2d');
apps.settings.vars.screensavers.bouncyBall.vars.ball.vel = [0, 0];
apps.settings.vars.screensavers.bouncyBall.vars.canRun = 1;
requestAnimationFrame(apps.settings.vars.screensavers.bouncyBall.vars.frame);
apps.settings.vars.screensavers.bouncyBall.vars.resetBall();
},
end: function(){
console.log('end');
apps.settings.vars.screensavers.bouncyBall.vars.canRun = 0;
apps.settings.vars.screensavers.bouncyBall.vars.ctxFg = null;
getId('screensaverLayer').innerHTML = '';
},
vars: {
ctxFg: null,
scr: [0, 0],
canRun: 0,
ball: {
size: 0,
coord: [0, 0],
vel: [0, 0]
},
timer: 0,
frame: function(){
if(apps.settings.vars.screensavers.bouncyBall.vars.canRun){
if((Math.abs(apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[0]) + Math.abs(apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1])) / 2 < 0.5){
apps.settings.vars.screensavers.bouncyBall.vars.timer++;
if(apps.settings.vars.screensavers.bouncyBall.vars.timer > 60){
apps.settings.vars.screensavers.bouncyBall.vars.resetBall();
}
}else{
apps.settings.vars.screensavers.bouncyBall.vars.timer = 0;
}
apps.settings.vars.screensavers.bouncyBall.vars.ctxFg.clearRect(0, 0, apps.settings.vars.screensavers.bouncyBall.vars.scr[0], apps.settings.vars.screensavers.bouncyBall.vars.scr[1]);
apps.settings.vars.screensavers.bouncyBall.vars.ctxFg.beginPath();
apps.settings.vars.screensavers.bouncyBall.vars.ctxFg.arc(
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[0],
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[1],
apps.settings.vars.screensavers.bouncyBall.vars.ball.size / 2,
0, 2 * Math.PI, false
);
apps.settings.vars.screensavers.bouncyBall.vars.ctxFg.fill();
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[0] += apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[0];
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[1] += apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1];
if(
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[0] - apps.settings.vars.screensavers.bouncyBall.vars.ball.size / 2 < 0 ||
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[0] + apps.settings.vars.screensavers.bouncyBall.vars.ball.size / 2 > apps.settings.vars.screensavers.bouncyBall.vars.scr[0]
){
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[0] -= apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[0];
apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[0] = -0.8 * apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[0];
apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1] = 0.75 * apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1];
}
if(
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[1] - apps.settings.vars.screensavers.bouncyBall.vars.ball.size / 2 < 0 ||
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[1] + apps.settings.vars.screensavers.bouncyBall.vars.ball.size / 2 > apps.settings.vars.screensavers.bouncyBall.vars.scr[1]
){
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord[1] -= apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1];
apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[0] = 0.9 * apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[0];
apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1] = -0.75 * apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1];
}
apps.settings.vars.screensavers.bouncyBall.vars.ball.vel[1] += 0.098;
requestAnimationFrame(apps.settings.vars.screensavers.bouncyBall.vars.frame);
}
},
resetBall: function(){
apps.settings.vars.screensavers.bouncyBall.vars.ball.size = Math.floor(Math.random() * 20) + 11;
apps.settings.vars.screensavers.bouncyBall.vars.ball.coord = [
apps.settings.vars.screensavers.bouncyBall.vars.scr[0] / 2,
apps.settings.vars.screensavers.bouncyBall.vars.scr[1] / 2
];
apps.settings.vars.screensavers.bouncyBall.vars.ctxFg.fillStyle = 'rgb(' + (Math.floor(Math.random() * 255) + 1) + ',' + (Math.floor(Math.random() * 255) + 1) + ',' + (Math.floor(Math.random() * 255) + 1) + ')';
apps.settings.vars.screensavers.bouncyBall.vars.ball.vel = [
Math.floor(Math.random() * 80) - 39,
Math.floor(Math.random() * 80) - 39
];
}
}
},
wikiRandom: {
name: "Random Wikipedia Page",
selected: function(){
apps.prompt.vars.confirm('Show the text " ScreenSaver" on your wikipedia page?', ['No', 'Yes'], apps.settings.vars.screensavers.wikiRandom.vars.setSetting, 'Random Wikipedia ScreenSaver');
},
start: function(){
apps.settings.vars.screensavers.wikiRandom.vars.canRun = 1;
apps.settings.vars.screensavers.wikiRandom.vars.newPage();
},
end: function(){
apps.settings.vars.screensavers.wikiRandom.vars.canRun = 0;
},
vars: {
newPage: function(){
if(apps.settings.vars.screensavers.wikiRandom.vars.canRun){
getId('screensaverLayer').innerHTML = '';
if(USERFILES.APP_STN_scnsav_wikiRandom === '0'){
getId('screensaverLayer').innerHTML = '<iframe src="https://en.wikipedia.org/wiki/Special:Random" style="pointer-events:none;border:none;width:100%;height:100%;"></iframe>';
}else{
getId('screensaverLayer').innerHTML = '<iframe src="https://en.wikipedia.org/wiki/Special:Random" style="pointer-events:none;border:none;width:100%;height:100%;"></iframe><div style="top:10px;left:180px;font-size:108px;color:#557;font-family:ProFont"><img src="/appicons/ds/.png"><i>Screensaver</i></div>';
}
setTimeout(apps.settings.vars.screensavers.wikiRandom.vars.canRun, 180000);
}
},
setSetting: function(btn){
apps.savemaster.vars.save('APP_STN_scnsav_wikiRandom', String(btn), 1);
}
}
}
},
scnsavList: '',
grabScreensavers: function(){
this.scnsavList = '';
for(var item in this.screensavers){
this.scnsavList += '<button onclick="apps.settings.vars.setScreensaver(\'' + item + '\')">' + this.screensavers[item].name + '</button> ';
}
return this.scnsavList;
},
togScreensaver: function(){
this.screensaverEnabled = -1 * this.screensaverEnabled + 1;
apps.savemaster.vars.save("APP_STN_SETTING_SCREENSAVER_ENABLED", this.screensaverEnabled, 1);
},
setScreensaverTime: function(newTime){
this.screensaverTime = newTime;
apps.savemaster.vars.save("APP_STN_SETTING_SCREENSAVER_TIME", this.screensaverTime, 1);
},
setScreensaver: function(type){
this.currScreensaver = type;
this.screensavers[type].selected();
apps.savemaster.vars.save("APP_STN_SETTING_SCREENSAVER", this.currScreensaver, 1);
},
currWinColor: "rgba(190, 190, 255, .6)",
currWinBlend: "hard-light",
currWinOpac: "1",
currWinblurRad: "2",
isAero: 1,
sB: function(nosave){
perfStart('settings');
getId('loadingBg').style.backgroundImage = "url(" + getId('bckGrndImg').value + ")";
getId("monitor").style.backgroundImage = "url(" + getId("bckGrndImg").value + ")";
if(this.isAero){
this.tempArray = document.getElementsByClassName("winAero");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.backgroundImage = "url(" + getId("bckGrndImg").value + ")";
}
}
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_BACKGROUND", getId("bckGrndImg").value, 1);
}
d(1, perfCheck('settings') + '&micro;s to set background');
},
togAero: function(nosave){
perfStart('settings');
if(this.isAero){
this.tempArray = document.getElementsByClassName("winAero");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.backgroundImage = "none";
this.tempArray[elem].style.backgroundBlendMode = "initial";
this.tempArray[elem].style.filter = "none";
this.tempArray[elem].style.webkitFilter = "none";
}
this.isAero = 0;
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_AERO", "0", 1);
}
}else{
this.tempArray = document.getElementsByClassName("winAero");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.backgroundImage = getId("monitor").style.backgroundImage;
this.tempArray[elem].style.backgroundBlendMode = this.currWinBlend;
this.tempArray[elem].style.filter = "blur(" + this.currWinblurRad + "px)";
this.tempArray[elem].style.webkitFilter = "blur(" + this.currWinblurRad + "px)";
}
this.isAero = 1;
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_AERO", "1", 1);
}
}
d(1, perfCheck('settings') + '&micro;s to toggle windowblur');
},
isBackdrop: 0,
togBackdropFilter: function(nosave){
perfStart('settings');
if(this.isBackdrop){
this.tempArray = document.getElementsByClassName("window");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.webkitBackdropFilter = 'none';
this.tempArray[elem].style.backdropFilter = 'none';
}
getId('taskbar').style.webkitBackdropFilter = 'none';
getId('taskbar').style.backdropFilter = 'none';
this.isBackdrop = 0;
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_BACKDROPFILTER", "0", 1);
}
}else{
this.tempArray = document.getElementsByClassName("window");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.webkitBackdropFilter = 'blur(' + this.currWinblurRad + 'px)';
this.tempArray[elem].style.backdropFilter = 'blur(' + this.currWinblurRad + 'px)';
}
getId('taskbar').style.webkitBackdropFilter = 'blur(' + this.currWinblurRad + 'px)';
getId('taskbar').style.backdropFilter = 'blur(' + this.currWinblurRad + 'px)';
this.isBackdrop = 1;
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_BACKDROPFILTER", "1", 1);
}
}
d(1, perfCheck('settings') + '&micro;s to toggle backdrop filter');
},
setWinColor: function(nosave, newcolor){
perfStart('settings');
if(newcolor){
this.currWinColor = newcolor;
}else{
this.currWinColor = getId("STNwinColorInput").value;
}
this.tempArray = document.getElementsByClassName("winAero");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.backgroundColor = this.currWinColor;
}
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_WINCOLOR", this.currWinColor, 1);
}
d(1, perfCheck('settings') + '&micro;s to set window color');
},
setAeroRad: function(nosave){
perfStart('settings');
this.currWinblurRad = getId("STNwinblurRadius").value;
this.tempArray = document.getElementsByClassName("winAero");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.webkitFilter = "blur(" + this.currWinblurRad + "px)";
this.tempArray[elem].style.filter = "blur(" + this.currWinblurRad + "px)";
}
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_AERORAD", this.currWinblurRad, 1);
}
d(1, perfCheck('settings') + '&micro;s to set windowblur radius');
},
setWinBlend: function(nosave){
perfStart('settings');
this.currWinBlend = getId("STNwinBlendInput").value;
this.tempArray = document.getElementsByClassName("winAero");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.backgroundBlendMode = this.currWinBlend;
}
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_WINBLEND", this.currWinBlend, 1);
}
d(1, perfCheck('settings') + '&micro;s to set window blend mode');
},
setWinOpac: function(nosave){
perfStart('settings');
this.currWinOpac = getId("STNwinOpacInput").value;
this.tempArray = document.getElementsByClassName("winAero");
for(var elem = 0; elem < this.tempArray.length; elem++){
this.tempArray[elem].style.opacity = this.currWinOpac;
}
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_WINOPAC", this.currWinOpac, 1);
}
d(1, perfCheck('settings') + '&micro;s to set window opacity');
},
winFadeDistance: '0.5',
setFadeDistance: function(newDist, nosave){
this.winFadeDistance = newDist;
for(var app in apps){console.log(app);
if(getId('win' + apps[app].dsktpIcon).style.opacity !== "1"){
getId('win' + apps[app].dsktpIcon).style.transform = 'scale(' + newDist + ')';
getId('win' + apps[app].dsktpIcon).style.opacity = '0';
}
}
if(!nosave){
apps.savemaster.vars.save("APP_STN_SETTING_FADE", newDist, 1);
}
},
reqFullscreen: function(){
getId("monitor").webkitRequestFullscreen();
window.setTimeout(fitWindowRes(screen.width, screen.height), 100);
},
endFullscreen: function(){
document.webkitExitFullscreen();
window.setTimeout(fitWindow, 100);
},
tempchKey: '',
tempchPass: '',
changeKey: function(){
//this.tempchKey = prompt('What is the key of your target system? Keep in mind that you need a password file (password) set on the current OS to get back to it later. Press Cancel if you need to.');
apps.prompt.vars.prompt('What is the key of your target system? Keep in mind that you need a password set on the current OS to get back to it later. Leave blank to cancel.', 'Submit', function(tmpChKey){
apps.settings.vars.tempchKey = tmpChKey;
if(apps.settings.vars.tempchKey !== ''){
//this.tempchPass = prompt('What is the password of your target system? You still have a chance to press Cancel.');
apps.prompt.vars.prompt('What is the password of your target system? You still have a chance to cancel, by leaving the field blank.', 'Submit', function(tmpChPass){
apps.settings.vars.tempchPass = tmpChPass;
if(apps.settings.vars.tempchPass !== ''){
window.location = '?changeKey=' + apps.settings.vars.tempchKey + '&changePass=' + apps.settings.vars.tempchPass;
}else{
apps.prompt.vars.alert('-swap is cancelled.', 'Phew.', function(){}, 'Settings');
}
}, 'Settings');
}else{
apps.prompt.vars.alert('-swap is cancelled.', 'Phew.', function(){}, 'Settings');
}
}, 'Settings');
},
togTimeComp: function(){
tskbrToggle.timeComp = -1 * tskbrToggle.timeComp + 1;
apps.savemaster.vars.save("APP_STN_SETTING_TIMECOMP", tskbrToggle.timeComp, 1);
},
togNetStat: function(){
tskbrToggle.netStat = -1 * tskbrToggle.netStat + 1;
apps.savemaster.vars.save("APP_STN_SETTING_NETSTAT", tskbrToggle.netStat, 1);
},
togBatStat: function(){
tskbrToggle.batStat = -1 * tskbrToggle.batStat + 1;
apps.savemaster.vars.save("APP_STN_SETTING_BATSTAT", tskbrToggle.batStat, 1);
},
togBatComp: function(){
tskbrToggle.batComp = -1 * tskbrToggle.batComp + 1;
apps.savemaster.vars.save("APP_STN_SETTING_BATCOMP", tskbrToggle.batComp, 1);
},
togFpsStat: function(){
tskbrToggle.fpsStat = -1 * tskbrToggle.fpsStat + 1;
apps.savemaster.vars.save("APP_STN_SETTING_FPSSTAT", tskbrToggle.fpsStat, 1);
},
togFpsComp: function(){
tskbrToggle.fpsComp = -1 * tskbrToggle.fpsComp + 1;
apps.savemaster.vars.save("APP_STN_SETTING_FPSCOMP", tskbrToggle.fpsComp, 1);
},
togLodStat: function(){
tskbrToggle.lodStat = -1 * tskbrToggle.lodStat + 1;
apps.savemaster.vars.save("APP_STN_SETTING_LODSTAT", tskbrToggle.lodStat, 1);
},
setTskbrPos: function(newPos, nosave){
tskbrToggle.tskbrPos = newPos;
switch(newPos){
case 0:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
break;
case 1:
getId('desktop').style.left = '';
getId('desktop').style.top = '30px';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
break;
case 2:
getId('desktop').style.left = '30px';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = 'rotate(90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
case 3:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '';
getId('taskbar').style.left = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = 'rotate(-90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
default:
apps.prompt.vars.alert('Error - unrecognised taskbar position format: ' + newPos, 'OK', function(){}, 'Settings');
}
if(!nosave){
apps.savemaster.vars.save('APP_STN_TSKBRPOS', newPos, 1);
}
openapp(apps.startMenu, 'srtup');
},
shutDown: function(arg){
//apps.savemaster.vars.save();
if(arg === 'restart'){
apps.prompt.vars.confirm('Are you sure you wish to restart ?', ['No, Stay On', 'Yes, Restart'], function(btn){
if(btn){
getId('isLoading').style.opacity = '0';
getId('loadingBg').style.opacity = '0';
getId('isLoading').style.transition = '1s';
getId('isLoading').style.display = 'block';
getId('loadingBg').style.display = 'block';
getId('isLoading').innerHTML = '<div><h1>Restarting </h1>Shutting down...<br><br>Alerting app <span id="loadingInfo"></span>...<br><img src="/loadLight.gif" id="LoadingImage"></div>';
// getId('isLoading').style.cursor = cursors.loadLight;
getId('isLoading').classList.remove('cursorLoadDark');
getId('isLoading').classList.add('cursorLoadLight');
requestAnimationFrame(function(){
getId('isLoading').style.opacity = '1';
getId('loadingBg').style.opacity = '1';
});
window.setTimeout(function(){
getId('LoadingImage').src = "/loadDark.gif";
// getId('isLoading').style.cursor = cursors.loadDark;
getId('isLoading').classList.remove('cursorLoadLight');
getId('isLoading').classList.add('cursorLoadDark');
for(var app in apps){
c(function(args){
m('THERE WAS AN ERROR SHUTTING DOWN THE APP ' + args + '. SHUTDOWN SHOULD CONTINUE WITH NO ISSUE.');
getId('loadingInfo').innerHTML = args;
apps[args].signalHandler('shutdown');
}, app);
}
c(function(){
//apps.savemaster.vars.save();
getId('isLoading').innerHTML = '<div><h1>Restarting </h1>Shutting down...<br><br>Goodbye!<br><img src="/loadDark.gif" id="LoadingImage"></div>';
window.location = 'https:///blackScreen.html#restart-beta';
});
}, 1005);
}
}, '');
}else{
apps.prompt.vars.confirm('Are you sure you wish to shut down ?', ['No, Stay On', 'Yes, Shut Down'], function(btn){
if(btn){
getId('isLoading').style.opacity = '0';
getId('loadingBg').style.opacity = '0';
getId('isLoading').style.transition = '1s';
getId('isLoading').style.display = 'block';
getId('loadingBg').style.display = 'block';
getId('isLoading').innerHTML = '<div><h1>Shutting Down </h1>Shutting down...<br><br>Alerting app <span id="loadingInfo"></span>...<br><img src="/loadLight.gif" id="LoadingImage"></div>';
// getId('isLoading').style.cursor = cursors.loadLight;
getId('isLoading').classList.remove('cursorLoadDark');
getId('isLoading').classList.add('cursorLoadLight');
requestAnimationFrame(function(){
getId('isLoading').style.opacity = '1';
getId('loadingBg').style.opacity = '1';
});
window.setTimeout(function(){
getId('LoadingImage').src = "/loadDark.gif";
// getId('isLoading').style.cursor = cursors.loadDark;
getId('isLoading').classList.remove('cursorLoadLight');
getId('isLoading').classList.add('cursorLoadDark');
for(var app in apps){
c(function(args){
m('THERE WAS AN ERROR SHUTTING DOWN THE APP ' + args + '. SHUTDOWN SHOULD CONTINUE WITH NO ISSUE.');
getId('loadingInfo').innerHTML = args;
apps[args].signalHandler('shutdown');
}, app);
}
c(function(){
//apps.savemaster.vars.save();
getId('isLoading').innerHTML = '<div><h1>Shutting Down </h1>Shutting down...<br><br>Goodbye!<br><img src="/loadDark.gif" id="LoadingImage"></div>';
window.location = 'https:///blackScreen.html#beta';
});
}, 1005);
}
}, '');
}
}
}, 0, "settings", "/appicons/ds/STN.png"
);
getId('loadingInfo').innerHTML = 'Initializing Desktop Icon Maker';
});
c(function(){
m('init icon maker');
apps.iconMaker = new Application(
'IcM',
'Desktop Icon Maker',
1,
function(launchtype){
if(launchtype.indexOf('newicon') === 0){
this.newlaunch = launchtype.split(' ');
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 200, parseInt(getId('desktop').style.height, 10) / 2 - 250, 400, 500);
this.appWindow.setCaption('Desktop Icon Maker');
this.appWindow.setContent(
'<h1>Desktop Icon Maker</h1><hr>' +
'Position X: <input id="IcMleft" value="' + this.newlaunch[1] + '"><br>' +
'Position Y: <input id="IcMtop" value="' + this.newlaunch[2] + '"><br><br>' +
'Type of shortcut: <button onclick="apps.iconMaker.vars.setType(0)" id="IcMapp">Application</button> <button onclick="apps.iconMaker.vars.setType(1)" id="IcMfile">File</button><br><br>' +
'Name of shortcut: <input id="IcMname"><br><br>' +
'Unique ID for your shortcut (integer number): <input id="IcMid"><br><br>' +
'Enter the shortcut item path exactly as it appears in Files or Text Editor (example; apps.settings or USERFILES.YourFile)<br>' +
'Shortcut Item Path: <input id="IcMpath"><br><br>' +
'<button onclick="apps.iconMaker.vars.createIcon()">Create Desktop Icon</button>'
);
//set the icon type to 0 once the function is ready
this.vars.setType(0);
getId('winIcMh').style.overflowY = 'auto';
this.appWindow.openWindow();
}else{
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 200, parseInt(getId('desktop').style.height, 10) / 2 - 250, 400, 500);
this.appWindow.setCaption('Desktop Icon Maker');
this.appWindow.setContent(
'<h1>Desktop Icon Maker</h1><hr>' +
'Position X: <input id="IcMleft"><br>' +
'Position Y: <input id="IcMtop"><br><br>' +
'Type of shortcut: <button onclick="apps.iconMaker.vars.setType(0)" id="IcMapp">Application</button> <button onclick="apps.iconMaker.vars.setType(1)" id="IcMfile">File</button><br><br>' +
'Name of shortcut: <input id="IcMname"><br><br>' +
'Unique ID for your shortcut (integer number): <input id="IcMid"><br><br>' +
'Enter the shortcut item path exactly as it appears in the Apps Browser or in the Files Browser (example; apps.settings or USERFILES.YourFile)<br>' +
'Shortcut Item Path: <input id="IcMpath"><br><br>' +
'<button onclick="apps.iconMaker.vars.createIcon()">Create Desktop Icon</button>'
);
this.vars.setType(0);
getId('winIcMh').style.overflowY = 'auto';
this.appWindow.openWindow();
}
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
setTimeout(function(){
for(var file in USERFILES){
if(file.indexOf('APP_IcM_ICON_') === 0){
if(USERFILES[file].indexOf('[') === 0){
apps.iconMaker.vars.buildIcon(USERFILES[file]);
}
}
}
}, 3);
break;
case 'shutdown':
break;
default:
console.log("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'");
}
},
{
appInfo: 'This app is used to create desktop icons. You can get app names from the File Manager app.',
newlaunch: '',
type: 0,
compiledIcon: '',
decompiled: [],
setType: function(newtype){
this.type = newtype;
if(newtype){
getId('IcMfile').style.opacity = '1';
getId('IcMapp').style.opacity = '0.6';
}else{
getId('IcMapp').style.opacity = '1';
getId('IcMfile').style.opacity = '0.6';
}
},
createIcon: function(icon, id){
if(icon){
apps.savemaster.vars.save('APP_IcM_ICON_' + id, icon, 1);
}else{
if(getId('IcMid').value.length > 0 && getId('IcMleft').value.length > 0 && getId('IcMtop').value.length > 0 && getId('IcMname').value.length > 0 && getId('IcMpath').value.length > 0){
if(eval(getId('IcMpath').value) !== undefined){
this.compiledIcon = '[' + getId('IcMid').value + ', ' +
getId('IcMleft').value + ', ' +
getId('IcMtop').value + ', ' +
this.type + ', "' +
getId('IcMname').value + '", "' +
getId('IcMpath').value + '"]';
apps.savemaster.vars.save('APP_IcM_ICON_' + getId('IcMid').value, this.compiledIcon, 1);
this.buildIcon(this.compiledIcon);
}else{
apps.prompt.vars.alert('The specified app could not be found. Please check that the file path to your app is spelled correctly.', 'Okay', function(){}, 'Icon Maker')
}
}else{
apps.prompt.vars.alert('Please properly fill all fields.', 'Okay', function(){}, 'Icon Maker');
}
}
},
buildIcon: function(icon){
apps.iconMaker.vars.decompiled = eval(icon);
if(apps.iconMaker.vars.decompiled[3]){
getId('desktop').innerHTML +=
'<div class="app cursorPointer" id="app' + apps.iconMaker.vars.decompiled[0] + '" style="left:' + apps.iconMaker.vars.decompiled[1] + 'px;top:' + apps.iconMaker.vars.decompiled[2] + 'px" onclick="openapp(apps.notepad, \'open\');apps.notepad.vars.openFile(\'' + apps.iconMaker.vars.decompiled[5] + '\');requestAnimationFrame(function(){toTop(apps.notepad)})" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/load.png\', \'\', \'/ctxMenu/beta/x.png\'], \' Open\', \'openapp(apps.notepad, \\\'open\\\');apps.notepad.vars.openFile(\\\'' + apps.iconMaker.vars.decompiled[5] + '\\\');requestAnimationFrame(function(){toTop(apps.notepad)})\', \'+Move Icon\', \'icnmove(event, \\\'' + apps.iconMaker.vars.decompiled[0] + '\\\')\', \' Delete Icon\', \'apps.iconMaker.vars.deleteIcon(' + apps.iconMaker.vars.decompiled[0] + ')\'])">' +
'<div class="appIcon" id="ico' + apps.iconMaker.vars.decompiled[0] + '" style="pointer-events:none"><img style="max-height:64px;max-width:64px" src="/appicons/ds/TE.png" onerror="this.src=\'/appicons/ds/redx.png\'"></div>' +
'<div class="appDesc" id="dsc' + apps.iconMaker.vars.decompiled[0] + '">' + apps.iconMaker.vars.decompiled[4] + '</div>' +
'</div>';
}else{
getId("desktop").innerHTML +=
'<div class="app cursorPointer" id="app' + apps.iconMaker.vars.decompiled[0] + '" style="left:' + apps.iconMaker.vars.decompiled[1] + 'px;top:' + apps.iconMaker.vars.decompiled[2] + 'px" onclick="openapp(' + apps.iconMaker.vars.decompiled[5] + ', \'dsktp\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/window.png\', \'\', \'/ctxMenu/beta/x.png\'], \' Open\', \'openapp(' + apps.iconMaker.vars.decompiled[5] + ', \\\'dsktp\\\')\', \'+Move Icon\', \'icnmove(event, \\\'' + apps.iconMaker.vars.decompiled[0] + '\\\')\', \' Delete Icon\', \'apps.iconMaker.vars.deleteIcon(' + apps.iconMaker.vars.decompiled[0] + ')\'])">' +
'<div class="appIcon" id="ico' + apps.iconMaker.vars.decompiled[0] + '" style="pointer-events:none"><img style="max-height:64px;max-width:64px" src="' + vartry('eval(' + apps.iconMaker.vars.decompiled[5] + ').appWindow.appImg') + '" onerror="this.src=\'/appicons/ds/redx.png\'"></div>' +
'<div class="appDesc" id="dsc' + apps.iconMaker.vars.decompiled[0] + '">' + apps.iconMaker.vars.decompiled[4] + '</div>' +
'</div>';
}
},
moveSelect: '0',
moveTo: [0, 0],
replaceObj: [],
moveIcon: function(element, movedata){
this.moveTo = eval(movedata);
this.moveSelect = element.substring(3, element.length);
this.replaceObj = eval(USERFILES['APP_IcM_ICON_' + this.moveSelect]);
this.replaceObj[1] = this.moveTo[0];
this.replaceObj[2] = this.moveTo[1];
this.createIcon('[' + this.replaceObj[0] + ', ' +
this.replaceObj[1] + ', ' +
this.replaceObj[2] + ', ' +
this.replaceObj[3] + ', "' +
this.replaceObj[4] + '", "' +
this.replaceObj[5] + '"]', this.moveSelect
);
},
deleteElem: 0,
deleteIcon: function(element){
this.deleteElem = element;
apps.prompt.vars.confirm('Are you sure you wish to delete this icon?<br><br>If deleted (assuming does not hit an error), you can get it back by locating the icon in USERFILES and erasing the word "DELETED" from the beginning of the file. It is recommended that you make a copy of the icon file in USERFILES and name it something different, in case an error is reached.', ['No, Keep Icon', 'Yes, Delete Icon'], function(btn){
if(btn){
getId('app' + apps.iconMaker.vars.deleteElem).style.display = 'none';
apps.savemaster.vars.save('APP_IcM_ICON_' + apps.iconMaker.vars.deleteElem), 'DELETED' + USERFILES['APP_IcM_ICON_' + apps.iconMaker.vars.deleteElem], 1
}
}, '');
}
}, 1, 'iconMaker', 'appicons/ds/IcM.png'
);
getId('loadingInfo').innerHTML = 'Initializing Text Editor';
});
var files;
c(function(){
m('init NP');
apps.notepad = new Application(
"TE",
"Text Editor",
1,
function(launchType){
this.vars.launchedAs = launchType;
if(launchType !== "tskbr"){
this.appWindow.setCaption("Text Editor");
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 325, parseInt(getId('desktop').style.height, 10) / 2 - 200, 650, 400);
}
/* old UI
this.appWindow.setContent(
'<textarea id="npScreen" style="white-space:no-wrap; width:99%; height:90%; position:absolute; border:none; bottom: 0px; left: 0px;font-family:ProFont,Courier,monospace; font-size:12px; resize:none; box-shadow:0px 0px 5px #000;"></textarea>' +
'<button onClick="apps.notepad.vars.saveFile(getId(\'npLoad\').value)" style="position:absolute; width:20%; height:10%; padding:0;">Save</button>' +
'<input type="text" style="position:absolute; left:20%; height:5%; top:2.5%; width:60%" id="npLoad"></input>' +
'<button onClick="apps.notepad.vars.openFile(getId(\'npLoad\').value)" style="position:absolute; height:10%; width:20%; padding:0; right:0px;">Load</button>'
);
*/
this.appWindow.setContent(
'<textarea id="npScreen" style="white-space:no-wrap; width:100%; height:359px; position:absolute; padding:0; border:none; bottom: 0px; left: 0px; font-family:ProFont,Courier,monospace; font-size:12px; resize:none; box-shadow:0px 0px 5px #000;"></textarea>' +
'<div style="width:100%; border-bottom:1px solid #557; height:16px; background-color:#AAC; color:#557;">' +
'<input id="npLoad" style="border:none; height:16px; border-right:1px solid #557; position:absolute; left:0; top:0; width:75%;"></input>' +
//'<div onclick="apps.notepad.vars.saveFile(getId(\'npLoad\').value)" style="cursor:url(cursors/pointer.png) 9 3, pointer;top:0; right:10%; border-left:1px solid #557; border-right:1px solid #557;">Save</div> ' +
//'<div onclick="apps.notepad.vars.openFile(getId(\'npLoad\').value)" style="cursor:url(cursors/pointer.png) 9 3, pointer;top:0; right:1%; border-left:1px solid #557; border-right:1px solid #557;">Load</div>' +
'<div onclick="requestAnimationFrame(function(){ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/save.png\', \'/ctxMenu/beta/load.png\'], \' Save\', \'apps.notepad.vars.saveFile(getId(\\\'npLoad\\\').value)\', \' Load\', \'apps.notepad.vars.openFile(getId(\\\'npLoad\\\').value)\'])})" class="cursorPointer" style="top:0; right:1%; border-left:1px solid #557; border-right:1px solid #557;">&nbsp;File&nbsp;</div> ' +
'<div id="npToolsBtn" class="cursorPointer" style="top:0; right:10%; border-left:1px solid #557; border-right:1px solid #557;">&nbsp;Tools&nbsp;</div>' +
'</div>'
);
getId('npToolsBtn').addEventListener('click', apps.notepad.vars.openEditTools);
addEditContext('npLoad');
addEditContext('npScreen');
this.appWindow.dimsSet = function(){
if(getId('npScreen') !== null){
getId('npScreen').style.height = this.windowV - 40 + "px";
}
};
getId("npScreen").wrap = "off";
getId('winTEh').style.background = 'none';
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'Simple text editor for OS. Edits text files created by the user, and views strings, numbers, and functions of OS apps.',
openEditTools: function(){apps.prompt.vars.notify('This button is unfinished. Right-click the document instead.', [], function(){}, 'Text Editor', '/appicons/ds/TE.png')},
launchedAs: '',
openFile: function(filename){
if(filename.indexOf('window.') === 0){
if(this.launchedAs !== 'open'){
apps.prompt.vars.confirm('You will lose all unsaved work. Continue?', ['No', 'Yes'], function(btn){
if(btn){
getId("npScreen").value = eval(filename);
getId("npScreen").scrollTop = 0;
}
}, 'Text Editor');
}else{
getId("npLoad").value = filename;
getId("npScreen").value = eval(filename);
getId("npScreen").scrollTop = 0;
}
}else if(filename.indexOf('files.') === 0 || filename.indexOf('apps.') === 0 || filename.indexOf('widgets.') === 0){
if(typeof eval(filename) !== "undefined"/* && (filename.substring(0, 4) === "apps" || filename.substring(0, 5) === "files")*/){
if(this.launchedAs !== 'open'){
apps.prompt.vars.confirm('You will lose all unsaved work. Continue?', ['No', 'Yes'], function(btn){
if(btn){
getId("npScreen").value = eval(filename);
getId("npScreen").scrollTop = 0;
}
}, 'Text Editor');
//if(confirm("You will lose all unsaved work. Continue?")){
// getId("npScreen").value = eval(filename);
// getId("npScreen").scrollTop = 0;
//}
}else{
getId("npLoad").value = filename;
getId("npScreen").value = eval(filename);
getId("npScreen").scrollTop = 0;
}
}else{
apps.prompt.vars.alert("File '" + filename + "' does not exist.", 'Oops.', function(){}, 'Text Editor');
}
}else if(filename.indexOf('USERFILES.') === 0){
if(typeof eval(filename) !== "undefined"){
if(this.launchedAs !== 'open'){
apps.prompt.vars.confirm('You will lose all unsaved work. Continue?', ['No', 'Yes'], function(btn){
if(btn){
getId("npScreen").value = eval(filename);
getId("npScreen").scrollTop = 0;
}
}, 'Text Editor');
//if(confirm("You will lose all unsaved work. Continue?")){
// getId("npScreen").value = eval("USERFILES." + filename);
// getId("npScreen").scrollTop = 0;
//}
}else{
getId("npLoad").value = filename;
getId("npScreen").value = eval(filename);
getId("npScreen").scrollTop = 0;
}
}else{
apps.prompt.vars.alert("File '" + filename + "' does not exist.", 'Oops.', function(){}, 'Text Editor');
}
}else{
if(typeof eval("USERFILES." + filename) !== "undefined"){
if(this.launchedAs !== 'open'){
apps.prompt.vars.confirm('You will lose all unsaved work. Continue?', ['No', 'Yes'], function(btn){
if(btn){
getId("npScreen").value = eval("USERFILES." + filename);
getId("npScreen").scrollTop = 0;
}
}, 'Text Editor');
//if(confirm("You will lose all unsaved work. Continue?")){
// getId("npScreen").value = eval("USERFILES." + filename);
// getId("npScreen").scrollTop = 0;
//}
}else{
getId("npLoad").value = filename;
getId("npScreen").value = eval("USERFILES." + filename);
getId("npScreen").scrollTop = 0;
}
}else{
apps.prompt.vars.alert("File '" + filename + "' does not exist.", 'Oops.', function(){}, 'Text Editor');
}
}
},
saveFile: function(filename){
if(filename.indexOf('files.') === 0 || filename.indexOf('apps.') === 0 || filename.indexOf('widgets.') === 0){
if(typeof eval(filename) !== "undefined"){
//if(confirm("Overwrite existing file '" + filename + "'?")){
// files[filename.substring(7, filename.length - 1)] = getId("npScreen").value;
//}
apps.prompt.vars.confirm("Overwrite existing file '" + filename + "'?", ['No, Cancel', 'Yes, Overwrite'], function(btn){
if(btn){
files[filename.substring(7, filename.length - 1)] = getId("npScreen").value;
}
}, 'Text Editor');
}else{
files[filename.substring(7, filename.length - 1)] = getId("npScreen").value;
}
//files[filename.substring(6, filename.length)] = getId("npScreen").value;
}else if(filename.indexOf('USERFILES.') === 0){
if(typeof eval(filename) !== "undefined"){
//if(confirm("Overwrite existing file '" + filename + "'?")){
// USERFILES[filename] = getId("npScreen").value;
// apps.savemaster.vars.save(filename, getId("npScreen").value, 1);
//}
apps.prompt.vars.confirm("Overwrite existing user file '" + filename + "'?", ['No, Cancel', 'Yes, Overwrite'], function(btn){
if(btn){
eval(filename + ' = getId("npScreen").value');
apps.savemaster.vars.save(filename, getId("npScreen").value, 1);
}
}, 'Text Editor');
}else{
eval(filename + ' = getId("npScreen").value');
apps.savemaster.vars.save(filename, getId("npScreen").value, 1);
}
}else{
if(typeof eval("USERFILES." + filename) !== "undefined"){
//if(confirm("Overwrite existing file '" + filename + "'?")){
// USERFILES[filename] = getId("npScreen").value;
// apps.savemaster.vars.save(filename, getId("npScreen").value, 1);
//}
apps.prompt.vars.confirm("Overwrite existing user file '" + filename + "'?", ['No, Cancel', 'Yes, Overwrite'], function(btn){
if(btn){
eval('USERFILES.' + filename + ' = getId("npScreen").value');
apps.savemaster.vars.save(filename, getId("npScreen").value, 1);
}
}, 'Text Editor');
}else{
eval('USERFILES.' + filename + ' = getId("npScreen").value');
apps.savemaster.vars.save(filename, getId("npScreen").value, 1);
}
//USERFILES[filename] = getId("npScreen").value;
}
}
}, 1, "notepad", "/appicons/ds/TE.png"
);
getId('loadingInfo').innerHTML = 'Initializing Files';
});
c(function(){
m('init files');
files = {
customStyles: {
tskbrOnTop: "/* Taskbar on top */\n#desktop{\n top: 31px;\n}\n#taskbar{\n top: 0px;\n}",
sCustom: "/* caption buttons */\n.winExit{\n right: 0;\n width: 19px;\n border-radius: 0;\n border-right: none;\n}\n.winShrink{\n right: 40px;\n width: 19px;\n border-bottom-right-radius: 0;\n border-right: none;\n}\n.winBig{\n right: 20px;\n width: 19px;\n border-radius: 0;\n border-right: none;\n}\n\n/* context menu */\n#ctxMenu{\n background-color: rgba(255, 255, 255, 0.75);\n padding-top: 5px;\n padding-bottom: 5px;\n border-radius: 10px;\n}",
alpha: "@font-face{\n font-family: 'ProFont';\n src:\n url('/ProFont/ProFontOnline.ttf') format('truetype'),\n url('/ProFont/ProFontOnline.woff') format('woff'),\n url('/ProFont/ProFontOnline.eot'),\n url('/ProFont/ProFontOnline.svg') format('svg');\n}\n/* Default styling */\n::-webkit-scrollbar{\n width:16px;\n background-color:#557;\n box-shadow:inset 0 0 10px #AAC;\n}\n::-webkit-scrollbar-corner{\n background-color:#557;\n box-shadow:inset 0 0 10px #AAC;\n}\n::-webkit-resizer{\n border-radius:8px;\n background-color:#AAC;\n box-shadow:inset 0 0 10px #557;\n}\n::-webkit-scrollbar-thumb{\n border-radius:8px;\n background-color:#AAC;\n box-shadow:inset 0 0 10px #557;\n}\n::-webkit-scrollbar-button{\n border-radius:8px;\n background-color:#AAC;\n box-shadow:inset 0 0 10px #557;\n}\nbutton{\n background-color:#AAC;\n border:1px solid #557;\n color:#557;\n font-family:ProFont, Courier, monospace;\n font-size:12px;\n cursor:url(cursors/default.png) 3 3, default;\n box-shadow:0 0 0 #000;\n transition:box-shadow 0.3s;\n}\nbutton:hover{\n box-shadow:0 0 5px #000;\n}\ninput, textarea{\n border:1px solid #557;\n}\nhr{\n border-color:#557 #AAC #AAC #557;\n}\na{\n cursor:url(cursors/pointer.png) 9 3, pointer;\n}\n#pagebody{\n margin:0;\n}\ndiv{\n position:absolute;\n overflow:hidden;\n}\n#mastersaveframediv{\n display:none;\n}\n#monitor{\n left: 0;\n top: 0;\n width:100%; /* 1050 x 600 original */\n /*max-width:1050px;*/\n height:100%;\n /*cursor:url(cursors/default.png) 3 3, default;*/\n background-color:#AAE;\n /*\n original = url(http://upload.wikimedia.org/wikipedia/commons/d/d2/Campania_Capri1_tango7174.jpg)\n second = url(http://golfunfiltered.com/wp-content/uploads/2014/10/moutains-golf-course.jpg)\n third = url(https://grapevineonline.files.wordpress.com/2014/12/x6vezahrpqd8lczpaogc_2014-08-27-02-46-52-1.jpg)\n fourth = url(https://newevolutiondesigns.com/images/freebies/nature-hd-background-9.jpg)\n aeroFriendly1 = url(http://i40.photobucket.com/albums/e220/benjamin_allen1/lava_zpsce2852a9.gif)\n aeroFriendly2 = url(http://i.giphy.com/g1tZmuF6BKBcA.gif)\n aeroFriendly3 = url(http://i50.photobucket.com/albums/f331/HawaiiWirikidor/ththththStickPeople.gif)\n interesting1 = url(http://orig11.deviantart.net/dec2/f/2012/185/9/2/tileable_futuristic_grid_by_ndugger-d55yz5h.png)\n */\n background-image:url(bg.jpg);\n /*background-size:cover;*/\n background-position:0 0;\n font-family:sans-serif;\n}\n #desktop{\n top:0;\n left:0;\n width:1050px;\n height:570px;\n overflow:visible;\n }\n #hideall{\n width: 100%;\n height: 100%;\n }\n #timesUpdated{\n display:block;\n position:absolute;\n width:1042px;\n text-align:right;\n top:-3px;\n right:8px;\n font-family:ProFont, monospace;\n font-size:20px;\n color:#0FA;\n transition:3s;\n transition:3s;\n z-index: 101;\n pointer-events: none;\n }\n #timesUpdated::selection{\n background: none;\n }\n .window{\n width:525px;\n height:300px;\n left:0px;\n top:0px;\n /*background-color:#005;*/\n /*Aero theme if supported*/\n /*background-color:rgba(190, 190, 255, .6);*/\n display:none;\n z-index:50;\n border-radius: 5px;\n transform-origin: 50% 0;\n \n /* experimental */\n transition:transform 0.3s, opacity 0.3s;\n transform:scale(0.5);\n transform-origin:50%;\n opacity:0;\n }\n .winAero{\n width:605px;\n height:360px;\n left:-40px;\n top:-40px;\n background-image:url(bg.jpg);\n -webkit-filter:blur(2px);\n filter:blur(2px);\n opacity:1;\n background-position: -485px -260px;\n /*background-color:rgba(190, 190, 255, .6);*/\n background-color:rgba(190, 190, 255, .6);\n /*background-blend-mode:screen;*/\n background-blend-mode:hard-light;\n }\n #tskbrAero{\n height: 70px;\n width: 1090px;\n left: -20px;\n top: -20px;\n }\n .winBimg{\n width:100%;\n height:100%;\n background-image:url(winimg.png);\n }\n .winRot{\n height:50%;\n bottom:0;\n width:100%;\n /*cursor:url(cursors/move.png) 14 14, move;*/\n }\n .winCap{\n font-family:Courier, monospace;\n font-size:16px;\n top:1px;\n left:3px;\n padding-left:23px;\n width:519px;\n height:20px;\n text-shadow:0px 0px 2px #000;\n color:#FFF;\n /*cursor:url(cursors/move.png) 14 14, move;*/\n transition: opacity .5s;\n }\n .winHTML{\n width:519px;\n height:276px;\n bottom:3px;\n left:3px;\n background-color:#FFF;\n border-bottom-left-radius: 5px;\n border-bottom-right-radius: 5px;\n }\n .STNtableTR{\n height:100px;\n text-align:center;\n }\n .STNtableTD{\n width:33%;\n transition:1s;\n /*cursor:url(cursors/pointer.png) 9 3, pointer;*/\n }\n .STNtableTD:hover{\n background-color:#7F7F7F;\n }\n #tItabC:focus{\n outline: none;\n }\n #FILtbl td{\n border-top:1px solid #000;\n /*cursor:url(cursors/pointer.png) 9 3, pointer;*/\n }\n #FILtbl tr:hover{\n background-color:#AAA;\n }\n #tMgMemTable{\n width: 100%;\n font-family:ProFont, monospace;\n text-align:right;\n }\n #tMgMemTable td{\n background-color:#BBB;\n }\n .monoinput{\n font-family:monospace;\n }\n #NORAout{\n width:100%;\n height:95%;\n background-color:#223;\n color:#DDD;\n font-family:ProFont, monospace;\n font-size:12px;\n overflow:scroll;\n }\n #NORAspeech{\n position:absolute;\n width:10%;\n height:5%;\n bottom:0;\n left:0;\n }\n #NORAin{\n position:absolute;\n left:10%;\n bottom:0;\n font-family:monospace;\n width:80%;\n height:5%;\n padding-top:0;\n padding-bottom:0;\n }\n #NORAbtn{\n position:absolute;\n bottom:0;\n right:0;\n width:10%;\n height:5%;\n }\n #BNGiframe{\n border:none;\n display:block;\n position:absolute;\n width:100%;\n height:100%;\n }\n .appsBrowserItem:hover{\n background-color:#DDD;\n }\n .winExit{\n height:16px;\n right:3px;\n width:18px;\n border:1px solid rgba(255, 255, 255, .3);\n border-top:none;\n border-radius:5px;\n border-top-right-radius:0;\n border-top-left-radius:0;\n color:rgba(255, 255, 255, .3);\n font-family:Courier;\n font-size:16px;\n text-align:center;\n /*cursor:url(cursors/pointer.png) 9 3, pointer;*/\n }\n .winExit:hover{\n border-color:#C00;\n color:#C00;\n background-color:#E55;\n }\n .winExit:active{\n border-color:#E55;\n color:#E55;\n background-color:#C00;\n }\n .winShrink, .winBig, .winFld{\n height:16px;\n width:18px;\n border:1px solid rgba(255, 255, 255, .3);\n border-top:none;\n border-radius:5px;\n border-top-right-radius:0;\n border-top-left-radius:0;\n color:rgba(255, 255, 255, .3);\n font-family:Courier;\n font-size:16px;\n text-align:center;\n /*cursor:url(cursors/pointer.png) 9 3, pointer;*/\n }\n .winShrink:hover, .winBig:hover, .winFld:hover{\n border-color:#090;\n color:#090;\n background-color:#4C4;\n }\n .winShrink:active, .winBig:active, .winFld:active{\n border-color:#4C4;\n color:#4C4;\n background-color:#090;\n }\n .winShrink{\n right:49px;\n }\n .winBig{\n right:26px;\n }\n .winFld{\n left: 3px;\n }\n .winShrink, .winBig, .winExit , .winFld{\n transition: .2s;\n }\n .app{\n width:100px;\n height:75px;\n border-radius:5px;\n text-align:center;\n /*cursor:url(cursors/pointer.png) 9 3, pointer;*/\n overflow:visible;\n transition:background-color .5s;\n }\n .app:hover{\n background-color:#BBE;\n /*Aero theme if supported*/\n background-color:rgba(190, 190, 255, .6);\n }\n .app:active{\n transition: background-color .1s;\n background-color:#99F;\n /*Aero theme if supported*/\n background-color:rgba(150, 150, 255, .6);\n }\n .appIcon{\n font-family:Courier, monospace;\n color:#FFF;\n text-shadow:0px 0px 5px #000;\n width:100px;\n font-size:50px;\n top:-6px;\n overflow:visible;\n }\n .appIcon img{\n display:block;\n margin:auto;\n margin-top:6px;\n max-height:50px;\n max-width:50px;\n }\n .appDesc{\n bottom:0;\n color:#FFF;\n text-shadow:0px 0px 2px #000;\n font-family:ProFont, sans-serif;\n font-size:12px;\n text-align:center;\n width:100px;\n }\n #winmove{\n left:0;\n top:0;\n width:100%;\n height:100%;\n z-index:125;\n display:none;\n /*cursor:url(cursors/move.png) 14 14, move;*/\n }\n #icomove{\n left:0;\n top:0;\n width:100%;\n height:100%;\n z-index:125;\n display:none;\n /*cursor:url(cursors/move.png) 14 14, move;*/\n }\n #icnmove{\n left:0;\n top:0;\n width:100%;\n height:100%;\n z-index:125;\n display:none;\n /*cursor:url(cursors/move.png) 14 14, move;*/\n }\n #winrot{\n left:0;\n top:0;\n width:100%;\n height:100%;\n z-index:125;\n display:none;\n /*cursor:url(cursors/move.png) 14 14, move;*/\n }\n#taskbar{\n bottom:0;\n left:0;\n width:1050px;\n height:30px;\n /*Aero theme if supported\n background-color:rgba(190, 190, 255, .6);*/\n color:#FFF;\n text-shadow:0px 0px 2px #000;\n font-family:Courier, monospace;\n font-size: 21px;\n box-shadow: 0 0 10px #000;\n z-index:101;\n transform-origin:15px 15px;\n}\n #icons{\n height:30px;\n width:600px;\n }\n .icon{\n height:30px;\n width:45px;\n /*border-right:2px solid rgba(100, 100, 155, .6);*/\n border-radius:2px;\n display:none;\n /*cursor:url(cursors/pointer.png) 9 3, pointer;*/\n /*display:inline-block;*/\n position:static;\n transition:background-color .5s;\n }\n .icon:hover{\n background:radial-gradient(25px at 50% 100%, rgba(220, 220, 255, .8) 0px, rgba(220, 220, 255, 0) 25px);\n }\n .iconImg{\n margin-top:3px;\n position:static;\n text-align:center;\n }\n .imageIco{\n max-height:25px;\n max-width:25px;\n margin-top:3px;\n margin-left:10px;\n }\n #time{\n height:26px;\n right:3px;\n top:3px;\n text-align:right;\n width:90%;\n pointer-events: none;\n }\n #compactTime, #compactFPS{\n display:inline;\n font-size:12px;\n font-family:ProFont, monospace;\n width:52px;\n height:23px;\n text-align:center;\n }\n #stylishBattery{\n display:inline;\n border:1px solid #FFF;\n background:#000;\n width:50px;\n height:21px;\n }\n#ctxMenu{\n background-color:#AAC;\n border:1px solid #557;\n color:#557;\n box-shadow:0 0 30px #000;\n display:none;\n /*text-align:center;*/\n font-family:ProFont, Courier;\n font-size:12px;\n z-index:200;\n padding:2px;\n overflow-y:auto;\n max-height:50%;\n background-size:100%;\n background-origin:center;\n}\n #ctxMenu p{\n height:1em;\n width:100%;\n display:block;\n margin:0;\n /*cursor:url(cursors/pointer.png) 9 3, pointer;*/\n transition: background-color .2s, color .2s;\n }\n #ctxMenu p:hover{\n background-color:#557;\n color:#AAC;\n }\n #ctxMenu .hiddenCtxOption{\n opacity:0.5;\n /*cursor:url(cursors/default.png) 3 3, default;*/\n }\n #ctxMenu .hiddenCtxOption:hover{\n background:none;\n color:inherit;\n }\n #ctxMenu hr{\n height:1px;\n border:none;\n background-color:#557;\n width:100%;/*\n margin-top:2px;\n margin-bottom:2px;\n margin-left:-2px;\n margin-right:-4px;*/\n margin:2px 0 2px -2px;\n border-right:4px solid #557;\n display:block;\n }\n#customPointer{\n width:12px;\n height:12px;\n background:#AAC;\n border-top:1px solid #557;\n border-left:1px solid #557;\n border-radius:0px 6px 6px 6px;\n /*box-shadow:0 0 6px #000;*/\n display:none;\n top:51px;\n left:51px;\n z-index:99999999999999999;\n}\n#loadingBg{\n width:calc(100% + 40px);\n height:calc(100% + 40px);\n top:-20px;\n left:-20px;\n z-index:9999999999999998;\n transition:opacity 1s;\n background-color:#ACE;\n background-image:url('bg.jpg');\n filter:blur(10px);\n background-position:20px 20px;\n}\n#isLoading{\n width:100%;\n height:100%;\n top:0;\n left:0;\n /*background-color:#ACE;*/\n text-align:center;\n transition:1s;\n z-index:9999999999999999;\n /*cursor:url(cursors/loadLight.png) 16 16, wait;*/\n}\n#isLoading div{\n top:10px;\n width:100%;\n height:100%;\n}\n #loadingInfo{\n font-family:monospace;\n font-size:12px;\n }\n #bootCrashTest{\n padding:3px;\n color:#000;\n background-color:#000;\n transition:0.2s;\n }\n #bootCrashTest:hover{\n color:#F00;\n background-color:#000;\n }\n #bootCrashTest:active{\n color:#000;\n background-color:#F00;\n }\n#screensaverLayer{\n width:100%;\n height:100%;\n display:none;\n z-index:999999999999;\n}\n/*\n#aDE{\n display:none;\n position:absolute;\n left:0;\n top:0;\n width:100%;\n height:100%;\n}\n*/\n#windowFrameOverlay{\n display:none;\n box-shadow:inset 0 0 20px #FFF, 0 0 20px #000;\n /*outline:1px solid #000;*/\n pointer-events:none;\n z-index:9999999999;\n background:linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 45%, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, 0.2) 100%);\n border-radius:5px;\n}\n.cursorDefault{\n cursor:url(cursors/default.png) 3 3, default;\n}\n.cursorMove{\n cursor:url(cursors/move.png) 14 14, move;\n}\n.cursorPointer{\n cursor:url(cursors/pointer.png) 9 3, pointer;\n}\n.cursorLoadLight{\n /*cursor:url(cursors/loadLight.png) 16 16, wait;*/\n cursor:url(cursors/wait.png) 9 14, wait;\n}\n.cursorLoadDark{\n /*cursor:url(cursors/loadDark.png) 16 16, wait;*/\n cursor:url(cursors/wait.png) 9 14, wait;\n}\n.cursorForceLoad{\n cursor:url(cursors/wait.png) 9 14, wait !important;\n}\n.changeLogTitle, .changeLogDate, .changeLogAddition, .changeLogTweak, .changeLogRemoval, .changeLogUnknown{\n font-family:ProFont, monospace;\n font-size:12px;\n margin:0;\n border-bottom:1px solid #000;\n}\n.changeLogTitle{\n font-size:24px;\n border-top:1px solid #000;\n}\n.changeLogDate{\n text-align:right;\n margin-top:-1em;\n border-top:none;\n border-bottom:none;\n}\n.changeLogAddition{\n background-color:#BFFFBF;\n}\n.changeLogRemoval{\n background-color:#FFBFBF;\n}\n.changeLogTweak{\n background-color:#BFBFFF;\n}\n#notifWindow{\n right:16px;\n bottom:16px;\n min-height:100px;\n min-width:300px;\n border-radius:5px;\n background-color:#AAC;\n border:2px solid #557;\n color:#557;\n font-family:ProFont, monospace;\n font-size:12px;\n box-shadow:0 0 20px #000;\n opacity:0.8;\n transition:0.3s;\n z-index:110;\n}\n#notifWindow:hover{\n opacity:1;\n}\n#notifTitle{\n font-size:24px;\n left:2px;\n top:2px;\n width:calc(100% - 4px);\n height:1em;\n}\n#notifContent{\n bottom:2px;\n left:2px;\n width:calc(100% - 56px);\n height:calc(100% - 2em - 4px);\n overflow:auto;\n}\n#notifButtons{\n right:2px;\n bottom:2px;\n}\n#notifImage{\n position:absolute;\n display:block;\n right:2px;\n top:calc(50% - 25px);\n width:50px;\n height:50px;\n border:none;\n}",
elme: "/* Provided by Elme Delos Santos from Quora */\n.window{\n border-radius:0;\n box-shadow:0 5px 20px -5px #000 !important;\n}\n.winHTML{\n border-radius:0;\n left: 1px;\n width:calc(100% - 2px) !important;\n bottom:1px;\n box-shadow:inset 0 40px 60px -40px rgba(0, 0, 0, 0.25) !important;\n background:#FFF;\n}\n.winFld, .winExit, .winShrink, .winBig{\n border:none;\n color:rgba(0, 0, 0, 0.5);\n background-color:rgba(0, 0, 0, 0);\n border-radius:0;\n top:3px;\n}\n.winFld:hover, .winExit:hover, .winShrink:hover, .winBig:hover{\n background-color:rgba(0, 0, 0, 0.25);\n color:rgba(0, 0, 0, 1);\n}\n.winFld:active, .winExit:active, .winShrink:active, .winBig:active{\n background-color:rgba(0, 0, 0, 0.5);\n color:rgba(0, 0, 0, 1);\n}\n.winCap{\n color:#59595B;\n text-shadow:0 0 1px #FFF;\n font-family:sans-serif;\n}\n#ctxMenu{\n background:#FFF;\n border:1px solid #E6E7EC;\n box-shadow:0 0 10px rgba(0, 0, 0, 0.25);\n}\n#ctxMenu hr{\n background:#E6E7EC;\n border-right:4px solid #E6E7EC;\n}\n#ctxMenu p{\n color:#59595B !important;\n}\n#ctxMenu p:hover{\n background:rgba(0, 0, 0, 0.25);\n}\nbutton{\n background:#FFF;\n color:#59595B;\n border:1px solid #59595B;\n}\n#taskbar{\n color:#59595B;\n text-shadow:0 0 5px #FFF;\n}",
windows98: "/* Windows 98 Styles */\n/* scrollbars */\n::-webkit-scrollbar{\n width:16px;\n background-color: #DEDEDE;\n background-image: url('/customStyles/win98scroll.png');\n box-shadow: none;\n}\n::-webkit-scrollbar-corner{\n background-color: #DEDEDE;\n background-image: url('/customStyles/win98scroll.png');\n box-shadow: none;\n}\n::-webkit-resizer{\n border-radius: 0;\n background-color: #BDBDBD;\n box-shadow: none;\n width:12px;\n /*height:12px;*/\n border-top: 2px solid #DEDEDE;\n border-left: 2px solid #DEDEDE;\n border-bottom: 2px solid #7B7B7B;\n border-right: 2px solid #7B7B7B;\n background-color: #BDBDBD;\n}\n::-webkit-scrollbar-thumb{\n border-radius: 0;\n background-color: #BDBDBD;\n box-shadow: none;\n width: 12px;\n border-top: 2px solid #DEDEDE;\n border-left: 2px solid #DEDEDE;\n border-bottom: 2px solid #7B7B7B;\n border-right: 2px solid #7B7B7B;\n background-color: #BDBDBD;\n}\n::-webkit-scrollbar-button{\n border-radius: 0;\n background-color: #BDBDBD;\n box-shadow: none;\n width:12px;\n border-top: 2px solid #DEDEDE;\n border-left: 2px solid #DEDEDE;\n border-bottom: 2px solid #7B7B7B;\n border-right: 2px solid #7B7B7B;\n background-color: #BDBDBD;\n}\n/* buttons */\nbutton{\n background-color: #BDBDBD;\n border-top: 2px solid #DEDEDE;\n border-left: 2px solid #DEDEDE;\n border-bottom: 2px solid #7B7B7B;\n border-right: 2px solid #7B7B7B;\n color: #000;\n}\nbutton:active{\n border-top: 2px solid #7B7B7B;\n border-left: 2px solid #7B7B7B;\n border-bottom: 2px solid #DEDEDE;\n border-right: 2px solid #DEDEDE;\n}\n/* dividers */\nhr{\n border-top: 1px solid #7B7B7B;\n border-left: 1px solid #7B7B7B;\n border-bottom: 1px solid #DEDEDE;\n border-right: 1px solid #DEDEDE;\n}\n/* windows */\n.window{\n border-radius: 0;\n border-top: 2px solid #DEDEDE;\n border-left: 2px solid #DEDEDE;\n border-bottom: 2px solid #7B7B7B;\n border-right: 2px solid #7B7B7B;\n background-color: #BDBDBD;\n}\n.winAero{\n display: none;\n}\n.winImg{\n display: none;\n}\n.winCap{\n background:linear-gradient(90deg, #00007B, #0884CE);\n height: 18px;\n left: 2px;\n padding-left:2px;\n}\n.winHTML{\n border-radius: 0;\n border-top: 1px solid #7B7B7B;\n border-left: 1px solid #7B7B7B;\n border-right: 1px solid #DEDEDE;\n border-bottom: 1px solid #DEDEDE;\n left: 2px;\n bottom: 2px;\n background-color:#BDBDBD;\n}\n.winShrink, .winExit, .winBig{\n background-color: #BDBDBD;\n border-top: 1px solid #DEDEDE;\n border-bottom: 1px solid #7B7B7B;\n border-left: 1px solid #DEDEDE;\n border-right: 1px solid #7B7B7B;\n border-radius: 0;\n top: 3px;\n color: #000;\n width: 13px;\n height: 12px;\n font-size: 14px;\n font-family: ProFont, monospace;\n}\n.winExit{\n right: 4px;\n}\n.winBig{\n right: 21px;\n}\n.winShrink{\n right: 36px;\n}\n/* taskbar */\n#taskbar{\n background-color:#BDBDBD;\n border-top: 2px solid #DEDEDE;\n text-shadow: none;\n color: #000;\n}\n/* context menu */\n#ctxMenu{\n border-top: 2px solid #DEDEDE;\n border-left: 2px solid #DEDEDE;\n border-bottom: 2px solid #7B7B7B;\n border-right: 2px solid #7B7B7B;\n background-color: #BDBDBD;\n color: #000;\n}\n#ctxMenu p{\n transition: none;\n}\n#ctxMenu p:hover{\n background-color: #000080;\n color: #FFF;\n transition: none;\n}\n#ctxMenu hr{\n border-top: 1px solid #7B7B7B;\n border-bottom: 1px solid #DEDEDE;\n border-left:none;\n border-right:none;\n height: 0;\n margin-left: 0;\n}",
windowsXP: "/* Windows XP */\n.winExit, .winShrink, .winBig{\n top:2px;\n border:1px solid #FFF;\n color:#FFF;\n border-radius:3px;\n box-shadow:inset 0 0 2px rgba(0, 0, 0, 0.5);\n}\n.winFld{\n display:none;\n}\n.winBig, .winShrink{\n background:radial-gradient(ellipse farthest-corner at 0px 0px, #94B7F9 0%, #004DE0 100%);\n}\n.winExit{\n background:radial-gradient(ellipse farthest-corner at 0px 0px, #F0A896 0%, #D93401 100%);\n}\n.winExit:hover, .winShrink:hover, .winBig:hover{\n border-color:#FFF;\n color:#FFF;\n}\n.winShrink:active, .winBig:active{\n background:radial-gradient(ellipse farthest-corner at 100% 100%, #004DE0 55%, #94B7F9 100%);\n color:#DDD;\n}\n.winExit:active{\n background:radial-gradient(ellipse farthest-corner at 100% 100%, #D93401 55%, #F0A896 100%);\n}\n#taskbar{\n background:linear-gradient(to bottom, #326ED8 0, #4590E5 3px, #2259D7 6px, #2158D7 60%, #2562DF 90%, #1941A5 100%);\n}\n.winAero, .winBimg{\n display:none;\n}\n#icons div:first-child{\n border-top-right-radius:10px;\n border-bottom-right-radius:10px;\n background:linear-gradient(to bottom, #479246 0, #8FC08F 3px, #409A3F 6px, #43A543 60%, #38A638 90%, #31723F 100%);\n box-shadow:inset 6px 6px 3px -5px #559B55, inset -6px -6px 10px -5px #246825, 2px 2px 1px #2A71E2;\n}\n#icons div:first-child div{\n background:none;\n box-shadow:none;\n}\n#time{\n width:auto;\n right:0;\n top:0;\n padding-top:4px;\n background:linear-gradient(to bottom, #0D79D7 0, #18B5F2 3px, #139CEC 6px, #0D8DEA 60%, #1395E4 90%, #095BC9 100%);\n box-shadow:inset 10px 0 10px -10px #21C1F3;\n border-left:1px solid #0A365A;\n}\n.winCap{\n left:0;\n top:0;\n padding-left:3px;\n width:100% !important;\n padding-top:1px;\n background:linear-gradient(to bottom, #075FED 0, #3994FF 3px, #0054E3 6px, #0055EA 60%, #046EFC 90%, #0444D1 100%);\n box-shadow:inset 25px 0px 10px -20px #0022C7, inset -25px 0px 10px -20px #0022C7;\n}\n.window{\n border-bottom-left-radius:0;\n border-bottom-right-radius:0;\n background:#0022C7;\n}\n.winHTML{\n border-radius:0;\n background-color:#ECE9D8;\n box-shadow:-3px 0 3px -1px #1467EB, 1px 1px 1px #003DDD;\n}",
transparentXP: "/* Windows XP Transparent */\n.winExit, .winShrink, .winBig{\n top:2px;\n border:1px solid #FFF;\n color:#FFF;\n border-radius:3px;\n box-shadow:inset 0 0 2px rgba(0, 0, 0, 0.5);\n}\n.winFld{\n display:none;\n}\n.winBig, .winShrink{\n background:radial-gradient(ellipse farthest-corner at 0px 0px, rgba(255, 255, 255, 0.46) 0%, rgba(0, 0, 0, 0.09) 100%);\n}\n.winExit{\n background:radial-gradient(ellipse farthest-corner at 0px 0px, rgba(255, 255, 255, 0.46) 0%, rgba(0, 0, 0, 0.09) 100%);\n /*background:radial-gradient(ellipse farthest-corner at 0px 0px, #F0A896 0%, #D93401 100%);*/\n}\n.winShrink:hover, .winBig:hover{\n border-color:#FFF;\n color:#FFF;\n background-color:#00F;\n}\n.winExit:hover{\n border-color:#FFF;\n color:#FFF;\n background-color:#F00;\n}\n.winShrink:active, .winBig:active{\n background:radial-gradient(ellipse farthest-corner at 100% 100%, #004DE0 55%, #94B7F9 100%);\n}\n.winExit:active{\n background:radial-gradient(ellipse farthest-corner at 100% 100%, #D93401 55%, #F0A896 100%);\n}\n#icons{\n background:linear-gradient(to bottom, rgba(255, 255, 255, 0.19) 0, rgba(255, 255, 255, 0.37) 3px, rgba(0,0, 0, 0.14) 6px, rgba(255, 255, 255, 0.13) 60%, rgba(255, 255, 255, 0.17) 90%, rgba(0, 0, 0, 0.03) 100%);\n}\n/*\n.winAero, .winBimg{\n display:none;\n}\n*/\n#icons div:first-child{\n border-top-right-radius:10px;\n border-bottom-right-radius:10px;\n background:linear-gradient(to bottom, #479246 0, #8FC08F 3px, #409A3F 6px, #43A543 60%, #38A638 90%, #31723F 100%);\n box-shadow:inset 6px 6px 3px -5px #559B55, inset -6px -6px 10px -5px #246825, 2px 2px 1px rgba(255, 255, 255, 0.2);\n}\n#icons div:first-child div{\n background:none;\n box-shadow:none;\n}\n#time{\n width:auto;\n right:0;\n top:0;\n padding-top:4px;\n background:linear-gradient(to bottom, #0D79D7 0, #18B5F2 3px, #139CEC 6px, #0D8DEA 60%, #1395E4 90%, #095BC9 100%);\n box-shadow:inset 10px 0 10px -10px #21C1F3;\n border-left:1px solid #0A365A;\n}\n.winCap{\n left:0;\n top:0;\n padding-left:3px;\n width:100% !important;\n padding-top:1px;\n background:linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0, rgba(255, 255, 255, 0.29) 3px, rgba(0, 0, 0, 0.08) 6px, rgba(255, 255, 255, 0.12) 60%, rgba(255, 255, 255, 0.18) 90%, rgba(0, 0, 0, 0.17) 100%);\n box-shadow:inset 25px 0px 10px -20px rgba(0, 0, 0, 0), inset -25px 0px 10px -20px rgba(0, 0, 0, 0);\n}\n.window{\n border-bottom-left-radius:0;\n border-bottom-right-radius:0;\n /*background:rgba(0, 0, 0, 0.7);*/\n}\n.winHTML{\n border-radius:0;\n background-color:#ECE9D8;\n box-shadow:-3px 0 3px -1px rgba(255, 255, 255, 0.27), 1px 1px 1px rgba(0, 0, 0, 0.17);\n}",
windows7: "#taskbar{\n box-shadow:0 -1px rgba(255, 255, 255, 0.8), 0 -2px rgba(0, 0, 0, 0.6);\n}\n.window{\n box-shadow:0 0 0 1px rgba(255, 255, 255, 0.8), 0 0 0 2px rgba(0, 0, 0, 0.6), 0 0 30px #000 !important;\n}\n.winExit, .winBig, .winShrink, .winFld{\n border-color:rgba(0, 0, 0, 0.4);\n box-shadow:0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.4), inset 0 8px 4px rgba(255, 255, 255, 0.4);\n color:#FFF;\n text-shadow:0 0 1px #000;\n}\n.winExit{\n border-bottom-left-radius:0;\n width:22px;\n border-left-color:rgba(0, 0, 0, 0);\n background-color:#D44;\n}\n.winBig{\n border-radius:0;\n width:22px;\n}\n.winShrink{\n border-bottom-right-radius:0;\n width:22px;\n border-right-color:rgba(0, 0, 0, 0);\n}\n.winBig:hover, .winShrink:hover, .winFld:hover{\n background-color:#57D;\n color:#FFF;\n border-color:rgba(0, 0, 0, 0.4);\n box-shadow:0 0 10px 2px #BAF, inset 0 8px 4px rgba(255, 255, 255, 0.4);\n}\n.winExit:hover{\n background-color:#D64;\n color:#FFF;\n box-shadow:0 0 10px 2px #FAA, inset 0 8px 4px rgba(255, 255, 255, 0.4);\n border-color:rgba(0, 0, 0, 0.4);\n}\n.winBig:active, .winShrink:active, .winFld:active{\n background-color:#03A;\n}\n.winExit:active{\n background-color:#A30;\n}\n.winCap{\n color:#000;\n text-shadow:0 0 10px #FFF;\n font-family:sans-serif;\n}\n.winHTML{\n box-shadow:0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.8) !important;\n}\nbutton{\n font-family:sans-serif;\n color:#000;\n border-radius:3px;\n border-color:#7F7F7F;\n background:linear-gradient(0deg, #D0D0D0 0%, #D7D7D7 40%, #EEE 60%, #F7F7F7 100%);\n box-shadow:inset 0 0 0 1px rgba(255, 255, 255, 0.65);\n outline:none;\n transition:0.3s;\n}\nbutton:hover, button:focus{\n border-color:#7087d0;\n box-shadow:inset 0 0 0 1px rgba(235, 235, 255, 0.65);\n background-image:linear-gradient(0deg, #D0D0D0 0%, #D7D7D7 40%, #EEE 60%, #F7F7F7 100%);\n background-color:rgba(205, 220, 255, 0.65);\n background-blend-mode:luminosity;\n}\nbutton:active{\n border-color:#5067b0;\n box-shadow:inset 0 0 3px #67D, inset 0 8px 4px rgba(255, 255, 255, 0.6);\n background-image:linear-gradient(0deg, #D0D0D0 0%, #D7D7D7 40%, #EEE 60%, #F7F7F7 100%);\n background-color:rgba(150, 175, 255, 0.65);\n background-blend-mode:soft-light;\n}\ninput, textarea{\n border-color:#EEE;\n border-top-color:#AAA;\n border-radius:3px;\n outline:none;\n}\ninput:hover, input:focus, input:active, textarea:hover, textarea:focus, textarea:active{\n border-color:#CDF;\n border-top-color:#89B;\n}\nhr{\n background:linear-gradient(90deg, rgba(100, 127, 150, 0) 0%, rgba(100, 127, 150, 0.3) 10%, rgba(100, 127, 150, 0.3) 90%, rgba(100, 127, 150, 0) 100%);\n height:1px;\n border:none;\n}\n#ctxMenu{\n border-color:#CCC;\n background-color:#F2F2F2;\n}\n#ctxMenu hr{\n background-color:#D7D7D7;\n border-radius: 0;\n border: none;\n margin-left:14px;\n width:calc(100% - 14px);\n}\n#ctxMenu p{\n transition: 0s;\n color: #000;\n border-radius:3px;\n}\n#ctxMenu p:hover{\n transition: 0s;\n box-shadow:inset 0 0 3px #67D;\n background:none;\n color: #000;\n}",
windows8: "/* Windows 8 */\n/* scrollbars */\n::-webkit-scrollbar{\n width:16px;\n background-color: #F0F0F0;\n box-shadow: none;\n}\n::-webkit-scrollbar-corner{\n background-color: #F0F0F0;\n box-shadow: none;\n}\n::-webkit-resizer{\n border-radius: 0;\n background-color: #CDCDCD;\n box-shadow: none;\n}\n::-webkit-scrollbar-thumb{\n border-radius: 0;\n background-color: #CDCDCD;\n box-shadow: none;\n}\n::-webkit-scrollbar-button{\n border-radius: 0;\n background-color: #DADADA;\n box-shadow: none;\n}\n/* window itself */\n.window{\n border-radius: 0;\n}\n/* window html */\n.winHTML{\n border-radius: 0;\n}\n/* taskbar */\n#taskbar .winAero{\n opacity:0.5;\n}\n/* window buttons */\n.winBig, .winShrink, .winExit{\n color: #FFF;\n border-radius: 0;\n border: none;\n height: 19px;\n top: 1px;\n width: 38px;\n font-family:ProFont;\n font-size:19px;\n text-align:center;\n}\n.winExit{\n right: 1px;\n}\n.winExit:hover{\n background-color:#E81123;\n color: #FFF;\n}\n.winBig{\n right: 40px;\n}\n.winShrink{\n right: 79px;\n}\n.winBig:hover, .winShrink:hover{\n background-color: rgba(255, 255, 255, 0.3);\n color: #FFF;\n}\n/* context menu */\n#ctxMenu{\n border-color:#CCC;\n background-color:#F2F2F2;\n}\n#ctxMenu hr{\n background-color:#D7D7D7;\n border-radius: 0;\n border: none;\n margin-left:14px;\n width:calc(100% - 14px);\n}\n#ctxMenu p{\n transition: 0s;\n color: #000;\n}\n#ctxMenu p:hover{\n transition: 0s;\n background-color: #91C9F7;\n color: #000;\n}\n/* buttons */\nbutton{\n border-color: #ADADAD;\n background-color:#E1E1E1;\n color: #000;\n outline: none;\n transition: 0.1s;\n}\nbutton:hover{\n border-color:#0078D7;\n background-color:#E5F1FB;\n}\nbutton:active{\n border-color:#005499;\n background-color:#CCE4F7;\n}",
windows10: "/* Windows 10 */\n/* scrollbars */\n::-webkit-scrollbar{\n width:16px;\n background-color: #F0F0F0;\n box-shadow: none;\n}\n::-webkit-scrollbar-corner{\n background-color: #F0F0F0;\n box-shadow: none;\n}\n::-webkit-resizer{\n border-radius: 0;\n background-color: #CDCDCD;\n box-shadow: none;\n}\n::-webkit-scrollbar-thumb{\n border-radius: 0;\n background-color: #CDCDCD;\n box-shadow: none;\n}\n::-webkit-scrollbar-button{\n border-radius: 0;\n background-color: #DADADA;\n box-shadow: none;\n}\n/* window itself */\n.window{\n border-radius: 0;\n}\n/* window html */\n.winHTML{\n border-radius: 0;\n left: 1px;\n bottom: 1px;\n padding-right: 4px;\n padding-bottom: 2px;\n}\n/* taskbar */\n#taskbar .winAero{\n opacity:0.5;\n}\n/* window buttons */\n.winBig, .winShrink, .winExit{\n color: #FFF;\n border-radius: 0;\n border: none;\n height: 19px;\n top: 1px;\n width: 38px;\n font-family:ProFont;\n font-size:19px;\n text-align:center;\n}\n.winExit{\n right: 1px;\n}\n.winExit:hover{\n background-color:#E81123;\n color: #FFF;\n}\n.winBig{\n right: 40px;\n}\n.winShrink{\n right: 79px;\n}\n.winBig:hover, .winShrink:hover{\n background-color: rgba(255, 255, 255, 0.3);\n color: #FFF;\n}\n/* context menu */\n#ctxMenu{\n border-color:#CCC;\n background-color:#F2F2F2;\n}\n#ctxMenu hr{\n background-color:#D7D7D7;\n border-radius: 0;\n border: none;\n margin-left:14px;\n width:calc(100% - 14px);\n}\n#ctxMenu p{\n transition: 0s;\n color: #000;\n}\n#ctxMenu p:hover{\n transition: 0s;\n background-color: #91C9F7;\n color: #000;\n}\n/* buttons */\nbutton{\n border-color: #ADADAD;\n background-color:#E1E1E1;\n color: #000;\n outline: none;\n transition: 0.1s;\n}\nbutton:hover{\n border-color:#0078D7;\n background-color:#E5F1FB;\n}\nbutton:active{\n border-color:#005499;\n background-color:#CCE4F7;\n}",
elCapitan: "\n/* OSX EL CAPITAN */\n.winCap{\n text-align:center;\n text-shadow:/*0px 0px 2px #FFF*/none;\n color:#000;\n font-family:ProFont, monospace;\n font-size:12px;\n}\n.winHTML{\n left: 0;\n padding-right:6px;\n bottom: 0px;\n}\nbutton{\n background-color:#FFF;\n border:1px solid #7F7F7F;\n color:#000;\n border-radius:5px;\n}\nbutton:active{\n background:linear-gradient(0deg, #55D, #88D);\n}\n.winBimg{\n opacity:0;\n}\n.window{\n background:linear-gradient(180deg, rgb(254, 240, 239), rgb(207, 207, 207) 22px, rgb(146, 146, 146));\n padding-bottom:0;\n}\n.winBig, .winExit, .winShrink{\n border-radius:7px;\n top:5px;\n width:11px;\n height:11px;\n font-size:0;\n}\n.winExit{\n left: 5px;\n background-color:rgb(251, 98, 92);\n border:1px solid rgb(188, 82, 84);\n}\n.winExit:hover{\n background-color:rgb(241, 88, 82);\n border:1px solid rgb(178, 72, 74);\n}\n.winExit:active{\n background-color:rgb(178, 72, 74);\n border:1px solid rgb(241, 88, 82);\n}\n.winShrink{\n left: 23px;\n background-color:rgb(255, 187, 60);\n border:1px solid rgb(208, 161, 73);\n}\n.winShrink:hover{\n background-color:rgb(245, 177, 50);\n border:1px solid rgb(198, 151, 63);\n}\n.winShrink:active{\n background-color:rgb(198, 151, 63);\n border:1px solid rgb(245, 177, 50);\n}\n.winBig{\n left: 41px;\n background-color:rgb(49, 200, 71);\n border:1px solid rgb(53, 157, 68);\n}\n.winBig:hover{\n background-color:rgb(39, 190, 61);\n border:1px solid rgb(43, 147, 58);\n}\n.winBig:active{\n background-color:rgb(43, 147, 58);\n border:1px solid rgb(39, 190, 61);\n}\n#taskbar{\n max-width:80%;\n left:10%;\n border-top-left-radius:5px;\n border-top-right-radius:5px;\n}\n#ctxMenu{\n background-color: rgba(255, 255, 255, 0.75);\n padding-top: 5px;\n padding-bottom: 5px;\n border-radius: 10px;\n}",
osjs: "/* OS.js */\n#desktop{\n top: 31px;\n}\n#taskbar{\n top: 0;\n background-color:rgba(0, 0, 0, 0.8);\n}\n.winCap{\n color: #000;\n text-shadow:none;\n font-family:Sans Serif;\n font-size:12px;\n text-align:center;\n}\n.winBimg{\n display:none;\n opacity:0;\n}\n.winAero{\n display:none;\n opacity:0;\n}\n.window{\n background-color:#EBEBEB;\n padding-right:5px;\n padding-bottom:2px;\n}\n.winHTML{\n left: 5px;\n bottom: 5px;\n}\nbutton{\n background-color:#F7F7F7;\n border-color:#C1C1C1;\n color:#000;\n}\n.winBig, .winExit, .winShrink{\n border-radius:7px;\n top:4px;\n width:11px;\n height:11px;\n font-size:0;\n}\n.winExit{\n right: 6px;\n background-color:rgb(251, 98, 92);\n border:1px solid rgb(188, 82, 84);\n}\n.winExit:hover{\n background-color:rgb(241, 88, 82);\n border:1px solid rgb(178, 72, 74);\n}.winExit:active{\n background-color:rgb(178, 72, 74);\n border:1px solid rgb(241, 88, 82);\n}.winShrink{\n right:46px;\n background-color:rgb(255, 187, 60);\n border:1px solid rgb(208, 161, 73);\n}\n.winShrink:hover{\n background-color:rgb(245, 177, 50);\n border:1px solid rgb(198, 151, 63);\n}\n.winShrink:active{\n background-color:rgb(198, 151, 63);\n border:1px solid rgb(245, 177, 50);\n}\n.winBig{\n right:26px;\n background-color:rgb(49, 200, 71);\n border:1px solid rgb(53, 157, 68);\n}\n.winBig:hover{\n background-color:rgb(39, 190, 61);\n border:1px solid rgb(43, 147, 58);\n}\n.winBig:active{\n background-color:rgb(43, 147, 58);\n border:1px solid rgb(39, 190, 61);\n}\n#ctxMenu{\n background-color:#EBEBEB;\n border-color:#C1C1C1;\n color: #000;\n}\n#ctxMenu p{\n color:#000;\n transition:none;\n}\n#ctxMenu p:hover{\n background-color:#2D73D2;\n color:#FFF;\n}\n#ctxMenu hr{\n background-color:#C1C1C1;\n border-color:#C1C1C1;\n}",
jdStyle: "/* jd style */\n#taskbar{\n max-width:80%;\n left:10%;\n border-top-left-radius:20px !important;\n border-top-right-radius:20px !important;\n\n border-bottom-left-radius:0px !important;\n border-bottom-right-radius:0px !important;\n}\nbutton{\n border-radius:50px;\n background-color:#1BCB58;\n color:#00699A;\n}\ndiv #win{a} window{\n left:130px !important;\n}\ntd{\n border-radius:3px;\n background-color:#008400;\n color:#00B6FF\n}\nth{\n border-radius:50px;\n background-color:#008400;\n color:#00B6FF\n}\n#win{a}{\n height:400px;\n}\n#win{a}h{\n top:20px;\n}\nwin{a}i{\n \n}\n#icn{a}{\n border-radius:20px;\n}\n#win{a}{\n overflow:visible;\n}\n#win{a} .winCap{\n box-shadow:0px 300px 0px #000;\n}\n#taskbar{\n border-radius:20px;\n}\n.iconImg{\n border-radius:50px;\n}\n.winBimg{\n background-image:url(http://wallpapercave.com/wp/CVO9Y72.jpg);\n}\n.winBig, .winExit, .winShrink{\n border-top:4px;\n width:25px;\n height:18px;\n background-color:#1AAC3C;\n}\n.winExit{\n right:15px;\n}\n.winExit:hover{\n background-color:rgb(241, 88, 82);\n}\n.winExit:active{\n background-color:rgb(178, 72, 74);\n}\n.winShrink{\n right:75px;\n}\n.winShrink:hover{\n background-color:rgb(245, 177, 50);\n}\n.winShrink:active{\n background-color:rgb(198, 151, 63);\n}\n.winBig{\n right:45px;\n}\n.winBig:hover{\n background-color:rgb(39, 190, 61);\n}\n.winBig:active{\n background-color:rgb(43, 147, 58);\n}"
},
changelog_old:
"OLD CHANGELOG AND PLANNING SHEET\nThis could be found in a very large comment at the very top of the main script file before this file addition.\n\n" +
"By Adams, original somewhere in codecademy.com/MineAndCraft12/codebits\n" +
"I have alot of work to do to make this work well. Here's the list of to-do's, starting with a key\n" +
": To-Do (optional comments or details)\n" +
"> Work-In-Progress (optional comments or details)\n" +
" :) Satisfactory (mandatory comment on any way it could be better)\n" +
" :\\ Needs Improvement (mandatory comment on what isnt right or what can be added)\n" +
" :| Skipped (mandatory comment on why it was skipped)\n" +
" :( Unsatisfactory (mandatory comment on why it did not work or is not good)\n" +
" :D Perfect (mandatory comment on why improvement is useless or unneeded)\n" +
"________________________________________________________________________________\n" +
" :) Make screen size itself to the screen as apposed to stretching to the screen (optimise to resize more quickly)\n" +
" :) Fix the FPS meter as the beginning info is now irrelevant (possibly fit this one onto the taskbar with the time)\n" +
" :\\ Allow desktop icons to go all the way down and all the way right (some screen sizes cause icons to overlap or to skip a space)\n" +
"> Make the thing look better (always working on this one)\n" +
" :) Make an object to hold running Timeout and Interval functions and a task manager for them (finally made removeTimeout)\n" +
" :) Remove size controlling options from settings (make more settings)\n" +
" :) Move FPS meter onto the taskbar with the time meter (pretty much perfect already)\n" +
" :) Allow window dragging (actually drag mouse instead of click-click maybe)\n" +
" :) Give the current window a shadow, and all other windows no shadow (make more noticeable)\n" +
" :D Make built-in apps remember their last position on-screen (works perfectly)\n" +
" :| Surprise for 2000 lines of code (skipped due to just chugging on with development :P)\n" +
" :D Allow users to easily make their own apps (Just make a Tampermonkey script that runs when the page is finished!)\n" +
" :D Order window layering by order used instead of order initialised (perfect but may have limit)\n" +
" :| Make login system (use mySQL database or maybe use a hash to save to a file somewhere in Users->User (working on other features first, same with below)\n" +
" :) Make file-system actually work with a simple-as-possible system, preferably 1 or 2 end commands (in future, maybe real-time load system)\n" +
" :) Put Aero blur on windows (possibly have windows/icons show through the aero)\n" +
" :) Settings to enable/disable Aero blur (perfect, remember to add taskbar support)\n" +
" :) Taskbar support for Aero (have it work to show windows below, possibly)\n" +
" :) Settings to change window frame color (perfect, possibly differ it from the taskbar later on)\n" +
" :) Get rid of editor warnings (evals are here to stay sadly, and so are missing radix parameters on parseInt)\n" +
" :| Make web browser work on non-https sites (works only on teh non-https stable version)\n" +
" :D Add a way to determine both JS FPS and visual FPS (literally perfect - Chrome FTW)\n" +
" :D Make filebrowser support USERFILES and find+fix its 'files.n' access issue (works now!)\n" +
" :D Get rid of all branded names and such, like Start Menu, Aero, etc. (did it!)\n" +
" :D Allow apps to save cross-session data (works perfectly)\n" +
" :) Make saving app work no matter filesize (use param 1 at end - should work for large files as long as not insanely crazy)\n" +
" :) Allow window rotating! (make it easier to improve)\n" +
" :) Setting to change background-blend-modes on the window aeros, maybe just toggle between multiply and overlay (works just like windowcolor)\n" +
" :) Setting to change experimental opacity of window aero layer (work just fine)\n" +
" :) Custom scrollbar for (maybe add cursors later)\n" +
" :) Implementing Module system so that errors are easier to track (works great)\n" +
" :) Context Menu (Make the thing easier to set up)\n" +
" :) Add App Icons (works pretty well)\n" +
" :) Make system to allow code to wait for FPS reasons (works as well as it ever will)\n" +
" :) Fix RD (still halves the FPS but better than 1FPS)\n" +
" :) Add cursors (dunno if adding a text cursor would be worth it)\n" +
" :) Maybe allow movement of desktop icons (even saves)\n" +
" :) Fix for browsers that do not support getAnimationFrame\n" +
" :| Make Window Moving more optimised (what i thought would be an optimization actually ended up slower)\n" +
"> Loads of optimisations (you can count on this one never being finished)\n" +
" :) Ability to send error report (impossible to email with the IDE i use - but i found another way)\n" +
" :) Send apps into Enlarge mode (just like hitting the middle of the top-right buttons in windows)\n" +
" :) Change Window Rotation into Window Scaling\n" +
" :) Minimize, enlarge, and exit buttons look better now.\n" +
" :) Let Files app have different filenames\n" +
" :) Optimize file browser just like the start menu system was optimized\n" +
" :) Messaging App\n" +
" :) Performance-checking features - lets you see how many microseconds between two calls of the function\n" +
" :) Allow User to login to another account (works great)\n" +
" :) Make window resizing actually resize the window\n" +
" :) Allow apps to resize their elements when its window is resized\n" +
" :) Default apps open in middle of screen\n" +
" :) Save CPU by having the time and FPS render at vsync instead of every millisecond\n" +
" :) Show network status on the taskbar\n" +
" :) Allow user to ping server\n" +
"> NORAA - Take that Cortana! (have it in its own window [genius!] and have it learn from you - take JOSHUA from War Games as example for the display and give it a personality shaped by experience)\n" +
"> Performance Mode - certain system functions will be made less CPU-intesive (for older browsers)\n" +
" :) Speech Recognition for NORAA (possibly find out a way to keep it from being forever stuck... may be an API issue)\n" +
" :) 's own TTS engine (based off of Chrome 33's)\n" +
" :) NORAA speaks responses to user's spoken commands\n" +
" :) Optimise formDate (put functions into arrays rather than loops)\n" +
" :) Added ProFont (windows .ttf version) and changed many apps fonts, like NORAA, jsConsole. All credit to the creators of this absolutely brilliant font. Bravo!\n" +
" :) Added stylish battery\n" +
"> Optimise many functions for performance mode (Application.setDims)\n" +
"> Languages (The language that is the language that the United States of America currently speaks, Anglish,)",
changelog:
"MM/DD/YYYY: VX.X.X.X\n + New Feature Addition\n - Old Feature Removal\n : Change or Fix\n\n" +
"01/26/2016: A1.2.0.0\n + Changelog Added.\n : Windowblur fixed when dims not set.\n + Search app added.\n : RD no longer brings to its knees.\n + System to allow apps to have code wait its turn to avoid OS-crippling lag.\n + App Maker can now give apps image-based icons.\n\n" +
"01/30/2016: A1.2.1.0\n + Right-click menu for desktop icons, allows re-arrangement of icons.\n : Text Editor app no longer uses word-wrap.\n\n" +
"02/04/2016: A1.2.2.0\n + Text-to-speech added to right-click menu, credits to creator are in the Settings app.\n + Experimental image editor began development.\n\n" +
"02/23/2016: A1.2.3.0\n + Copyright notice added to Settings application - (c) 2016 Adams\n + Waiting Code system modified to allow args in functions.\n : Resizing of the monitor is now manual - reduces strain on CPU.\n + Ability to send error reports if the filesaving service is intact.\n + replaces requestAnimationFrame with a custom function if requestAnimationFrame is unsupported in your browser.\n + True fullscreen support - remember to use Chrome.\n\n" +
"04/04/2016: A1.2.4.0\n : Window Rotation changed to Window Scaling.\n + Windows can now fit to the size of the desktop - just hit the 'O' button and watch what it does.\n + Change calulating app, ChC.\n : Various bug fixes - this one is spread between the last few updates, just forgot to mention it.\n : version format changed from 'V_._._' to 'A_._._', 'A' meaning alpha. When in beta form, it will be changed to 'B_._._', and on full release will be changed back to 'V_._._'.\n + RemoveTimeout is added to task manager.\n : File manager can no longer cripple the system.\n + Replaces performance.now with custom function if not supported by your browser.\n + Added messaging app, lets you message all other users with Messaging app currently open.\n + Added performance-checking features, see an example in the initialization-time log in the console.\n + Ability to switch between OS accounts.\n + Built-in apps now fully support variable window sizes.\n + Network status now shown on taskbar.\n + NORAA added.\n : TTS uses Googles built-in TTS.\n + NORAA can hear the user, if given permission.\n\n" +
"06/06/2016: A1.2.5.0\n + Bing app added for quick bing search (google wont let me).\n + NORAA can now tell you what nearly anything is.\n : Improvements to formDate to help with CPU load.\n + Files can view window object.\n : Context menus better to create and faster.\n + Files now can show properties of a file.\n + New font called ProFont i think, credits to its creator, not me.\n : Settings app rewritten.\n + NORAA can listen for you to speak to him, and now referrs to himself as 'me' instead of 'NORAA'.\n : filesaving optimised.\n + Help App.\n + Music Visualiser (add /unrelated/keyfingers/visual.php to the URL to get non-laggy version).\n + Taskmanager can close tasks.\n : More optimised for mobile FPS on performance mode.\n + New prompt system that does not freeze browser.\n : Messaging more safe but breaks on mobile still.\n + More icons added.\n + Mobile can double-tap to context menu, but only on some objects.\n : When ctxmenu opens using that method, drag both fingers out of the OS window before lifting them, or the menu will close.\n : Files is safer to use.\n : Probably many other changes but forgotten what as I keep forgetting to log them.\n\n" +
"08/17/2016: A1.2.6.0\n + Properties now displays the size of functions.\n + When needed, Properties now shows KB, MB, and GB so values are easier to count.\n : Battery no longer has blue background, and instead gives the foreground a blue tint when charging.\n + Performance Monitor app shows CPU usage stats.\n : Changelog is easier to read.\n : Properties app shows shorter description for file sizes.\n + Windows now have texture to their borders, looks good if you can find a glassy texture like Windows has (i wont steal theirs) or if your device cant run windowblur.\n + Rightclick menu lets you open an app from its icon.\n + App controls are now accessible from the app's window caption.\n : Camera app now resizes correctly.\n : Music Visualizer now waits for the song to load before trying to play it.\n - Application List can no longer be moved or resized.\n + If JavaScript is disabled or unsupported, the loading page will nag you to enable it.\n + Alerts, confirms, and prompts can now tell you where they came from.\n + Music Visualizer now shows loading progress and song playtime progress.\n + New simple version of Music Visualizer, uses a canvas (thus looks worse), and runs on one color only: black (with a green screen behind it), which achieves 60fps instead of 15.\n + New Ringtone for Messaging.\n + New Looketh Over There ringtone for Messaging.\n + Fix for double quotes in Messaging.\n + Apps can now stay Always On Top.\n : Notepad reworked.\n : Fixed NORAA looking up definitions.\n + Copy/Paste added.\n : Fixed Fullscreen Dimensions.\n\n" +
"09/23/2016: A1.2.7.0\n + Mathway app Added.\n : Developers can now keep their app out of the apps list, in case it acts as a utility of sorts..\n + Icon added to music visualizer.\n + Apps can now be opened by Files browser.\n + Files can now be deleted in File Browser.\n + New AppBrowser, for opening any app installed on the system.\n : Task Manager is now capitalized in application list.\n + Simon Says App.\n : Updated the appearance of apps on the desktop; two-word names no longer overlap the icon, and it looks a bit cleaner and easier to read with bright and dark backgrounds alike.\n + Smoother animations in desktop icons and window borders and buttons.\n + Taskbar now shows which app is active.\n : Stylish Battery icon now looks like a AA battery rather than just a box.\n : OS loads your files more cautiously, notifies you of errors.\n : Fixed inconsitency in desktop icon ctxMenus.\n : Changelog is a little better.\n : Apps can no longer interrup each others saving processes.\n : Deleting now works properly again.\n + Shut down and restart are now a feature; lets apps save their progress if you do it while they running.\n + Large additions to API documentation.\n + Complete API Documentation started in the Help App.\n + Raw battery information is now stored outside of an anonymous function.\n : now tries up to three times to set up the battery.\n + Bug Central app, to track and document known bugs.\n + Donation button added.\n + Indycar app added; the first app not written 100% by hand.\n + Added Dont-Save argument to most settings.\n\n" +
"09/23/2016: A1.2.8.0\n + New changelog mechanic - Because is updated live, it's harder to keep one version number on everything. Updates will be tracked in more detail, adding a fourth update number, and dates will be closer together so you can tell exactly when each visible change was made.\n : Controls changed in House game.\n + New sprites in House game, explosion animation and soldiers now shoot at an angle.\n + Experimental RDP system. No, it's not perfect, but it's a start.\n\n" +
"09/24/2016: A1.2.8.1\n : Complete rewrite of render system for music visualizer, you now get max fps instead of 10.\n : Along with this new render system, by clicking on the visualization it will resize to fit its window. Theoretically, it will work for any width 2048 pixels or less, and for any height physically possible.\n + You can access Visualizer as its own separate browser window! Visit https:///unrelated/keyfingers/cnv.php, and that way the OS itself wont slow down the visualizer and you can also put it into true fullscreen.\n\n" +
"09/25/2016: A1.2.8.2\n : New look for the Settings app.\n + Context menus can now have disabled options.\n\n" +
"09/30/2016: A1.2.9.3\n + New Mouse Control app; purely experimental.\n + Added function grapher, to help with math students.\n + Added external debug window for if you have trouble clicking on .\n\n" +
"10/01/2016: A1.3.0.0\n : User can now drag to move windows instead of having to click several times.\n\n" +
"10/04/2016: A1.3.1.0\n + User can now create their own desktop icons.\n\n" +
"10/04/2016: A1.3.2.0\n + Remote Debugging Menu for debugging another user's computer.\n\n" +
"10/06/2016: A1.3.3.0\n + Added binary file viewer... because it's cool, I guess.\n\n" +
"10/07/2016: A1.4.0.0\n + Context Menus can now have 10x10 images to represent their options.\n : Context Menu options are now left-aligned instead of center-aligned.\n\n" +
"10/12/2016: A1.4.0.1\n : Fixed Saving of FPS Status settings on taskbar.\n\n" +
"10/13/2016: A1.4.1.0\n + Added compact settings for FPS and Time on taskbar.\n + Added Custom Stylesheet feature - check Settings -> Advanced for more info.\n\n" +
"10/18/2016: A1.4.2.0\n + Added Magnifier App; lets you magnify , focusing on your mouse.\n\n" +
"10/20/2016: A1.5.0.0\n + Added a new type of context menu; it is the same visually but is easier to edit, can be added to on the fly, and can safely perform more actions.\n\n" +
"10/21/2016: A1.5.0.1\n : Fixed fatal error when taskbar is the first right-clicked element since launch.\n : Changed context menus for app icons, taskbar icons, and Applications List to the new version.\n\n" +
"10/22/2016: A1.5.1.0\n : Fixed fatal error when right-clicking window border after toggling performance mode.\n : Changed Task Manager to display more important information and added entry to Help app to describe what they mean.\n\n" +
"10/24/2016: A1.5.2.0\n + LiveElements can now target their element attributes.\n\n" +
"10/25/2016: A1.6.0.0\n + Clipboard is now saved between sessions and restarts.\n + Emergency Clear Clipboard button in Settings.\n : Network Status is less distracting.\n : Fixed blurry buttons, font sized changed to 12px, native for font.\n + Added crash tester and force-boot option on boot menu.\n : Fixed graphics bug where power-down screen appeared suddenly instead of fading.\n + New animation, start menu slides up from bottom.\n\n" +
"10/27/2016: A1.6.1.0\n + You can now copy text from any window in the OS instead of only in text boxes.\n + Experimental support for Safari's backdrop-filter CSS property in Settings to blur windows.\n + Added Current Selection to task manager.\n : Applications List only updates its data at system start, as it is only needed then. Saves on FPS and makes Apps List faster.\n + Loading icons added in Apps List, Files Browser, Loading Screen, and Shutdown Screen.\n\n" +
"10/28/2016: A1.6.2.0\n : Applications List now slides in from the left... looks a bit better.\n + New Tampermonkey script to get on any tab!\n\n" +
"10/19/2016: A1.6.2.1\n + Added cookie image for use in context menus, not actually being used yet though.\n\n" +
"10/30/2016: A1.6.3.0\n : Desktop Icons now position themselves correctly. About time!\n\n" +
"11/02/2016: A1.7.0.0\n : Taskbar no longer has occasional positioning issue.\n + Custom Style Gallery in Settings, with Win98, Win8, and Win10 options so far.\n + Screensaver support - default is after 5 mins, cycle color hues on screen.\n\n" +
"11/07/2016: A1.7.0.1\n + now attempts to adapt to Google Play by automatically enabling performance mode.\n\n" +
"11/09/2016: A1.7.1.0\n + Calculator App.\n - Custom Math App.\n\n" +
"11/10/2016: A1.7.1.1\n + Button added to calculator so user can undo clearing the display.\n\n" +
"11/15/2016: A1.7.1.2\n : Disabled rendering of elements that are always hidden, to save on performance.\n\n" +
"11/21/2016: A1.7.2.0\n + Files location bar now shows loading progress.\n\n" +
"12/01/2016: A1.7.2.1\n + Added new screensaver: Color Randomization.\n\n" +
"12/02/2016: A1.7.3.0\n + Added new PNG file saver for saving base-64 images to .\n\n" +
"12/07/2016: A1.7.3.1\n + Added desktop background to loading screen.\n + Added new screensavers: blank and Random Wikipedia Page.\n\n" +
"12/08/2016: A1.7.3.2\n + Added configurability to screensavers (currently only the wikipedia one though).\n : Fixed Random Color screensaver.\n : Fixed Force Boot.\n\n" +
"12/13/2016: A1.7.4.0\n + Added 60fps Ultra setting to music visualizer... absolutely stunning on 15px mode.\n\n" +
"12/15/2016: A1.7.4.1\n : checks for battery 10 times instead of 3, just in case.\n\n" +
"12/16/2016: A1.7.4.2\n : Fixed error on startup for new users.\n\n" +
"12/17/2016: A1.7.5.0\n + Added CPU Monitor Graphing app.\n : Changed some text in Applications List.\n\n" +
"01/05/2017: A1.7.5.1\n : Fixed maximized windows.\n + Added links to old versions in files.oldVersions.\n\n" +
"01/07/2017: A1.7.5.2\n : Fixed key generation for new users.\n\n" +
"01/10/2017: A1.7.6.0\n + Began development on experimental bash console.\n\n" +
"01/23/2017: A1.7.7.0\n + Added commands cp, mv, del, su, and sudo to bash console.\n : Revised commands cd and ls in bash console.\n + Bash console now shows current directory in command prompt.\n\n" +
"01/24/2017: A1.7.7.1\n : Fixed .. directory selections in bash console.\n + Added alias support in bash console (try 'alias please=sudo').\n + Added mkdir in bash console.\n : Changed del to rm in bash console (oops, this isnt MS-DOS!)\n : Made ls calculate dir all at once instead of separately, now takes < 1 second to calculate 'ls -s /' as opposed to 10 minutes and does not interrupt system processes.\n\n" +
"01/25/2017: A1.7.8.0\n + Begun commenting all necessary code (11,000 lines, ugh) in , as right now its just a huge mess.\n\n" +
"02/02/2017: A1.8.0.0\n : now boots modularly, so if one app initializes incorrectly, other apps still have a chance to start and the os will not lock you out.\n\n" +
"02/03/2017: A1.8.0.1\n : Boots much faster, but still slower than 1.7.8, especially for Google Play version.\n\n" +
"02/06/2017: A1.8.1.0\n + Automatically adjusts screen resolution when window is resized. Much more efficient mechanism than the early days of .\n\n" +
"02/08/2017: A1.8.2.0\n + Taskbar can now be repositioned; bottom, top, left, and right are the options.\n + Version number on page title now shows date of last update.\n : Context menu on taskbar now directs user to taskbar settings page instead of directly changing them.\n\n" +
"02/18/2017: A1.8.3.0\n + Windows can now 'fold'; hides body so you can more easily sort through them.\n\n" +
"02/19/2017: A1.8.3.1\n + Windows can now be hidden via taskbar buttons right-click.\n\n" +
"03/01/2017: A1.8.3.2\n + Added Search app to the top of Apps List.\n + Beginning aDE (aDesktopEnvironment) framework development, plan is to serve similar purpose to the xServer of Linux.\n\n" +
"03/22/2017: A1.8.3.3\n + Added setting to allow user to watch build itself at startup.\n\n" +
"03/28/2017: A1.8.4.0\n + Merged and my friend's J into the same workspace, for his ease of building.\n + Added psuedo-GRUB to startup to choose between Operating Systems.\n : Shutdown screen slightly different.\n\n" +
"04/25/2017: A1.8.4.1\n + Added Windows XP (plain and colorable) themes to CustomStyles.\n + Added (extremely buggy) pipe logic to bash console.\n + Added grep command to bash console, currently case-sensitive, will fix.\n\n" +
"04/26/2017: A1.8.5.0\n + Windows will now be 'highlighted' when their icon in the taskbar is hovered over.\n: Instead of making windows move slowly, Performance Mode draws a border of the window instead of having the window follow the cursor - great for FPS.\n\n" +
"04/27/2017: A1.8.5.1\n + Added background to window highlighting to make it more visible; normally it looks sleek but in performance mode it is easier to render.\n : Default window blur is now 2 instead of 5 - helps the FPS and looks a bit better.\n : The experimental Backdrop Filter blur now uses the blur strength setting instead of always 5.\n+ now remembers Performance Mode settings - a very useful setting for many low- to medium-power devices.\n\n" +
"04/28/2017: A1.8.5.2\n : Window highlight looks a bit better.\n + Apps Browser can now open apps from the context of the taskbar, however this tends to break things, notably with the Files app.\n\n" +
"05/04/2017: A1.8.6.0\n : Cursors are now controlled by class, not by direct style overrides - this allows customStyles to change cursor theme.\n : Loading cursors changed to hourglass shape that was originally intended - i forgot that was there.\n\n" +
"05/09/2017: A1.8.6.1\n : Fixed Google Play version of .\n - Removed aDE framework for now.\n : File Browser now opens folders much faster, even loads the window object super quickly.\n\n" +
"05/10/2017: A1.8.6.2\n + Added Changelog app - the changelog is much easier to read this way.\n\n" +
"05/11/2017: A1.9.0.0\n + Added Notification system, for non-urgent notifications. Current bug however means that only one notif/alert can be open at a time.\n + Added sweet animations to opening and closing windows, sadly though this means cutting support for pretty much everything but Chrome as it uses Fat-Arrow notation.\n\n" +
"05/12/2017: A1.9.0.1\n + Windows now have opacity-change when opening/closing.\n : Windows only scale halfway instead of all the way when closing\n\n" +
"05/15/2017: A1.9.0.2\n : Fixed Serverside Error [2] Cannot modify header information\n : Fixed certain windows not animating correctly\n\n" +
"05/16/2017: A1.9.0.3\n + Added framework for new, better language system\n\n" +
"05/18/2017: A1.9.0.4\n : Modified the behavior of the ls command in the bash console.\n : Messaging is now MUCH faster than before - major speed improvement.\n : Fixed bug in messenger where username would sometimes not appear when opening the app\n\n" +
"05/19/2017: A1.9.1.0\n + Added more content to Chinese language.\n + Context menus, app names, and apps list are now programmed to reflect language selection if translation available.\n + Re-added Ultra Verbose as a joke language.\n\n" +
"05/21/2017: A1.9.2.0\n : Changed around some icons, I think they look a bit better now. Credit to Elme Delos Santos\n + Added 42 new backgrounds.\n + Notification that tells what the latest update was.\n : Made JavaScript Console, Prompts, and Text Editor translatable.\n : Messaging now loads 10 messages by default instead of 5.\n\n" +
"05/23/2017: A1.9.2.1\n - Removed security hole from Messaging\n + Messaging now highlights real admins green.\n : Suppressed a bug in Camera.\n\n" +
"05/24/2017: A1.9.2.2\n + Added custom style by Elme Delos Santos.\n\n" +
"05/28/2017: A1.9.2.3\n : Messaging app is a bit more secure.\n + If a notification is already open, additional dialogs will flash the notification to attract attention.\n + Added 'Into Your Arms' and 'Live For The Drop' to Music Visualizer. Both songs are by Capital Kings and I claim no rights to them.\n\n" +
"05/29/2017: A1.9.2.4\n : Notification for latest update only happens if the latest update is new.\n : Fixed Messaging encoding names incorrectly since the 1.9.2.3 update.\n\n" +
"05/30/2017: A1.9.2.5\n : Messaging app is, once again, more secure. One side effect of this update is that all messaging usernames were reset. Just re-enter your name again to get it back.\n\n" +
"06/01/2017: A1.9.3.0\n + Added Style Editor app to more easily edit Custom Styles. \n : Moved Boot Script into the Applications List.\n : Reboot now correctly reboots to .\n + Version of is now included in error reports. Chrome cache sucks for debugging.\n : Even easier to tell admins in messaging now.\n\n" +
"06/02/2017: A1.9.3.1\n + Images can now be sent in messaging. [IMG]http://URL.HERE/image.png[/IMG]\n - Fixed error in Google Play version where attempts to determine its last version via localStorage.\n - Fixed error in Google Play where, when loading a desktop previously loaded on a PC, NORAA throws an error at boot and fails to initialize.\n\n" +
"06/03/2017: A1.9.3.2\n + Windows now minimize to the correct position on the taskbar.\n\n" +
"06/05/2017: A1.9.3.3\n : Fixed backslash error with names in Messaging.\n\n" +
"06/06/2017: A1.9.4.0\n + Added App Search functionality to Dashboard\n + Added new types of Dashboard, Windows 7 and Whisker Dashboards, they can be found in settings.\n : Renamed Apps List to Dashboard.\n\n" +
"06/13/2017: A1.9.4.1\n : Fixed error in psuedo-GRUB that prevents from loading in Google Play app and older browsers\n : Forced Chrome to ignore cached version of script and style on reboot/refresh. Take that, Chrome!\n\n" +
"06/18/2017: A1.9.5.0\n + Added Windows 7 theme to Custom Styles in Settings.\n + Added new Android-like Dashboard setting.\n + will now try to keep your device awake while in use.\n\n" +
"06/19/2017: A1.9.5.1\n : Fixed error when attempting to change Dashboard in settings.\n\n" +
"06/22/2017: A1.9.6.0\n + Added timestamps to Messaging\n + Added Discussion Topics in Messaging.\n\n" +
"06/29/2017: A1.9.6.1\n + Made timestamps in messaging easier to read.\n\n" +
"07/10/2017: B0.1.0.0\n + OS Beta has finally begun development!\n - Removed apps that are abandoned or bloatware: Window Test Application, Test App 2, RD, PNG Saver, Canvas Video Games, The Internet, Mouse Recorder, TI-83+ Simulator, img Editor, Change Calculator, Performance Monitor, Simon, Bug Central, Remote Desktop Host, Remote Desktop Viewer, External Debug, Alternate Mouse Control, Online Debug Connection, File Binary, Jana, and Dark Room.\n : Files app renamed to File Manager to avoid confusion.\n : All filesaving is now local.\n + Support for apps to add folders to USERFILES has been added.\n : Saving files is now different programmatically - just save the file in USERFILES, then invoke apps.savemaster.vars.save() with no arguments to save.\n\n" +
"07/11/2017: B0.1.1.0\n : Changed UI from using ugly purplish colors to sleek black-and-white and inputs, with subtle hints for hovering, clicking, and focus. Affected are buttons, inputs, and textareas.\n : Changed horizontal dividers to look better - works best on white or black backgrounds.\n : Changed the look of the context menu - now looks less ugly and gray, now has sleek feel to it.\n : Changed the display size of most icons - they are now evenly powers of two (16, 32, 64, 128, etc).\n\n" +
"07/12/2017: B0.1.1.1\n + Added application to help me test the UI of the beta.\n : Changed window title bars back to normal, as they were huge before.\n : Changed window caption icons to 32x32 instead of 20x20. The icons now scale cleanly.\n\n" +
"07/16/2017: B0.1.2.0\n : Settings background is now truly black.\n : Fixed color of shadow for context menu.\n : Changed context menu icons.\n\n" +
"07/17/2017: B0.1.2.1\n - Removed local file saving, as it caused issues.\n + Re-added cloud file-saving, as removing it broke the original vision for - a desktop that lives in the Cloud.\n\n" +
"07/23/2017: B0.1.3.0\n + Added rudimentary GTK theme support - use the GTK Conversion app to turn a GTK theme into a compatible theme.\n\n" +
"07/24/2017: B0.1.3.1\n + GTK Theme Converter now removes some lag sources (wildcards ftw) and supports inputs and textareas, as well as selection colors.\n\n" +
"07/31/2017: B0.1.4.0\n + 15 new icons from Nightmare Sphere developer Hasan Shahrier - great job, Hasan! More icons on the way.\n\n" +
"08/05/2017: B0.1.4.1\n + 16 new icons from Nightmare Sphere developer Hasan Shahrier - great job again!\n : Default window background changed - cleaner now.\n - Removed many desktop icons, as at the moment, built-in icons cannot be removed, and it made the screen look cluttered.\n\n" +
"08/07/2017: B0.1.4.2\n + Changed cursor set to KDE Breeze and added open/closed hand for moving and resizing windows.\n : Changed Window Background Image to one that is much more subtle and doesn't distract from content.\n\n" +
"08/08/2017: B0.1.5.0\n + Added new ScreenSaver, Bouncy Ball, which bounces a ball around the screen with realistic(ish) physics.\n : Fixed Settings icon color.\n : Changed default screensaver to Bouncy Ball.\n\n" +
"08/14/2017: B0.1.6.0\n + Added new Modding Tutorials app and a tutorial for making your own NORAA apps.\n : Changed default screensaver back to Hue, as Bouncy Ball had some locking problems. Still have no idea what happened.\n : Changed error message to be a bit less intimidating.\n\n" +
"08/15/2017: B0.1.7.0\n + Added App Information Viewer that allows you to see the full app icon and a help page for an app.\n + Added Help Pages for all built-in apps on the App Information Viewer.\n\n" +
"08/21/2017: B0.1.8.0\n : Changed symbols used in window control buttons, they are now all the same size and are more consistent\n : Fixed setting names in Messaging\n : Fixed Bouncy Ball screensaver and set as default again.\n : Changed default Window Fade Distance to 0.8 from 0.5, it is smoother and less distracting \n + Added password setting in Settings - Information.\n\n" +
"08/22/2017: B0.1.8.1\n + Added support for HiDpi displays in Settings - Screen Resolution\n : Changed CORS proxy to https://cors-anywhere.herokuapp.com/ and NORAA can now answer 'what is' questions again.\n\n" +
"08/23/2017: B0.1.8.2\n : Fixed cutoff of icons on window titlebar\n + Added funny error messages\n : Fixed File Manager UI\n : Fixed JavaScript Console UI\n : Fixed crash in Firefox when typing into alert box\n\n" +
"08/24/2017: B0.1.8.3\n + Added Phosphor screensaver from Linux XScreenSaver and set as default.\n : Fixed screensavers freezing when deactivated by keypress.\n\n" +
"09/08/2017: B0.1.8.4\n : Window titlebar buttons look much cleaner now; font is consistent across devices and looks less like text than a button.\n\n" +
"09/09/2017: B0.1.8.5\n : Fixed close button on notifications\n\n" +
"09/12/2017: B0.1.9.0\n : Updated mobile app to the Beta version of .\n : Updated mobile adaptations to work better. Someone please give feedback if it works right!\n\n" +
"09/21/2017: B0.1.9.1\n + Added touch and clear to Bash Console.\n\n" +
"09/23/2017: B0.1.9.2\n : Fixed Phosphor screensaver.\n\n" +
"10/05/2017: B0.2.0.0\n + Taskbar Widgets! All right-side content of taskbar is now Widgets. This is a major update and a major improvement over the old style.\n\n" +
"10/06/2017: B0.2.1.0\n + Added Network Widget\n : Fixed positioning of context menu when screen is scaled\n : Fixed position of moving windows when screen is scaled.\n + Added new folder to File Explorer for the new taskbar widgets, so their source can be explored just like apps.\n : Fixed cursor style issues in Files Explorer.\n : Fixed some horribly inefficient code in text editor.\n\n" +
"10/07/2017: B0.2.2.0\n + Added CPU load widget; every piece of the original taskbar is now available again.\n\n" +
"10/21/2017: B0.2.2.1\n : Fixed a bug with moving windows caused by screen scaling.\n\n" +
"11/11/2017: B0.2.2.2\n - Removed annoying false error prompt from music visualizer.\n\n" +
"11/16/2017: B0.2.2.3\n : Easier to use notifications, when closing notification and another is waiting, it slides out and back in so you can tell there are more.\n + Minor spam protection in Messaging.\n\n" +
"01/01/2018: B0.2.2.4\n : Images added to Messaging now have 3px padding around them.\n\n" +
"01/10/2018: B0.2.2.5\n : Changed description in GRUB from Unstable to Current.\n\n" +
"01/20/2018: B0.2.2.6\n : Made the method of forcing https more efficient.\n\n" +
"01/24/2018: B0.2.3.0\n + Added menu for Battery Widget.\n : Finally fixed bug where windows disappear if you click on other windows too many times. It should be impossible now.\n + Laid groundwork for new Mobile Mode. Very unstable so far, so disabled.\n\n" +
"01/26/2018: B0.2.3.1\n : Fixed size of icons in Android, Aero, and Wisker dashboards so that they are readable with the new icons.\n : Fixed the scrollbar in the Dashboard so it does not disappear if the list gets too short during a search.",
oldVersions: " has undergone many stages of development. Here\'s all older versions I've been able to recover.\nV0.9 https:///_old_index.php\nA1.2.5 https:///_backup/index.1.php\nA1.2.6 http://.epizy.com/.php\nA1.2.9.1 https:///_backup/index9_25_16.php\nA1.4 https:///_backup/"
}; //changelog: (using this comment to make changelog easier for me to find)
window.version = 'B0.2.3.1 (01/26/2017)';
document.title = ' ' + version;
getId('loadingInfo').innerHTML = 'Initializing Properties Viewer';
});
c(function(){
m('init PPT');
apps.properties = new Application(
"PPT",
"Properties Viewer",
1,
function(launchtype, fileToOpen){
getId('winPPTh').style.overflow = 'auto';
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 200, parseInt(getId('desktop').style.height, 10) / 2 - 250, 400, 500, 1);
}
this.appWindow.setCaption('Properties Viewer');
if(launchtype !== 'openFile' && launchtype !== 'tskbr'){
this.appWindow.setContent('This app is intended for use with the Files app. Please right-click a file in that app, and select "Properties".');
}else if(launchtype !== 'tskbr'){
this.appWindow.setCaption(fileToOpen.split('.')[fileToOpen.split('.').length - 1] + ' Properties');
this.appWindow.setContent(
'<div style="font-family:ProFont, monospace;font-size:12px; width:100%; overflow:visible">' +
'<span style="font-size:36px;">' + fileToOpen.split('.')[fileToOpen.split('.').length - 1] + '</span><br>' +
'<span style="font-size:24px;">' + apps.files.vars.filetype(typeof eval(fileToOpen)) + '</span><br><br><br>' +
function(file){
if(file.indexOf('USERFILES.') === 0){
if(file.split('.')[file.split('.').length - 1].indexOf('APP_') === 0){
return 'Claims association with app ' + file.split('.')[file.split('.').length - 1].split('_')[1] + '.<br><br>';
}else if(file.indexOf('USERFILES.DSKTP_ico_app') === 0){
return 'This file determines the position of an icon called ' + file.split('_app')[1] + ' on the desktop.<br><br>';
}else if(file.indexOf('USERFILES.NORAA_') === 0){
return 'This file claims to represent some memory of NORAA\'s.<br><br>';
}else if(file.indexOf('USERFILES.APM_APPS_DATABASE_') === 0){
return 'This file is representative of a user-made application called ' + file.split('APM_APPS_DATABASE_')[1] + '.<br><br>';
}else if(file === 'USERFILES.password'){
return 'This is the password used when signing into this copy of from another. DO NOT RELEASE THE CONTENTS OF THIS FILE TO THE PUBLIC!<br><br>';
}else{
return 'File does not claim association with an app.<br><br>';
}
}else if(file.indexOf('apps') === 0){
return 'Belongs to app ' + file.split('.')[1] + '.<br><br>';
}else{
return 'File does not claim association with an app.<br><br>';
}
}(fileToOpen) +
'File Location: ' + fileToOpen + '<br>&nbsp;- ' + fileToOpen.split('.').join('<br>&nbsp;- ') + '<br><br>' +
function(file){
if(apps.files.vars.filetype(typeof eval(file)) === 'folder'){
return 'Items in Folder: ' +
function(fil){
var counting = 0;
for(var i in fil){
counting++;
}
return counting;
}(eval(file)) + '<br>Size of Folder: <button id="PPTcalcfoldsize" onclick="apps.properties.vars.calcFold(' + file + ')">Calculate</button><br><br>';
}else{
apps.properties.vars.tmpNum = String(eval(file)).length;
apps.properties.vars.tmpTry = 0;
apps.properties.vars.tmpNmb = apps.properties.vars.tmpNum;
while(apps.properties.vars.tmpNum >= 1000){
apps.properties.vars.tmpNum = Math.round(apps.properties.vars.tmpNum / 1000);
apps.properties.vars.tmpTry++;
}
apps.properties.vars.tmpStr = apps.properties.vars.tmpByt[apps.properties.vars.tmpTry];
if(apps.properties.vars.tmpTry !== 0){
apps.properties.vars.tmpStr += apps.properties.vars.tmpNmb + ' Bytes)';
}
return 'File Size: ~ ' + apps.properties.vars.tmpNum + apps.properties.vars.tmpStr + '<br><br>';
}
}(fileToOpen) +
'</div>'
);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
if(this.vars.counting){
apps.prompt.vars.alert('Please don\'t close the window until it is done counting.', 'Oh, I nearly broke stuff.', function(){}, 'Properties');
}else{
this.appWindow.closeWindow();
this.appWindow.setContent("");
}
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app is used to view file properties in the File Manager.',
tmpNum: 0,
tmpByt: [' Bytes', 'KB (', 'MB (', 'GB ('],
tmpTry: 0,
tmpStr: ' Bytes',
counting: 0,
lastCount: 0,
lastFile: {},
calcFold: function(fname){
this.counting = 1;
this.lastCount = 0;
getId('PPTcalcfoldsize').outerHTML = '~ <span id="PPTcalcfoldsize">0</span> Bytes';
this.lastFile = eval(fname);
for(var i in this.lastFile){
if(this.lastFile[i] !== undefined){
c(function(number){
apps.properties.vars.lastCount += number;
getId('PPTcalcfoldsize').innerHTML = apps.properties.vars.lastCount;
}, String(this.lastFile[i]).length);
}
}
c(function(){apps.properties.vars.counting = 0;});
}
}, 2, "properties", "/appicons/ds/PPT.png"
);
getId('loadingInfo').innerHTML = 'Initializing File Manager';
});
c(function(){
m('init FIL');
apps.files = new Application(
"FIL",
"File Manager",
1,
function(launchType){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 350, parseInt(getId('desktop').style.height, 10) / 2 - 200, 700, 400, 1);
}
this.appWindow.setCaption("File Explorer");
this.appWindow.openWindow();
if(launchType === 'dsktp'){
this.vars.currLoc = '';
getId('winFILh').style.background = "none";
this.appWindow.setContent(
'<div id="FILtopdiv" style="width:694px; height:25px;">' +
'<div class="cursorPointer" style="width:34px; height:18px; padding-top:2px; left:5px; top:4px; background-color:#FFF; color:#333; border-top-left-radius:10px; border-bottom-left-radius:10px; text-align:center;" onClick="apps.files.vars.back()">&larr;&nbsp;</div>' +
'<div class="cursorPointer" style="width:24px; border-left:1px solid #333; height:18px; padding-top:2px; left:30px; top:4px; background-color:#FFF; color:#333; border-top-left-radius:10px; border-bottom-left-radius:10px; text-align:center;" onClick="apps.files.vars.home()">H</div>' +
'<div class="cursorPointer" style="width:24px; height:18px; padding-top:2px; right:6px; top:4px; background-color:#FFF; color:#333; border-top-right-radius:10px; border-bottom-right-radius:10px; text-align:center;" onClick="apps.files.vars.update()">?</div>' +
'</div>' +
'<div style="width:694px; height:368px; top:25px; background-color:#FFF; overflow:scroll; background-repeat:no-repeat; background-position:center" id="FILcntn"></div>' +
'<div id="FILpath" style="left:55px; background-color:#FFF; font-family:monospace; height:' + (25 + scrollHeight) + 'px; line-height:25px; vertical-align:middle; width:609px; border-top-left-radius:5px; border-top-right-radius:5px; overflow-x:scroll;"><div id="FILgreen" style="width:0;height:100%;"></div>this.is.a.file.path.example.for.the.thingy.and.it.is.very.useful.because.it.tells.you.where.you.are.in.the.thing</div>'
);
}
if(typeof this.appWindow.dimsSet !== 'function'){
this.appWindow.dimsSet = function(){
getId('FILtopdiv').style.width = this.windowH - 6 + 'px';
getId('FILcntn').style.width = this.windowH - 6 + 'px';
getId('FILcntn').style.height = this.windowV - 32 + 'px';
getId('FILpath').style.width = this.windowH - 91 + 'px';
getId('FILtbl').style.width = this.windowH - 5 - scrollHeight + 'px';
};
}
this.vars.update();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
if(getId("FILgreen").style.backgroundColor !== "rgb(170, 255, 170)"){
this.appWindow.closeWindow();
this.appWindow.setContent("");
}else{
apps.prompt.vars.alert('Please allow Files to finish searching the current folder.', 'Oops, I almost broke stuff.', function(){}, 'Files');
}
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'The official OS File Manager. Use it to manage your personal files and to view code. At the moment, only plain-text userfiles are supported.',
currLoc: '',
back: function(){
this.currLoc = this.currLoc.split(".");
this.currLoc.pop();
this.currLoc = this.currLoc.join(".");
this.update();
},
home: function(){
this.currLoc = '';
this.update();
},
next: function(nextName){
if(getId("FILgreen").style.backgroundColor !== "rgb(170, 255, 170)"){
if(this.currLoc === ''){
this.currLoc = nextName;
}else{
this.currLoc += "." + nextName;
}
this.update();
}else{
apps.prompt.vars.alert('Please allow Files to finish searching the current folder.', 'Oops, I almost broke stuff.', function(){}, 'Files');
}
},
filetype: function(type){
switch(type){
case 'object':
return 'folder';
case 'string':
return 'text';
case 'function':
return 'code';
case 'boolean':
return 'T/F';
case 'undefined':
return 'nothing';
case 'number':
return 'value';
default:
return type;
}
},
currTotal: 0,
currItem: 0,
currEffect: 0,
currContentStr: '',
update: function(){
this.currContentStr = '';
getId("FILgreen").style.backgroundColor = 'rgb(170, 255, 170)';
getId("FILgreen").style.width = "0";
getId("FILcntn").style.backgroundImage = 'url(/loadDark.gif)';
// getId("FILcntn").style.cursor = cursors.loadDark;
getId('FILcntn').classList.add('cursorLoadDark');
getId("FILcntn").innerHTML =
'<table id="FILtbl" style="width:' + (apps.files.appWindow.windowH - 5 - scrollHeight) + 'px; position:absolute; top:' + scrollHeight + 'px; margin:auto; font-family:monospace;">' +
'<tr>' +
'<th>Filename</th>' +
'<th>Filetype</th>' +
'</tr>' +
'</table>';
getId("FILtbl").style.marginTop = scrollHeight;
if(this.currLoc === ''){
getId("FILpath").innerHTML = '<div id="FILgreen" style="height:100%;background-color:rgb(170, 255, 170)"></div>';
getId("FILtbl").innerHTML +=
'<tr class="cursorPointer" onClick="apps.files.vars.next(\'files\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'files\\\');toTop(apps.properties)\'])">' +
'<td>files</td>' +
'<td>folder</td>' +
'</tr><tr class="cursorPointer" onClick="apps.files.vars.next(\'apps\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'apps\\\');toTop(apps.properties)\'])">' +
'<td>apps</td>' +
'<td>folder</td>' +
'</tr><tr class="cursorPointer" onClick="apps.files.vars.next(\'widgets\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'widgets\\\');toTop(apps.properties)\'])">' +
'<td>widgets</td>' +
'<td>folder</td>' +
'</tr><tr class="cursorPointer" onClick="apps.files.vars.next(\'USERFILES\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'USERFILES\\\');toTop(apps.properties)\'])">' +
'<td>USERFILES</td>' +
'<td>folder</td>' +
function(){
if(apps.settings.vars.FILcanWin){
return '</tr><tr class="cursorPointer" onClick="apps.files.vars.next(\'window\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'window\\\');toTop(apps.properties)\'])">' +
'<td style="color:#F00">Everything</td>' +
'<td>Debug</td>';
}else{
return '';
}
}() +
'</tr>';
}else{
getId("FILpath").innerHTML = '<div id="FILgreen" class="liveElement" liveTarget="style.width" liveVar="apps.files.vars.currItem/apps.files.vars.currTotal*100+\'%\'" style="height:100%;background-color:rgb(170, 255, 170);box-shadow:0 0 20px 10px rgb(170, 255, 170)"></div><div>' + this.currLoc + '</div>';
this.currTotal = objLength(eval(this.currLoc));
this.currItem = 0;
for(var findElem in eval(this.currLoc)){
if(typeof(eval(this.currLoc)[findElem]) === "string" || typeof(eval(this.currLoc)[findElem]) === "number" || typeof(eval(this.currLoc)[findElem]) === "function" || typeof(eval(this.currLoc)[findElem]) === "boolean" || typeof(eval(this.currLoc)[findElem]) === "undefined"){
if((this.currLoc + "." + findElem).substring(0, 20) !== "USERFILES.MOUSEDATA_"){
if(this.currLoc === "USERFILES"){
c(function(arg){
//getId("FILtbl").innerHTML +=
apps.files.vars.currContentStr +=
'<tr class="cursorPointer" onClick="openapp(apps.notepad, \'open\');apps.notepad.vars.openFile(\'' + arg + '\');requestAnimationFrame(function(){toTop(apps.notepad)})" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\', \'/ctxMenu/beta/x.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'' + apps.files.vars.currLoc + '.' + arg + '\\\');toTop(apps.properties)\', \'+Delete\', \'apps.savemaster.vars.delete(\\\'' + arg + '\\\');\'])">' +
'<td>' + arg + '</td>' +
'<td>' + apps.files.vars.filetype(typeof(eval(apps.files.vars.currLoc)[arg])) + '</td>' +
'</tr>';
apps.files.vars.currItem++;
//getId('FILgreen').style.width = Math.floor(apps.files.vars.currItem / apps.files.vars.currTotal * 100) + "%";
}, findElem);
}else{
c(function(arg){
// getId("FILtbl").innerHTML +=
apps.files.vars.currContentStr +=
'<tr class="cursorPointer" onClick="openapp(apps.notepad, \'open\');apps.notepad.vars.openFile(\'' + apps.files.vars.currLoc + '.' + arg + '\');requestAnimationFrame(function(){toTop(apps.notepad)})" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\', \'/ctxMenu/beta/x.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'' + apps.files.vars.currLoc + '.' + arg + '\\\');toTop(apps.properties)\', \'_Delete\', \'\'])">' +
'<td>' + arg + '</td>' +
'<td>' + apps.files.vars.filetype(typeof(eval(apps.files.vars.currLoc)[arg])) + '</td>' +
'</tr>';
apps.files.vars.currItem++;
//getId('FILgreen').style.width = Math.floor(apps.files.vars.currItem / apps.files.vars.currTotal * 100) + "%";
}, findElem);
}
}
}else{
if(this.currLoc === "apps"){
c(function(arg){
// getId("FILtbl").innerHTML +=
apps.files.vars.currContentStr +=
'<tr class="cursorPointer" onClick="apps.files.vars.next(\'' + arg + '\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/window.png\', \'/ctxMenu/beta/file.png\', \'\'], \' Launch App\', \'openapp(apps.' + arg + ', \\\'dsktp\\\')\', \'+Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'' + apps.files.vars.currLoc + '.' + arg + '\\\');toTop(apps.properties)\'])">' +
'<td>' + arg + '</td>' +
'<td>' + apps.files.vars.filetype(typeof(eval(apps.files.vars.currLoc)[arg])) + '</td>' +
'</tr>';
apps.files.vars.currItem++;
//getId('FILgreen').style.width = Math.floor(apps.files.vars.currItem / apps.files.vars.currTotal * 100) + "%";
}, findElem);
}else{
c(function(arg){
// getId("FILtbl").innerHTML +=
apps.files.vars.currContentStr +=
'<tr class="cursorPointer" onClick="apps.files.vars.next(\'' + arg + '\')" oncontextmenu="ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/file.png\', \'/ctxMenu/beta/x.png\'], \' Properties\', \'apps.properties.main(\\\'openFile\\\', \\\'' + apps.files.vars.currLoc + '.' + arg + '\\\');toTop(apps.properties)\', \'_Delete\', \'\'])">' +
'<td>' + arg + '</td>' +
'<td>' + apps.files.vars.filetype(typeof(eval(apps.files.vars.currLoc)[arg])) + '</td>' +
'</tr>';
apps.files.vars.currItem++;
//getId('FILgreen').style.width = Math.floor(apps.files.vars.currItem / apps.files.vars.currTotal * 100) + "%";
}, findElem);
}
}
}
}
c(function(){getId('FILtbl').innerHTML += apps.files.vars.currContentStr;getId("FILgreen").className = '';getId('FILgreen').style.backgroundColor = "#FFF";getId("FILgreen").style.display = "none";getId("FILcntn").style.backgroundImage="";getId('FILcntn').classList.remove('cursorLoadDark')});
}
}, 0, "files", "/appicons/ds/FIL.png"
);
getId('loadingInfo').innerHTML = 'Initializing Changelog';
});
c(function(){
apps.changelog = new Application(
"CLg",
"Changelog",
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 350, parseInt(getId('desktop').style.height, 10) / 2 - 200, 700, 400, 1);
this.appWindow.setCaption("Changelog");
this.vars.cLogSplit = files.changelog.split('\n\n');
for(var i in this.vars.cLogSplit){
this.vars.cLogSplit[i] = this.vars.cLogSplit[i].split('\n ');
}
this.vars.cLogHTML = '';
for(var i in this.vars.cLogSplit){
this.vars.cLogHTML += '<p class="changeLogTitle">' + this.vars.cLogSplit[i][0].split(': ')[1] + '</p><p class="changeLogDate">' + this.vars.cLogSplit[i][0].split(': ')[0] + '</p>';
for(var j = 1; j < this.vars.cLogSplit[i].length; j++){
if(this.vars.cLogSplit[i][j][0] === '+'){
this.vars.cLogHTML += '<p class="changeLogAddition">' + this.vars.cLogSplit[i][j].substring(2, this.vars.cLogSplit[i][j].length) + '</p>';
}else if(this.vars.cLogSplit[i][j][0] === ':'){
this.vars.cLogHTML += '<p class="changeLogTweak">' + this.vars.cLogSplit[i][j].substring(2, this.vars.cLogSplit[i][j].length) + '</p>';
}else if(this.vars.cLogSplit[i][j][0] === '-'){
this.vars.cLogHTML += '<p class="changeLogRemoval">' + this.vars.cLogSplit[i][j].substring(2, this.vars.cLogSplit[i][j].length) + '</p>';
}else{
this.vars.cLogHTML += '<p class="changeLogUnknown">' + this.vars.cLogSplit[i][j].substring(2, this.vars.cLogSplit[i][j].length) + '</p>';
}
}
}
getId('winCLgh').style.overflow = 'auto';
this.appWindow.setContent(this.vars.cLogHTML);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.vars.currGame = '';
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This is the official changelog for OS. It lists all versions from the point of its creation up until the current running version.',
cLogSplit: [],
cLogHTML: ''
}, 1, "changelog", "/appicons/ds/CLg.png"
);
getId('loadingInfo').innerHTML = 'Initializing Flash Cards';
});
c(function(){
m('init FC');
apps.flashCards = new Application(
"FC",
"Flash Cards",
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 350, parseInt(getId('desktop').style.height, 10) / 2 - 200, 700, 400, 1);
this.appWindow.setCaption("Flash Cards");
this.appWindow.setContent(
'Type the name of a flashcard set:<br>' +
'<input id="appFCinput"> <button onclick="apps.flashCards.vars.chooseSet()">Start</button><hr>' +
'How to create a flashcard set:<br>' +
'Using text editor, save your set of flashcards as follows:<br>' +
'Card 1, Answer 1, Image URL 1<br>Card 2, Answer 2, Image URL 2<br>etc...<br><br>' +
'The filename you save it under is the one you use to access it in this app.'
);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.vars.currGame = '';
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app lets you create sets of flash cards to be quizzed on.',
currentName: '',
currentCard: 0,
correct: 0,
chooseSet: function(){
this.currentName = getId('appFCinput').value;
this.buffer = [];
this.currentSet = [];
this.workingSet = [];
if(USERFILES[this.currentName]){
this.buffer = USERFILES[this.currentName].split('\n');
for(var i in this.buffer){
this.currentSet.push(this.buffer[i].split(','));
}
apps.flashCards.appWindow.setContent(
'<div id="appFCbg" style="text-align:center;font-family:ProFont;font-size:24px;width:100%;height:100%;background-position:center;background-size:contain;background-repeat:no-repeat;">' +
'<div id="appFCinfo" style="right:8px;top:8px;color:#7F7F7F;"></div>' +
'<br><br><span id="appFCquestion"></span><br><br><input id="appFCanswer"><br>' +
'<button onclick="apps.flashCards.vars.showAnswer()">Check Answer</button>' +
'</div>'
);
this.startGame();
}else{
apps.prompt.vars.alert('This file was not found.<br>Check that your flash card file name is correct.', 'Okay.', function(){}, 'Flash Cards');
}
},
startGame: function(){
this.workingSet = [...this.currentSet;
]
this.correct = 0;
this.chooseCard(1);
},
chooseCard: function(start){
if(!start){
apps.flashCards.vars.workingSet.splice(apps.flashCards.vars.currentCard, 1);
}
if(apps.flashCards.vars.workingSet.length > 0){
apps.flashCards.vars.currentCard = Math.floor(Math.random() * apps.flashCards.vars.workingSet.length);
getId('appFCanswer').value = '';
getId('appFCquestion').innerHTML = apps.flashCards.vars.workingSet[apps.flashCards.vars.currentCard][0];
getId('appFCinfo').innerHTML = 'Remaining: ' + apps.flashCards.vars.workingSet.length + ' / ' + apps.flashCards.vars.currentSet.length + '<br>Correct: ' + apps.flashCards.vars.correct + ' / ' + apps.flashCards.vars.currentSet.length;
getId('appFCbg').style.backgroundImage = 'url(' + apps.flashCards.vars.workingSet[apps.flashCards.vars.currentCard][2] + ')';
}else{
apps.prompt.vars.alert('Final score is ' + apps.flashCards.vars.correct + ' / ' + apps.flashCards.vars.currentSet.length + '.', 'Ok', function(){
apps.flashCards.vars.startGame();
}, 'Flash Cards');
}
},
showAnswer: function(){
if(getId('appFCanswer').value === this.workingSet[this.currentCard][1].trim()){
getId('appFCquestion').innerHTML += '<br>Correct!<br>Next card in 5 seconds';
setTimeout(this.chooseCard, 5000);
this.correct++;
getId('appFCinfo').innerHTML = 'Remaining: ' + this.workingSet.length + ' / ' + this.currentSet.length + '<br>Correct: ' + this.correct + ' / ' + this.currentSet.length;
}else{
getId('appFCquestion').innerHTML += '<br>Wrong!<br>Next card in 5 seconds<br>Correct answer: ' + this.workingSet[this.currentCard][1];
setTimeout(this.chooseCard, 5000);
}
}
}, 1, "flashCards"
);
getId('loadingInfo').innerHTML = 'Initializing Windowblur Test';
});
c(function(){
m('init WbT');
apps.aerotest = new Application(
"WbT",
"Windowblur Test",
0,
function(){
this.appWindow.setCaption("Windowblur Performance Test Window");
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 200, parseInt(getId('desktop').style.height, 10) / 2 - 150, 400, 300);
}
//this.appWindow.setContent('<button onClick="apps.aerotest.appWindow.setDims(50, 50, prompt(\'New window width?\'), prompt(\'New window height?\'))">Change Window Size</button>');
getId("winWbTh").style.background = "none";
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This application is used for testing the performance and effect quality of WindowBlur. This app is great for testing or playing with new window colors and background blend modes.'
}, 2, "aerotest", "/appicons/WbT.png"
);
getId('loadingInfo').innerHTML = 'Initializing File Saving System';
});
c(function(){
window.SRVRKEYWORD = "";
m('init SAV');
/*var cansaveyet = 0;
window.setTimeout(function(){cansaveyet = 1}, 500);*/
apps.savemaster = new Application(
"SAV",
"SaveMaster",
0,
function(launchtype){
this.appWindow.setCaption("SaveMaster");
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 300, parseInt(getId('desktop').style.height, 10) / 2 - 25, 600, 50);
}
this.appWindow.setContent("This is useless unless you are an app developer. Please don't.");
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "save":
getId("mastersaveframe").src = "filesaver.php/?k=" + SRVRKEYWORD + "&f=" + this.vars.sp + "&c=" + this.vars.sc;
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This application handles all file saving over the Cloud to the OS server. It is only accessible via API to apps.',
sp: "",
sc: "",
saving: 0,
xf: {},
//xhttp: new XMLHttpRequest(),
//fd: new FormData(),
savePerf: 0,
save: function(filepath, filecontent, newformat, errorreport, pass){
m('Saving File');
d(1, 'Saving File ' + filepath);
if(window.navigator.onLine){
this.savePerf = Math.floor(performance.now());
if(!newformat){
getId("mastersaveframe").src = "filesaver.php/?k=" + SRVRKEYWORD + "&f=" + filepath + "&c=" + filecontent;
}else{
this.saving = 2;
taskbarShowHardware();
if(errorreport === 'ERROR_REPORT'){
//getId("mastersaveframediv").innerHTML = '<iframe id="mastersaveframe" name="mastersaveframe"></iframe><form action="filesavernew.php/?error=error" method="POST" target="mastersaveframe" id="mastersaveform"><input name="k" value="' + SRVRKEYWORD + '"><input name="f" value="' + filepath + '"><textarea name="c">' + filecontent + '</textarea><input type="submit" id="savesubmit"></form>';
this.xf['fd' + this.savePerf] = new FormData();
this.xf['fd' + this.savePerf].append('k', SRVRKEYWORD);
this.xf['fd' + this.savePerf].append('f', filepath);
this.xf['fd' + this.savePerf].append('c', filecontent);
this.xf['xhttp' + this.savePerf] = new XMLHttpRequest();
this.xf['xhttp' + this.savePerf].onreadystatechange = function(){
if(apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
};
this.xf['xhttp' + this.savePerf].open('POST', 'filesavernew.php/?error=error');
this.xf['xhttp' + this.savePerf].send(this.xf['fd' + this.savePerf]);
USERFILES[filepath] = '' + filecontent;
}else if(errorreport === 'RDP'){
this.xf['fd' + this.savePerf] = new FormData();
this.xf['fd' + this.savePerf].append('k', SRVRKEYWORD);
this.xf['fd' + this.savePerf].append('f', filepath);
this.xf['fd' + this.savePerf].append('c', filecontent);
this.xf['xhttp' + this.savePerf] = new XMLHttpRequest();
this.xf['xhttp' + this.savePerf].onreadystatechange = function(){
if(apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
};
this.xf['xhttp' + this.savePerf].open('POST', 'filesavernew.php/?rdp=rdp');
this.xf['xhttp' + this.savePerf].send(this.xf['fd' + this.savePerf]);
}else if(errorreport === 'mUname'){
this.xf['fd' + this.savePerf] = new FormData();
this.xf['fd' + this.savePerf].append('k', SRVRKEYWORD);
this.xf['fd' + this.savePerf].append('f', filepath);
this.xf['fd' + this.savePerf].append('c', filecontent);
this.xf['xhttp' + this.savePerf] = new XMLHttpRequest();
this.xf['xhttp' + this.savePerf].onreadystatechange = function(){
if(apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
};
this.xf['xhttp' + this.savePerf].open('POST', 'filesavernew.php/?mUname=mUname&pass=' + pass.split('?').join('X').split('&').join('X'));
this.xf['xhttp' + this.savePerf].send(this.xf['fd' + this.savePerf]);
USERFILES[filepath] = '' + filecontent;
}else{
//getId("mastersaveframediv").innerHTML = '<iframe id="mastersaveframe" name="mastersaveframe"></iframe><form action="filesavernew.php" method="POST" target="mastersaveframe" id="mastersaveform"><input name="k" value="' + SRVRKEYWORD + '"><input name="f" value="' + filepath + '"><textarea name="c">' + filecontent + '</textarea><input type="submit" id="savesubmit"></form>';
this.xf['fd' + this.savePerf] = new FormData();
this.xf['fd' + this.savePerf].append('k', SRVRKEYWORD);
this.xf['fd' + this.savePerf].append('f', filepath);
this.xf['fd' + this.savePerf].append('c', filecontent);
this.xf['xhttp' + this.savePerf] = new XMLHttpRequest();
this.xf['xhttp' + this.savePerf].onreadystatechange = function(){
if(apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
};
this.xf['xhttp' + this.savePerf].open('POST', 'filesavernew.php');
this.xf['xhttp' + this.savePerf].send(this.xf['fd' + this.savePerf]);
USERFILES[filepath] = '' + filecontent;
}
//document.getElementById("mastersaveform").submit();
}
}else{
doLog('Tried to save file ' + filepath + ' but the browser says we are offline.');
}
m(modulelast);
},
latestDel: '',
delete: function(filepath){
this.savePerf = Math.floor(performance.now());
this.latestDel = '';
if(vartry('apps.savemaster.vars.delete.caller.name').indexOf('-' + lang('', 'failedVarTry') + ' vartry(apps.savemaster.vars.delete.caller.name)') < 0){
this.latestDel += 'A function named "' + apps.savemaster.vars.delete.caller.name + '" ';
}else{
this.latestDel += 'An anonymous function ';
}
if(vartry('event.type').indexOf('-failed vartry(event.type)') < 0){
this.latestDel += 'from a "' + event.type + '" event';
}else{
this.latestDel += 'with no defined event trigger';
}
apps.prompt.vars.confirm(this.latestDel + ' wants to permanantly delete the file ' + filepath + '. Do you give permission to delete the file? This cannot be undone.', ['No, do nothing', 'Yes, delete file'], function(btn){
if(btn){
apps.savemaster.vars.saving = 2;
taskbarShowHardware();
apps.savemaster.vars.xf['fd' + apps.savemaster.vars.savePerf] = new FormData();
apps.savemaster.vars.xf['fd' + apps.savemaster.vars.savePerf].append('k', SRVRKEYWORD);
apps.savemaster.vars.xf['fd' + apps.savemaster.vars.savePerf].append('f', filepath);
apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf] = new XMLHttpRequest();
apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].onreadystatechange = function(){
if(apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
};
apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].open('POST', 'filedeleter.php');
apps.savemaster.vars.xf['xhttp' + apps.savemaster.vars.savePerf].send(apps.savemaster.vars.xf['fd' + apps.savemaster.vars.savePerf]);
delete USERFILES[filepath];
}
});
}
}, 2, "savemaster", "/appicons/ds/SAV.png"
);
getId('loadingInfo').innerHTML = 'Initializing API';
});
c(function(){
m('init API');
apps.appAPI = new Application(
"API",
" API",
0,
function(){
this.appWindow.setCaption(" API Documentation");
this.appWindow.setContent('<div id="appAPIdiv"></div>');
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 300, parseInt(getId('desktop').style.height, 10) / 2 - 200, 600, 400);
}
getId('winAPIh').style.overflow = 'scroll';
this.appWindow.openWindow();
this.vars.showDocumentation();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app attempts to document many API features. However, a better API Documentation can be found in the Help App.',
newdoc: function(code, example, description){
getId('appAPIdiv').innerHTML += '<hr><span style="font-size:24px;font-family:ProFont, monospace">' + code + '</span><p style="margin-left:8px; border-radius:5px; padding:3px; border-left:1px solid #000; font-family:ProFont, monospace;font-size:12px;">' + example + '</p>' + description;
},
showDocumentation: function(){
/*
c(function(){apps.appAPI.vars.newdoc(
'',
'',
''
);});
*/
c(function(){apps.appAPI.vars.newdoc(
' function or variable',
'Example of usage',
'Description of its purpose and what it does'
);});
c(function(){apps.appAPI.vars.newdoc(
'getId(target);',
'getId("myDiv");<br>//returns element with ID "myDiv"',
'All this does is return document.getElementById(target). Think of it as shorthand, as document.getElementById is a lot to type over and over again.'
);});
c(function(){apps.appAPI.vars.newdoc(
'formDate(dateString)',
'formDate("d- M-/D-/y- h-:m-:S")<br>//returns (in this case) "' + formDate("d- M-/D-/y- h-:m-:S") + '"',
'Sends a date and/or time in string format. All(?) of the supported time formats are accessed by using the lower- or upper-case version of its first letter.<br>To get minutes, use "m". To get months, use "M". This is because months are bigger than minutes and therefore uses a bigger letter.<br>Seconds uses "S" and milliseconds uses "s".<br>Some of them use the format of lowercase being a shorthand of the thing. For instance, "y" outputs ' + formDate("y") + ' and "Y" outputs ' + formDate("Y") +
'.<br>One exception is days, where "d- D" outputs ' + formDate("d- D") + '.<br>You may use a "-" in the same way that a "\\" is used in JavaScript.<br>If you must include a space or slash or the actual letter "Y", without it being formatted into the year, make it look like "-Y" instead of just "Y".'
);});
c(function(){apps.appAPI.vars.newdoc(
'this.vars // from main function or signal handler<br>this // from your app\'s vars<br>apps.YOURAPPCODENAME.vars',
'[one of the vars above].YOURVARIABLE',
'This is the object where the variables for your app are stored. There are several ways to access your apps variables.<br>When accessing app vars from inside your main function or signal handler, use <b>this.vars</b><br>When accessing app vars from inside one of your apps own variables (like a function), use <b>this</b><br>When accessing from outside of the target apps vars or from inside a timeout or interval, use <b>apps.YOURAPPCODENAME.vars</b><br>If you\'re unsure of where the code will be running from or want to be safe, <b>apps.YOURAPPCODENAME.vars will always work, no matter what.'
);});
c(function(){apps.appAPI.vars.newdoc(
'this.appWindow.setDims(x, y, w, h)<br>this.appWindow.setCaption(windowCaption)<br>this.appWindow.setContent(windowContent)<br>this.appWindow.openWindow()',
'this.appWindow.setDims(20, 20, 500, 400) //sets app x/y location to (20, 20) and width/height to (500, 400)<br>this.appWindow.setCaption("awesome window") //sets the name of your window<br>this.appWindow.setContent("some awesome content") //sets content of your app window, in HTML<br>this.appWindow.openWindow() //opens window',
'When setting dims, remember that the number you give INCLUDES the title bar and borders of the window. The width of the sides of the border are 6px total, and the width of the top and bottom border are 24px total.<br>If your window has an icon, it will always be displayed before your caption. If not, your app\'s text icon will.<br>this.appWindow.setContent("text") is the same as calling <b>getId("win" + YOURAPPICON + "h").innerHTML = "text"</b><br>When opening your window, ensure the dims and caption were manually set. If they were not, then default settings will be used and things may break.'
);});
c(function(){apps.appAPI.vars.newdoc(
'requestAnimationFrameIntact<br>windowperformancenowIntact',
'requestAnimationFrameIntact<br>windowperformancenowIntact',
'Whether or not window.requestAnimationFrame or window.performance.now are supported by the browser, as true/false values.'
);});
c(function(){apps.appAPI.vars.newdoc(
'vartry(variableAsString)',
'vartry(\'document.getElementById("notAnElement").style.display\');',
'Useful for if theres a variable that may cause errors upon read. If the variable exists, it returns the variable. If an error is thrown, a safe error string is returned instead of a script-breaking error.<br>Example: -failed vartry(document.getElementById("notAnElement").style.display) TypeError: Cannot read property \'style\' of null-'
);});
c(function(){apps.appAPI.vars.newdoc(
'numtf(zeroOrOne)',
'numtf(1) // returns true<br>numtf(0) //returns false',
'Useful for if you have true/false indicators of 1 or 0, but want to quickly display them as "true" or "false" to the user, or need an actual boolean.'
);});
c(function(){apps.appAPI.vars.newdoc(
'textspeech(message)',
'textspeech("Hello World")',
'Has NORAA speak some text, if supported by the browser. If not supported, it does not work.'
);});
c(function(){apps.appAPI.vars.newdoc(
'USERFILES',
'USERFILES.persistentFile',
'This is the home of the user\'s personal files. Simply setting something in here is not enough, as the next function will show...'
);});
c(function(){apps.appAPI.vars.newdoc(
'apps.savemaster.vars.save(filename, filecontent, savetype)',
'apps.savemaster.vars.save("persistentFile", "This is the files content as a string", 1)',
'This is how we save persistent files on . Keep in mind that a working internet connection must be available, and we <span style="text-decoration:line-through">CANNOT</span> can, as of A1.2.8, save more than one file at once. <span style="text-decoration:line-through">You must wait some time before saving the next one to allow the previous to finish saving.</span> Ensure the name of the file does not break JavaScript variable naming rules, and that the third argument is ALWAYS the number 1. The only working savetype is 1 and if you forget to include it, your file will not be saved.'
);});
c(function(){apps.appAPI.vars.newdoc(
'apps.savemaster.vars.delete(filename)',
'apps.savemaster.vars.delete("persistentFile")',
'This will delete a file from the USERFILES folder. Keep in mind that the user will ALWAYS be asked for permission and, as such, it will take time to do. My recommendation is to include each separate file to delete as a separate button, as there is no telling how long the user will take.'
);});
c(function(){apps.appAPI.vars.newdoc(
'Live Elements',
'&lt;span class="liveElement" liveVar="Date()"&gt;&lt;/span&gt; // => <span class="liveElement" liveVar="Date()"></span>',
'A Live Element is any HTML element that will have its innerHTML constantly kept up-to-date with a given variable. Variables or expressions can be included within. class="liveElement" is what tells the LiveElement engine to watch your element and keep it up to date. liveVar="something" is the variable or expression that LiveElement will update the innerHTML of the element to. I recommend using &lt;span&gt; elements, but you can theoretically use any element that supports innerHTML.'
);});
c(function(){apps.appAPI.vars.newdoc(
'm(message);',
'm("risky function")',
'The Module system (the function called m) is an easy debug system. Because JavaScript tends to lose where you are in a script file, you can use m("message") just before a risky function, and the OS will report what module was last reported, should an error occour.'
);});
c(function(){apps.appAPI.vars.newdoc(
'perfStart(name)<br>perfCheck(name)',
'perfStart("testPerformance") // returns, in this case, ' + perfStart("testPerformance") + '<br>perfCheck("testPerformance") // returns, in this case, ' + perfCheck("testPerformance"),
'The Performance Checking system is an easy way to tell how long, in microseconds, some script takes to run. Give the check a test name to define/check for it to work properly. The above example started a performance check, and later in the example, checked it again. The values, in this case, were generated immediately after each other. perfStart will always return the current performance.now() value. perfCheck will always return the number of microseconds it took to get from perfStart to perfCheck.'
);});
c(function(){apps.appAPI.vars.newdoc(
'batteryLevel<br>batteryCharging',
'batteryLevel // in this case ' + batteryLevel + '<br>batteryCharging // in this case ' + batteryCharging,
'The level of battery left in the system, or the status of the battery charging. If batteryLevel is -1, then no battery was detected by . Same with batteryLevel. (on some systems, this is a glitch and a simple restart of can fix it) A batteryCharging of 1 means it is charging. 0 means it is not charging.'
);});
c(function(){apps.appAPI.vars.newdoc(
'addEditContext(elementId)',
'addEditContext("myInputElement")',
'Adds the Copy-Paste context menu to any &lt;input&gt; or &lt;textarea&gt;. An example of this menu can be seen in many apps, such as Text Editor or Sticky Note. Use addEditContext <i>after</i> you create the element, and make sure you use its element ID.'
);});
c(function(){apps.appAPI.vars.newdoc(
'c(someFunction, functionArgs)',
'c(function(arg){<br>&nbsp; alert("Your arg is " + arg); // alerts 743 for us<br>}, 743);',
'The c function is a useful tool in making an app that will take a long time to process some information. Instead of processing the information or performing a large action all at once and causing to freeze, you can spread it out over more time easily, with the c function. Keep in mind that any function you put inside of c will run <i>after</i> the current function is done running. For instance, we can make x = 1, then tell c to alert(x), then make x = 2. We will get an alert of 2 because the c function runs <i>after the current function</i>'
);});
c(function(){apps.appAPI.vars.newdoc(
'apps.prompt.vars. &darr;<br>&nbsp; .prompt(string, button, callback, name)<br>&nbsp; .alert(string, button, callback, name)<br>&nbsp; .confirm(string, buttons, callback, name)',
'apps.prompt.vars.prompt("What is your name?", "Submit", function(text){alert("Your name is " + text)}, "Your App") // gives alert box from app called Your App, asking user for their name, with a button called Submit. When submitted, we get an alert of the users name.<br><br>apps.prompt.vars.alert("Whoa! Watch out for them viruses!", "Okay, I will!", function(){console.log("User clicked the button!")}, "My App") // same as above, but with different text and a different button, and does not ask for anything<br><br>apps.prompt.vars.confirm("Please choose a meal.", ["Cheese Sticks", "Pizza", "Chicken"], function(btn){alert("you picked button " + btn)}, "My App") // asks the user to pick a button. the btn variable will be the index of the button in your array that was picked, starting at 0, of course.',
'Show prompt, alert, and confirm boxes using the prompt system instead of your browser\'s system. Prevents the OS from freezing when you pop an alert or ask for info. Also looks pretty nice, too. The callback function is called when the user clicks on an option.'
);});
c(function(){apps.appAPI.vars.newdoc(
'toTop(App)',
'toTop(apps.settings) // bumps the Settings app window to the top',
'You can bump an app window to the top if you need to for some reason. One way this is commonly used, is if an app is opened through some kind of menu. Sometimes the app will not go to the top, and you will need to do it manually via this function.'
);});
c(function(){apps.appAPI.vars.newdoc(
'ctxMenu(setupArray)',
'ctxMenu(<br>&nbsp;[<br>&nbsp; [event.pageX, event.pageY],<br>&nbsp; "Make an alert", "alert(\'hi\')",<br>&nbsp; "Do something else", "console.log(\'hey, it works\')"<br>&nbsp;]<br>)',
'Makes a context menu. Most useful for the oncontextmenu event for buttons or other elements. You can set the oncontextmenu to create your own context menu, instead of the default. Make sure the first array item is always that array of mouse coords. The next item will be the name of an option on your context menu. The next will be the function run on click of that option. Every two items you include after that will serve the purpose of another option. Theoretically, you can have unlimited options in your context menu.'
);});
}
}, 1, "appAPI", "/appicons/ds/API.png"
);
getId('loadingInfo').innerHTML = 'Initializing App Maker';
});
c(function(){
m('init APM');
apps.appmaker = new Application(
"APM",
"App Maker",
1,
function(launchtype){
if(launchtype === "dsktp"){
this.appWindow.setCaption("App Maker");
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 500, parseInt(getId('desktop').style.height, 10) / 2 - 300, 1000, 600);
}
this.vars.div = getId("winAPMh");
this.vars.div.style.overflow = "auto";
this.vars.div.style.backgroundPosition = 'center';
this.vars.div.style.backgroundRepeat = 'no-repeat';
this.vars.div.innerHTML = '<h1>AppMaker</h1>' +
'<p id="APMappsaving">Not currently saving...</p>' +
'<p>If you need to leave and return later: <button onclick="apps.appmaker.vars.saveProj()">Save Project</button> <button onclick="apps.appmaker.vars.loadProj()">Load Project</button><br>' +
'Currently stored project: ' + function(){if(typeof USERFILES.APP_APM_proj_name === "string"){return '<span style="font-family:monospace">' + USERFILES.APP_APM_proj_name + '</span>'}else{return 'no project saved'}}() +
'<br>WARNING: There is only one save file available. Saving this one will overwrite the existing one, and loading it in will overwrite whatever is in your window.</p>' +
'<p>Codename of Application (your app is accessible to other apps through apps.-this name-): <input id="APMappcode" class="monoinput"></p>' +
'<p>Name of Application: <input id="APMappname" class="monoinput"></p>' +
'<p>Application\'s Icon (3 or fewer chars): <input id="APMappicon" class="monoinput"></p>' +
'<p>Will the Application Behave Differently Depending on How Opened? (Y=1, N=0): <input id="APMapplaunchtypes" class="monoinput"></p>' +
'<p>Enter the code below that will run when your app is clicked on. Here are several assets you could use. The list is not yet complete: <button onclick="openapp(apps.appAPI, \'dsktp\');c(function(){toTop(apps.appAPI)})">Show</button></p>' +
'<textarea id="APMappmaincode" style="width:98%;height:300px; font-family:ProFont, monospace;white-space:no-wrap;">//make sure to set up and open the window if your app has one!</textarea>' +
'<p>If your app will use the signal system to allow other apps that you make to quietly communicate with yours, modify this signal system...</p>' +
'<textarea id="APMappsignal" style="width:98%;height:300px; font-family:ProFont, monospace; white-space:no-wrap;">case "forceclose":\n this.vars = this.varsOriginal;\n this.appWindow.closeWindow();\n this.appWindow.closeIcon();\n break;\ncase "close":\n this.appWindow.closeWindow();\n this.appWindow.setContent("");\n break;\ncase "checkrunning":\n if(this.appWindow.appIcon){\n return 1;\n }else{\n return 0;\n }\n break;\ncase "shrink":\n this.appWindow.closeKeepTask();\n break;\ncase "USERFILES_DONE":\n\n break;</textarea>' +
'<p>If your app will have any of its own defined variables, define them here. Remember that this is wrapped inside an object definition, so name them like <span class="monoinput">var1: "hi",var2: "foo",var3: ""</span></p>' +
'<textarea id="APMappvars" style="width:98%;height:300px;font-family:ProFont, monospace; white-space:no-wrap;"></textarea>' +
'<p>If your app will not appear on the desktop, enter 1. If it will not appear in the apps list or the desktop, enter 2. If it will be on the desktop and on the app list, enter 0. <input id="APMappdsktp"></p>' +
'<p>If your app has an image icon (50x50 or 100x100 is best), place its URL <b>IN QUOTES</b> here. If not, place a 0. <input id="APMappiconimage"></p>' +
'<button onClick="apps.appmaker.vars.compileApp()">Compile and Open in Text Editor</button> <button onClick="apps.appmaker.vars.installApp()">Compile and Install on This Browser (requires OS reboot)</button><br>';
addEditContext('APMappcode');
addEditContext('APMappname');
addEditContext('APMappicon');
addEditContext('APMapplaunchtypes');
addEditContext('APMappmaincode');
addEditContext('APMappsignal');
addEditContext('APMappvars');
addEditContext('APMappdsktp');
addEditContext('APMappiconimage');
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
doLog("Initializing APM apps...", "#ACE");
for(var file in USERFILES){
if(file.indexOf("APM_APPS_DATABASE_") === 0){
eval(USERFILES[file]);
}
}
doLog("Done.", "#ACE");
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app is used to create and install your very own custom apps! If your custom app happens to break, you can go to USERFILES and delete its entry under APM_APPS_DATABASE.',
div: undefined,
newapp: "",
compileApp: function(){
this.newApp = 'apps.' + getId("APMappcode").value +
' = new Application(\n"' + getId("APMappicon").value +
'",\n"' + getId("APMappname").value +
'",\n' + getId("APMapplaunchtypes").value +
',\nfunction(launchtype){\n' + getId("APMappmaincode").value +
'\n},\nfunction(signal){\nswitch(signal){\n' + getId("APMappsignal").value +
'\n}\n},\n{\n' + getId("APMappvars").value + '\n},' + getId("APMappdsktp").value + ',"' + getId("APMappcode").value + '",' + getId("APMappiconimage").value + ')';
USERFILES.APP_APM_newapp = this.newApp;
openapp(apps.notepad, 'open');
apps.notepad.vars.openFile('APP_APM_newapp');
apps.savemaster.vars.save('APP_APM_newapp', this.newApp, 1);
},
installApp: function(){
this.newApp = 'apps.' + getId("APMappcode").value +
' = new Application(\n"' + getId("APMappicon").value +
'",\n"' + getId("APMappname").value +
'",\n' + getId("APMapplaunchtypes").value +
',\nfunction(launchtype){\n' + getId("APMappmaincode").value +
'\n},\nfunction(signal){\nswitch(signal){\n' + getId("APMappsignal").value +
'\n}\n},\n{\n' + getId("APMappvars").value + '\n},' + getId("APMappdsktp").value + ',"' + getId("APMappcode").value + '",' + getId("APMappiconimage").value + ')';
USERFILES['APM_APPS_DATABASE_' + getId("APMappcode").value] = this.newApp;
apps.savemaster.vars.save('APM_APPS_DATABASE_' + getId("APMappcode").value, this.newApp, 1);
setTimeout(function(){apps.settings.vars.shutDown('restart');}, 2000);
},
saveProj: function(){
apps.prompt.vars.confirm('Overwrite your existing saved project?', ['No', 'Yes'], function(btn){
getId('winAPMh').style.backgroundImage = 'url(/loadLight.gif)';
// getId('winAPMh').style.cursor = cursors.loadLight;
getId('winAPMh').classList.add('cursorLoadLight');
if(btn){
getId('APMappsaving').innerHTML = 'SAVING PROJECT...';
USERFILES.APP_APM_proj_code = getId('APMappcode').value;
USERFILES.APP_APM_proj_icon = getId('APMappicon').value;
USERFILES.APP_APM_proj_name = getId('APMappname').value;
USERFILES.APP_APM_proj_launchtypes = getId('APMapplaunchtypes').value;
USERFILES.APP_APM_proj_maincode = getId('APMappmaincode').value;
USERFILES.APP_APM_proj_signal = getId('APMappsignal').value;
USERFILES.APP_APM_proj_vars = getId('APMappvars').value;
USERFILES.APP_APM_proj_dsktp = getId('APMappdsktp').value;
USERFILES.APP_APM_proj_code = getId('APMappcode').value;
USERFILES.APP_APM_proj_iconimage = getId('APMappiconimage').value;
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_code', USERFILES.APP_APM_proj_code, 1)}, 0);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_icon', USERFILES.APP_APM_proj_icon, 1)}, 500);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_name', USERFILES.APP_APM_proj_name, 1)}, 1000);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_launchtypes', USERFILES.APP_APM_proj_launchtypes, 1)}, 1500);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_maincode', USERFILES.APP_APM_proj_maincode, 1)}, 2000);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_signal', USERFILES.APP_APM_proj_signal, 1)}, 2500);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_vars', USERFILES.APP_APM_proj_vars, 1)}, 3000);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_dsktp', USERFILES.APP_APM_proj_dsktp, 1)}, 3500);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_code', USERFILES.APP_APM_proj_code, 1)}, 4000);
setTimeout(function(){apps.savemaster.vars.save('APP_APM_proj_iconimage', USERFILES.APP_APM_proj_iconimage, 1)}, 4500);
setTimeout(function(){
getId('APMappsaving').innerHTML = 'Not currently saving...';
getId('winAPMh').style.backgroundImage = '';
// getId('winAPMh').style.cursor = '';
getId('winAPMh').classList.remove('cursorLoadLight')
}, 5000);
}
}, 'App Maker');
},
loadProj: function(){
apps.prompt.vars.confirm('Overwrite all unsaved work?', ['No', 'Yes'], function(btn){
if(btn){
getId('APMappcode').value = USERFILES.APP_APM_proj_code;
getId('APMappicon').value = USERFILES.APP_APM_proj_icon;
getId('APMappname').value = USERFILES.APP_APM_proj_name;
getId('APMapplaunchtypes').value = USERFILES.APP_APM_proj_launchtypes;
getId('APMappmaincode').value = USERFILES.APP_APM_proj_maincode;
getId('APMappsignal').value = USERFILES.APP_APM_proj_signal;
getId('APMappvars').value = USERFILES.APP_APM_proj_vars;
getId('APMappdsktp').value = USERFILES.APP_APM_proj_dsktp;
getId('APMappcode').value = USERFILES.APP_APM_proj_code;
getId('APMappiconimage').value = USERFILES.APP_APM_proj_iconimage;
}
}, 'App Maker');
}
}, 1, "appmaker", "/appicons/ds/APM.png"
);
getId('loadingInfo').innerHTML = 'Initializing Calculator';
});
c(function(){
m('init Clc');
apps.calculator = new Application(
"Clc",
"Calculator",
0,
function(){
this.appWindow.setCaption(" Calculator");
if(!this.appWindow.appIcon){
this.appWindow.setContent('<iframe id="CalcFrame" style="width:100%;height:100%;border:none;font-family:ProFont, monospace;font-size:12px;" src="/Calculator/"></iframe>');
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 300, parseInt(getId('desktop').style.height, 10) / 2 - 200, 600, 400);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This is the official OS Calculator. It supports simple calculator functions as well as custom advanced functions by the developer.'
}, 1, "calculator", "/appicons/ds/Clc.png"
);
getId('loadingInfo').innerHTML = 'Initializing Search';
});
c(function(){
m('init SRC');
apps.search = new Application(
"SRC",
"Search",
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 250, parseInt(getId('desktop').style.height, 10) / 2 - 200, 500, 400);
}
this.appWindow.setCaption("Search ");
this.appWindow.setContent(
'<input id="SRCfield"><button onClick="apps.search.vars.search()">Go</button>' +
'<p id="SRCapps">Search Results in "apps"</p>' +
'<p id="SRCfiles">Search Results in "files"</p>' +
'<p id="SRCuserfiles">Search Results in "USERFILES"</p>'
);
addEditContext('SRCfield');
getId('winSRCh').style.overflowY = 'scroll';
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app can be used to search for apps and files within .',
lastsearch: "",
search: function(){
m('Searching ');
this.lastsearch = getId("SRCfield").value;
getId("SRCapps").innerHTML = 'Search Results in "apps"';
for(var app in apps){
if(apps[app].appDesc.toLowerCase().indexOf(this.lastsearch.toLowerCase()) > -1 && app !== 'startMenu'){
getId("SRCapps").innerHTML += '<br><span class="cursorPointer" style="font-family:monospace" onclick="openapp(apps.' + app + ', \'dsktp\');window.setTimeout(function(){toTop(apps.' + app + ')},0);">' + apps[app].appDesc + '</span>';
}
}
getId("SRCfiles").innerHTML = 'Search Results in "files"';
for(var file in files){
if(file.toLowerCase().indexOf(this.lastsearch.toLowerCase()) > -1){
getId("SRCfiles").innerHTML += '<br><span class="cursorPointer" style="font-family:monospace" onclick="openapp(apps.files, \'dsktp\');window.setTimeout(function(){toTop(apps.files);apps.files.vars.next(\'files\')},0);">' + file + '</span>';
}
if(typeof files[file] === 'object'){
for(var innerfile in files[file]){
if(innerfile.toLowerCase().indexOf(this.lastsearch.toLowerCase()) > -1){
getId("SRCfiles").innerHTML += '<br><span class="cursorPointer" style="font-family:monospace" onclick="openapp(apps.files, \'dsktp\');window.setTimeout(function(){toTop(apps.files);apps.files.vars.next(\'files.' + file + '\')},0);"">' + file + '.' + innerfile + '</span>';
}
}
}
}
getId("SRCuserfiles").innerHTML = 'Search Results in "USERFILES"';
for(var file in USERFILES){
if(file.toLowerCase().indexOf(this.lastsearch.toLowerCase()) > -1){
getId("SRCuserfiles").innerHTML += '<br><span class="cursorPointer" style="font-family:monospace" onclick="openapp(apps.notepad, \'open\');apps.notepad.vars.openFile(\'' + file + '\');requestAnimationFrame(function(){toTop(apps.notepad)})">' + file + '</span>';
}else if(USERFILES[file].toLowerCase().indexOf(this.lastsearch.toLowerCase()) > -1){
getId("SRCuserfiles").innerHTML += '<br><span class="cursorPointer" style="color:#7F7F7F;font-family:monospace" onclick="openapp(apps.notepad, \'open\');apps.notepad.vars.openFile(\'' + file + '\');requestAnimationFrame(function(){toTop(apps.notepad)})">' + file + ' [' + USERFILES[file].toLowerCase().indexOf(this.lastsearch.toLowerCase()) + ']</span>';
}
}
}
}, 1, "search", "/appicons/ds/SRC.png"
);
getId('loadingInfo').innerHTML = 'Initializing Messaging';
});
c(function(){
m('init MSG');
apps.messaging = new Application(
"MSG",
"Messaging",
1,
function(launchType){
if(!this.appWindow.appIcon){
this.vars.lastUserRecieved = '';
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 400, parseInt(getId('desktop').style.height, 10) / 2 - 250, 800, 500);
}
this.appWindow.setCaption('Messaging');
getId('winMSGh').setAttribute('onclick', 'if(apps.messaging.vars.soundToPlay && apps.messaging.vars.canLookethOverThereSound){apps.messaging.vars.notifClick.play(); apps.messaging.vars.soundToPlay = 0;}');
if(launchType === 'dsktp'){
this.appWindow.setContent('<div id="MSGdiv" style="width:100%;height:90%;overflow-y:scroll"></div><div style="left:0;top:0;background:#FFA;padding:2px;font-family:ProFont,monospace;font-size:12px;border-bottom-right-radius:5px;">Weekly Discussion Topic: ' + this.vars.discussionTopic + '</div><button style="position:absolute;bottom:0;height:10%;width:10%;" onclick="apps.messaging.vars.doSettings()">Settings</button><input id="MSGinput" style="position:absolute;height:10%;width:80%;bottom:0;left:10%;border:none;border-top:1px solid black;text-align:center;font-family:monospace"><button onclick="apps.messaging.vars.sendMessage()" style="position:absolute;right:0;bottom:0;width:10%;height:10%">Send</button>');
this.vars.lastMsgRecieved = this.vars.lastMsgStart;
getId('MSGinput').setAttribute('onkeyup', 'if(event.keyCode === 13){apps.messaging.vars.sendMessage();}');
}
addEditContext('MSGinput');
this.appWindow.openWindow();
this.vars.recieveMessage();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
if(USERFILES.APP_MSG_CHATNAME){
apps.messaging.vars.name = USERFILES.APP_MSG_CHATNAME;
}
if(USERFILES.APP_MSG_lookOverThere){
if(USERFILES.APP_MSG_lookOverThere === "1"){
this.vars.canLookethOverThereSound = 1;
}
}
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'The official OS Messenger. Chat with the entire community, all at once.<br><br>To set your name, go to Settings -&gt; 1, and enter a chat name.<br><br>To view past messages, go to Settings -&gt; 2, and enter in the number of past messages you wish to view.',
discussionTopic: 'Questions and Suggestions for <br>View Past Messages: Settings -&gt; 2 -&gt; Number of Messages',
lastMsgRecieved: '-9',
nameTemp: 'Anonymous',
name: 'Anonymous',
xhttpDelay: 0,
messageTemp: '',
message: '',
lastSetIn: '',
lastMsgStart: '-9',
doSettings: function(){
apps.prompt.vars.prompt('Choose a Setting:<br>1: Change Chatname<br>2: Load the last x messages<br>3: Toggle fun "Looketh Over There", from Geico commercial', 'Choose', function(txtIn){
apps.messaging.vars.lastSetIn = txtIn;
switch(apps.messaging.vars.lastSetIn){
case '1':
apps.prompt.vars.prompt('Please enter a Chatname.<br>Default is Anonymous<br>Current is ' + apps.messaging.vars.name, 'Submit', function(txtIN){
apps.messaging.vars.nameTemp = txtIN;
if(apps.messaging.vars.nameTemp.length > 30 && apps.messaging.vars.nameTemp.length < 3){
apps.prompt.vars.alert('Your name cannot be more than 30 or less than 3 characters long.', 'Okay', function(){}, 'Messaging');
}else if(apps.messaging.vars.nameTemp.toLowerCase().indexOf('mineandcraft12') > -1 || apps.messaging.vars.nameTemp.toUpperCase().indexOf('{ADMIN}') > -1){
apps.prompt.vars.prompt('REALITY CHECK<br>Please enter your hashed password, ... or admin.', 'This user security agent again?', function(secretpass){
//if(secretpass === navigator.userAgent){
apps.messaging.vars.name = apps.messaging.vars.nameTemp; // = "";
//for(var i in apps.messaging.vars.nameTemp){
// apps.messaging.vars.name += encodeURIComponent(apps.messaging.vars.nameTemp[i]);
//}
// This zone is quite battlescarred. Why must our fellow samaritans attack it so much?
apps.savemaster.vars.save('APP_MSG_CHATNAME', apps.messaging.vars.name, 1, 'mUname', secretpass || 'pass');
//}else{
// apps.prompt.vars.alert('Nice try! You aren\'t ! And you aren\'t an admin either! What gives, man? Calm down with the impersonation here! I\'m just a kid doing something really cool with computers, chill out and quit trying to mess things up!', 'Sheesh, I guess I won\'t pretend to be or an admin, like a jerk or something.', function(){}, '');
//}
}, 'Messaging');
}else{
apps.messaging.vars.name = apps.messaging.vars.nameTemp; // = "";
//for(var i in apps.messaging.vars.nameTemp){
// apps.messaging.vars.name += encodeURIComponent(apps.messaging.vars.nameTemp[i]);
//}
apps.savemaster.vars.save('APP_MSG_CHATNAME', apps.messaging.vars.name, 1, 'mUname', '');
}
}, 'Messaging');
break;
case '2':
apps.prompt.vars.prompt('Load the last x messages.<br>Default when opening is 10.<br>Make it a positive integer.<br>This will restart the Messaging app.', 'Submit', function(subNum){
apps.messaging.vars.lastMsgStart = "-" + subNum;
apps.messaging.appWindow.closeWindow();
openapp(apps.messaging, 'dsktp');
}, 'Messaging');
break;
case '3':
apps.messaging.vars.canLookethOverThereSound = apps.messaging.vars.canLookethOverThereSound * -1 + 1;
apps.prompt.vars.alert('Looketh Over There enabled: ' + numtf(apps.messaging.vars.canLookethOverThereSound), 'Okay', function(){}, 'Messaging');
apps.savemaster.vars.save('APP_MSG_lookOverThere', apps.messaging.vars.canLookethOverThereSound, 1);
default:
doLog('Messaging settings change cancelled');
}
}, 'Messaging');
},
xhttp: {},
lastMessage: '',
lastMessageTime: 0,
sendMessage: function(){
this.messageTemp = getId("MSGinput").value;
if(this.messageTemp === this.lastMessage){
apps.prompt.vars.notify('Please don\'t send the same message twice in a row.', ['Okay'], function(btn){}, 'Messaging', '/appicons/ds/MSG.png');
getId('MSGinput').value = '';
}else if(performance.now() - this.lastMessageTime < 3000){
apps.prompt.vars.notify('Please wait at least 3 seconds between messages.', ['Okay'], function(btn){}, 'Messaging', '/appicons/ds/MSG.png');
}else{
this.lastMessage = this.messageTemp;
if(this.messageTemp.length !== 0){
this.message = '';
this.messageTemp = this.messageTemp.split('\\').join('\\\\');
for(var i in this.messageTemp){
if(this.messageTemp[i] === '"'){
this.message += "''";
}else{
this.message += encodeURIComponent(this.messageTemp[i]);
}
}
getId("messagingframe").src = 'messager.php?c=' + this.message;
getId("MSGinput").value = "";
}
}
this.lastMessageTime = performance.now();
},
lastResponseObject: {},
lastUserRecieved: '',
needsScroll: false,
notifPing: new Audio('messagingSounds/messagePing.wav'),
notifMessage: new Audio('messagingSounds/lookethOverThere.wav'),
notifClick: new Audio('messagingSounds/madestThouLook.wav'),
soundToPlay: 0,
canLookethOverThereSound: 0,
nextMessage: function(text){
m('reading from messaging server');
if(text[0] === '{'){
d(2, 'Recieving message');
this.lastResponseText = text;
eval("apps.messaging.vars.lastResponseObject = " + this.lastResponseText);
this.lastMsgRecieved = this.lastResponseObject.l;
this.needsScroll = (getId('MSGdiv').scrollTop + 440 >= getId('MSGdiv').scrollHeight);
if(this.lastResponseObject.t){
if(this.lastResponseObject.n !== this.lastUserRecieved){
if(this.lastResponseObject.n.indexOf('{ADMIN}') === 0){
getId('MSGdiv').innerHTML += '<div style="color:#0A0; position:static; width:80%; margin-left:10%; height:20px; font-family:monospace; text-align:right">' + this.lastResponseObject.n + '</div>';
getId('MSGdiv').innerHTML += '<div style="background-color:#CEA; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;"><div style="width:10%;text-align:right;margin-left:-10%;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace">' + String(new Date(this.lastResponseObject.t - 0)).split(' ').slice(1, 4).join(' ') + '</div><div style="width:10%;text-align:left;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace;margin-left:80%;">' + String(new Date(this.lastResponseObject.t - 0)).split(' ')[4] + '</div>' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:calc(100% - 6px);padding-left:3px;padding-right:3px;" src="').split('[/IMG]').join('">') + '</div>';
}else{
getId('MSGdiv').innerHTML += '<div style="color:#777; position:static; width:80%; margin-left:10%; height:20px; font-family:monospace; text-align:right">' + this.lastResponseObject.n + '</div>';
getId('MSGdiv').innerHTML += '<div style="background-color:#ACE; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;"><div style="width:10%;text-align:right;margin-left:-10%;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace">' + String(new Date(this.lastResponseObject.t - 0)).split(' ').slice(1, 4).join(' ') + '</div><div style="width:10%;text-align:left;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace;margin-left:80%;">' + String(new Date(this.lastResponseObject.t - 0)).split(' ')[4] + '</div>' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:calc(100% - 6px);padding-left:3px;padding-right:3px;" src="').split('[/IMG]').join('">') + '</div>';
}
}else{
getId('MSGdiv').innerHTML += '<div style="color:#777; position:static; width:80%; margin-left:10%; height:2px;"></div>';
if(this.lastResponseObject.n.indexOf('{ADMIN}') === 0){
getId('MSGdiv').innerHTML += '<div style="background-color:#CEA; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;"><div style="width:10%;text-align:right;margin-left:-10%;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace">' + String(new Date(this.lastResponseObject.t - 0)).split(' ').slice(1, 4).join(' ') + '</div><div style="width:10%;text-align:left;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace;margin-left:80%;">' + String(new Date(this.lastResponseObject.t - 0)).split(' ')[4] + '</div>' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:calc(100% - 6px);padding-left:3px;padding-right:3px;" src="').split('[/IMG]').join('">') + '</div>';
}else{
getId('MSGdiv').innerHTML += '<div style="background-color:#ACE; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;"><div style="width:10%;text-align:right;margin-left:-10%;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace">' + String(new Date(this.lastResponseObject.t - 0)).split(' ').slice(1, 4).join(' ') + '</div><div style="width:10%;text-align:left;color:#7F7F7F;font-size:12px;font-family:ProFont,monospace;margin-left:80%;">' + String(new Date(this.lastResponseObject.t - 0)).split(' ')[4] + '</div>' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:calc(100% - 6px);padding-left:3px;padding-right:3px;" src="').split('[/IMG]').join('">') + '</div>';
}
}
}else{
if(this.lastResponseObject.n !== this.lastUserRecieved){
if(this.lastResponseObject.n.indexOf('{ADMIN}') === 0){
getId('MSGdiv').innerHTML += '<div style="color:#0A0; position:static; width:80%; margin-left:10%; height:20px; font-family:monospace; text-align:right">' + this.lastResponseObject.n + '</div>';
getId('MSGdiv').innerHTML += '<div style="background-color:#CEA; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;">' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:100%" src="').split('[/IMG]').join('">') + '</div>';
}else{
getId('MSGdiv').innerHTML += '<div style="color:#777; position:static; width:80%; margin-left:10%; height:20px; font-family:monospace; text-align:right">' + this.lastResponseObject.n + '</div>';
getId('MSGdiv').innerHTML += '<div style="background-color:#ACE; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;">' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:100%" src="').split('[/IMG]').join('">') + '</div>';
}
}else{
getId('MSGdiv').innerHTML += '<div style="color:#777; position:static; width:80%; margin-left:10%; height:2px;"></div>';
if(this.lastResponseObject.n.indexOf('{ADMIN}') === 0){
getId('MSGdiv').innerHTML += '<div style="background-color:#CEA; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;">' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:100%" src="').split('[/IMG]').join('">') + '</div>';
}else{
getId('MSGdiv').innerHTML += '<div style="background-color:#ACE; position:static; padding-top:3px; padding-bottom:3px; border-radius:10px; color:#000; width:80%; margin-left:10%; font-family:monospace;">' + this.lastResponseObject.c.split('[IMG]').join('<img style="max-width:100%" src="').split('[/IMG]').join('">') + '</div>';
}
}
}
this.lastUserRecieved = this.lastResponseObject.n;
if(this.needsScroll){
getId('MSGdiv').scrollTop = getId('MSGdiv').scrollHeight;
}
if(this.canLookethOverThereSound){
this.notifMessage.play();
this.soundToPlay = 1;
}else{
this.notifPing.play();
}
apps.messaging.vars.xhttpDelay = makeTimeout('MSG', 'recieveMessage', 'apps.messaging.vars.recieveMessage()', 10);
}else{
apps.messaging.vars.xhttpDelay = makeTimeout('MSG', 'recieveMessage', 'apps.messaging.vars.recieveMessage()', 1000);
}
},
lastResponseTime: 0,
recieveMessage: function(){
this.xhttp = new XMLHttpRequest();
this.xhttp.onreadystatechange = function(){
if(apps.messaging.vars.xhttp.readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
if(apps.messaging.vars.xhttp.status === 200){
apps.messaging.vars.lastResponseTime = perfCheck('messagingServer');
if(apps.messaging.appWindow.appIcon){
apps.messaging.vars.nextMessage(apps.messaging.vars.xhttp.responseText);
}
}else{
apps.prompt.vars.notify('Connection to messaging server lost.', [], function(){}, 'Messaging Error', '/appicons/ds/MSG.png');
//apps.messaging.vars.xhttpDelay = makeTimeout('MSG', 'recieveMessage', 'apps.messaging.vars.recieveMessage()', 1000);
}
}
};
this.xhttp.open("GET", "messaging.php?l=" + this.lastMsgRecieved, true);
perfStart('messagingServer');
this.xhttp.send();
apps.savemaster.vars.saving = 3;
taskbarShowHardware();
}
}, 0, "messaging", "/appicons/ds/MSG.png"
);
getId('loadingInfo').innerHTML = 'Initializing Camera';
});
c(function(){
m('init CAM');
apps.camera = new Application(
"CAM",
"Camera",
1,
function(launchType){
if(launchType !== 'tskbr'){
this.appWindow.dimsSet = function(){
getId('CAMvideo').style.width = apps.camera.appWindow.windowH - 6 + 'px';
getId('CAMvideo').style.height = apps.camera.appWindow.windowV - 24 + 'px';
};
this.appWindow.setCaption('Camera');
this.appWindow.setContent(
'<video id="CAMvideo" width="640" height="480" style="background:none" autoplay></video>' +
//'<div onclick="apps.camera.vars.takePic()" style="cursor:url(cursors/pointer.png) 9 3, pointer; width:20px; height:20px; border-radius:10px; bottom:10px; left:310px; background-color:#557"></div>' +
'<canvas id="CAMcanvas" width="640" height="480" style="display:none"></canvas>'
);
getId('winCAMh').style.background = 'none';
window.navigator.webkitGetUserMedia(
{"video": true},
function(stream){
apps.camera.vars.streamObj = stream;
getId('CAMvideo').src = window.webkitURL.createObjectURL(stream);
getId('CAMvideo').play();
},
function(err){
doLog('Error starting camera!', '#F00');
doLog(err, '#F00');
}
);
this.vars.cnv = getId('CAMcanvas');
this.vars.ctx = this.vars.cnv.getContext('2d');
}
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 321, parseInt(getId('desktop').style.height, 10) / 2 - 251, 643, 502);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
try{
getId('CAMvideo').pause();
getId('CAMvideo').src = "";
this.vars.streamObj.getTracks()[0].stop();
}catch(e){
apps.prompt.vars.notify('Error stopping camera<br><br>' + e, [], function(){}, 'Camera Error', '/appicons/ds/CAM.png')
}
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
try{
getId('CAMvideo').pause();
getId('CAMvideo').src = "";
this.vars.streamObj.getTracks()[0].stop();
}catch(e){
apps.prompt.vars.notify('Error stopping camera. Your camera may still be running.<br><br>' + e, [], function(){}, 'Camera Error', '/appicons/ds/CAM.png')
}
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'Very simple camera app, purely meant for testing wether your browser can see through your webcam or not.',
cnv: null,
ctx: null,
streamObj: {},
lastImage: {},
takePic: function(){
this.ctx.drawImage(getId('CAMvideo'), 0, 0, getId('CAMcanvas').width, getId('CAMcanvas').height);
this.lastImage = this.ctx.getImageData(0, 0, getId('CAMcanvas').width, getId('CAMcanvas').height);
}
}, 1, "camera", "/appicons/ds/CAM.png"
);
getId('loadingInfo').innerHTML = 'Initializing Bing App';
});
c(function(){
m('init BNG');
apps.bing = new Application(
'BNG',
'Bing',
1,
function(launchType){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('desktop').style.width, 10) / 2 - 321, parseInt(getId('desktop').style.height, 10) / 2 - 251, 643, 503);
}
this.appWindow.setCaption('Bing');
if(launchType === 'NORAA'){ // example url: https://www.bing.com/search?q=javascript+speech+api
this.vars.timeTaken = 0;
this.vars.currSearch = '';
for(var i in this.vars.nextSearch){
this.vars.currSearch += encodeURIComponent(this.vars.nextSearch[i]);
}
this.vars.nextSearch = this.vars.nextSearch.replace('%20', '+');
if(this.vars.currSearch.indexOf('what%20is%20') === 0){
this.vars.http.onreadystatechange = function(){
if(apps.bing.vars.http.readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
if(apps.bing.vars.http.readyState === 4 && apps.bing.vars.http.status === 200){
apps.bing.vars.lastResult = apps.bing.vars.http.responseText;
if(apps.bing.vars.currSearch.indexOf('what%20is%20the%20weather') === 0){
apps.bing.vars.descStart = apps.bing.vars.lastResult.indexOf('<div class="b_focusTextLarge" data-tag="">') + 42;
apps.bing.vars.descStart2 = apps.bing.vars.lastResult.indexOf('<div class="b_focusTextSmall">', apps.bing.vars.descStart) + 31;
apps.bing.vars.descStart2 = apps.bing.vars.lastResult.indexOf('<div class="b_focusTextSmall">', apps.bing.vars.descStart2) + 30;
if(apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.lastResult.indexOf('</div>', apps.bing.vars.descStart)).indexOf('en" xmlns') !== 0 && apps.bing.vars.lastResult.substring(apps.bing.vars.descStart2, apps.bing.vars.lastResult.indexOf('</div>', apps.bing.vars.descStart2)).indexOf('" xmlns=') !== 0){
apps.nora.vars.say('It is currently ' + apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.lastResult.indexOf('</div>', apps.bing.vars.descStart)) + ' degrees and ' + apps.bing.vars.lastResult.substring(apps.bing.vars.descStart2, apps.bing.vars.lastResult.indexOf('</div>', apps.bing.vars.descStart2)) + '.');
}else{
apps.nora.vars.say('I cant find that weather.');
}
}else{
//the container of desc is this
apps.bing.vars.divLoc = apps.bing.vars.lastResult.indexOf('<div class="dcont">');
//if the desc is there
if(apps.bing.vars.divLoc !== -1){
//the start of desc is this
apps.bing.vars.descStart = apps.bing.vars.lastResult.indexOf('>', apps.bing.vars.lastResult.indexOf('<div class="dc_mn"') + 1) + 1;
//the end of desc is this
apps.bing.vars.descEnd = apps.bing.vars.lastResult.indexOf('</div>', apps.bing.vars.descStart);
if(apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).indexOf('ml lang="en"') !== 0){
apps.nora.vars.say((apps.bing.vars.rawInput[0].toUpperCase() + apps.bing.vars.rawInput.slice(1)).replace('?', '') + ' is ' + apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd));
openapp(apps.nora, 'tskbr');
}else{
apps.nora.vars.say('I do not know what that is. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
}else{
apps.nora.vars.say('I do not know what that is. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
}
apps.nora.vars.lastResult = '';
}else if(apps.bing.vars.http.readyState === 3){
apps.bing.vars.timeTaken++;
if(apps.bing.vars.timeTaken % 20 === 0){
apps.nora.vars.say('Still thinking...');
}
}else if(apps.bing.vars.http.readyState === 4 && apps.bing.vars.http.status === 0){
apps.nora.vars.say('I do not know what that is, as my brain appears broken. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
};
}else if(this.vars.currSearch.indexOf('who%20is%20') === 0){
this.vars.http.onreadystatechange = function(){
if(apps.bing.vars.http.readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
if(apps.bing.vars.http.readyState === 4 && apps.bing.vars.http.status === 200){
apps.bing.vars.lastResult = apps.bing.vars.http.responseText;
//the container of desc is this
apps.bing.vars.divLoc = apps.bing.vars.lastResult.indexOf('<li class="b_ans b_top b_topborder">');
if(apps.bing.vars.divLoc === -1){
apps.bing.vars.divLoc = apps.bing.vars.lastResult.indexOf('<div class="b_entityTP">');
}
//if the desc is there
if(apps.bing.vars.divLoc !== -1){
//the start of desc is this
apps.bing.vars.descStart = apps.bing.vars.lastResult.indexOf('<div class="df_fb df_ps">') + 25;
apps.bing.vars.descType = 'd';
if(apps.bing.vars.descStart === 24){
apps.bing.vars.descStart = apps.bing.vars.lastResult.indexOf('<span id="dscexpitem_') + 54;
if(apps.bing.vars.lastResult[apps.bing.vars.descStart] === '>'){
apps.bing.vars.descStart++;
}
apps.bing.vars.descType = 's';
}
//the end of desc is this
if(apps.bing.vars.descType === 'd'){
apps.bing.vars.descEnd = apps.bing.vars.lastResult.indexOf('</div>', apps.bing.vars.descStart);
}else if(apps.bing.vars.descType === 's'){
apps.bing.vars.descEnd = apps.bing.vars.lastResult.indexOf('<div', apps.bing.vars.descStart);
}
if(apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).indexOf('ml lang="en"') !== 0 && apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).indexOf('g="en" xml:lang="en"') !== 0 && apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).indexOf('ttp://') !== 0){
apps.nora.vars.say(apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).replace(/<p>/g, '').replace(/<\/p>/g, ' '));
openapp(apps.nora, 'tskbr');
}else{
apps.nora.vars.say('I do not know who that is. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
}else{
apps.nora.vars.say('I do not know who that is. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
apps.nora.vars.lastResult = '';
}else if(apps.bing.vars.http.readyState === 3){
apps.bing.vars.timeTaken++;
if(apps.bing.vars.timeTaken % 20 === 0){
apps.nora.vars.say('Still thinking...');
}
}else if(apps.bing.vars.http.readyState === 4 && apps.bing.vars.http.status === 0){
apps.nora.vars.say('I do not know who that is, as my brain appears broken. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
};
apps.nora.vars.lastResult = "";
}else if(this.vars.currSearch.indexOf('define%20') === 0){
this.vars.http.onreadystatechange = function(){
if(apps.bing.vars.http.readyState === 4){
apps.savemaster.vars.saving = 0;
taskbarShowHardware();
}
if(apps.bing.vars.http.readyState === 4 && apps.bing.vars.http.status === 200){
apps.bing.vars.lastResult = apps.bing.vars.http.responseText;
console.log(apps.bing.vars.lastResult);
//the container of desc is this
apps.bing.vars.divLoc = apps.bing.vars.lastResult.indexOf('</strong> definition, ');
//if the desc is there
if(apps.bing.vars.divLoc !== -1){
//the start of desc is this
apps.bing.vars.descStart = apps.bing.vars.lastResult.indexOf('</strong> definition, ') + 22;
apps.bing.vars.descType = 'd';
if(apps.bing.vars.descStart === 31){
apps.bing.vars.descStart = apps.bing.vars.lastResult.indexOf('<span id="dscexpitem_') + 54;
if(apps.bing.vars.lastResult[apps.bing.vars.descStart] === '>'){
apps.bing.vars.descStart++;
}
apps.bing.vars.descType = 's';
}
//the end of desc is this
if(apps.bing.vars.descType === 'd'){
apps.bing.vars.descEnd = apps.bing.vars.lastResult.indexOf('</p>', apps.bing.vars.descStart);
}else if(apps.bing.vars.descType === 's'){
apps.bing.vars.descEnd = apps.bing.vars.lastResult.indexOf('<div', apps.bing.vars.descStart);
}
if(apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).indexOf('ml lang="en"') !== 0 && apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).indexOf('g="en" xml:lang="en"') !== 0 && apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).indexOf('ttp://') !== 0){
apps.nora.vars.say(apps.bing.vars.lastResult.substring(apps.bing.vars.descStart, apps.bing.vars.descEnd).replace(/<p>/g, '').replace(/<\/p>/g, ' '));
openapp(apps.nora, 'tskbr');
}else{
apps.nora.vars.say('I do not know what that is. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
}else{
apps.nora.vars.say('I do not know what that is. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
apps.nora.vars.lastResult = '';
}else if(apps.bing.vars.http.readyState === 3){
apps.bing.vars.timeTaken++;
if(apps.bing.vars.timeTaken % 20 === 0){
apps.nora.vars.say('Still thinking...');
}
}else if(apps.bing.vars.http.readyState === 4 && apps.bing.vars.http.status === 0){
apps.nora.vars.say('I do not know what that is, as my brain appears broken. I will search Bing for you.');
apps.bing.appWindow.setDims(
apps.nora.appWindow.windowX,
apps.nora.appWindow.windowY,
apps.nora.appWindow.windowH,
apps.nora.appWindow.windowV
);
apps.bing.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com/search?q=' + apps.bing.vars.currSearch + '"></iframe>');
apps.bing.appWindow.openWindow();
}
};
apps.nora.vars.lastResult = "";
}
this.vars.http.open('GET', apps.settings.vars.corsProxy + 'https://bing.com/search?q=' + this.vars.currSearch, true);
apps.savemaster.vars.saving = 3;
taskbarShowHardware();
this.vars.http.send();
apps.nora.vars.say('Let me think...');
}else{
if(launchType === 'dsktp'){
this.appWindow.setContent('<iframe id="BNGiframe" src="https://bing.com"></iframe>');
}
this.appWindow.openWindow();
}
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
this.vars.currSearch = '';
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app is used by NORAA to look up information for "what is" and "who is" questions.',
nextSearch: '',
currSearch: '',
lastResult: '',
divLoc: 0,
descStart: 0,
descStart2: 0,
descEnd: 0,
timeTaken: 0,
http: new XMLHttpRequest()
}, 2, "bing", "/appicons/new/tI.png"
);
getId('loadingInfo').innerHTML = 'Initializing Help App';
});
c(function(){
m('init HLP');
apps.help = new Application(
'HLP',
' Help',
1,
function(launchtype){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 400, parseInt(getId('monitor').style.height, 10) / 2 - 255, 800, 500);
this.appWindow.setCaption(' Help');
getId('winHLPh').style.overflow = 'auto';
this.vars.populateList();
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app attempts to assist users with the basic functions of OS. Note that some information needs to be updated and may be outdated.',
categories: {
'1': 'folder',
'2': 'Categories',
taskbar: {
'1': 'folder',
'2': 'Taskbar<br><img src="helpapp/taskbar/thumb.png">',
appsList: {
'1': 'land',
'2': 'Applications List<br><img src="helpapp/taskbar/appsList/thumb.png">',
helpPage:
'This lists all applications properly installed in \'s app directory, including those not displayed on the desktop, and allows you to open them.<br><br>' +
'Apps act as if opened through the desktop; even if already open. Clicking anywhere away from the apps list will close the apps list. If you cannot find an app in this list, then that means it was not properly installed.'
},
appIcons: {
'1': 'land',
'2': 'Application Icons<br><img src="helpapp/taskbar/appIcons/thumb.png">',
helpPage:
'These icons appear when any application is running. The icon displayed gives a quick indication to what is open, and allows you to find a single window if many are open.<br><br>' +
'Click an icon to open the app to view, if it has been minimised.<br><img src="helpapp/taskbar/appIcons/rightclick.png"><br>Right click an app icon to get the options to open them or to close them; useful if an app has beem minimised and you want to close it without first opening it.'
},
statusIcons: {
'1': 'land',
'2': 'Status Icons<br><img src="helpapp/taskbar/statusIcons/thumb.png">',
helpPage: 'The status icons show the state of many things; battery, network activity, time, even FPS. More information coming soon.'
}
},
desktop: {
'1': 'land',
'2': 'Desktop',
helpPage:
'The desktop is the main work area of ; where all of your application icons and all of your windows reside.<br>' +
'To move an icon on your desktop, simply right-click the icon, select Move Icon, then click elsewhere.'
},
windows: {
'1': 'land',
'2': 'Windows<br><img src="helpapp/windows/thumb.png">',
helpPage:
'The window is where most of your work will be shown. The top-left is where your app\'s icon and title reside.<br>' +
'The three buttons in the top-right have special functions to control your windows. Some windows may have fewer than three buttons.<br>' +
'<span style="color:#0F0">[-]</span> Button: Hides your window from view, to reduce clutter and CPU strain, without completely closing the app. Watch out, however, as some apps may incorrectly handle this action.<br>' +
'<span style="color:#0F0">[O]</span> Button: Fits the window to the size of your desktop. It\'s much easier to use that button to get a bigger window than to move and drag the window manually.<br>' +
'<span style="color:#F00">[X]</span> Button: Closes the window. Useful to lessen the strain on CPU and rendering system, especially if Windowblur is enabled. By closing the app, you can re-open it again and start fresh. Keep in mind that some apps may run background tasks and may "remember" where they last left off.<br><br>' +
'To move a window, click on the top title bar of the window, and then click on another location on the screen.<br>' +
'To resize a window, click on the bottom half of the window\'s border, then click elsewhere on the screen. The window always resizes by the bottom and right borders - the left and top border will not move.<br>' +
'Apps can only have one app window.'
},
noraa: {
'1': 'land',
'2': 'NORAA<br><img src="helpapp/noraa/thumb.png">',
helpPage: 'NORAA is the personal assistant designed for your operating system. More information coming soon.'
},
taskManager: {
'1': 'land',
'2': 'Task Manager',
helpPage: 'This is the list of descriptions for values within task manager.<br><br>' +
'<code>Script Performance Benchmark:</code> This is the time, in microseconds, that it takes your code to check the current time since boot in microseconds. It is used to measure how powerful your script engine is; a small number means more powerful, while a large number is less powerful. If is run in the background, this number will be significantly higher. For comparison, my personal computer generally gets anywhere around 5 - 50 on idle.<br><br>' +
'<code>Visual Performance Benchmark:</code> This is the time, in microseconds, that it takes your browser to render one frame of visual content. It is used to measure how well your graphics system is handling ; a small number means more powerful, while a large number is less powerful. If is run in the background, this number will be extremely high, because web browsers put off rendering for frames that are not visible. Running at 60 FPS, a perfect score would be 16666, or 16 <sup>2</sup>/<sub>3</sub> milliseconds per render.<br><br>' +
'<code>Code Pieces Waiting to Run:</code> This is the number of code pieces that your apps and have put off to run over time, in order to increase framerate. If things like context menus, the apps list, or the filebrowser are freezing, check this number and see how large it is. If you can see it counting down from a very large number, then some app is dumping alot of code into the system.<br><br>' +
'<code>Temp Speech Running:</code> This is a true/false value that tells you if NORAA is listening for you to say his activation phrase. If you do not want NORAA to listen, you can toggle this option in Settings -&gt; NORAA.<br><br>' +
'<code>Temp Speech Storage:</code> This is the temporary storage of the above listening system. If temp speech is running, this is what NORAA can hear you saying. If it sees his activation phrase in what you have said, it will clear the storage and activate NORAA. This sstorage is required for the system to work, so I allow the user to see what it hears.<br><br>' +
'<code>Live Elements Loaded:</code> This is the number of Live Elements that are currently loaded and running. A Live Element is some field that automatically updates itself to a value. For instance, here is a Live Element that displays the number of microseconds since launch: <span class="liveElement" liveVar="Math.round(performance.now() * 1000)">0</span><br><br>' +
'<code>Modulelast, Module:</code> This is the current and latest module that is running. Typically, these values will mostly be idle. When opening windows and other tasks such as these, the module will be updated. Remember that the OS and/or apps must manually set this value for it to appear... if you are performing a large task and it still says idle, then the developer probably did not implement their app into the module system.<br><br>' +
'Blue tasks are code that has been scheduled to run repeatedly over time; the interval between runs, in milliseconds, is displayed on the right side.<br><br>Green tasks are tasks that are waiting to run at some point in time; the time that they were set for in milliseconds is displayed on the right side.'
},
devApi: {
/* template for landing page
: {
'1': 'land',
'2': '',
helpPage: ''
}
*/
/* template for folder page
: {
'1': 'folder',
'2': '',
}
*/
'1': 'folder',
'2': 'Developer API<br>Useful for app developers only.<br>Intended to be full documentation in full detail of <i>all</i> useful functions and variables.',
navigatingDevApi: {
'1': 'land',
'2': 'Navigating the Developer API',
helpPage:
'This is the help page for navigating this Developer API doc.<br><br>' +
'Help items that have the symbol <code>{</code> after them indicate an item with more options inside (i.e. an object or class that holds more objects). Note that these items will often have an item within them labeled after itself, which will be the help topic for that particular folder.<br><br>' +
'This is set up as a directory of sorts. All objects contained in the top level of the API doc are assumed to be at the top level of JavaScript scope (meaning they are directly inside the window object)<br><br>' +
'As of now, this documentation is very incomplete. It is a large-scale project that probably will not be finished anytime soon.'
},
apps: {
'1': 'folder',
'2': 'apps',
prompt: {
'1': 'folder',
'2': 'apps.prompt',
vars: {
'1': 'folder',
'2': 'apps.prompt.vars',
pAlert: {
'1': 'land',
'2': 'apps.prompt.vars.alert(aText, aButton, aCallback(), aCaption)',
helpPage:
'Make an alert box similar to JavaScript\'s alert() command, but using an window to prevent freezing the OS.<br><br>' +
'The function expects 3 mandatory arguments, <code>aText</code>, <code>aButton</code>, and <code>aCallback()</code>. It also expects 1 recommended but optional argument, <code>aCaption</code>.<br><br>' +
'<code>aText</code> is used as the text for the alert\'s body text. It can be any string-convertible data-type and supports HTML formatting.<br>' +
'<code>aButton</code> is used as the text for the alert\'s Close button text. It can be any string-convertible data-type.<br>' +
'<code>aCallback()</code> is the function called after the Close button has been clicked by the user. It must be a function.<br>' +
'<code>aCaption</code> is the optional name of the application that opened the alert box. It helps the user determine which app the alert came from. It can be any string-convertible data-type, though string is recommended.<br><br>' +
'Alerts, confirms, prompts, and notifications will all open one after the other. That is, if one app has opened an alert, your app\'s alert will open after the previous is closed.'
},
pConfirm: {
'1': 'land',
'2': 'apps.prompt.vars.confirm(cText, cButtons, cCallback(btn), cCaption)',
helpPage:
'Make a confirm box similar to JavaScript\'s confirm() command, but using an window to prevent freezing the OS.<br><br>' +
'The function expects 3 mandatory arguments, <code>cText</code>, <code>cButtons</code>, and <code>cCallback(btn)</code>. It also expects 1 recommended but optional argument, <code>cCaption</code>.<br><br>' +
'<code>cText</code> is used as the text for the confirm\'s body text. It can be any string-convertible data-type and supports HTML formatting.<br>' +
'<code>cButtons</code> is used as the labels for the confirm\'s button texts. It must be an array consisting of strings. Each string within the array will be used as a separate button choice for the user to choose.<br>' +
'<code>cCallback(btn)</code> is the function called after the selection has been clicked by the user, and must accept one argument, recommended name is <code>btn</code>. It must be a function. The value passed to the function as argument btn will always be a number that will match the button pressed by the user to its index in <code>cButtons</code><br>' +
'<code>cCaption</code> is the optional name of the application that opened the confirm box. It helps the user determine which app the confirm came from. It can be any string-convertible data-type, though string is recommended.<br><br>' +
'Alerts, confirms, prompts, and notifications will all open one after the other. That is, if one app has opened a confirm, your app\'s confirm will open after the previous is closed.'
},
pPrompt: {
'1': 'land',
'2': 'apps.prompt.vars.prompt(pText, pButton, pCallback(text), pCaption)',
helpPage:
'Make a prompt box similar to JavaScript\'s prompt() command, but using an window to prevent freezing the OS.<br><br>' +
'The function expects 3 mandatory arguments, <code>pText</code>, <code>pButton</code>, and <code>pCallback(text)</code>. It also expects 1 recommended but optional argument, <code>pCaption</code>.<br><br>' +
'<code>pText</code> is used as the text for the prompt\'s body text. It can be any string-convertible data-type and supports HTML formatting.<br>' +
'<code>pButton</code> is used as the text for the prompt\'s Submit button text. It can be any string-convertible data-type.<br>' +
'<code>pCallback(text)</code> is the function called after the Close button has been clicked by the user, and must accept one argument, recommended name is <code>text</code>. It must be a function. The value passed to the function as argument text will always be a string representing the user\'s input.<br>' +
'<code>pCaption</code> is the optional name of the application that opened the prompt box. It helps the user determine which app the prompt came from. It can be any string-convertible data-type, though string is recommended.<br><br>' +
'Alerts, confirms, prompts, and notifications will all open one after the other. That is, if one app has opened a prompt, your app\'s prompt will open after the previous is closed.'
},
pNotify: {
'1': 'land',
'2': 'apps.prompt.vars.notify(nText, nButtons, nCallback(btn), nCaption, nImage)',
helpPage:
'Show a notification to the user - less intrusive and comes across as less urgent.<br><br>' +
'The function expects 3 mandatory arguments, <code>nText</code>, <code>nButtons</code>, <code>nCallback(btn)</code>. It also expects 2 recommended but optional arguments, <code>nCaption</code>, <code>nImage</code>.<br><br>' +
'<code>nText</code> is used as the main body text of the Notification. It can be any string-convertible data-type and, though not recommended, supports HTML formatting.<br>' +
'<code>nButtons</code> is used as the labels of the button texts of the notification. It must be an array consisting of any number of strings, including 0 if you do not want buttons on the notification. Each string represents its own button.<br>' +
'<code>nCallback</code> is the function called after the Close button or a selection has been pressed by the user. It must accept one argument, recommended name it <code>btn</code>. It must be a function. The value passed to the function is the index of the user selection in the supplied array of button labels. If the notification was closed and no option was selected, it returns -1.<br>' +
'<code>nCaption</code> is the optional caption displayed on the top of the notification in bold. It helps the user determine what the notification is about, via a quick glance. It can be any string-convertible data-type, though string is recommended.<br>' +
'<code>nImage</code> is the optional image to be displayed on the side of the notification - typically used to show what app it came from. It must be a string containing the URL to an image.<br><br>' +
'Alerts, conforms, prompts, and notifications will all open one after the other. That is, if one app has opened a notificaiton, your app\'s notification will open after the previous is closed.'
}
}
},
savemaster: {
'1': 'folder',
'2': 'apps.savemaster',
vars: {
'1': 'folder',
'2': 'apps.savemaster.vars',
saving: {
'1': 'land',
'2': 'apps.savemaster.vars.saving',
helpPage:
'This is a lesser-known feature of , so its help page is short. More help will be added over time, but only after more important help docs are finished.<br><br>' +
'This variable is used by the taskbar to determine the network status to display to the user. 3rd-party support is mostly experimental. More details soon.'
},
save: {
'1': 'land',
'2': 'apps.savemaster.vars.save(filepath, filecontent, newformat, errorreport)',
helpPage:
'Save a <b>persistent</b> file to <code>USERFILES</code>. A network connection and connection to the server is required, as no files are saved on the local machine.<br><br>' +
'The function expects 3 mandatory arguments, <code>filepath</code>, <code>filecontent</code>, and <code>newformat</code>. An optional argument, <code>errorreport</code>, is used only by . If included, it must be set to 0 and does not actually do anything.<br><br>' +
'<code>filepath</code> is the name of the file that you will save. If a file with the same name is found, it is overwritten. It must be presented as a string and the string must follow JavaScript\'s variable naming syntax. No spaces.<br>' +
'<code>filecontent</code> is the content of the new file to be saved. If the file is 0 bytes long, it may not save. It must be a string-convertible data-type. Upon restart of the operating system, ALL contents of USERFILES that are properly saved will be converted to strings.<br>' +
'<code>newformat</code> tells the operating system wether to use protocol 0 (this protocol is depreceated and has since been deleted) or protocol 1. Always set this value to 1 or the file will not be saved correctly.<br>' +
'<code>errorreport</code> is not a recommended argument to include. For 3rd-party developers, it does nothing.<br><br>' +
'As of 1.2.8, multiple files can now be saved at the same time. All file saves since boot will be recorded to <code>apps.savemaster.vars.xf</code>. Each file-save request is saved as a pair of two variables, a set of FormData, and an XMLHttpRequest, and are designed for users to be able to retrieve a lost file version, should it have been saved over.'
},
sDelete: {
'1': 'land',
'2': 'apps.savemaster.vars.delete(filepath)',
helpPage:
'Delete a persistent file from the USERFILES server. A network connection and connection to the server is required.<br><br>' +
'The function expects 1 mandatory argument, <code>filepath</code>.<br><br>' +
'<code>filepath</code> is the name of the file that you will delete. It must be presented as a string and must follow JavaScript\'s variable naming syntax.<br><br>' +
'The user will ALWAYS be prompted to delete a file, even if you already have been given permission before. There are some known bugs, and sometimes it does not work.'
}
}
}
},
application: {
/* template for landing page
: {
'1': 'land',
'2': '',
helpPage: ''
}
*/
/* template for folder page
: {
'1': 'folder',
'2': '',
}
*/
'1': 'folder',
'2': 'Application( ... ) {',
application: {
'1': 'land',
'2': 'Application(<br>&nbsp; appIcon, appDesc,<br>&nbsp; handlesLaunchTypes, mainFunction(launchType), signalHandlerFunction(signal),<br>&nbsp; appVariables, keepOffDesktop, appPath, appImg<br>)',
helpPage:
'Code used to initialize new apps, only works properly during OS boot. (This function is useless to developers; it is only used by itself. I only included it because it is technically the class that holds all your app\'s variables.)<br><br>' +
'The function expects 8 mandatory arguments, <code>appIcon</code>, <code>appDesc</code>, <code>handlesLaunchTypes</code>, <code>mainFunction(launchType)</code>, <code>signalHandlerFunction(signal)</code>, <code>appVariables</code>, <code>keepOffDesktop</code>, and <code>appPath</code>. It also accepts one optional argument, <code>appImg</code>.<br><br>' +
'You shouldn\'t use this function, so no documentation for you!'
},
dsktpIcon: {
'1': 'land',
'2': 'Application.dsktpIcon',
helpPage:
'The variable that your app\'s three-letter ID code is stored in. Modifying this variable is sure to end in disaster within milliseconds, so don\'t do it.<br><br>' +
'The code must be compatible with CSS ID-name rules, as it will be frequently used in combination with CSS, and will be accessed with JavaScript quite frequently.'
},
appDesc: {
'1': 'land',
'2': 'Application.appDesc',
helpPage: 'The name of your application as it appears on the desktop and apps list. Recommended to be 3 words or less. Maybe four if theu are short words.'
},
main: {
'1': 'land',
'2': 'Application.main(launchTypes)',
helpPage: 'The main function of your application. If you wish to programatically start an application, do not run this function. Instead, use the function openapp(appToOpen, launchTypeUsed). See its documentation in the API.'
},
signalHandler: {
'1': 'land',
'2': 'Application.signalHandler(string signal)',
helpPage:
'This is the function used by your application to process and respond to many signals that it may spontaneously be sent. It is recommended to be set up as a switch statement.<br><br>' +
'Examples of common use of the signal system...<br>When the user closes your app, this is handled with a call to signalHandler called "close". This same idea is used for many other things, like shrinking.<br><br>' +
'There are two calls that will ALWAYS be executed... one called "USERFILES_DONE" (called after the OS is loaded and ready to open to user interactivity) and another called "shutdown" (run just before the OS shuts down or restarts)'
},
vars: {
'1': 'land',
'2': 'Application.vars',
helpPage: 'This is the home of your application\'s variables. That\'s... about it.'
},
appWindow: {
'1': 'folder',
'2': 'Application.appWindow {',
/* template for landing page
: {
'1': 'land',
'2': '',
helpPage: ''
}
*/
/* template for folder page
: {
'1': 'folder',
'2': '',
}
*/
appWindow: {
'1': 'land',
'2': 'Application.appWindow',
helpPage: 'This object houses all variables and functions used in association with your app\'s window, all wrapped up in a nice appWindow package.'
},
dsktpIcon: {
'1': 'land',
'2': 'Application.appWindow.dsktpIcon',
helpPage: 'See Application.dsktpIcon. Same value and purpose.'
},
appImg: {
'1': 'land',
'2': 'Application.appWindow.appImg',
helpPage: 'This is the variable that holds the URL to the image icon of your app. Recommended that you don\'t modify it.'
},
windowX: {
'1': 'land',
'2': 'Application.appWindow.windowX',
helpPage: 'Recommended not to be directly edited. The distance in pixels of your app window from the left edge of the screen.'
},
windowY: {
'1': 'land',
'2': 'Application.appWindow.windowY',
helpPage: 'Recommended not to be directly edited. The distance in pixels of your app window from the top edge of the screen.'
},
windowH: {
'1': 'land',
'2': 'Application.appWindow.windowH',
helpPage: 'Recommended not to be directly edited. The width in pixels of your app window, including its borders. To get the width of the window\'s content box, just take this value - 6.'
},
windowV: {
'1': 'land',
'2': 'Application.appWindow.windowV',
helpPage: 'Recommended not to be directly edited. The height in pixels of your app window, including its borders. To get the height of the window\'s content box, just take this value - 24.'
},
fullscreen: {
'1': 'land',
'2': 'Application.appWindow.fullscreen',
helpPage: 'Recommended not to be directly edited. Status of your app window in fullscreen mode... If the value is 1, your app has been toggled into fullscreen. If the value is 0, your app has been toggled out of fullscreen.'
},
appIcon: {
'1': 'land',
'2': 'Application.appWindow.appIcon',
helpPage: 'Recommended not to be directly edited. This value indicates if your app is "running", or in better terms, if its app icon is visible in the taskbar.'
},
dimsSet: {
'1': 'land',
'2': 'Application.appWindow.dimsSet',
helpPage: 'The function to be run when your app window is resized. By default, it is the number 0. But if you want to run some function when the window is resized (usually to modify the UI to fit the screen), this is how you can.'
},
onTop: {
'1': 'land',
'2': 'Application.appWindow.onTop',
helpPage: 'Recommended not to be directly edited. This is the status of your window\'s Always On Top flag. 0 is not, 1 is yes.'
},
alwaysOnTop: {
'1': 'land',
'2': 'Application.appWindow.alwaysOnTop(setTo)',
helpPage: 'Sets your window into or out of Always On Top mode. Passing a 0 takes it out of the mode. Passing a 1 puts it into On Top Mode.'
},
setDims: {
'1': 'land',
'2': 'Application.appWindow.setDims(xOff, yOff, xSiz, ySiz, ignoreDimsSet)',
helpPage: 'Sets the position and dimensions of your app window. xOff and yOff are the x and y position on the screen. xSiz and ySiz are the width and height of the window, borders included. The width and height of the borders are 6 x 24.'
},
openWindow: {
'1': 'land',
'2': 'Application.appWindow.openWindow()',
helpPage: 'Simply opens your window so the user can see it.'
},
closeWindow: {
'1': 'land',
'2': 'Application.appWindow.closeWindow()',
helpPage: 'Closes your window. However, recommended to use Application.signalHandler("close") instead of this.'
},
closeKeepTask: {
'1': 'land',
'2': 'Application.appWindow.closeKeepTask()',
helpPage: 'Hides your window but keeps it "running". However, recommended to use Application.signalHandler("shrink") instead.'
},
setCaption: {
'1': 'land',
'2': 'Application.appWindow.setCaption(newCap)',
helpPage: 'Sets the caption of your window. If your app has an image icon, that will always be displayed before your caption. If not, the 3-letter ID of your app will be.'
},
setContent: {
'1': 'land',
'2': 'Application.appWindow.setContent(newHTML)',
helpPage: 'Sets the content of your window, in HTML. You can alternatively use <code>getId("win" + YOURDSKTPICON + "h").innerHTML = "new HTML content"</code>'
},
fullscreenTempVars: {
'1': 'land',
'2': 'Application.appWindow.fullscreenTempVars',
helpPage: 'Not helpful to you. Move along.'
},
toggleFullscreen: {
'1': 'land',
'2': 'Application.appWindow.toggleFullscreen()',
helpPage: 'Welp. Toggles fullscreen. Not real fullscreen, just make your app\'s window fill the desktop.'
}
},
keepOffDesktop: {
'1': 'land',
'2': 'Application.keepOffDesktop',
helpPage: 'This is the stored value of wether or not an app is present on the desktop or apps list.<br><br>A value of 0 means it appears in both the desktop and apps list.<br>A value of 1 means it appears in the apps list but not the desktop.<br>A value of 2 means it does not appear in either location.'
}
},
addEditContext: {
'1': 'land',
'2': 'addEditContext(element)',
helpPage: 'Adds the copy-paste context menu to an element. Works only given the following are true.<br><ul><li>Element has an ID; you need to pass the ID of your element to addEditContext.</li><li>Element must be an input or a textarea.</li></ul>'
},
c: {
'1': 'land',
'2': 'c(code(arg), args)',
helpPage:
'Allows you to hold code back, and wait to run it. It works sort of like a line: the first apps to use c() will be first in line to be run. Each call after that will then be further down the list. Good for running code in a particular order, but not freezing the OS with it.<br><br>' +
'<code>code</code> is the JS function to be run. It can optionally ask for parameter <code>arg</code>, which will be substituted with your <code>args</code> when the function finally runs.'
},
makeTimeout: {
'1': 'land',
'2': 'makeTimeout(appname, taskname, functionname, functiontime)',
helpPage:
'Same idea as <code>window.setTimeout()</code>, except your timeout is registered with task manager.<br><br>' +
'<code>appname</code> is the three-letter codename of your app, for organisation purposes.<br>' +
'<code>taskname</code> is a name for your task to take on. Think of it like a window caption, except it\'s on a task, in a list.<br>' +
'<code>functionname</code> is the name of your function, <b><u>ENCODED AS A STRING!</u></b> It is recommended to be a reference to a function (try using the value "apps.YOURAPP.vars.importantFunction()").' +
'<code>functiontime</code> is the number of milliseconds that JS waits to run your code, just like setTimeout().'
},
makeInterval: {
'1': 'land',
'2': 'makeInterval(appname, taskname, functionname, functiontime)',
helpPage:
'Same idea as <code>window.setInterval()</code>, except your interval is registered with task manager.<br><br>' +
'<code>appname</code> is the three-letter codename of your app, for organisation purposes.<br>' +
'<code>taskname</code> is a name for your task to take on. Think of it like a window caption, except it\'s on a task, in a list.<br>' +
'<code>functionname</code> is the code to run for your function, <b><u>ENCODED AS A STRING!</u></b> It is recommended to be a reference to a function (try using the value "apps.YOURAPP.vars.importantFunction()").' +
'<code>functiontime</code> is the number of milliseconds that JS waits to run your code, just like setInterval().'
},
removeTimeout: {
'1': 'land',
'2': 'removeTimeout(appname, taskname, cnfrm)',
helpPage: 'Same as window.clearTimeout, except it removes a task registered with task manager. Use the same appname and taskname as you used to register it. <code>cnfrm</code> is a useless argument and does nothing.'
},
removeInterval: {
'1': 'land',
'2': 'removeInterval(appname, taskname, cnfrm)',
helpPage: 'Same as window.clearInterval, except it removes a task registered with task manager. Use the same appname and taskname as you used to register it. <code>cnfrm</code> is a useless argument and does nothing.'
},
currentSelection: {
'1': 'land',
'2': 'currentSelection',
helpPage: 'The current user text selection, automatically updated by . It only works for text within inputs or textareas, so keep that in mind.'
},
doLog: {
'1': 'land',
'2': 'doLog(msg, color)',
helpPage: 'Logs the msg to the JS Console with the given color. If no given color, it is white. The message is also logged to the browser\'s console.'
},
toTop: {
'1': 'land',
'2': 'toTop(appToNudge, dsktpClick)',
helpPage: 'Send an app to the top of the window stack. <code>appToNude</code> is the location in <code>apps</code> that the app resides, i.e. <code>apps.settings</code> would be the input there.'
},
openapp: {
'1': 'land',
'2': 'openapp(appToOpen, launchTypeUsed)',
helpPage:
'Opens an app installed on .<br><br>' +
'<code>appToOpen</code> is the path to the app inside the <code>apps</code> object, i.e. <code>apps.settings</code><br>' +
'<code>launchTypeUsed</code> is the launchType sent to the app. The launchtypes officially supported by apps are "dsktp" and "tskbr", to determine how they open. However, you can make your own.'
},
ctxMenu: {
'1': 'land',
'2': 'ctxMenu(setupArray, version, event, args)',
helpPage:
'Opens a context menu at the user\'s cursor, depending on which ctxMenu type is used.<br><br>More help coming soon.'
}
}
},
lastPath: '',
lastFolder: {},
populateList: function(menuPath){
if(menuPath){
this.lastPath = menuPath;
}else{
this.lastPath = '';
}
this.lastFolder = eval('apps.help.vars.categories' + this.lastPath);
if(this.lastFolder['1'] === 'folder'){
apps.help.appWindow.setContent('<button onClick="apps.help.vars.populateList(\'\')">Home</button> Help: ' + this.lastFolder['2'] + '<hr><ul id="HLPlist"></ul>');
for(var i in this.lastFolder){
if(i !== '1' && i !== '2'){
getId('HLPlist').innerHTML += '<li class="cursorPointer" style="font-family:ProFont, monospace; font-size:12px; margin-top:8px;" onClick="apps.help.vars.populateList(\'' + this.lastPath + '.' + i + '\')">' + this.lastFolder[i]['2'] + '</li>';
}
}
}else if(this.lastFolder['1'] === 'land'){
apps.help.appWindow.setContent('<button onClick="apps.help.vars.populateList(\'\')">Home</button> Help: ' + this.lastFolder['2'] + '<hr>' + this.lastFolder.helpPage);
}
}
}, 0, 'help', '/appicons/ds/HLP.png'
);
getId('loadingInfo').innerHTML = 'Initializing Music Visualizer';
});
c(function(){
m('init MSC');
apps.musicVis = new Application(
'MSC',
'Music Visualiser',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setContent('<iframe id="MSCframe" style="border:none; display:block; width:100%; height:100%; overflow:hidden;" src="unrelated/keyfingers/cnv.php"></iframe>');
}
if(!this.vars.intervalMade){
this.vars.intervalMade = 1;
makeInterval('MSC', 'winColorCheck', 'apps.musicVis.vars.checkColors()', 1);
}
this.appWindow.setCaption('Music Visualizer');
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 515, parseInt(getId('monitor').style.height, 10) / 2 - 143, 1030, 309);
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This is the official OS Music Visualizer. To see all compatible songs, visit https:///unrelated/keyfingers/music and type the name of a song from there - for example, "music/Neurology.mp3"',
intervalMade: 0,
beforeColor: '',
working: 0,
currtitle: '',
currnumber: 0,
checkColors: function(){
if(getId("MSCframe") !== null){
this.currtitle = getId("MSCframe").contentDocument.title;
if(this.currtitle.indexOf(' recolor') > -1){
if(!this.working){
this.beforeColor = apps.settings.vars.currWinColor;
this.working = 1;
}
this.currnumber = parseInt(this.currtitle);
apps.settings.vars.setWinColor(1, 'rgb(0,' + this.currnumber + ',' + (255 - this.currnumber) + ')');
}else{
if(this.working){
apps.settings.vars.setWinColor(1, this.beforeColor);
this.working = 0;
}
}
}else{
if(this.working){
apps.settings.vars.setWinColor(1, this.beforeColor);
this.working = 0;
}
}
}
}, 1, 'musicVis', '/appicons/ds/MSC.png'
);
getId('loadingInfo').innerHTML = 'Initializing Mathway';
});
c(function(){
apps.mathway = new Application(
'MWy',
'Mathway',
0,
function(){
if(!this.appWindow.appIcon){
apps.prompt.vars.notify('This app is just a quick-access link to mathway.com and I do not claim ownership of Mathway.', [], function(){}, 'Mathway', '/appicons/MWy.png');
this.appWindow.setContent('<iframe src="https://mathway.com" style="width:100%;height:100%;border:none;display:block;position:absolute;"></iframe>');
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 400, parseInt(getId('monitor').style.height, 10) / 2 - 250, 800, 500);
this.appWindow.setCaption('Mathway');
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app simply links the Mathway website inside a frame for use on . I CLAIM NO OWNERSHIP OR AFFILIATION WITH MATHWAY!'
}, 1, "mathway", "/appicons/MWy.png"
);
getId('loadingInfo').innerHTML = 'Initializing Apps Browser';
});
c(function(){
apps.appsbrowser = new Application(
'APB',
'Apps Browser',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 200, parseInt(getId('monitor').style.height, 10) / 2 - 250, 400, 500);
this.appWindow.setCaption('Apps Browser');
this.appWindow.setContent('<div id="APBdiv" style="width:100%;height:100%;overflow-y:auto;font-family:ProFont;"><div style="overflow-y:auto;font-size:12px;width:100%;height:128px;border-bottom:1px solid #000;">This is a list of EVERY SINGLE APP installed on your copy of , in the order that they were installed in (believe it or not, being in the wrong order can cause issues); including those that are hidden from your desktop and applications list.<br><br>WARNING - If an app is not available in the Apps List, it\'s probably for a reason. Some apps not available in the applications list may break if you launch them.<br><br>Note - if nothing happens when you try to open a certain app, do not worry. A window is <b>not</b> a requirement for an app to work. It probably is not designed for you to access.</div></div>');
this.vars.appsListed = 1;
for(var app in apps){
this.vars.currAppImg = apps[app].appWindow.appImg;
this.vars.currAppIcon = apps[app].dsktpIcon;
this.vars.currAppName = apps[app].appDesc;
if(apps[app].keepOffDesktop === 0){
this.vars.currAppDesktop = 'Available On Desktop';
}else{
this.vars.currAppDesktop = 'Not On Desktop';
}
if(apps[app].keepOffDesktop < 2){
this.vars.currAppOnList = 'Available In Apps List';
}else{
this.vars.currAppOnList = 'Not In Apps List';
}
if(apps[app].launchTypes){
this.vars.currAppLaunchTypes = 'Uses LaunchTypes';
}else{
this.vars.currAppLaunchTypes = 'No LaunchTypes';
}
if(apps[app].appWindow.onTop){
this.vars.currAppOnTop = 'Always On Top<br>';
}else{
this.vars.currAppOnTop = '';
}
if(typeof USERFILES['APM_APPS_DATABASE_' + app] === "string"){
this.vars.currAppBuiltIn = 'User-Made APM App';
}else{
this.vars.currAppBuiltIn = 'Built-In App'
}
getId("APBdiv").innerHTML += '<div class="appsBrowserItem cursorPointer" onclick="c(function(){openapp(apps.' + app + ', \'dsktp\')});" style="top:' + this.vars.appsListed * /*101*/129 + 'px;height:128px;width:100%;border-bottom:1px solid #000;"><img style="height:128px;width:128px;" src="' + this.vars.currAppImg + '" onerror="this.src=\'/appicons/ds/redx.png\'"><div style="font-size:24px;left:132px;bottom:66px;">' + this.vars.currAppIcon + '</div><div style="left:132px;top:66px;font-size:12px;">' + this.vars.currAppName + '</div><div style="color:#555;left:132px;top:4px;font-size:12px;text-align:right">apps.' + app + '</div><div style="color:#555;font-size:12px;right:4px;bottom:4px;text-align:right">' + this.vars.currAppOnTop + this.vars.currAppDesktop + '<br>' + this.vars.currAppOnList + '<br>' + this.vars.currAppBuiltIn + '</div><div style="color:#555;font-size:12px;left:132px;bottom:4px;">' + this.vars.currAppLaunchTypes + '</div></div>';
getId("APBdiv").innerHTML += '<button style="position:absolute;right:0px;top:' + this.vars.appsListed * 129 + 'px;font-size:12px;" onclick="c(function(){ctxMenu([[event.pageX, event.pageY, \'/ctxMenu/beta/window.png\', \'/ctxMenu/beta/window.png\', \'/ctxMenu/beta/file.png\', \'/ctxMenu/beta/folder.png\', \'/ctxMenu/beta/file.png\'], \' Open App\', \'c(function(){openapp(apps.' + app + ', \\\'dsktp\\\')})\', \' Open App via Taskbar\', \'c(function(){openapp(apps.' + app + ', \\\'tskbr\\\')})\', \'+About This App\', \'c(function(){openapp(apps.appInfo, \\\'' + app + '\\\')})\', \' View in Files\', \'c(function(){openapp(apps.files, \\\'dsktp\\\');c(function(){apps.files.vars.next(\\\'apps.' + app + '\\\')})})\'' + function(appname, builtin){if(builtin === "User-Made APM App"){return ', \' Open Source File\', \'c(function(){openapp(apps.notepad, \\\'open\\\');apps.notepad.vars.openFile(\\\'APM_APPS_DATABASE_' + appname + '\\\')})\'';}else{return ''}}(app, this.vars.currAppBuiltIn) + '])})">v</button>';
this.vars.appsListed++;
}
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'Use this app to browse through every app installed on the system, including internal system apps.',
appsListed: 1,
currAppImg: '',
currAppIcon: '',
currAppName: '',
currAppDesktop: '',
currAppOnList: '',
currAppLaunchTypes: '',
currAppBuiltIn: ''
}, 1, 'appsbrowser', '/appicons/ds/APB.png'
);
getId('loadingInfo').innerHTML = 'Initializing Indy Car';
});
c(function(){
apps.indycar = new Application(
'ICr',
'Indycar',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 323, parseInt(getId('monitor').style.height, 10) / 2 - 251, 646, 502);
this.appWindow.setCaption('<span class="liveElement" liveVar="getId(\'ICrFrame\').contentDocument.title">');
this.appWindow.setContent('<iframe id="ICrFrame" src="INDYCAR/index.html" style="border:none;width:640px;height:480px;overflow:hidden;"></iframe>');
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setCaption('IndyCar');
getId('ICrFrame').contentDocument.innerHTML = "";
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'An IndyCar-based game made by the developer in GameMaker: Studio'
}, 1, "indycar", '/appicons/ICr.png'
);
getId('loadingInfo').innerHTML = 'Initializing House Game';
});
c(function(){
apps.housegame = new Application(
'HsG',
'House Game',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 507, parseInt(getId('monitor').style.height, 10) / 2 - 316, 1015, 633);
this.appWindow.setCaption('<span class="liveElement" liveVar="getId(\'HsGFrame\').contentDocument.title">');
this.appWindow.setContent('<iframe id="HsGFrame" src="HOUSEGAME/index.html" style="border:none;width:1009px;height:609px;overflow:hidden;"></iframe>');
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setCaption("House Game");
getId('HsGFrame').contentDocument.innerHTML = "";
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'A house defense game made by the developer with GameMaker: Studio'
}, 1, "housegame", '/appicons/HsG.png'
);
getId('loadingInfo').innerHTML = 'Initializing Sticky Notes';
});
c(function(){
apps.postit = new Application(
'SNt',
'Sticky Note',
0,
function(){
this.appWindow.setCaption('Sticky Note');
if(!this.appWindow.appIcon){
this.appWindow.setDims(10, 10, 200, 200);
this.appWindow.setContent('<textarea id="stickyNotePad" onblur="apps.postit.vars.savePost()" style="padding:0;font-family:Comic Sans MS;font-weight:bold;border:none;resize:none;display:block;width:100%;height:100%;background-color:#FF7;"></textarea>');
addEditContext('stickyNotePad');
if(typeof USERFILES.APP_SNt_stickyNoteSave === "string"){
getId('stickyNotePad').value = USERFILES.APP_SNt_stickyNoteSave;
}
this.appWindow.alwaysOnTop(1);
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
//apps.savemaster.vars.save('APP_SNt_stickyNoteSave', getId('stickyNotePad').value, 1);
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
this.appWindow.alwaysOnTop(1);
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'Simple stickynote that stays above other apps on your screen. The contents are saved across reboots.',
savePost: function(){
if(apps.postit.appWindow.appIcon){
apps.savemaster.vars.save('APP_SNt_stickyNoteSave', getId('stickyNotePad').value, 1);
}
}
}, 1, 'postit', '/appicons/ds/SNt.png'
);
getId('loadingInfo').innerHTML = 'Initializing Bootscript App';
});
c(function(){
apps.bootScript = new Application(
'BtS',
'Boot Script',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 200, parseInt(getId('monitor').style.height, 10) / 2 - 200, 400, 400);
this.appWindow.setCaption('Boot Script');
this.appWindow.setContent('<textarea id="BtStextarea" style="font-family:ProFont, monospace;font-size:12px;padding:0;border:none;width:100%;height:90%;resize:none;"></textarea><button style="position:absolute;bottom:0;left:0;width:50%;height:10%;" onclick="apps.bootScript.vars.saveBootScript()">Save</button><button style="position:absolute;bottom:0;right:0;width:50%;height:10%;" onclick="apps.bootScript.vars.helpBootScript()">Help</button>');
if(typeof USERFILES.APP_BtS_BOOTSCRIPT === "string"){
getId('BtStextarea').innerHTML = USERFILES.APP_BtS_BOOTSCRIPT;
}
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
window.setTimeout(apps.bootScript.vars.doBootScript, 1);
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app runs your own custom JavaScript code just after boots, just before the loading screen disappears. Any JS code will work here - mod to your heart\'s content!<br><br>If you created something you would wish to be featured in , please tell the developer so he can take a look!',
theBootScript: '',
doBootScript: function(){
if(typeof USERFILES.APP_BtS_BOOTSCRIPT === 'string'){
this.theBootScript = USERFILES.APP_BtS_BOOTSCRIPT;
try{
eval(this.theBootScript);
}catch(err){
apps.prompt.vars.notify('An error occoured in your bootscript.<br><br>' + err, ['Debug'], function(btn){
doLog('----------<br>Bootscript error!', '#F00');
doLog(err, '#ACE');
doLog('----------', '#F00');
if(btn === 0){
openapp(apps.jsConsole, 'dsktp');
openapp(apps.bootScript, 'dsktp');
}
}, 'Boot Script', '/appicons/BgC.png');
}
}
},
saveBootScript: function(){
apps.savemaster.vars.save('APP_BtS_BOOTSCRIPT', getId('BtStextarea').value, 1);
},
helpBootScript: function(){
apps.prompt.vars.alert('WARNING - ADVANCED USERS ONLY<br>The Bootscript is your very own script to run on OS boot. Use it for useful things like... well, I can\'t think of anything. Here you are though.<br><br>BootScript will run your script one millisecond after the OS finishes loading your userfiles.<br><br>Save all variables for your script inside the \'this\' object. Example... this.myVar = 9000.1;<br><br>Bootscripts are written in JavaScript. Use the API and assume that your script lives inside of an app\'s vars... (<b>apps.theoreticalApp.vars</b> <-- your script theoretically here) Check the API doc for reference to what this means.<br><br>Your bootscript is NOT AN APP and has no window. Trying to call anything within this.appWindow WILL result in an error!', 'Okay, thanks.', function(){}, 'Boot Script');
}
}, 1, 'bootScript', '/appicons/ds/BtS.png'
);
getId('loadingInfo').innerHTML = 'Initializing Custom Style Editor';
});
c(function(){
apps.styleEditor = new Application(
'CSE',
'Custom Style Editor',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 200, parseInt(getId('monitor').style.height, 10) / 2 - 200, 400, 400);
this.appWindow.setCaption('Custom Style Editor');
this.appWindow.setContent('<textarea id="CSEtextarea" style="font-family:ProFont, monospace;font-size:12px;padding:0;border:none;width:50%;height:90%;resize:none;" onkeyup="try{apps.styleEditor.vars.updateFrame()}catch(e){}"></textarea><iframe src="/csePreview.html" style="position:absolute;right:0;top:0;border:none;display:block;width:50%;height:90%" id="CSEframe" onload="apps.styleEditor.vars.updateFrame()"></iframe><button style="position:absolute;bottom:0;left:0;width:50%;height:10%;" onclick="apps.styleEditor.vars.saveStyleEditor()">Save</button><button style="position:absolute;bottom:0;right:0;width:50%;height:10%;" onclick="apps.styleEditor.vars.helpStyleEditor()">Help</button>');
if(typeof USERFILES.CustomStyle === "string"){
getId('CSEtextarea').innerHTML = USERFILES.CustomStyle;
//this.vars.updateFrame();
}
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'Create your own custom CSS stylesheet for ! It is embedded as an actual stylesheet, placed such that it overrides the default styles.<br><br>If you create something you want to be featured in , please tell the developer so he can take a look!',
saveStyleEditor: function(){
apps.savemaster.vars.save('CustomStyle', getId('CSEtextarea').value, 1);
getId('CustomStyle').innerHTML = USERFILES.CustomStyle;
},
helpStyleEditor: function(){
apps.prompt.vars.alert('WARNING - ADVANCED USERS ONLY<br>The Custom Stylesheet is your very own set of styling rules for . Use it to style to your whim - theoretically, every element of the OS can be customized with this file.<br><br>You can check out style.css for the default stylesheet, and use your browser\'s developer tools to get easier access to elements as they are shown on-screen.', 'Okay, thanks.', function(){}, 'Boot Script');
},
updateFrame: function(){
// iframe is called CSEframe
getId('CSEframe').contentDocument.getElementById('CustomStyle').innerHTML = getId('CSEtextarea').value;
}
}, 1, 'styleEditor', '/appicons/ds/CSE.png'
);
getId('loadingInfo').innerHTML = 'Initializing GTK2';
});
c(function(){
apps.gtk2 = new Application(
'GTK',
'GTK3 Style Converter',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setCaption('GTK2');
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 200, parseInt(getId('monitor').style.height, 10) / 2 - 200, 400, 400);
this.appWindow.setContent('<iframe src="/gtk/" style="border:none;width:100%;height:100%;display:block;"></iframe>');
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'This app turns GTK3 themes into themes compatible with OS. It is still a work in progress and results may vary in quality. My favorite themes to convert are Mint-Y-Dark and Arc-Dark.'
}, 1, 'gtk2', '/appicons/ds/GTK.png'
);
getId('loadingInfo').innerHTML = 'Initializing Function Grapher';
});
c(function(){
apps.graph = new Application(
'Gph',
'Function Grapher',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 203, parseInt(getId('monitor').style.height, 10) / 2 - 262, 406, 524);
this.appWindow.setCaption('Function Grapher');
this.appWindow.setContent('<canvas width="400" height="400" style="width:400px;height:400px;position:absolute;border:none;" id="GphGraph"></canvas><div id="GphControls" style="white-space:nowrap;width:400px;height:99px;border-top:1px solid #000;bottom:0;font-family:monospace;overflow:auto;"></div>');
getId('GphControls').innerHTML = '&nbsp;f(x) = <input id="GphInput"><br>xStep = <input id="GphStep" value="0.05" size="6"> (must be &gt; 0.005)<br>Color = <input id="GphColor" value="#000"><br><button onclick="apps.graph.vars.graph()">Graph</button><br>Calculate at X: <input id="GphCalc" size="5"> <button onclick="apps.graph.vars.calculate()">Calculate</button><hr><span id="GphStatus"></span>';
this.vars.cnv = getId('GphGraph');
this.vars.ctx = this.vars.cnv.getContext('2d');
this.vars.ctx.strokeStyle = '#CCC';
for(var i = 0; i < 400; i += 20){
if(i !== 200){
this.vars.ctx.beginPath();
this.vars.ctx.moveTo(i + 0.5, 0);
this.vars.ctx.lineTo(i + 0.5, 400);
this.vars.ctx.stroke();
this.vars.ctx.beginPath();
this.vars.ctx.moveTo(0.5, i + 0.5);
this.vars.ctx.lineTo(400.5, i + 0.5);
this.vars.ctx.stroke();
}
}
this.vars.ctx.strokeStyle = '#555';
this.vars.ctx.beginPath();
this.vars.ctx.moveTo(0.5, 200.5);
this.vars.ctx.lineTo(400.5, 200.5);
this.vars.ctx.stroke();
this.vars.ctx.beginPath();
this.vars.ctx.moveTo(200.5, 0);
this.vars.ctx.lineTo(200.5, 400);
this.vars.ctx.stroke();
this.vars.ctx.beginPath();
this.vars.ctx.strokeStyle = '#000';
this.vars.ctx.strokeWidth = '1';
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'A very simple function grapher for . The "window" size is from -10 to 10 on the X and Y axis. Keep in mind that the math uses JAVASCRIPT NOTATION!',
cnv: {},
ctx: {},
getBreak: function(type){
switch(String(type)){
case 'NaN':
return 'y is NaN';
case 'Infinity':
return 'Divide by Zero';
case '-Infinity':
return 'Divide by Zero';
default:
return 'Unknown Error';
}
},
currY: 0,
lastY: 0,
currFunc: '',
failed: 0,
graph: function(){
this.currFunc = getId('GphInput').value;
this.currColor = getId('GphColor').value;
this.currStep = parseFloat(getId('GphStep').value);
this.ctx.strokeStyle = this.currColor;
this.ctx.beginPath();
this.failed = 1;
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#00F">&nbsp;</span> f(x) = ' + this.currFunc + '<br>';
if(this.currStep <= 0.005 || isNaN(this.currStep)){
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#F00">&nbsp;</span> xStep ' + this.currStep + ' invalid, using 0.05<br>';
this.currStep = 0.05;
}else{
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#00F">&nbsp;</span> xStep ' + this.currStep + '<br>';
}
for(var x = -10; x <= 10; x = Math.round((x + this.currStep) * 100) / 100){
try{
this.currY = eval(this.currFunc);
if(isNaN(this.currY) || this.currY === Infinity || this.currY === -Infinity){
if(!this.failed){
this.failed = 1;
this.ctx.stroke();
this.ctx.beginPath();
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#F00">&nbsp;</span> Break at ' + x + ' : ' + this.getBreak(this.currY) + '<br>';
}
}else{
if(this.failed){
//this.lastY = eval(this.currFunc);
this.failed = 0;
this.ctx.moveTo((x + 10) * 20 + 0.5, 400 - (eval(this.currFunc) + 10) * 20);
if(x !== -10){
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#0F0">&nbsp;</span> Start at ' + x + '<br>';
}
}
this.ctx.lineTo((x + 10) * 20 + 0.5, 400 - (this.currY + 10) * 20);
}
}catch(err){
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#F00">&nbsp;</span> Break at ' + x + ' : Parse Error<br>';
break;
}
}
this.ctx.stroke();
},
calculate: function(){
this.currFunc = getId('GphInput').value;
this.currColor = getId('GphColor').value;
this.currX = getId('GphCalc').value;
this.ctx.strokeStyle = this.currColor;
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#7F00FF">&nbsp;</span> f(x) = ' + this.currFunc + '<br>';
try{
var x = parseFloat(this.currX);
this.currY = eval(this.currFunc);
if(isNaN(this.currY) || this.currY === Infinity || this.currY === -Infinity){
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#F00">&nbsp;</span> Break at f(' + x + ') : ' + this.getBreak(this.currY) + '<br>';
}else{
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#7F00FF">&nbsp;</span> f(' + x + ') = ' + this.currY + '<br>';
this.ctx.strokeRect(Math.floor((x + 10) * 20) - 1.5, Math.round(400 - (this.currY + 10) * 20) - 1.5, 4, 4);
}
}catch(err){
getId('GphStatus').innerHTML += '<span style="background-color:' + this.currColor + '">&nbsp;</span><span style="background-color:#F00">&nbsp;</span> Break at f(' + x + ') : Parse Error<br>';
}
}
}, 1, 'graph', '/appicons/ds/Gph.png'
);
getId('loadingInfo').innerHTML = 'Initializing Magnifier';
});
c(function(){
apps.magnifier = new Application(
'Mag',
'Magnifier',
0,
function(){
if(!this.appWindow.appIcon){
this.appWindow.setDims(10, 10, 300, 100);
this.appWindow.setCaption('Magnifier');
this.appWindow.setContent('<button onclick="apps.magnifier.vars.startMag(event)">Start</button><button onclick="apps.magnifier.vars.endMag()">Stop</button><br>Zoom: <input id="MAGpercent" value="2" size="3"><br><button onclick="apps.magnifier.vars.setMag()">Set Zoom</button>')
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'Magnify the screen to make it easier to see with visual impairments or HiDpi monitors.',
running: 0,
currMag: 2,
startMag: function(event){
if(!this.running){
document.body.style.overflow = 'hidden';
getId('monitor').style.transform = 'scale(' + this.currMag + ')';
getId('monitor').style.transformOrigin = event.pageX + 'px ' + event.pageY + 'px';
document.body.addEventListener('mousemove', apps.magnifier.vars.setOrigin);
this.running = 1;
}
},
endMag: function(){
if(this.running){
document.body.style.overflow = 'auto';
getId('monitor').style.transform = '';
getId('monitor').style.transformOrigin = '50% 50%';
document.body.removeEventListener('mousemove', apps.magnifier.vars.setOrigin);
this.running = 0;
}
},
setMag: function(){
this.currMag = parseFloat(getId('MAGpercent').value);
if(this.running){
getId('monitor').style.transform = 'scale(' + this.currMag + ')';
}
},
setOrigin: function(event){
getId('monitor').style.transformOrigin = event.pageX + 'px ' + event.pageY + 'px';
}
}, 1, "magnifier", '/appicons/ds/Mag.png'
);
getId('loadingInfo').innerHTML = 'Initializing Cookie Clicker';
});
c(function(){
apps.cookieClicker = new Application(
'CCl',
'Cookie Clicker',
0,
function(){
if(!this.appIcon){
this.appWindow.setDims(parseInt(getId('monitor').style.width, 10) / 2 - 400, parseInt(getId('monitor').style.height, 10) / 2 - 300, 800, 600);
this.appWindow.setCaption('Cookie Clicker');
this.appWindow.setContent('<iframe src="/COOKIE" style="border:none; width:100%; height:100%; display:block;"></iframe>');
}
this.appWindow.openWindow();
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
appInfo: 'The Cookie Clicker clone written by , the developer, and Joseph, the developer of J. It\'s actually pretty addicting.'
}, 1, 'cookieClicker', '/appicons/ds/CCl.png'
);
getId('loadingInfo').innerHTML = 'Finalizing...';
});
/*
c(function(){
apps.clicker = new Application(
'Clk',
' Clicker',
0,
function(){
},
function(signal){
switch(signal){
case "forceclose":
this.vars = this.varsOriginal;
this.appWindow.closeWindow();
this.appWindow.closeIcon();
break;
case "close":
this.appWindow.closeWindow();
this.appWindow.setContent("");
break;
case "checkrunning":
if(this.appWindow.appIcon){
return 1;
}else{
return 0;
}
case "shrink":
this.appWindow.closeKeepTask();
break;
case "USERFILES_DONE":
if(typeof USERFILES.APP_Clk_save === "string"){
apps.clicker.vars.game = JSON.parse(USERFILES.APP_Clk_save)
}
break;
case 'shutdown':
break;
default:
doLog("No case found for '" + signal + "' signal in app '" + this.dsktpIcon + "'", "#F00");
}
},
{
game: {
clicks: 0
}
saveGame: function(){
apps.savemaster.vars.save('APP_Clk_save', JSON.stringify(apps.clicker.vars.game), 1);
}
}, 1, ' Clicker', '/appicons/ds/CCl.png'
);
getId('loadingInfo').innerHTML = 'Finalizing...';
})
*/
m('init finalizing');
//function to open apps
function toTop(appToNudge, dsktpClick){
m('Moving App ' + appToNudge.dsktpIcon + ' to Top');
for(var appLication in apps){
if(dsktpClick !== 2){
if(getId("win" + apps[appLication].dsktpIcon).style.zIndex !== "100"){
getId("win" + apps[appLication].dsktpIcon).style.zIndex = parseInt(getId("win" + apps[appLication].dsktpIcon).style.zIndex, 10) - 1;
}
getId("win" + apps[appLication].dsktpIcon + "c").style.opacity = ".5";
getId("win" + apps[appLication].dsktpIcon + "a").style.opacity = ".8";
getId('icn' + apps[appLication].dsktpIcon).style.backgroundColor = '';
}
}
if(!dsktpClick){
if(getId("win" + appToNudge.dsktpIcon).style.zIndex !== "100"){
getId("win" + appToNudge.dsktpIcon).style.zIndex = "90";
}
getId("win" + appToNudge.dsktpIcon + "c").style.opacity = "1";
getId("win" + appToNudge.dsktpIcon + "a").style.opacity = "1";
getId('icn' + appToNudge.dsktpIcon).style.backgroundColor = 'rgba(255, 255, 255, 0.25)';
//getId("win" + appToNudge.dsktpIcon).style.boxShadow = "0 0 30px #000";
}
if(appToNudge !== apps.startMenu && apps.startMenu.appWindow.appIcon){
apps.startMenu.signalHandler('shrink');
}
getId("ctxMenu").style.display = "none";
var tempAppsList = [];
for(var appLication in apps){
if(getId("win" + apps[appLication].dsktpIcon).style.zIndex !== "100" && apps[appLication].appWindow.appIcon){
tempAppsList.push([appLication, getId("win" + apps[appLication].dsktpIcon).style.zIndex]);
}
}
tempAppsList.sort(function(a, b){
return b[1] - a[1];
});
for(var i = 0; i < tempAppsList.length; i++){
getId("win" + apps[tempAppsList[i][0]].dsktpIcon).style.zIndex = 90 - i;
}
}
function openapp(appToOpen, launchTypeUsed){
m('Opening App ' + appToOpen.dsktpIcon);
if(appToOpen.launchTypes){
appToOpen.main(launchTypeUsed);
}else{
appToOpen.main();
}
toTop(appToOpen);
}
// Applications onclicks
/*
for(var application in apps){
getId("app" + apps[application].dsktpIcon).setAttribute("onClick", "openapp(apps." + application + ", 'dsktp')");
getId("icn" + apps[application].dsktpIcon).setAttribute("onClick", "openapp(apps." + application + ", 'tskbr')");
getId("win" + apps[application].dsktpIcon).setAttribute("onClick", "toTop(apps." + application + ")");
getId("win" + apps[application].dsktpIcon + "e").setAttribute("onClick", "apps." + application + ".signalHandler('close')");
getId("win" + apps[application].dsktpIcon + "s").setAttribute("onClick", "apps." + application + ".signalHandler('shrink')");
}
*/
finishedMakingAppClicks = 1;
//function to remove broken text warning
function fadeResizeText(){
getId("timesUpdated").style.display = "none";
}
//function to measure FPS has been moved to time function
//function to allow app windows to be moved
var winmoveSelect = "";
var winmovex = 0;
var winmovey = 0;
var winmoveOrX = 0;
var winmoveOrY = 0;
var winmovecurrapp = '';
function winmove(e){
if(e.currentTarget !== getId("winmove")){
getId("winmove").style.display = "block";
winmoveSelect = e.currentTarget.id.substring(0, e.currentTarget.id.length - 1);
winmovex = e.pageX;
winmovey = e.pageY;
//winmoveOrX = parseInt(getId(winmoveSelect).style.left);
//winmoveOrY = parseInt(getId(winmoveSelect).style.top);
for(var app in apps){
if(apps[app].dsktpIcon == winmoveSelect.substring(3, winmoveSelect.length)){
winmovecurrapp = app;
break;
}
}
winmoveOrX = apps[winmovecurrapp].appWindow.windowX;
winmoveOrY = apps[winmovecurrapp].appWindow.windowY;
if(apps.settings.vars.performanceMode){
getId('windowFrameOverlay').style.display = 'block';
getId('windowFrameOverlay').style.left = winmoveOrX + 'px';
getId('windowFrameOverlay').style.top = winmoveOrY + 'px';
getId('windowFrameOverlay').style.width = apps[winmovecurrapp].appWindow.windowH + 'px';
getId('windowFrameOverlay').style.height = apps[winmovecurrapp].appWindow.windowV + 'px';
}
}else{
getId("winmove").style.display = "none";
apps[winmovecurrapp].appWindow.setDims(
winmoveOrX + (e.pageX - winmovex) * (1 / screenScale), winmoveOrY + (e.pageY - winmovey) * (1 / screenScale),
apps[winmovecurrapp].appWindow.windowH, apps[winmovecurrapp].appWindow.windowV
);
if(apps.settings.vars.performanceMode){
getId('windowFrameOverlay').style.display = 'none';
}
//eval(getId(winmoveSelect).getAttribute('onclick').substring(6, getId(winmoveSelect).getAttribute('onclick').length - 1) + ".appWindow.windowX = " + (winmoveOrX + (e.pageX - winmovex)));
//eval(getId(winmoveSelect).getAttribute('onclick').substring(6, getId(winmoveSelect).getAttribute('onclick').length - 1) + ".appWindow.windowY = " + (winmoveOrY + (e.pageY - winmovey)));
//getId(winmoveSelect).style.left = winmoveOrX + (e.pageX - winmovex) + "px";
//getId(winmoveSelect).style.top = winmoveOrY + (e.pageY - winmovey) + "px";
//getId(winmoveSelect + "a").style.backgroundPosition = (-1 * (winmoveOrX + (e.pageX - winmovex)) + 40) + "px " + (-1 * (winmoveOrY + (e.pageY - winmovey)) + 40) + "px";
}
}
getId("winmove").addEventListener("click", winmove);
function winmoving(e){
winmovelastx = e.pageX;
winmovelasty = e.pageY;
if(apps.settings.vars.performanceMode){
getId('windowFrameOverlay').style.left = winmoveOrX + (e.pageX - winmovex) * (1 / screenScale) + 'px';
getId('windowFrameOverlay').style.top = winmoveOrY + (e.pageY - winmovey) * (1 / screenScale) + 'px';
}else{
apps[winmovecurrapp].appWindow.setDims(
winmoveOrX + (e.pageX - winmovex) * (1 / screenScale), winmoveOrY + (e.pageY - winmovey) * (1 / screenScale),
apps[winmovecurrapp].appWindow.windowH, apps[winmovecurrapp].appWindow.windowV
);
}
//getId(winmoveSelect).style.left = winmoveOrX + (e.pageX - winmovex) + "px";
//getId(winmoveSelect).style.top = winmoveOrY + (e.pageY - winmovey) + "px";
//getId(winmoveSelect + "a").style.backgroundPosition = (-1 * (winmoveOrX + (e.pageX - winmovex)) + 40) + "px " + (-1 * (winmoveOrY + (e.pageY - winmovey)) + 40) + "px";
}
var icomoveSelect = "";
var icomovex = 0;
var icomovey = 0;
var icomoveOrX = 0;
var icomoveOrY = 0;
function icomove(e, elem){
if(elem){
getId("icomove").style.display = "block";
icomoveSelect = "app" + elem;
icomovex = e.pageX;
icomovey = e.pageY;
icomoveOrX = parseInt(getId(icomoveSelect).style.left, 10);
icomoveOrY = parseInt(getId(icomoveSelect).style.top, 10);
toTop({dsktpIcon: 'DESKTOP'}, 1);
}else{
getId("icomove").style.display = "none";
apps.savemaster.vars.save('DSKTP_ico_' + icomoveSelect, '[' + (icomoveOrX + (e.pageX - icomovex) * (1 / screenScale)) + ',' + (icomoveOrY + (e.pageY - icomovey) * (1 / screenScale)) + ']', 1);
getId(icomoveSelect).style.left = icomoveOrX + (e.pageX - icomovex) * (1 / screenScale) + "px";
getId(icomoveSelect).style.top = icomoveOrY + (e.pageY - icomovey) * (1 / screenScale) + "px";
}
}
getId("icomove").addEventListener("click", icomove);
function icomoving(e){
getId(icomoveSelect).style.left = icomoveOrX + (e.pageX - icomovex) * (1 / screenScale) + "px";
getId(icomoveSelect).style.top = icomoveOrY + (e.pageY - icomovey) * (1 / screenScale) + "px";
}
//custom icons
function icnmove(e, elem){
if(elem){
getId("icnmove").style.display = "block";
icomoveSelect = "app" + elem;
icomovex = e.pageX;
icomovey = e.pageY;
icomoveOrX = parseInt(getId(icomoveSelect).style.left, 10);
icomoveOrY = parseInt(getId(icomoveSelect).style.top, 10);
toTop({dsktpIcon: 'DESKTOP'}, 1);
}else{
getId("icnmove").style.display = "none";
apps.iconMaker.vars.moveIcon(icomoveSelect, '[' + (icomoveOrX + (e.pageX - icomovex) * (1 / screenScale)) + ',' + (icomoveOrY + (e.pageY - icomovey) * (1 / screenScale)) + ']');
getId(icomoveSelect).style.left = icomoveOrX + (e.pageX - icomovex) * (1 / screenScale) + "px";
getId(icomoveSelect).style.top = icomoveOrY + (e.pageY - icomovey) * (1 / screenScale) + "px";
}
}
getId("icnmove").addEventListener("click", icnmove);
function icnmoving(e){
getId(icomoveSelect).style.left = icomoveOrX + (e.pageX - icomovex) * (1 / screenScale) + "px";
getId(icomoveSelect).style.top = icomoveOrY + (e.pageY - icomovey) * (1 / screenScale) + "px";
}
var tempwinrot = "";
var tempwinrota = "";
function winrot(e){
if(e.currentTarget !== getId("winrot")){
getId("winrot").style.display = "block";
winmoveSelect = e.currentTarget.id.substring(0, e.currentTarget.id.length - 1);
winmovex = e.pageX;
winmovey = e.pageY;
for(var app in apps){
if(apps[app].dsktpIcon == winmoveSelect.substring(3, winmoveSelect.length)){
winmovecurrapp = app;
break;
}
}
winmoveOrX = apps[winmovecurrapp].appWindow.windowH;
winmoveOrY = apps[winmovecurrapp].appWindow.windowV;
if(apps.settings.vars.performanceMode){
getId('windowFrameOverlay').style.display = 'block';
getId('windowFrameOverlay').style.left = apps[winmovecurrapp].appWindow.windowX + 'px';
getId('windowFrameOverlay').style.top = apps[winmovecurrapp].appWindow.windowY + 'px';
getId('windowFrameOverlay').style.width = winmoveOrX + 'px';
getId('windowFrameOverlay').style.height = winmoveOrY + 'px';
}
}else{
getId("winrot").style.display = "none";
apps[winmovecurrapp].appWindow.setDims(
apps[winmovecurrapp].appWindow.windowX, apps[winmovecurrapp].appWindow.windowY,
winmoveOrX + (e.pageX - winmovex) * (1 / screenScale), winmoveOrY + (e.pageY - winmovey) * (1 / screenScale)
);
if(apps.settings.vars.performanceMode){
getId('windowFrameOverlay').style.display = 'none';
}
//getId(winmoveSelect).style.transform = "rotateY(" + (e.pageX - winmovex) + "deg)rotateX(" + (e.pageY - winmovey) + "deg)";
//getId(winmoveSelect).style.transform = "scale(" + (1 + (e.pageX - winmovex) * 0.0025) + "," + (1 + (e.pageY - winmovey) * 0.0025) + ")";
//getId(winmoveSelect + "a").style.transform = "rotateY(" + -1 * (e.pageX - winmovex) + "deg)rotateX(" + -1 * (e.pageY - winmovey) + "deg)";
}
}
getId("winrot").addEventListener("click", winrot);
function winroting(e){
if(apps.settings.vars.performanceMode){
getId('windowFrameOverlay').style.width = winmoveOrX + (e.pageX - winmovex) * (1 / screenScale) + 'px';
getId('windowFrameOverlay').style.height = winmoveOrY + (e.pageY - winmovey) * (1 / screenScale) + 'px';
}else{
apps[winmovecurrapp].appWindow.setDims(
apps[winmovecurrapp].appWindow.windowX, apps[winmovecurrapp].appWindow.windowY,
winmoveOrX + (e.pageX - winmovex) * (1 / screenScale), winmoveOrY + (e.pageY - winmovey) * (1 / screenScale)
);
}
//getId(winmoveSelect).style.transform = "rotateY(" + (e.pageX - winmovex) + "deg)rotateX(" + (e.pageY - winmovey) + "deg)";
//getId(winmoveSelect).style.transform = "scale(" + (1 + (e.pageX - winmovex) * 0.0025) + "," + (1 + (e.pageY - winmovey) * 0.0025) + ")";
//getId(winmoveSelect + "a").style.transform = "rotateY(" + -1 * (e.pageX - winmovex) + "deg)rotateX(" + -1 * (e.pageY - winmovey) + "deg)";
}
function highlightWindow(app){
getId('windowFrameOverlay').style.display = 'block';
getId('windowFrameOverlay').style.left = apps[app].appWindow.windowX + "px";
getId('windowFrameOverlay').style.top = apps[app].appWindow.windowY + "px";
getId('windowFrameOverlay').style.width = apps[app].appWindow.windowH + "px";
getId('windowFrameOverlay').style.height = apps[app].appWindow.windowV + "px";
}
function highlightHide(){
getId('windowFrameOverlay').style.display = 'none';
}
c(function(){
openapp(apps.settings);
c(function(){
apps.settings.signalHandler('close');
});
});
var ctxSetup = [
[0, 0, "/appicons/ds/redx.png", "/appicons/ds/redx.png"],
' Context', 'alert("Context Menu Not Correctly Initialized")',
' Menu', 'alert("Context Menu Not Correctly Initialized")'
];
var newCtxSetup = [
[' Context', function(){alert('context')}, '/appicons/ds/redx.png'],
[' Menu', function(){alert('menu')}, '/appicons/ds/redx.png']
];
var newCtxCoord = [10, 10];
var newCtxArgs = [];
var ctxMenuImg = "";
function ctxMenu(setupArray, version, event, args){
m('Opening ctxMenu');
if(version){
if(getId('ctxMenu').style.display !== "block"){
newCtxCoord = [event.pageX * (1 / screenScale), event.pageY * (1 / screenScale)];
newCtxArgs = args;
newCtxSetup = setupArray;
getId("ctxMenu").style.display = "block";
if(newCtxCoord[0] > window.innerWidth * (1 / screenScale) / 2){
getId("ctxMenu").style.removeProperty("left");
getId("ctxMenu").style.right = window.innerWidth * (1 / screenScale) - newCtxCoord[0] - 1 + "px";
}else{
getId("ctxMenu").style.removeProperty("right");
getId("ctxMenu").style.left = newCtxCoord[0] + "px";
}
if(newCtxCoord[1] > window.innerHeight * (1 / screenScale) / 2){
getId("ctxMenu").style.removeProperty("top");
getId("ctxMenu").style.bottom = window.innerHeight * (1 / screenScale) - newCtxCoord[1] - 1 + "px";
}else{
getId("ctxMenu").style.removeProperty("bottom");
getId("ctxMenu").style.top = newCtxCoord[1] + "px";
}
getId("ctxMenu").innerHTML = "";
for(var i in newCtxSetup){
if(typeof newCtxSetup[i][0] === 'function'){
if(newCtxSetup[i][0](newCtxArgs)[0] === '+' || newCtxSetup[i][0](newCtxArgs)[0] === '_'){
c(function(){
getId("ctxMenu").innerHTML += '<hr>';
});
}
if(newCtxSetup[i][2]){
ctxMenuImg = '<img src="' + newCtxSetup[i][2] + '" style="width:10px; height:10px; margin-top:1px; margin-bottom:-2px; margin-left:1px;" onerror="this.style.marginLeft = \'0\';this.style.marginRight = \'1px\';this.src = \'/ctxMenu/beta/simple.png\'">';
}else{
ctxMenuImg = '<img src="/ctxMenu/beta/simple.png" style="width:10px; height:10px; margin-top:1px; margin-bottom:-2px; margin-right:1px">';
}
if(newCtxSetup[i][0](newCtxArgs)[0] === '-' || newCtxSetup[i][0](newCtxArgs)[0] === '_'){
c(function(arg){
getId("ctxMenu").innerHTML += '<p class="hiddenCtxOption">' + arg[1] + "&nbsp;" + newCtxSetup[arg[0]][0](newCtxArgs).substring(1,newCtxSetup[arg[0]][0](newCtxArgs).length) + '&nbsp;</p>';
}, [i, ctxMenuImg]);
}else{
c(function(arg){
getId("ctxMenu").innerHTML += '<p class="cursorPointer" onClick="newCtxSetup[' + arg[0] + '][1](newCtxArgs)">' + arg[1] + "&nbsp;" + newCtxSetup[arg[0]][0](newCtxArgs).substring(1,newCtxSetup[arg[0]][0](newCtxArgs).length) + '&nbsp;</p>';
}, [i, ctxMenuImg]);
}
}else{
if(newCtxSetup[i][0][0] === '+' || newCtxSetup[i][0][0] === '_'){
c(function(){
getId("ctxMenu").innerHTML += '<hr>';
});
}
if(newCtxSetup[i][2]){
ctxMenuImg = '<img src="' + newCtxSetup[i][2] + '" style="width:10px; height:10px; margin-top:1px; margin-bottom:-2px; margin-left:1px;" onerror="this.style.marginLeft = \'0\';this.style.marginRight = \'1px\';this.src = \'/ctxMenu/beta/simple.png\'">';
}else{
ctxMenuImg = '<img src="/ctxMenu/beta/simple.png" style="width:10px; height:10px; margin-top:1px; margin-bottom:-2px; margin-right:1px">';
}
if(newCtxSetup[i][0][0] === '-' || newCtxSetup[i][0][0] === '_'){
c(function(arg){
getId("ctxMenu").innerHTML += '<p class="hiddenCtxOption">' + arg[1] + "&nbsp;" + newCtxSetup[arg[0]][0].substring(1,newCtxSetup[arg[0]][0].length) + '&nbsp;</p>';
}, [i, ctxMenuImg]);
}else{
c(function(arg){
getId("ctxMenu").innerHTML += '<p class="cursorPointer" onClick="newCtxSetup[' + arg[0] + '][1](newCtxArgs)">' + arg[1] + "&nbsp;" + newCtxSetup[arg[0]][0].substring(1,newCtxSetup[arg[0]][0].length) + '&nbsp;</p>';
}, [i, ctxMenuImg]);
}
}
}
}
}else{
if(getId("ctxMenu").style.display !== "block"){
ctxSetup = setupArray;
getId("ctxMenu").style.display = "block";
ctxSetup[0][0] *= (1 / screenScale);
ctxSetup[0][1] *= (1 / screenScale);
if(ctxSetup[0][0] > window.innerWidth * (1 / screenScale) / 2){
getId("ctxMenu").style.removeProperty("left");
getId("ctxMenu").style.right = window.innerWidth * (1 / screenScale) - ctxSetup[0][0] - 1 + "px";
}else{
getId("ctxMenu").style.removeProperty("right");
getId("ctxMenu").style.left = ctxSetup[0][0] + "px";
}
if(ctxSetup[0][1] > window.innerHeight * (1 / screenScale) / 2){
getId("ctxMenu").style.removeProperty("top");
getId("ctxMenu").style.bottom = window.innerHeight * (1 / screenScale) - ctxSetup[0][1] - 1 + "px";
}else{
getId("ctxMenu").style.removeProperty("bottom");
getId("ctxMenu").style.top = ctxSetup[0][1] + "px";
}
getId("ctxMenu").innerHTML = "";
for(var i = 1; i < ctxSetup.length - 1; i += 2){ // first char of name of element: + means new group | - means cannot click | _ means new group and cannot click
if(i !== 1){
if(ctxSetup[i][0] === '+' || ctxSetup[i][0] === '_'){
//getId("ctxMenu").innerHTML += '<hr>';
c(function(){
getId("ctxMenu").innerHTML += '<hr>';
});
}
}
if(ctxSetup[0][2]){
ctxMenuImg = '<img src="' + ctxSetup[0][Math.floor(i / 2) + 2] + '" style="width:10px; height:10px; margin-top:1px; margin-bottom:-2px; margin-left:1px;" onerror="this.style.marginLeft = \'0\';this.style.marginRight = \'1px\';this.src = \'/ctxMenu/beta/simple.png\'">';
}else{
ctxMenuImg = '<img src="/ctxMenu/beta/simple.png" style="width:10px; height:10px; margin-top:1px; margin-bottom:-2px; margin-right:1px">';
}
if(ctxSetup[i][0] === '-' || ctxSetup[i][0] === '_'){
//getId("ctxMenu").innerHTML += '<p class="hiddenCtxOption">' + ctxSetup[i].substring(1,ctxSetup[i].length) + '</p>';
c(function(arg){
getId("ctxMenu").innerHTML += '<p class="hiddenCtxOption">' + arg[1] + "&nbsp;" + ctxSetup[arg[0]].substring(1,ctxSetup[arg[0]].length) + '&nbsp;</p>';
}, [i, ctxMenuImg]);
}else{
//getId("ctxMenu").innerHTML += '<p onClick="' + ctxSetup[i + 1] + '">' + ctxSetup[i].substring(1,ctxSetup[i].length) + '</p>';
c(function(arg){
getId("ctxMenu").innerHTML += '<p class="cursorPointer" onClick="' + ctxSetup[arg[0] + 1] + '">' + arg[1] + "&nbsp;" + ctxSetup[arg[0]].substring(1,ctxSetup[arg[0]].length) + '&nbsp;</p>';
}, [i, ctxMenuImg]);
}
}
}
}
//disabled as it caused some errors
//ctxSetup = [[0, 0], 'Context', 'alert("Context Menu Not Correctly Initialized")', 'Menu', 'alert("Context Menu Not Correctly Initialized")'];
}
//getId("monitor").setAttribute('oncontextmenu', 'window.setTimeout(ctxMenu, 2);return false');
var baseCtx = {
hideall: [
[' ' + lang('ctxMenu', 'settings'), function(){
openapp(apps.settings, 'dsktp');
}, '/ctxMenu/beta/gear.png'],
[' ' + lang('ctxMenu', 'jsConsole'), function(){
openapp(apps.jsConsole, 'dsktp');
}, '/ctxMenu/beta/console.png'],
['+' + lang('ctxMenu', 'screenResolution'), function(){
openapp(apps.settings, 'dsktp');
apps.settings.vars.showMenu(apps.settings.vars.menus.screenRes);
}, '/ctxMenu/beta/gear.png'],
[' ' + lang('ctxMenu', 'desktopBackground'), function(){
openapp(apps.settings, 'dsktp');
apps.settings.vars.showMenu(apps.settings.vars.menus.background);
getId('bckGrndImg').focus();
}, '/ctxMenu/beta/cool.png'],
['+' + lang('ctxMenu', 'addIcon'), function(){
openapp(apps.iconMaker, 'newicon ' + newCtxCoord[0] + ' ' + newCtxCoord[1]);
}, '/ctxMenu/beta/add.png']
],
desktop: [
[' ' + lang('ctxMenu', 'settings'), function(){
openapp(apps.settings, 'dsktp');
}, '/ctxMenu/beta/gear.png'],
[' ' + lang('ctxMenu', 'jsConsole'), function(){
openapp(apps.jsConsole, 'dsktp');
}, '/ctxMenu/beta/console.png'],
[function(){return '+' + lang('ctxMenu', 'speak') + ' "' + currentSelection.substring(0, 5) + '..."'}, function(){
textspeech(currentSelection);
}, '/ctxMenu/beta/happy.png']
],
taskbar: [
[' ' + lang('ctxMenu', 'settings'), function(){
openapp(apps.settings, 'dsktp');
}, '/ctxMenu/beta/gear.png'],
[' ' + lang('ctxMenu', 'jsConsole'), function(){
openapp(apps.jsConsole, 'dsktp');
}, '/ctxMenu/beta/console.png'],
[' ' + lang('appNames', 'taskManager'), function(){
openapp(apps.taskManager, 'dsktp');
}, '/ctxMenu/beta/.png'],
['+' + lang('ctxMenu', 'taskbarSettings'), function(){
openapp(apps.settings, 'dsktp');
apps.settings.vars.showMenu(apps.settings.vars.menus.taskbar);
}, '/ctxMenu/beta/gear.png']
/*
['+Toggle Compact Time', function(){
apps.settings.vars.togTimeComp();
}, '/ctxMenu/beta/cool.png'],
[' Toggle Network Status', function(){
apps.settings.vars.togNetStat();
}, '/ctxMenu/beta/wifi.png'],
[' Toggle Battery Status', function(){
apps.settings.vars.togBatStat();
}, '/ctxMenu/beta/battery.png'],
[' Toggle Stylish Battery', function(){
apps.settings.vars.togBatComp();
}, '/ctxMenu/beta/cool.png'],
[' Toggle FPS Status', function(){
apps.settings.vars.togFpsStat();
}, '/ctxMenu/beta/performance.png'],
[' Toggle Compact FPS', function(){
apps.settings.vars.togFpsComp();
}, '/ctxMenu/beta/cool.png'],
[' Toggle CPU Status', function(){
apps.settings.vars.togLodStat();
}, '/ctxMenu/beta/performance.png']
*/
],
appXXX: [
[' ' + lang('ctxMenu', 'openApp'), function(args){
openapp(apps[args[1]], 'dsktp');
}, '/ctxMenu/beta/window.png'],
['+' + lang('ctxMenu', 'moveIcon'), function(args){
icomove(args[0], args[2]);
}]
],
icnXXX: [
[' ' + lang('ctxMenu', 'showApp'), function(arg){
openapp(apps[arg], 'tskbr');
}, '/ctxMenu/beta/window.png'],
[' ' + lang('ctxMenu', 'hideApp'), function(arg){
apps[arg].signalHandler('shrink');
}, '/ctxMenu/beta/minimize.png'],
[' ' + lang('ctxMenu', 'closeApp'), function(arg){
apps[arg].signalHandler('close');
}, '/ctxMenu/beta/x.png']
],
winXXXc: [
[' About This App', function(arg){
openapp(apps.appInfo, arg);
}, '/ctxMenu/beta/file.png'],
['+' + lang('ctxMenu', 'fold'), function(arg){
apps[arg].appWindow.foldWindow();
}, '/ctxMenu/beta/less.png'],
['+' + lang('ctxMenu', 'hideApp'), function(arg){
apps[arg].signalHandler('shrink');
}, '/ctxMenu/beta/minimize.png'],
[' ' + lang('ctxMenu', 'fullscreen'), function(arg){
apps[arg].appWindow.toggleFullscreen();
toTop(apps[arg]);
}, '/ctxMenu/beta/add.png'],
[' Close', function(arg){
apps[arg].signalHandler('close');
}, '/ctxMenu/beta/x.png'],
[function(arg){
if(apps[arg].appWindow.onTop === 0){
return '+' + lang('ctxMenu', 'stayOnTop');
}else{
return '_' + lang('ctxMenu', 'stayOnTop');
}
}, function(arg){
apps[arg].appWindow.alwaysOnTop(1);
}, '/ctxMenu/beta/add.png'],
[function(arg){
if(apps[arg].appWindow.onTop === 1){
return ' ' + lang('ctxMenu', 'stopOnTop');
}else{
return '-' + lang('ctxMenu', 'stopOnTop');
}
}, function(arg){
apps[arg].appWindow.alwaysOnTop(0);
}, '/ctxMenu/beta/less.png']
]
};
getId("hideall").setAttribute('oncontextmenu', 'ctxMenu(baseCtx.hideall, 1, event);');
//getId("desktop").setAttribute('oncontextmenu', 'ctxMenu(baseCtx.desktop, 1, event);return false');
addEditContext('desktop', 1);
getId("taskbar").setAttribute('oncontextmenu', 'ctxMenu(baseCtx.taskbar, 1, event);');
getId("monitor").setAttribute('oncontextmenu', 'return false');
//OLD function to fit monitor to window size
/*
fitWindow = function(){
apps.settings.vars.sH();
apps.settings.vars.sV();
if(window.innerWidth < 1050 * apps.settings.vars.sX || window.innerHeight < 600 * apps.settings.vars.sV){
window.setTimeout('fitWindow()', 1000);
}else{
window.setTimeout('getId("timesUpdated").innerHTML = "Best on Chrome. Taskbar icons broken on Firefox, cant view this in IE."', 1000);
window.setTimeout('fadeResizeText()', 5000);
}
};
if(window.innerWidth < 1050 * apps.settings.vars.sX || window.innerHeight < 600 * apps.settings.vars.sV){
window.setTimeout('fitWindow()', 500);
getId('timesUpdated').innerHTML += '<br>Resizing monitor...';
}else{
window.setTimeout('fadeResizeText()', 5000);
}
*/
function fitWindow(){
perfStart('fitWindow');
if(screenScale === 1 || screenScale < 0.25){
getId('monitor').style.transform = '';
var numberOfScreenScale = 1;
}else{
getId('monitor').style.transform = 'scale(' + screenScale + ')';
var numberOfScreenScale = screenScale;
}
getId("monitor").style.width = window.innerWidth * (1 / numberOfScreenScale) + "px";
getId("monitor").style.height = window.innerHeight * (1 / numberOfScreenScale) + "px";
getId("desktop").style.width = window.innerWidth * (1 / numberOfScreenScale) + "px";
getId("desktop").style.height = window.innerHeight * (1 / numberOfScreenScale) - 30 + "px";
getId("taskbar").style.width = window.innerWidth * (1 / numberOfScreenScale) + "px";
//getId("taskbar").style.top = window.innerHeight - 30 + "px";
getId("tskbrAero").style.backgroundPosition = "20px " + (-1 * (window.innerHeight * (1 / numberOfScreenScale)) + 50) + "px";
getId("tskbrAero").style.width = window.innerWidth * (1 / numberOfScreenScale) + 40 + "px";
getId("icons").style.width = window.innerWidth * (1 / numberOfScreenScale) + "px";
//doLog(perfCheck('fitWindow') + '&micro;s to fit to window');
// taskbar position checking
switch(tskbrToggle.tskbrPos){
case 1:
getId('desktop').style.left = '';
getId('desktop').style.top = '30px';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
break;
case 2:
getId('desktop').style.left = '30px';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = 'rotate(90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
case 3:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '';
getId('taskbar').style.left = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = 'rotate(-90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
default:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
}
}
function fitWindowOuter(){
perfStart('fitWindow');
if(screenScale === 1 || screenScale < 0.25){
getId('monitor').style.transform = '';
var numberOfScreenScale = 1;
}else{
getId('monitor').style.transform = 'scale(' + screenScale + ')';
var numberOfScreenScale = screenScale;
}
getId("monitor").style.width = window.outerWidth * (1 / numberOfScreenScale) + "px";
getId("monitor").style.height = window.outerHeight * (1 / numberOfScreenScale) + "px";
getId("desktop").style.width = window.outerWidth * (1 / numberOfScreenScale) + "px";
getId("desktop").style.height = window.outerHeight * (1 / numberOfScreenScale) - 30 + "px";
getId("taskbar").style.width = window.outerWidth * (1 / numberOfScreenScale) + "px";
//getId("taskbar").style.top = window.outerHeight - 30 + "px";
getId("tskbrAero").style.backgroundPosition = "20px " + (-1 * (window.outerHeight * (1 / numberOfScreenScale)) + 50) + "px";
getId("tskbrAero").style.width = window.outerWidth * (1 / numberOfScreenScale) + 40 + "px";
getId("icons").style.width = window.outerWidth * (1 / numberOfScreenScale) + "px";
//doLog(perfCheck('fitWindow') + '&micro;s to fit to screen');
// taskbar position checking
switch(tskbrToggle.tskbrPos){
case 1:
getId('desktop').style.left = '';
getId('desktop').style.top = '30px';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
break;
case 2:
getId('desktop').style.left = '30px';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = 'rotate(90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
case 3:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '';
getId('taskbar').style.left = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = 'rotate(-90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
default:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
}
}
function fitWindowRes(newmonX, newmonY){
perfStart('fitWindow');
if(screenScale === 1 || screenScale < 0.25){
getId('monitor').style.transform = '';
var numberOfScreenScale = 1;
}else{
getId('monitor').style.transform = 'scale(' + screenScale + ')';
var numberOfScreenScale = screenScale;
}
getId("monitor").style.width = newmonX * (1 / numberOfScreenScale) + "px";
getId("monitor").style.height = newmonY * (1 / numberOfScreenScale) + "px";
getId("desktop").style.width = newmonX * (1 / numberOfScreenScale) + "px";
getId("desktop").style.height = newmonY * (1 / numberOfScreenScale) - 30 + "px";
getId("taskbar").style.width = newmonX * (1 / numberOfScreenScale) + "px";
//getId("taskbar").style.top = newmonY - 30 + "px";
getId("tskbrAero").style.backgroundPosition = "20px " + (-1 * (newmonY * (1 / numberOfScreenScale)) + 50) + "px";
getId("tskbrAero").style.width = newmonX * (1 / numberOfScreenScale) + 40 + "px";
getId("icons").style.width = newmonX * (1 / numberOfScreenScale) + "px";
//doLog(perfCheck('fitWindow') + '&micro;s to fit to custom size');
// taskbar position checking
switch(tskbrToggle.tskbrPos){
case 1:
getId('desktop').style.left = '';
getId('desktop').style.top = '30px';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
break;
case 2:
getId('desktop').style.left = '30px';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '0';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = 'auto';
getId('taskbar').style.transform = 'rotate(90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
case 3:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('desktop').style.height = getId('monitor').style.height;
getId('taskbar').style.top = '';
getId('taskbar').style.left = parseInt(getId('monitor').style.width, 10) - 30 + "px";
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = 'rotate(-90deg)';
getId('taskbar').style.width = getId('monitor').style.height;
break;
default:
getId('desktop').style.left = '';
getId('desktop').style.top = '';
getId('desktop').style.width = getId('monitor').style.width;
getId('desktop').style.height = parseInt(getId('monitor').style.height, 10) - 30 + "px";
getId('taskbar').style.top = '';
getId('taskbar').style.left = '';
getId('taskbar').style.right = '';
getId('taskbar').style.bottom = '';
getId('taskbar').style.transform = '';
getId('taskbar').style.width = getId('monitor').style.width;
}
}
var sessionStorageSupported = 1;
if(!sessionStorage){
sessionStorage = {getItem: function(){return false}, setItem: function(){return false}, removeItem: function(){return false}};
sessionStorageSupported = 0;
}
var localStorageSupported = 1;
if(!localStorage){
localStorage = {getItem: function(){return false}, setItem: function(){return false}, removeItem: function(){return false}};
localStorageSupported = 0;
}
c(function(){
if(window.location.href.indexOf('GooglePlay=true') > -1 || sessionStorage.getItem('GooglePlay') === 'true'){
doLog("Google Play Mode enabled.");
if(screen.height >= 1080){
apps.settings.vars.setScale(0.5, 1);
}
apps.settings.vars.togClickToMove();
sessionStorage.setItem('GooglePlay', 'true');
}else{
fitWindow();
}
});
fadeResizeText();
//auto-resize display on window change
window.addEventListener('resize', fitWindow);
//window.setTimeout(fitWindow, 1000);
//longtap support
var monMouseEvent = {};
function monMouseCheck(){
try{
if(typeof document.elementFromPoint(monMouseEvent.pageX, monMouseEvent.pageY).oncontextmenu === 'function'){
document.elementFromPoint(monMouseEvent.pageX, monMouseEvent.pageY).oncontextmenu(monMouseEvent);
}else if(typeof document.elementFromPoint(monMouseEvent.pageX, monMouseEvent.pageY).oncontextmenu === 'string'){
eval(document.elementFromPoint(monMouseEvent.pageX, monMouseEvent.pageY).oncontextmenu);
}else{
doLog('Failed to find ctxmenu on ' + vartry('document.elementFromPoint(monMouseEvent.pageX, monMouseEvent.pageY).id'));
}
}catch(err){
doLog('Failed to open ctxmenu on ' + vartry('document.elementFromPoint(monMouseEvent.pageX, monMouseEvent.pageY).id'));
}
}
function monMouseDown(evt){
if(apps.settings.vars.longTap && evt.touches.length > 1){
evt.preventDefault();
monMouseEvent = {pageX: evt.touches[0].pageX, pageY: evt.touches[0].pageY};
monMouseCheck();
return false;
}
}
getId("monitor").addEventListener('touchstart', monMouseDown);
/*
c(function(){
// print the time on the taskbar
window.showTimeOnTaskbar = function(){
timeElement.innerHTML = tskbrGetFpsStr() + tskbrGetLodStr() + tskbrGetNetStr() + tskbrGetTimeStr() + tskbrGetBatStr();
if(!apps.settings.vars.performanceMode){
window.requestAnimationFrame(showTimeOnTaskbar);
}else{
makeTimeout('', 'showtimeontaskbar', 'showTimeOnTaskbar()', 1000);
}
}
makeTimeout("", "TaskbarTime", "showTimeOnTaskbar()", 0);
// by default, runs every frame, but can run every second instead if it needs to
window.requestAnimationFrame(showTimeOnTaskbar);
window.setTimeout(countFPS, 0);
// in 1 second, register network checkin with task manager
requestAnimationFrame(function(){
makeInterval('', 'NetwrkCheck', 'taskbarShowHardware()', 1000);
});
});
*/
c(function(){
window.setTimeout(countFPS, 0);
requestAnimationFrame(function(){
makeInterval('', 'NtwrkCheck', 'taskbarShowHardware()', 1000);
});
});
var keepingAwake = false;
c(function(){
getId('loadingInfo').innerHTML = 'Loading your files...';
getId('LoadingImage').src = "/loadDark.gif";
// getId('isLoading').style.cursor = cursors.loadDark;
getId('isLoading').classList.remove('cursorLoadLight');
getId('isLoading').classList.add('cursorLoadDark');
initStatus = 1;
doLog('Took ' + perfCheck('masterInit') + '&micro;s to initialize.');
ping(function(text){
doLog(' server ping: ' + text[0] + ' &micro;s with status ' + text[1]);
});
corsPing(function(text){
doLog('NORAA search service ping: ' + text[0] + ' &micro;s with status ' + text[1]);
});
if(window.navigator.vendor !== "Google Inc."){
doLog('Looks like you are not using Google Chrome. Make sure you use Google Chrome to access . Otherwise, certain features will be missing or broken.', '#F00;text-decoration:underline');
apps.prompt.vars.notify('It appears that you\'re not using Google Chrome. Make sure you use Chrome to access . Otherwise, certain features will be missing or broken.', [], function(){}, 'Google Chrome', '/appicons/ds/.png');
}
// try to prevent monitor from sleeping
try{
navigator.wakeLock.request("display").then(
function successFunction(){
doLog('Browser has given permission to keep device awake. Your device shouldn\'t fall asleep while using .', '#0F0');
keepingAwake = true;
},
function errorFunction(){
doLog('Browser did not give permission to keep device awake. Your device may fall asleep while using .', '#F00');
}
);
}catch(err){
doLog(' ');
doLog('WakeLock API is not available. Your device may fall asleep while using .', '#F00');
doLog('Details: ' + err, '#F00');
doLog(' ');
}
if(localStorageSupported){
if(localStorage.getItem('latestVersion') !== version){
apps.prompt.vars.notify(files.changelog.split('\n\n')[files.changelog.split('\n\n').length - 1].split('\n').join('<br>'), ['Changelog'], function(btn){if(btn === 0){openapp(apps.changelog);}}, 'New Update!', '/appicons/ds/CLg.png');
localStorage.setItem('latestVersion', version);
}
}
console.log("Done initializing .");
});
// 2000 lines of code! 9/18/2015
// 51 lines of code to go for 3000! 12/16/2015
// 3000 lines of code! 1/6/2016
// 5000 lines of code! 4/18/2016
// 6333 lines of code! 6/6/2016
// 7000 lines of code! 8/29/2016
// 130 lines of code to go for 8000! 9/10/2016
// 9500 lines of code! 10/21/2016
// 10454 lines of code! 12/24/2016
// 11194 lines of code! 2/3/2017
// 12736 lines of code! 6/2/2017
@jessiejs
Copy link

So this is where aaronOS is from....

@MineAndCraft12
Copy link

MineAndCraft12 commented Jul 24, 2021

You can see my last name at line #4576, where my first name was stripped from the copyright notice. This came from AaronOS, not the other way around.

You can also see my email address in several locations if you search for "@".

This all being said, I am curious what this was used for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment