-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cec50aa
Showing
258 changed files
with
11,541 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
node_modules | ||
.DS_Store | ||
Thumbs.db | ||
*.log | ||
*.autogenerated | ||
|
||
# ignore everything in 'app' folder what had been generated from 'src' folder | ||
/app/stylesheets | ||
/app/app.js | ||
/app/background.js | ||
/app/env.json | ||
/app/**/*.map | ||
|
||
/dist | ||
|
||
/coverage |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"esversion": 6 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
os: | ||
- linux | ||
- osx | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
env: | ||
- NODE_VERSION="6.3.0" | ||
|
||
script: ./scripts/travis-build.sh | ||
|
||
cache: | ||
directories: | ||
- node_modules | ||
|
||
notifications: | ||
email: | ||
on_success: never | ||
on_failure: change |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015-2016 Jakub Szwacz | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
electron-boilerplate | ||
============== | ||
|
||
[](https://travis-ci.org/szwacz/electron-boilerplate) [](https://ci.appveyor.com/project/szwacz/electron-boilerplate) | ||
|
||
A minimalistic yet comprehensive boilerplate application for [Electron runtime](http://electron.atom.io). Tested on OSX, Windows and Linux. | ||
|
||
This project does not impose on you any framework (like Angular or React). Instead, it tries to give you only the 'electron' part of technology stack so you can pick your favorite tools for the rest. | ||
|
||
# Quick start | ||
The only development dependency of this project is [Node.js](https://nodejs.org). So just make sure you have it installed. | ||
Then type few commands known to every Node developer... | ||
``` | ||
git clone https://github.com/szwacz/electron-boilerplate.git | ||
cd electron-boilerplate | ||
npm install | ||
npm start | ||
``` | ||
... and boom! You have a running desktop application on your screen. | ||
|
||
# Structure of the project | ||
|
||
## Declaring dependencies | ||
|
||
There are **two** `package.json` files: | ||
|
||
#### 1. `package.json` for development | ||
Sits on path: `electron-boilerplate/package.json`. This is where you should declare dependencies for your development environment and build scripts. **This file is not distributed with real application!** | ||
|
||
It's also the place to specify the Electron runtime version you want to use: | ||
```json | ||
"devDependencies": { | ||
"electron": "1.3.3" | ||
} | ||
``` | ||
Note: [Electron authors advise](http://electron.atom.io/docs/tutorial/electron-versioning/) to use fixed version here. | ||
|
||
#### 2. `package.json` for your application | ||
Sits on path: `electron-boilerplate/app/package.json`. This is **real** manifest of your application. Declare your app dependencies here. | ||
|
||
#### OMG, but seriously why there are two `package.json`? | ||
1. Native npm modules (those written in C, not JavaScript) need to be compiled, and here we have two different compilation targets for them. Those used in application need to be compiled against electron runtime, and all `devDependencies` need to be compiled against your locally installed node.js. Thanks to having two files this is trivial. | ||
2. When you package the app for distribution there is no need to add up to size of the app with your `devDependencies`. Here those are always not included (reside outside the `app` directory). | ||
|
||
## Folders for application code | ||
|
||
The application is split between two main folders... | ||
|
||
`src` - this folder is intended for files which need to be transpiled or compiled (files which can't be used directly by electron). | ||
|
||
`app` - contains all static assets (put here images, css, html etc.) which don't need any pre-processing. | ||
|
||
The build process compiles all stuff from the `src` folder and puts it into the `app` folder, so after the build has finished, your `app` folder contains the full, runnable application. | ||
|
||
Treat `src` and `app` folders like two halves of one bigger thing. | ||
|
||
The drawback of this design is that `app` folder contains some files which should be git-ignored and some which shouldn't (see `.gitignore` file). But thanks to this two-folders split development builds are much (much!) faster. | ||
|
||
# Development | ||
|
||
### Installation | ||
|
||
``` | ||
npm install | ||
``` | ||
It will also download Electron runtime and install dependencies for the second `package.json` file inside the `app` folder. | ||
|
||
### Starting the app | ||
|
||
``` | ||
npm start | ||
``` | ||
|
||
### Adding npm modules to your app | ||
|
||
Remember to add your dependencies to `app/package.json` file: | ||
``` | ||
cd app | ||
npm install name_of_npm_module --save | ||
``` | ||
|
||
### Working with modules | ||
|
||
Thanks to [rollup](https://github.com/rollup/rollup) you can (and should) use ES6 modules for all code in `src` folder. But because ES6 modules still aren't natively supported you can't use them in the `app` folder. | ||
|
||
Use ES6 syntax in the `src` folder like this: | ||
```js | ||
import myStuff from './my_lib/my_stuff'; | ||
``` | ||
|
||
But use CommonJS syntax in `app` folder. So the code from above should look as follows: | ||
```js | ||
var myStuff = require('./my_lib/my_stuff'); | ||
``` | ||
|
||
# Testing | ||
|
||
### Unit tests | ||
|
||
Using [electron-mocha](https://github.com/jprichardson/electron-mocha) test runner with the [chai](http://chaijs.com/api/assert/) assertion library. To run the tests go with standard and use the npm test script: | ||
``` | ||
npm test | ||
``` | ||
This task searches for all files in `src` directory which respect pattern `*.spec.js`. | ||
|
||
### End to end tests | ||
|
||
Using [mocha](https://mochajs.org/) test runner and [spectron](http://electron.atom.io/spectron/). Run with command: | ||
``` | ||
npm run e2e | ||
``` | ||
This task searches for all files in `e2e` directory which respect pattern `*.e2e.js`. | ||
|
||
### Code coverage | ||
|
||
Using [istanbul](http://gotwarlost.github.io/istanbul/) code coverage tool. Run with command: | ||
``` | ||
npm run coverage | ||
``` | ||
You can set the reporter(s) by setting `ISTANBUL_REPORTERS` environment variable (defaults to `text-summary` and `html`). The report directory can be set with `ISTANBUL_REPORT_DIR` (defaults to `coverage`). | ||
|
||
### Continuous integration | ||
|
||
Electron [can be plugged](https://github.com/atom/electron/blob/master/docs/tutorial/testing-on-headless-ci.md) into CI systems. Here two CIs are preconfigured for you. [Travis CI](https://travis-ci.org/) covers testing on OSX and Linux and [App Veyor](https://www.appveyor.com) on Windows. | ||
|
||
# Making a release | ||
|
||
To package your app into an installer use command: | ||
``` | ||
npm run release | ||
``` | ||
It will start the packaging process for operating system you are running this command on. Ready for distribution file will be outputted to `dist` directory. | ||
|
||
You can create Windows installer only when running on Windows, the same is true for Linux and OSX. So to generate all three installers you need all three operating systems. | ||
|
||
All packaging actions are handled by [electron-builder](https://github.com/electron-userland/electron-builder). See docs of this tool if you want to customize something. | ||
|
||
**Note:** There are various icons and bitmap files in `resources` directory. Those are used in installers and intended to be replaced by your own graphics. | ||
|
||
# License | ||
|
||
Released under the MIT license. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!doctype html> | ||
<html class="no-js"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Manageyum</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width"> | ||
<!-- Place favicon.ico and apple-touch-icon.png in the root directory --> | ||
<!-- build:css(.) styles/vendor.css --> | ||
<!-- bower:css --> | ||
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css" /> | ||
<!-- endbower --> | ||
<!-- endbuild --> | ||
<!-- build:css(.tmp) styles/main.css --> | ||
<link rel="stylesheet" href="node_modules/ladda/dist/ladda-themeless.min.css"> | ||
<link rel="stylesheet" href="styles/main.css"> | ||
|
||
<!-- endbuild --> | ||
</head> | ||
|
||
<body ng-app="puraApp"> | ||
<!--[if lt IE 7]> | ||
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> | ||
<![endif]--> | ||
<ui-view></ui-view> | ||
<!-- build:js(.) scripts/vendor.js --> | ||
<!-- bower:js --> | ||
<script src="node_modules/jquery/dist/jquery.js" onload="window.$ = window.jQuery = module.exports;"></script> | ||
<script src="node_modules/angular/angular.js"></script> | ||
<script src="node_modules/angulartics/dist/angulartics.min.js"></script> | ||
<script src="node_modules/angulartics-mixpanel/dist/angulartics-mixpanel.min.js"></script> | ||
<script src="node_modules/angular-ui-router/release/angular-ui-router.js"></script> | ||
<script src="node_modules/angular-ui-router/release/stateEvents.js"></script> | ||
<script src="node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js"></script> | ||
<script src="node_modules/angular-sanitize/angular-sanitize.js"></script> | ||
<script src="node_modules/angular-local-storage/dist/angular-local-storage.min.js"></script> | ||
<script src="node_modules/lodash/lodash.js"></script> | ||
<script src="node_modules/angular-electron/angular-electron.js"></script> | ||
<script src="node_modules/angular-stripe-checkout/angular-stripe-checkout.js"></script> | ||
<script src="node_modules/ladda/dist/spin.min.js"></script> | ||
<script src="node_modules/ladda/dist/ladda.min.js"></script> | ||
<script src="node_modules/angular-ladda/dist/angular-ladda.min.js"></script> | ||
<script src="node_modules/angular-hotkeys/build/hotkeys.min.js"></script> | ||
<script src="node_modules/checklist-model/checklist-model.js"></script> | ||
<script src="node_modules/angular-md5/angular-md5.js"></script> | ||
<!-- endbower --> | ||
<!-- endbuild --> | ||
<!-- build:js({.tmp,app}) scripts/scripts.js --> | ||
<script src="./app.js"></script> | ||
<script src="src/app.js"></script> | ||
<script src="src/services/services.controller.js"></script> | ||
<script src="src/services/services.factory.js"></script> | ||
<script src="src/home/home.controller.js"></script> | ||
<script src="src/servicesList/servicesList.controller.js"></script> | ||
<script src="src/enabledServices/enabledServices.controller.js"></script> | ||
<script src="src/notificationcenter/notificationCenter.controller.js"></script> | ||
<script src="src/services/user.factory.js"></script> | ||
<!-- end Mixpanel --> | ||
<!-- endbuild --> | ||
</body> | ||
|
||
</html> |
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// This gives you default context menu (cut, copy, paste) | ||
// in all input fields and textareas across your app. | ||
|
||
(function () { | ||
'use strict'; | ||
|
||
var remote = require('electron').remote; | ||
var Menu = remote.Menu; | ||
var MenuItem = remote.MenuItem; | ||
|
||
var isAnyTextSelected = function () { | ||
return window.getSelection().toString() !== ''; | ||
}; | ||
|
||
var cut = new MenuItem({ | ||
label: "Cut", | ||
click: function () { | ||
document.execCommand("cut"); | ||
} | ||
}); | ||
|
||
var copy = new MenuItem({ | ||
label: "Copy", | ||
click: function () { | ||
document.execCommand("copy"); | ||
} | ||
}); | ||
|
||
var paste = new MenuItem({ | ||
label: "Paste", | ||
click: function () { | ||
document.execCommand("paste"); | ||
} | ||
}); | ||
|
||
var normalMenu = new Menu(); | ||
normalMenu.append(copy); | ||
|
||
var textEditingMenu = new Menu(); | ||
textEditingMenu.append(cut); | ||
textEditingMenu.append(copy); | ||
textEditingMenu.append(paste); | ||
|
||
document.addEventListener('contextmenu', function (e) { | ||
switch (e.target.nodeName) { | ||
case 'TEXTAREA': | ||
case 'INPUT': | ||
e.preventDefault(); | ||
textEditingMenu.popup(remote.getCurrentWindow()); | ||
break; | ||
default: | ||
if (isAnyTextSelected()) { | ||
e.preventDefault(); | ||
normalMenu.popup(remote.getCurrentWindow()); | ||
} | ||
} | ||
}, false); | ||
|
||
}()); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Convenient way for opening links in external browser, not in the app. | ||
// Useful especially if you have a lot of links to deal with. | ||
// | ||
// Usage: | ||
// | ||
// Every link with class ".js-external-link" will be opened in external browser. | ||
// <a class="js-external-link" href="http://google.com">google</a> | ||
// | ||
// The same behaviour for many links can be achieved by adding | ||
// this class to any parent tag of an anchor tag. | ||
// <p class="js-external-link"> | ||
// <a href="http://google.com">google</a> | ||
// <a href="http://bing.com">bing</a> | ||
// </p> | ||
|
||
(function () { | ||
'use strict'; | ||
|
||
var shell = require('electron').shell; | ||
|
||
var supportExternalLinks = function (e) { | ||
var href; | ||
var isExternal = false; | ||
|
||
var checkDomElement = function (element) { | ||
if (element.nodeName === 'A') { | ||
href = element.getAttribute('href'); | ||
} | ||
if (element.classList.contains('js-external-link')) { | ||
isExternal = true; | ||
} | ||
if (href && isExternal) { | ||
shell.openExternal(href); | ||
e.preventDefault(); | ||
} else if (element.parentElement) { | ||
checkDomElement(element.parentElement); | ||
} | ||
}; | ||
|
||
checkDomElement(e.target); | ||
}; | ||
|
||
document.addEventListener('click', supportExternalLinks, false); | ||
}()); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.