Last active
August 29, 2015 14:25
-
-
Save qsysmine/ff3893ea38423baba4bf to your computer and use it in GitHub Desktop.
codioNative; requires Electron.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>codioNative</title> | |
<style media="screen"> | |
html { | |
position:absolute; | |
top:0; | |
left:0; | |
right:0; | |
bottom:0; | |
font-family:"Helvetica Neue", Helvetica, "Century Gothic", sans-serif; | |
} | |
h1, p { | |
text-align:center; | |
} | |
iframe[seamless]{ | |
background-color: transparent; | |
border: 0px none transparent; | |
padding: 0px; | |
overflow: hidden; | |
} | |
#main-iframe { | |
position:absolute; | |
top:0; | |
left:0; | |
right:0; | |
bottom:0; | |
} | |
</style> | |
</head> | |
<body> | |
<iframe src="http://codio.com/home" id="main-iframe" seamless width="100%" height="100%"></iframe> | |
</body> | |
<script> | |
var wO; | |
setInterval(function() { | |
if(!navigator.onLine) { | |
wO = true; | |
document.body.innerHTML = '<div class="centred">\ | |
<h1>You are offline.</h1><br>\ | |
<p>\ | |
You appear to be offline. Please connect to a network to continue.\ | |
</p>'; | |
} else { | |
if(wO){ | |
wO = false; | |
document.body.innerHTML = ' <iframe src="http://codio.com/home" id="main-iframe" seamless width="100%" height="100%"></iframe>'; | |
} | |
} | |
}); | |
</script> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('app'); | |
var BrowserWindow = require('browser-window'); | |
require('crash-reporter').start(); | |
var mainWindow = null; | |
app.on('window-all-closed', function() { | |
app.quit(); | |
}); | |
app.on('ready', function() { | |
var atomScreen = require('screen'); | |
var size = atomScreen.getPrimaryDisplay().workAreaSize; | |
mainWindow = new BrowserWindow({ width: size.width, height: size.height }); | |
mainWindow.loadUrl('file://' + __dirname + '/index.html'); | |
mainWindow.on('closed', function() { | |
mainWindow = null; | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name" : "codioNative", | |
"version" : "0.1.0", | |
"main" : "main.js" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment