Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting to new webinos version #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ProximityReminder.wgt
Binary file not shown.
76 changes: 38 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ webinos Proximity Reminders

A webinos app for creating reminders based on where you are and what time it is.

Use it to set up a reminder for a certain time - e.g., an appointment - or for
Use it to set up a reminder for a certain time - e.g., an appointment - or for
when you are in a certain place - e.g., buying food when near a supermarket.


Creating a widget
=================

To make the application into a widget, simply zip the contents of the
To make the application into a widget, simply zip the contents of the
repository. You can also (for convenience) use the included shell scripts:

* create-widget.sh will create the widget package
Expand All @@ -22,34 +22,34 @@ repository. You can also (for convenience) use the included shell scripts:
Using this application
======================

This application assumes you are running webinos version 0.7.0 or greater. For
more information about the webinos project, visit webinos/Webinos-Platform .
You can either load the widget from the .wgt file (see the previous section)
or you can run index.html from a suitably modern web browser, such as Firefox
This application assumes you are running webinos version 0.7.0 or greater. For
more information about the webinos project, visit webinos/Webinos-Platform .

You can either load the widget from the .wgt file (see the previous section)
or you can run index.html from a suitably modern web browser, such as Firefox
or Chrome. If you run from a browser, you may need to replace the 'webinos.js'
file with a more recent version from the webinos project.

After the application loads, click on 'Create a reminder' to add a new
reminder, and then fill in the necessary details. You can select both a time
and location or neither. You can also select which of the devices in your
personal zone you would like to remind. New locations can be created by
clicking on the 'Add a new location' option. This will bring up a Google Maps
After the application loads, click on 'Create a reminder' to add a new
reminder, and then fill in the necessary details. You can select both a time
and location or neither. You can also select which of the devices in your
personal zone you would like to remind. New locations can be created by
clicking on the 'Add a new location' option. This will bring up a Google Maps
box which you can use to select the place of interest.

Existing reminders and locations can be edited or deleted by clicking "View
Existing reminders and locations can be edited or deleted by clicking "View
reminders" and then clicking on the reminder or place in question.

Reminders will not be checked automatically unless you tick the 'Check
reminders' box. Once triggered, the reminder will pop up a box and invoke the
Web Notification API. When this is cancelled, the reminder will set itself to
Reminders will not be checked automatically unless you tick the 'Check
reminders' box. Once triggered, the reminder will pop up a box and invoke the
Web Notification API. When this is cancelled, the reminder will set itself to
'disabled' so that it is not triggered again.

Data structures
===============

Reminders are stored as JSON objects in individual files using the webinos
implementation of the W3C File API. For simplicity we have not used any
Reminders are stored as JSON objects in individual files using the webinos
implementation of the W3C File API. For simplicity we have not used any
existing calendar format. Reminders have the following structure:

{
Expand All @@ -74,19 +74,19 @@ existing calendar format. Reminders have the following structure:
"devices": [
{
"id": "d9f83a1cb85165d3a2f23e6b95840795",
"api": "http:\/\/webinos.org\/api\/webnotification",
"api": "http:\/\/webinos.org\/api\/notifications",
"displayName": "Web Notification",
"description": "Web Notification API",
"serviceAddress": "..."
}
]
}

Note that many of these fields are optional. The intention is to allow for
multiple locations. However, the UI currently only supports a maximum of one
Note that many of these fields are optional. The intention is to allow for
multiple locations. However, the UI currently only supports a maximum of one
location per reminder.

Similarly, places are stored in individual files and have the following
Similarly, places are stored in individual files and have the following
structure:

{
Expand All @@ -103,48 +103,48 @@ structure:
Code structure
==============

The application has one HTML page - index.html - plus a lot of javascript and
The application has one HTML page - index.html - plus a lot of javascript and
CSS.

The application is split into the following javascript components:

* main.js - initialises the application and maintains the application's
* main.js - initialises the application and maintains the application's
state (the set of reminders and locations).
* alertreminder.js - triggers the checking of reminders (through the
checkInterval function) and display of notifications through a HTML pop-up
* alertreminder.js - triggers the checking of reminders (through the
checkInterval function) and display of notifications through a HTML pop-up
as well as the Notification API.
* editreminder.js - displays and populates the 'edit reminder' screen.
* findreminder.js - the logic that decides whether a particular reminder should
be triggered at any time.
* geoTools.js - contains geolocation methods such as invoking the geolocation
* geoTools.js - contains geolocation methods such as invoking the geolocation
API through webinos and loading the google maps scripts.
* globals.js - references to fixed DIV names that are used in the main code
* storereminders.js - uses the File API to store and load reminders from the
file system.
file system.
* viewreminders.js - populates the 'view reminders' page.
* webinos.js - a copy of the generated webinos.js script, required when running
in the browser.
in the browser.

It also makes heavy use of jquery and an add-on for showing a date and time
It also makes heavy use of jquery and an add-on for showing a date and time
picker.

License
=======

All source code and content created by members of the webinos project is
All source code and content created by members of the webinos project is
released with the APACHE 2.0 license (see the LICENSE file).

We have included other modules not created by the webinos project
We have included other modules not created by the webinos project
with different licenses. This includes:

* jquery and jquery-UI files which are under the MIT license -
http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
* js/jquery-ui-timepicker-addon.js -
* jquery and jquery-UI files which are under the MIT license -
http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
* js/jquery-ui-timepicker-addon.js -
http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
* css/jquery-ui-timepicker-addon.css -
http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
* The OpenSans fonts, which have an Apace 2.0 license -
http://www.google.com/webfonts/specimen/Open+Sans
* The OpenSans fonts, which have an Apace 2.0 license -
http://www.google.com/webfonts/specimen/Open+Sans

There are a couple of other trivial code snippets in this application, the
There are a couple of other trivial code snippets in this application, the
copyright for these lies with the original author.
29 changes: 29 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<project name="ProximityReminder" basedir="." default="main">
<property name="build.dir" value="."/>
<property name="widget.file" value="ProximityReminder"/>
<property name="src.dir" value="js"/>
<property name="css.dir" value="css"/>
<property name="fonts.dir" value="fonts"/>
<property name="certs.dir" value="example-certs"/>

<target name="clean">
<delete file="${build.dir}/${widget.file}.wgt" />
</target>

<target name="build">
<zip destfile="${widget.file}.zip" encoding="UTF-8">
<fileset dir="${basedir}">
<include name="${css.dir}/**"/>
<include name="${src.dir}/**"/>
<include name="${fonts.dir}/**"/>
<include name="${certs.dir}/**"/>
<include name="config.xml"/>
<include name="index.html"/>
<include name="remind_me.png"/>
</fileset>
</zip>
<move file="${basedir}/${widget.file}.zip" tofile="${basedir}/${widget.file}.wgt"/>
</target>

<target name="main" depends="clean,build"/>
</project>
14 changes: 7 additions & 7 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
<content src="index.html" />
<icon src="remind_me.png" />
<author>John Lyle</author>

<!-- features needed -->
<feature name="http://webinos.org/feature/internet" required="true">
<!-- should this be http://webinos.org/core/network-access ?-->
<param name="csp-img-src" value="http://maps.googleapis.com"/>
<param name="csp-script-src" value="http://maps.googleapis.com"/>
</feature>
<feature name="http://webinos.org/api/webnotification" required="false" />
<feature name="http://webinos.org/api/notifications" required="false" />
<feature name="http://webinos.org/api/file" required="true" />
<feature name="http://www.w3.org/ns/api-perms/geolocation" required="true" />

<!-- privacy policies -->
<DataHandlingPolicy PolicyId="#current">
<AuthorizationsSet>
Expand All @@ -27,7 +27,7 @@
</AuthorizationsSet>
<ObligationsSet />
</DataHandlingPolicy>

<!-- mapping policies to APIs -->
<ProvisionalActions>
<ProvisionalAction>
Expand All @@ -38,10 +38,10 @@
</DeveloperProvidedDescription>
</ProvisionalAction>
<ProvisionalAction>
<AttributeValue>http://webinos.org/api/webnotification</AttributeValue>
<AttributeValue>http://webinos.org/api/notifications</AttributeValue>
<AttributeValue>#current</AttributeValue>
<DeveloperProvidedDescription language="EN">
Notifications are used to alert you when a reminder is valid - e.g., at a
Notifications are used to alert you when a reminder is valid - e.g., at a
specific time or place.
</DeveloperProvidedDescription>
</ProvisionalAction>
Expand All @@ -59,6 +59,6 @@
Internet access is used to load Google Maps
</DeveloperProvidedDescription>
</ProvisionalAction>
</ProvisionalActions>
</ProvisionalActions>
</widget>

4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script type="text/javascript" src="./js/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="./js/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="./js/jquery-ui-sliderAccess.js"></script>
<script type="text/javascript" src="./js/webinos.js"></script>
<script type="text/javascript" src="/webinos.js"></script>
<script type="text/javascript" src="./js/globals.js"></script>
<script type="text/javascript" src="./js/storereminders.js"></script>
<script type="text/javascript" src="./js/geoTools.js"></script>
Expand Down Expand Up @@ -144,4 +144,4 @@ <h2 id="mapImgHeading"></h2>
</div>
</body>

</html>
</html>
Loading