From 997e64e900e92669055d72b24575407544635086 Mon Sep 17 00:00:00 2001 From: Kumar Priyansh Date: Tue, 13 Nov 2018 12:28:35 +0530 Subject: Added files via GIT --- script.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 script.js (limited to 'script.js') 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 -- cgit v1.2.3