archive.js 830 B

1234567891011121314151617181920
  1. /**
  2. * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
  3. * This file is licensed under the Affero General Public License version 3 or
  4. * later.
  5. * See the COPYING-README file.
  6. */
  7. $(document).ready(function() {
  8. if(typeof FileActions!=='undefined'){
  9. FileActions.register('application/zip','Open','',function(filename){
  10. window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
  11. });
  12. FileActions.setDefault('application/zip','Open');
  13. FileActions.register('application/x-gzip','Open','',function(filename){
  14. window.location=OC.linkTo('files', 'index.php')+'&dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
  15. });
  16. FileActions.setDefault('application/x-gzip','Open');
  17. }
  18. });