diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2017-03-29 01:16:59 -0400 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-04-05 11:49:08 +0100 |
commit | fd8a40783d593993caa76925eae1d54e6fd95c4b (patch) | |
tree | 42584066f86ffe50638eaa37ececac598f58533e /app/models/blob.rb | |
parent | d4d95ad32fb1f47ecb4b6d0e8d9885dba0222453 (diff) | |
download | gitlab-ce-fd8a40783d593993caa76925eae1d54e6fd95c4b.tar.gz |
Load a preview of Sketch 43 filessketch-preview-files
Sketch 43 files are technically a zip file, so the JavaScript opens the
zip file & locates a preview.png which is just a quick preview of the
last sketch page edited. After that is loaded it simply places the image
into the DOM
Diffstat (limited to 'app/models/blob.rb')
-rw-r--r-- | app/models/blob.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb index 95d2111a992..1c451a3976f 100644 --- a/app/models/blob.rb +++ b/app/models/blob.rb @@ -50,6 +50,10 @@ class Blob < SimpleDelegator text? && language&.name == 'Jupyter Notebook' end + def sketch? + binary? && extname.downcase.delete('.') == 'sketch' + end + def size_within_svg_limits? size <= MAXIMUM_SVG_SIZE end @@ -69,6 +73,8 @@ class Blob < SimpleDelegator 'image' elsif ipython_notebook? 'notebook' + elsif sketch? + 'sketch' elsif text? 'text' else |