2012-02-23 01:20:46 +04:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
$('#encryption_blacklist').multiSelect({
|
|
|
|
oncheck:blackListChange,
|
|
|
|
onuncheck:blackListChange,
|
|
|
|
createText:'...',
|
|
|
|
});
|
|
|
|
|
|
|
|
function blackListChange(){
|
|
|
|
var blackList=$('#encryption_blacklist').val().join(',');
|
|
|
|
OC.AppConfig.setValue('files_encryption','type_blacklist',blackList);
|
|
|
|
}
|
2012-04-19 18:36:07 +04:00
|
|
|
|
2012-08-03 14:21:49 +04:00
|
|
|
//TODO: Handle switch between client and server side encryption
|
2012-07-31 18:37:37 +04:00
|
|
|
$('input[name=encryption_mode]').change(function(){
|
|
|
|
var client=$('input[value="client"]:checked').val()
|
|
|
|
,server=$('input[value="server"]:checked').val()
|
2012-08-02 12:39:30 +04:00
|
|
|
,user=$('input[value="user"]:checked').val()
|
2012-07-31 18:37:37 +04:00
|
|
|
,none=$('input[value="none"]:checked').val()
|
2012-08-09 16:25:09 +04:00
|
|
|
,disable=false
|
|
|
|
if (client) {
|
2012-07-31 18:37:37 +04:00
|
|
|
OC.AppConfig.setValue('files_encryption','mode','client');
|
2012-08-09 16:25:09 +04:00
|
|
|
disable = true;
|
|
|
|
} else if (server) {
|
2012-07-31 18:37:37 +04:00
|
|
|
OC.AppConfig.setValue('files_encryption','mode','server');
|
2012-08-09 16:25:09 +04:00
|
|
|
disable = true;
|
|
|
|
} else if (user) {
|
2012-08-02 12:39:30 +04:00
|
|
|
OC.AppConfig.setValue('files_encryption','mode','user');
|
2012-08-09 16:25:09 +04:00
|
|
|
disable = true;
|
|
|
|
} else {
|
2012-07-31 18:37:37 +04:00
|
|
|
OC.AppConfig.setValue('files_encryption','mode','none');
|
2012-08-09 16:25:09 +04:00
|
|
|
}
|
|
|
|
if (disable) {
|
|
|
|
document.getElementById('server_encryption').disabled = true;
|
|
|
|
document.getElementById('client_encryption').disabled = true;
|
|
|
|
document.getElementById('user_encryption').disabled = true;
|
|
|
|
document.getElementById('none_encryption').disabled = true;
|
|
|
|
}
|
2012-07-31 18:37:37 +04:00
|
|
|
})
|
2012-02-23 01:20:46 +04:00
|
|
|
})
|