Permalink
Browse files

Merge commit 'adb507752d3f5d830447ece50d22f01498f9f962' (early Decemb…

…er 2011 release)

Conflicts:
	addons/jetpack/data/panel.css
	addons/jetpack/data/panel.html
	addons/jetpack/data/panel.js
	addons/jetpack/lib/ui.js
	docs/ACTIVITIES.md
  • Loading branch information...
2 parents f4992af + adb5077 commit a839ea2367d6566a95f1ad1a0d0bbdb73e55106e @ianb ianb committed Dec 14, 2011
Showing 429 changed files with 15,047 additions and 40,430 deletions.
View
@@ -2,4 +2,7 @@
site/tools/htmlcompressor-0.9.8.jar
site/tools/yuicompressor-2.4.2.jar
site/tools/yuicompressor-2.4.2.zip
-addons/firefox/extension/dist
+site/tools/build-compressor
+deps/
+addons/jetpack/mac/foxlauncher.o
+openwebapps.xpi
View
@@ -2,3 +2,21 @@
path = site/tests/doctestjs
url = http://github.com/ianb/doctestjs.git
+[submodule "site/tests/jstestnet"]
+ path = site/tests/jstestnet
+ url = git://github.com/kumar303/jstestnet.git
+
+[submodule "icongrid"]
+ path = icongrid
+ url = http://github.com/mozilla/icongrid.git
+
+[submodule "site/tests/jstestnetlib"]
+ path = site/tests/jstestnetlib
+ url = https://github.com/kumar303/jstestnetlib.git
+
+[submodule "site/tests/serverjs/djangode"]
+ path = site/tests/serverjs/djangode
+ url = https://github.com/mozilla/djangode.git
+[submodule "site/tools/apps.mozillalabs.com"]
+ path = site/tools/apps.mozillalabs.com
+ url = https://github.com/mozilla/apps.mozillalabs.com.git
View
@@ -0,0 +1,71 @@
+PYTHON = python
+
+MAKELAUNCHER =
+SYS := $(shell uname -s)
+ifeq ($(SYS), Darwin)
+ MAKELAUNCHER := ${MAKE} -C addons/jetpack/mac/
+endif
+
+ifeq ($(TOPSRCDIR),)
+ export TOPSRCDIR = $(shell pwd)
+endif
+profile :=
+ifneq ($(OWA_PROFILE),)
+ profile := --profiledir="$(OWA_PROFILE)"
+endif
+
+deps := $(TOPSRCDIR)/deps
+ifneq ($(DEPSDIR),)
+ deps := $(DEPSDIR)
+endif
+
+binary :=
+ifneq ($(MOZ_BINARY),)
+ binary := -b "$(MOZ_BINARY)"
+endif
+
+addon_sdk := $(deps)/addon-sdk/bin
+oauthorizer := $(deps)/oauthorizer
+openwebapps := $(TOPSRCDIR)/addons/jetpack
+activities := $(TOPSRCDIR)/addons/activities
+
+ifeq ($(TARGET),activities)
+ pkgdir := $(activities)
+ cfx_args := --pkgdir=$(pkgdir) $(binary) $(profile) --package-path=$(oauthorizer) --package-path=$(openwebapps) --binary-args="-console -purgecaches $(BINARYARGS)"
+else
+ pkgdir := $(openwebapps)
+ cfx_args := --pkgdir=$(pkgdir) $(binary) $(profile) --binary-args="-console -purgecaches $(BINARYARGS)"
+endif
+
+test_args :=
+ifneq ($(TEST),)
+ test_args := -f $(TEST)
+endif
+
+# might be useful for symlink handling...
+SLINK = ln -sf
+ifneq ($(findstring MINGW,$(shell uname -s)),)
+ SLINK = cp -r
+ export NO_SYMLINK = 1
+endif
+
+all: xpi
+
+xpi: pull
+ $(addon_sdk)/cfx xpi $(cfx_args)
+
+pull:
+ $(MAKELAUNCHER)
+ $(PYTHON) build.py -p $(pkgdir)/package.json
+
+test:
+ $(addon_sdk)/cfx test -v $(cfx_args) $(test_args)
+
+run:
+ $(MAKELAUNCHER)
+ $(addon_sdk)/cfx run $(cfx_args)
+
+build_rpms:
+ cd site/tools; ./build_rpm.sh
+
+.PHONY: xpi clean pull test run build_rpms
View
@@ -1,3 +1,56 @@
+
+PreRequisite
+===============
+
+* Firefox
+* Python
+* Git
+* make
+
+Getting setup
+=====================
+
+To pull and run openwebapps addon:
+
+ git clone https://github.com/mozilla/openwebapps
+ cd openwebapps
+ make pull
+ make run
+
+You can build an xpi:
+
+ make xpi
+
+You can run the tests:
+
+ make test
+
+
+If you want to run (using make run) in a specific profile:
+
+ OWA_PROFILE=/path/to/firefox/profile make run
+
+Tests cannot be run in a specific profile.
+
+
+Prepare your firefox profile
+-----------------------------
+
+You probably want a test firefox profile so open up the [Profile Manager](http://kb.mozillazine.org/Profile_manager).
+
+In the Mac:
+
+ /Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager
+
+On Windows:
+
+ firefox.exe -P
+
+In the profile manager, create a profile with the name `fxsharetest`, then exit the profile manager.
+
+Repository Layout
+===================
+
This is an experiment around installable web applications. What
you'll find here:
@@ -0,0 +1,15 @@
+
+This is a simple test harness / tiny-sdk for Web Activities
+
+START by loading index.html in a browser (file URL is okay).
+
+The harness files are:
+ index.html
+ webactivities.js
+
+The specific service implementation, which you'll want to modify, are:
+ example-activity.js
+ login.html
+
+To make this work on an existing service, these files need to be served
+from the appropriate domain.
@@ -0,0 +1,10 @@
+<head><title>example activity</title>
+<!-- utilities -->
+<script src="underscore-min.js" type="text/javascript"></script>
+<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
+
+<script src="webactivities.js" type="text/javascript"></script>
+<script src="example-activity.js" type="text/javascript"></script>
+</head>
+<body>
+</body>
@@ -0,0 +1,93 @@
+/*
+ * An example activity registration
+ */
+
+// capabilities
+navigator.apps.services.registerHandler(
+ 'http://webactivities.org/share',
+ 'getParameters',
+ function(activity, credentials) {
+ activity.postResult({
+ // no features for simple twitter-style sharing
+ features: [],
+ constraints: {
+ textLimit: 140,
+ editableURLInMessage: true,
+ shortURLLength: 20
+ },
+ shareTypes: [
+ {type: 'public', name: 'Public Timeline'},
+ {type: 'direct', name: 'Direct Message', toLabel: 'recipient handle'},
+ ]
+ });
+ }
+);
+
+// list of items to autocomplete
+var RECIPIENTS = [
+ 'Alice',
+ 'Bob',
+ 'Charlie',
+ 'Connor',
+ 'Chloe',
+ 'David',
+ 'Doris',
+ 'Emily',
+ 'Erin',
+ 'Eric'
+];
+
+// autocomplete recipients
+navigator.apps.services.registerHandler(
+ 'http://webactivities.org/share',
+ 'autocompleteRecipients',
+ function(activity, credentials) {
+ // auto-complete on direct share type only
+ if (activity.data.type == 'direct') {
+ activity.postResult(_.select(RECIPIENTS, function(recipient) {
+ return recipient.indexOf(activity.data.input > -1);
+ }));
+ } else {
+ activity.postResult([]);
+ }
+ }
+);
+
+// validate recipients
+navigator.apps.services.registerHandler(
+ 'http://webactivities.org/share',
+ 'validateRecipients',
+ function(activity, credentials) {
+ // for now no invalid recipients.
+ activity.postResult(true);
+ }
+);
+
+navigator.apps.services.registerHandler(
+ // the share activity (don't change this)
+ 'http://webactivities.org/share',
+ // the specific action within that activity (don't change this either)
+ 'send',
+ function(activity, credential) {
+ // post the message to our server (e.g. MyShare) using AJAX
+
+ // if successful:
+ var result = {messagePosted: activity.data.message,
+ messageURL: "http://example.com/" + Math.round(Math.random() * 10000)};
+
+ // look at recipients
+ if (activity.data.recipients) {
+ result['recipients'] = _.map(activity.data.recipients, function(r) {return "@" + r;});
+ }
+
+ activity.postResult(result);
+
+ // if not logged (credential is bad, expired, or inexistent)
+ // activity.postException(activity.CREDENTIAL_FAILURE);
+
+ // if other failure:
+ // activity.postException(activity.FAILURE);
+ });
+
+// tell the system that all handlers have been registered.
+navigator.apps.services.ready();
@@ -0,0 +1,53 @@
+<head>
+ <!-- utilities -->
+ <script src="underscore-min.js" type="text/javascript"></script>
+ <script src="jquery-1.6.2.min.js" type="text/javascript"></script>
+
+ <!-- framework shim -->
+ <script src="webactivities.js" type="text/javascript"></script>
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $('#share').hide();
+ $('#recipient').hide();
+ });
+ </script>
+</head>
+<body>
+ <h2>Web Activities Test Harness</h2>
+ <p>
+ Customize the behavior of the activity by editing <tt>example-activity.js</tt><br />
+ Customize the login page by editing <tt>login.html</tt>.
+ </p>
+ <hr>
+ <div id="setup">
+ <button onclick="navigator.apps.services.setup();">setup</button>
+ <hr>
+ </div>
+ <div id="share">
+ <h3>Share Something</h3>
+ <form onsubmit="navigator.apps.services.testShare(this.message.value); return false;">
+ <div id="shareTypes">
+ <select name="shareType" id="shareType">
+ </select>
+ <span id="recipient">
+ <span id="toLabel"></span>: <input type="text" name="to" size="60" id="recipients_input" />
+ </span>
+ </div>
+ <br />
+ Message:<br />
+ <textarea name="message" rows=3 cols=80 wrap="soft"></textarea><br />
+ <input type="submit" value="share" />
+ </form>
+<br /><br />
+</div>
+<p id="credentials">
+<em>not logged in</em>
+</p>
+
+<h4>Log</h4>
+
+<div id="log">
+</div>
+
+</body>
Oops, something went wrong.
@@ -0,0 +1,27 @@
+<head>
+ <script src="webactivities.js" type="text/javascript"></script>
+
+ <script type="text/javascript">
+
+ // The login page can be AJAX or normal form submit,
+ // with a full page reload. All that matters is that
+ // the following navigator.apps.* call be made.
+
+ function onSuccessfulLogin() {
+ navigator.apps.services.storeCredential({
+ credential: {id: 'john@smith.com'},
+ displayName: "John Smith"
+ });
+ }
+ </script>
+
+</head>
+<body>
+<h2>Login</h2>
+
+<p>
+This page fakes a login. Replace it with your own login experience.
+</p>
+
+<button onclick="onSuccessfulLogin();">login as John Smith</button>
+</body>
@@ -0,0 +1,15 @@
+{
+ "name": "Twitter",
+ "icons": {
+ "32": "/icons/32.png"
+ },
+ "services": {
+ "http://webactivities.org/login": {
+ "path": "/login.html"
+ },
+ "http://webactivities.org/share": {
+ "type": [ "application/url", "text/*", "image/*" ],
+ "path": "/example-activity.html"
+ }
+ }
+ }
Oops, something went wrong.

0 comments on commit a839ea2

Please sign in to comment.