Coder Social home page Coder Social logo

ehealth-container-app's Introduction

Ehealth Container Application

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.

NOTE: You may not have to build the wrapper to change the URL

  • 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.

Building the Wrapper

$ npm install
$ grunt

This will write fresh OS X, Windows32 and Linux32 builds into the build directory.

Making the builds look good

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):

OS X

  1. Right-click build/darwin/atom-shell/atom.app and show package contents.
  2. Replace the file /Resources/atom.icns with this one: app/ehealth_logo.icns.
  3. Inside info.plist find <key>CFBundleName</key> and change the following line to <string>eHealth - Call Center</string>.
  4. In the same file, find <key>CFBundleIconFile</key> and change the following line to <string>ehealth_logo.icns</string>.
  5. 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.

Windows

This step is only possible on Windows, unless you want to wrap Reshacker in Wine.

  1. Rename build/win32/atom-shell/atom.exe to whatever app it is you're wrapping.
  2. Download Resource Hacker.
  3. Run Resource Hacker and drag the .exe onto it.
  4. In Resource Hacker, click action -> replace icon, and select the ehealth_logo.ico file from the app folder.
  5. Save and close.

Linux

I have no idea.

Making Apps Wrappable

Apart from implementing AppCache, the call center needed a few modifications so it would run inside Atom Shell:

1. Use native file saving dialog

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.

2. Prevent print feature from opening a new window

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;

3. Make moment.js work

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.

Troubleshooting

PouchDB 405 Error

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

ehealth-container-app's People

Contributors

dougnukem avatar espy avatar owenthereal avatar wprater avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ehealth-container-app's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.