WIP mailvelope installation dialog

This commit is contained in:
Hadi Nategh 2015-09-14 17:38:33 +00:00
parent c159e47406
commit 591f55e3d7
2 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
</template>
</overlay>

View File

@ -971,6 +971,7 @@ var AppJS = Class.extend(
}
else
{
egw.message('You need to install Mailvelope plugin available for Chrome and Firefox from <a target="_blank">mailvelope.com</a>.Add your domain as "*.localhost" in options to list of email providers and enable API.', true);
jQuery(window).on('mailvelope', function()
{
self.mailvelopeOpenKeyring().then(callback);
@ -1276,6 +1277,65 @@ var AppJS = Class.extend(
},
mailvelopeInstallationOffer: function ()
{
var dialog = function(_content, _callback)
{
return et2_createWidget("dialog", {
callback: function(_button_id, _value) {
if (typeof _callback == "function")
{
_callback.call(this, _button_id, _value.value);
}
},
title: egw.lang('PGP Encryption Installation'),
buttons: et2_dialog.BUTTONS_YES_NO,
dialog_type: 'info',
value: {
content: _content
},
template: egw.webserverUrl+'/etemplate/templates/default/pgp_installation.xet',
class: "pgp_installation",
modal: true,
//resizable:false,
});
};
var content = [{}];
dialog(content, function(_button){
if (_button == et2_dialog.YES_BUTTON)
{
if (typeof chrome != 'undefined' && typeof chrome.webstore != '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.'));
});
}
else if (typeof InstallTrigger != 'undefined' && InstallTrigger.enabled())
{
InstallTrigger.install({mailvelope:"https://download.mailvelope.com/releases/latest/mailvelope.firefox.xpi"},
function(_url, _status){
if (_status == 0)
{
et2_dialog.alert(lang('Mailvelope addon installation succeded. Now you may configure the options.'));
return;
}
else
{
et2_dialog.alert(lang('Mailvelope addon installation faild! Please try agian.'));
}
});
}
}
});
},
/**
* PGP begin and end tags
*/