Merge pull request #33 from mmouterde/master

add hello-word demo (#6)
This commit is contained in:
Thomas Brouard 2017-07-02 13:25:56 +02:00 committed by GitHub
commit 10e5447e73
2 changed files with 52 additions and 0 deletions

16
demo/app.js Normal file
View file

@ -0,0 +1,16 @@
const electron = require('electron');
const app = electron.app;
app.setName('electron-tabs-demo');
app.on('ready', function () {
const mainWindow = new electron.BrowserWindow();
mainWindow.loadURL('file://' + __dirname + '/electron-tabs.html');
mainWindow.on('ready-to-show', function () {
mainWindow.show();
mainWindow.focus();
});
});

36
demo/electron-tabs.html Normal file
View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../electron-tabs.css">
</head>
<body style="margin:0">
<div class="etabs-tabgroup">
<div class="etabs-tabs"></div>
<div class="etabs-buttons"></div>
</div>
<div class="etabs-views"></div>
<script>
//const TabGroup = require('electron-tabs') normally but for demo :
const TabGroup = require("../index");
let tabGroup = new TabGroup();
tabGroup.addTab({
title: 'Google',
src: 'http://google.com',
});
tabGroup.addTab({
title: "Electron",
src: "http://electron.atom.io",
visible: true,
active: true
});
</script>
</body>
</html>