mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
WIP mailvelope installation dialog
This commit is contained in:
parent
c159e47406
commit
591f55e3d7
10
etemplate/templates/default/pgp_installation.xet
Normal file
10
etemplate/templates/default/pgp_installation.xet
Normal 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>
|
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user