Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
40 lines
737 B
JavaScript
Executable file
40 lines
737 B
JavaScript
Executable file
/*global
|
|
AutoTheme,
|
|
Main
|
|
*/
|
|
'use strict';
|
|
|
|
(function(exports) {
|
|
if (!window.navigator.mozSetMessageHandler) {
|
|
return;
|
|
}
|
|
|
|
const ActivityDataType = {
|
|
IMAGE: 'image/*'
|
|
};
|
|
|
|
var ActivityHandler = {
|
|
onShareActivity(activity) {
|
|
var activityData = activity.source.data;
|
|
|
|
if (activityData.type !== ActivityDataType.IMAGE) {
|
|
return;
|
|
}
|
|
|
|
if (!activityData.blobs.length) {
|
|
return;
|
|
}
|
|
|
|
var image = activityData.blobs[0];
|
|
Navigation.popToRoot().then(() => {
|
|
Main.createTheme();
|
|
AutoTheme.load(image);
|
|
});
|
|
}
|
|
};
|
|
|
|
window.navigator.mozSetMessageHandler(
|
|
'activity', ActivityHandler.onShareActivity.bind(ActivityHandler)
|
|
);
|
|
|
|
})(window);
|