Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
40
gaia/apps/wappush/js/activity_picker.js
Executable file
40
gaia/apps/wappush/js/activity_picker.js
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
|
||||
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
||||
|
||||
/* global MozActivity */
|
||||
|
||||
(function(exports) {
|
||||
'use strict';
|
||||
|
||||
function activityDefaultError(event) {
|
||||
console.warn('Unhandled error spawning activity: ' +
|
||||
event.target.error.message + '\n');
|
||||
}
|
||||
|
||||
var ActivityPicker = {
|
||||
url: function ap_browse(url, onsuccess, onerror) {
|
||||
if (typeof onerror !== 'function') {
|
||||
onerror = activityDefaultError;
|
||||
}
|
||||
|
||||
if (window.MozActivity) {
|
||||
var activity = new MozActivity({
|
||||
name: 'view',
|
||||
data: {
|
||||
type: 'url',
|
||||
url: url
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof onsuccess === 'function') {
|
||||
activity.onsuccess = onsuccess;
|
||||
}
|
||||
|
||||
activity.onerror = onerror;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.ActivityPicker = ActivityPicker;
|
||||
|
||||
}(this));
|
||||
Loading…
Reference in a new issue