This is an atom-shell app that acts as a thin wrapper for the Atom branch of the SL call center app (details on that below), it basically just opens a URL. But if that URL points to an app that uses AppCache and local data storage (PouchDB for example), you now have an offline-capable, auto-updating cross-platform application. Yay!
So, app/main.js
, line 30 onwards, defines which URL gets wrapped.
- On OS X, you can just browse the contents of the built package, find
Contents/Resources/App/main.js
and modify the target. - On Linux, it's even easier, just open
resources/App/main.js
directly. - On Windows, you're out of luck, sorry.
$ npm install
$ grunt
This will write fresh OS X, Windows32 and Linux32 builds into the build
directory.
The folders, packages, executables etc. will still be called Atom
and will use the Atom logo. We don't want that. Here's how to mod them (sorry, this is terrible/impossible to automate):
- Right-click
build/darwin/atom-shell/atom.app
and show package contents. - Replace the file
/Resources/atom.icns
with this one:app/ehealth_logo.icns
. - Inside
info.plist
find<key>CFBundleName</key>
and change the following line to<string>eHealth - Call Center</string>
. - In the same file, find
<key>CFBundleIconFile</key>
and change the following line to<string>ehealth_logo.icns</string>
. - Rename the package from step 1 to whatever app it is you're wrapping.
On OS X, you also have the option of changing the wrapper target in the built app, so you don't have to build and modify the wrapper for each target. To do this, open the package, and inside that the file Contents/Resources/App/main.js
. You'll find the build targets from line 30 onwards.
This step is only possible on Windows, unless you want to wrap Reshacker in Wine.
- Rename
build/win32/atom-shell/atom.exe
to whatever app it is you're wrapping. - Download Resource Hacker.
- Run Resource Hacker and drag the
.exe
onto it. - In Resource Hacker, click
action -> replace icon
, and select theehealth_logo.ico
file from theapp
folder. - Save and close.
I have no idea.
Apart from implementing AppCache, the call center needed a few modifications so it would run inside Atom Shell:
The way ng-csv
saves files fails silently in Atom Shell, letting us use ng-click
to call a fallback function that checks whether we're in Atom Shell and then uses the native file API to save the CSV. See the source for details. Docs for this feature are here.
I haven't found a way to make Atom Shell open a new window with the same session, so clicking on print
would always open a new login window. My solution was to open the print view in the same window, and add an explicit Print this window
button on that that would call window.print()
, because CMD-P
/printing via menu doesn't work in Atom Shell at the moment. This is super simple, see the view and the controller;
Moment.js is problematic because it works in both the browser and the node environment, so it will check where it is and then expose itself accordingly. Sadly, Atom Shell is a node environment, so Moment.js will expose itself as a module, and not as a browser global (see here for an explanation). So I forked moment.js, removed that check so it is forced to expose a global, and everything's peachy.
You've got conflicting local databases. Delete them here:
- __ on OS X:__ ~/Library/Application Support/MyAppName (something like `\Users\username\Library\Application Support\Atom`)
- __ on Windows:__ %APPDATA%\MyAppName (something like `C:\Users\Username\AppData\Roaming\Atom-Shell)
- __ on Linux:__ ~/.config/MyAppName
Enjoy!
<3