You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
971 B
JavaScript
44 lines
971 B
JavaScript
/*global OC, $ */
|
|
|
|
var documentsSettings = {
|
|
save : function() {
|
|
$('#wopi_apply').attr('disabled', true);
|
|
var data = {
|
|
wopi_url : $('#wopi_url').val().replace(/\/$/, '')
|
|
};
|
|
|
|
OC.msg.startAction('#documents-admin-msg', t('richdocuments', 'Saving...'));
|
|
$.post(
|
|
OC.filePath('richdocuments', 'ajax', 'admin.php'),
|
|
data,
|
|
documentsSettings.afterSave
|
|
);
|
|
},
|
|
|
|
saveDocFormat: function(format) {
|
|
$.post(
|
|
OC.filePath('richdocuments', 'ajax', 'admin.php'),
|
|
{ 'doc_format': format }
|
|
);
|
|
},
|
|
|
|
afterSave : function(response){
|
|
$('#wopi_apply').attr('disabled', false);
|
|
OC.msg.finishedAction('#documents-admin-msg', response);
|
|
},
|
|
|
|
initialize: function() {
|
|
$('#wopi_apply').on('click', documentsSettings.save);
|
|
|
|
$(document).on('change', '.doc-format-ooxml', function() {
|
|
var ooxml = this.checked;
|
|
documentsSettings.saveDocFormat(ooxml ? 'ooxml' : 'odf');
|
|
});
|
|
|
|
}
|
|
};
|
|
|
|
$(document).ready(function(){
|
|
documentsSettings.initialize();
|
|
});
|