Commit 476844dc9d926c93849472b43ba12e2970c03a42

Authored by Andrey Karpikov
1 parent 28b701c6

add webp image format for preview

@@ -1930,7 +1930,7 @@ jQuery(document).ready(function(){ @@ -1930,7 +1930,7 @@ jQuery(document).ready(function(){
1930 1930
1931 1931
1932 // DRAG and DROP file 1932 // DRAG and DROP file
1933 - var available_file_type = ['image/jpeg', 'image/pjpeg', 'image/png', 'image/gif']; 1933 + var available_file_type = ['image/jpeg', 'image/pjpeg', 'image/png', 'image/gif', 'image/webp'];
1934 1934
1935 var initImageDragDrop = function(){ 1935 var initImageDragDrop = function(){
1936 $('.drop-down-upload').each(function(){ 1936 $('.drop-down-upload').each(function(){
@@ -466,7 +466,7 @@ @@ -466,7 +466,7 @@
466 }; 466 };
467 defaultFileTypeSettings = { 467 defaultFileTypeSettings = {
468 image: function (vType, vName) { 468 image: function (vType, vName) {
469 - return compare(vType, 'image.*') || compare(vName, /\.(gif|png|jpe?g)$/i); 469 + return compare(vType, 'image.*') || compare(vName, /\.(webp|gif|png|jpe?g)$/i);
470 }, 470 },
471 html: function (vType, vName) { 471 html: function (vType, vName) {
472 return compare(vType, 'text/html') || compare(vName, /\.(htm|html)$/i); 472 return compare(vType, 'text/html') || compare(vName, /\.(htm|html)$/i);
@@ -25,7 +25,7 @@ module Kanjai @@ -25,7 +25,7 @@ module Kanjai
25 25
26 def self.image?(url) 26 def self.image?(url)
27 ext = File.extname(url) 27 ext = File.extname(url)
28 - ['.jpg', '.gif', '.jpeg', '.png', '.svg'].include?(ext) 28 + ['.jpg', '.gif', '.jpeg', '.png', '.svg', '.webp'].include?(ext)
29 end 29 end
30 30
31 end 31 end
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.377" 2 + VERSION = "0.0.378"
3 end 3 end