diff options
| author | Kumar Priyansh <[email protected]> | 2018-11-13 12:28:35 +0530 |
|---|---|---|
| committer | Kumar Priyansh <[email protected]> | 2018-11-13 12:28:35 +0530 |
| commit | 997e64e900e92669055d72b24575407544635086 (patch) | |
| tree | d624aadb49076797e5ce9aa1fbc95b0c5a527944 /script.js | |
| parent | b9b67f24f6043e5f7658e6a8601af4d09e7783b0 (diff) | |
| download | aboutscreen-997e64e900e92669055d72b24575407544635086.tar.xz aboutscreen-997e64e900e92669055d72b24575407544635086.zip | |
Added files via GIT
Diffstat (limited to 'script.js')
| -rw-r--r-- | script.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/script.js b/script.js new file mode 100644 index 0000000..92006ff --- /dev/null +++ b/script.js @@ -0,0 +1,47 @@ +$(document).ready(function(){ + const os = require('os'); + const si = require('systeminformation'); + $('#ram').html((os.totalmem())/(1024*1024*1024)) + si.cpu(function(data) { + $('#manufacturer').html(data.manufacturer) + $('#model').html(data.brand) + }); + si.graphics(function(data) { + console.log(data) + $('#resx').html(data.displays[0].resolutionx) + $('#resy').html(data.displays[0].resolutiony) + $('#display').html(data.displays[0].model) + $('#graphics').html(data.controllers[0].model) + }); + $('#cores').html((os.cpus().length)) + $('#speed').html((os.cpus()[0].speed)/1000) + $('#type').html(os.arch()) +}); + +const shell = require('electron').shell; + +// assuming $ is jQuery +$(document).on('click', 'a[href^="http"]', function(event) { + event.preventDefault(); + shell.openExternal(this.href); +}); + + +(function () { + // Retrieve remote BrowserWindow + const {BrowserWindow} = require('electron').remote + + function init() { + // Close app + document.getElementById("close").addEventListener("click", (e) => { + var window = BrowserWindow.getFocusedWindow(); + window.close(); + }); + }; + + document.onreadystatechange = () => { + if (document.readyState == "complete") { + init(); + } + }; +})();
\ No newline at end of file |
