Mailvelope backup/restore integration WIP:

- Implements Mailvelope installation dialog
This commit is contained in:
Hadi Nategh 2015-09-15 16:32:56 +00:00
parent 539d2be255
commit cd7324983b
2 changed files with 50 additions and 18 deletions

View File

@ -2,9 +2,30 @@
<!DOCTYPE overlay PUBLIC "-//Stylite AG//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
<overlay>
<template id="etemplate.pgp_installation" template="" lang="" group="" version="15.1">
<vbox height="300" width="300">
<description value="You need to have mailvelope plugin installed on your browser, although, before procceding further, we do recommend you to watch this short video tutorial about how to work with mailvelope plugin."/>
<video video_src="webdav.php/home/sysop/Tutorials/20150616_PGP_EN.mp4" controls="true" height="260" width="60%"/>
</vbox>
<grid height="300" width="450">
<columns>
<column/>
</columns>
<rows>
<row part="header">
<description value="You need to install Mailvelope plugin available for Chrome and Firefox from www.mailvelope.com or by clicking on install button."/>
</row>
<row>
<description value="$row_cont[domain]"/>
</row>
<row>
<description value="Although, before proceeding further, we do highly recommend you to watch this short video, to see how mailvelope plugin works with EGroupware."/>
</row>
<row>
<video video_src="https://www.egroupware.de/videos/mailvelope_only_EN.mp4" controls="true" height="260" width="60%"/>
</row>
</rows>
</grid>
<styles>
video {
margin-left: 18%;
}
</styles>
</template>
</overlay>

View File

@ -1237,7 +1237,7 @@ var AppJS = Class.extend(
}
},
title: egw.lang('Backup/Restore'),
buttons:[{"button_id": 'close',"text": 'Close', id: 'dialog[close]', image: 'check', "default":true}],
buttons:[{"button_id": 'close',"text": 'Close', id: 'dialog[close]', image: 'cancelled', "default":true}],
value: {
content: {
menu:_content
@ -1272,8 +1272,16 @@ var AppJS = Class.extend(
}
},
/**
* Create a dialog and offers installation option for installing mailvelope plugin
* plus it offers a video tutorials to get the user morte familiar with mailvelope
*/
mailvelopeInstallationOffer: function ()
{
var buttons = [
{"text": 'Install', id: 'install', image: 'check', "default":true},
{"text": 'Close', id:'close', image: 'cancelled'}
];
var dialog = function(_content, _callback)
{
return et2_createWidget("dialog", {
@ -1284,7 +1292,7 @@ var AppJS = Class.extend(
}
},
title: egw.lang('PGP Encryption Installation'),
buttons: et2_dialog.BUTTONS_YES_NO,
buttons: buttons,
dialog_type: 'info',
value: {
content: _content
@ -1296,20 +1304,23 @@ var AppJS = Class.extend(
});
};
var content = [{}];
var content = [
// Header row should be empty item 0
{},
{domain:this.egw.lang('Add your domain as "%1" in options to list of email providers and enable API.',
'*.'+this._mailvelopeDomain()), video:"test", control:"true"}
];
dialog(content, function(_button){
if (_button == et2_dialog.YES_BUTTON)
if (_button == 'install')
{
if (typeof chrome != 'undefined' && typeof chrome.webstore != 'undefined')
if (typeof chrome != 'undefined')
{
chrome.webstore.install("https://chrome.google.com/webstore/detail/mailvelope/kajibbejlbohfaggdiogboambcijhkke",
function(){
et2_dialog.alert(lang('Mailvelope addon installation succeded. Now you may configure the options.'));
return;
},
function(){
et2_dialog.alert(lang('Mailvelope addon installation faild! Please try agian.'));
});
// ATM we are not able to trigger mailvelope installation directly
// since the installation should be triggered from the extension
// owner validate website (mailvelope.com), therefore, we just redirect
// user to chrome webstore to install mailvelope from there.
window.open('https://chrome.google.com/webstore/detail/mailvelope/kajibbejlbohfaggdiogboambcijhkke');
}
else if (typeof InstallTrigger != 'undefined' && InstallTrigger.enabled())
{