richdocuments/js/admin.js

44 lines
971 B
JavaScript
Raw Normal View History

2014-03-31 20:27:07 +03:00
/*global OC, $ */
2016-10-11 12:14:53 +05:30
var documentsSettings = {
save : function() {
$('#wopi_apply').attr('disabled', true);
var data = {
2017-03-19 00:27:05 +01:00
wopi_url : $('#wopi_url').val().replace(/\/$/, '')
2016-10-11 12:14:53 +05:30
};
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 }
);
},
2016-10-11 12:14:53 +05:30
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');
});
2016-10-11 12:14:53 +05:30
}
};
$(document).ready(function(){
documentsSettings.initialize();
2014-03-31 20:27:07 +03:00
});