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
48
gaia/apps/ftu/js/import_services.js
Executable file
48
gaia/apps/ftu/js/import_services.js
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
/* global ServicesLauncher */
|
||||
/* exported ImportIntegration */
|
||||
'use strict';
|
||||
|
||||
var ImportIntegration = {
|
||||
|
||||
get liveImportButton() {
|
||||
delete this.liveImportButton;
|
||||
return (this.liveImportButton =
|
||||
document.getElementById('live-import-button'));
|
||||
},
|
||||
|
||||
get gmailImportButton() {
|
||||
delete this.gmailImportButton;
|
||||
return (this.gmailImportButton =
|
||||
document.getElementById('gmail-import-button'));
|
||||
},
|
||||
|
||||
init: function () {
|
||||
this.liveImportButton.addEventListener('click', this);
|
||||
this.gmailImportButton.addEventListener('click', this);
|
||||
},
|
||||
|
||||
handleEvent: function (event) {
|
||||
switch (event.type) {
|
||||
case 'click':
|
||||
if (event.target === this.liveImportButton) {
|
||||
ServicesLauncher.start('live');
|
||||
}
|
||||
else if (event.target === this.gmailImportButton) {
|
||||
ServicesLauncher.start('gmail');
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
checkImport: function (nextState) {
|
||||
|
||||
if (nextState === 'disabled') {
|
||||
this.gmailImportButton.setAttribute('disabled', 'disabled');
|
||||
this.liveImportButton.setAttribute('disabled', 'disabled');
|
||||
}
|
||||
else if (nextState === 'enabled') {
|
||||
this.gmailImportButton.removeAttribute('disabled');
|
||||
this.liveImportButton.removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Reference in a new issue