diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2014-03-31 21:27:07 +0400 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2014-03-31 21:27:07 +0400 |
commit | 1bbcd7f6af785946defbed3db3266e0768a6dd2e (patch) | |
tree | 4cc6ba185a77164da8231b3add5ca1d412bad188 /js/admin.js | |
parent | 29fd4ecf69d5d3656d448c12f05d987ed2a9c7c6 (diff) |
Add config page and settings
Diffstat (limited to 'js/admin.js')
-rw-r--r-- | js/admin.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/js/admin.js b/js/admin.js new file mode 100644 index 00000000..1cb25405 --- /dev/null +++ b/js/admin.js @@ -0,0 +1,37 @@ +/*global OC, $ */ + +$(document).ready(function(){ + + var documentsSettings = { + converter : '', + save : function() { + $('#docs_apply').attr('disabled', true); + var data = { + converter : documentsSettings.converter + }; + + if (documentsSettings.converter !== 'local'){ + data.url = $('#docs_url').val(); + } + + $.post( + OC.filePath('documents', 'ajax', 'admin.php'), + data, + documentsSettings.afterSave + ); + }, + + afterSave : function(response){ + $('#docs_apply').attr('disabled', false); + if (response && response.message) { + OC.Notification.show(response.message); + } + } + }; + + $('#docs_converter_external, #docs_converter_local').on('click', function(){ + documentsSettings.converter = $(this).val(); + $('#docs_extra').toggle(documentsSettings.converter !== 'local'); + }); + $('#docs_apply').on('click', documentsSettings.save); +}); |