Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0b3ff9c8
Commit
0b3ff9c8
authored
Apr 24, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set BlobViewer::Base.binary instead of .text
parent
a2f4650f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
17 additions
and
17 deletions
+17
-17
app/models/blob_viewer/base.rb
app/models/blob_viewer/base.rb
+5
-5
app/models/blob_viewer/binary_stl.rb
app/models/blob_viewer/binary_stl.rb
+1
-1
app/models/blob_viewer/download.rb
app/models/blob_viewer/download.rb
+1
-1
app/models/blob_viewer/empty.rb
app/models/blob_viewer/empty.rb
+1
-1
app/models/blob_viewer/image.rb
app/models/blob_viewer/image.rb
+1
-1
app/models/blob_viewer/markup.rb
app/models/blob_viewer/markup.rb
+1
-1
app/models/blob_viewer/notebook.rb
app/models/blob_viewer/notebook.rb
+1
-1
app/models/blob_viewer/pdf.rb
app/models/blob_viewer/pdf.rb
+2
-2
app/models/blob_viewer/sketch.rb
app/models/blob_viewer/sketch.rb
+1
-1
app/models/blob_viewer/svg.rb
app/models/blob_viewer/svg.rb
+1
-1
app/models/blob_viewer/text.rb
app/models/blob_viewer/text.rb
+1
-1
app/models/blob_viewer/text_stl.rb
app/models/blob_viewer/text_stl.rb
+1
-1
No files found.
app/models/blob_viewer/base.rb
View file @
0b3ff9c8
module
BlobViewer
class
Base
class_attribute
:partial_name
,
:type
,
:extensions
,
:client_side
,
:
text_based
,
:switcher_icon
,
:switcher_title
,
:max_size
,
:absolute_max_size
class_attribute
:partial_name
,
:type
,
:extensions
,
:client_side
,
:
binary
,
:switcher_icon
,
:switcher_title
,
:max_size
,
:absolute_max_size
delegate
:partial_path
,
:rich?
,
:simple?
,
:client_side?
,
:server_side?
,
:text?
,
:binary?
,
to: :class
...
...
@@ -31,12 +31,12 @@ module BlobViewer
!
client_side?
end
def
self
.
text
?
text_based
def
self
.
binary
?
binary
end
def
self
.
binary
?
!
text
?
def
self
.
text
?
!
binary
?
end
def
self
.
can_render?
(
blob
)
...
...
app/models/blob_viewer/binary_stl.rb
View file @
0b3ff9c8
...
...
@@ -5,6 +5,6 @@ module BlobViewer
self
.
partial_name
=
'stl'
self
.
extensions
=
%w(stl)
self
.
text_based
=
fals
e
self
.
binary
=
tru
e
end
end
app/models/blob_viewer/download.rb
View file @
0b3ff9c8
...
...
@@ -7,7 +7,7 @@ module BlobViewer
include
ClientSide
self
.
partial_name
=
'download'
self
.
text_based
=
fals
e
self
.
binary
=
tru
e
def
render_error
nil
...
...
app/models/blob_viewer/empty.rb
View file @
0b3ff9c8
...
...
@@ -4,6 +4,6 @@ module BlobViewer
include
ServerSide
self
.
partial_name
=
'empty'
self
.
text_based
=
fals
e
self
.
binary
=
tru
e
end
end
app/models/blob_viewer/image.rb
View file @
0b3ff9c8
...
...
@@ -5,7 +5,7 @@ module BlobViewer
self
.
partial_name
=
'image'
self
.
extensions
=
UploaderHelper
::
IMAGE_EXT
self
.
text_based
=
fals
e
self
.
binary
=
tru
e
self
.
switcher_icon
=
'picture-o'
self
.
switcher_title
=
'image'
end
...
...
app/models/blob_viewer/markup.rb
View file @
0b3ff9c8
...
...
@@ -5,6 +5,6 @@ module BlobViewer
self
.
partial_name
=
'markup'
self
.
extensions
=
Gitlab
::
MarkupHelper
::
EXTENSIONS
self
.
text_based
=
tru
e
self
.
binary
=
fals
e
end
end
app/models/blob_viewer/notebook.rb
View file @
0b3ff9c8
...
...
@@ -5,7 +5,7 @@ module BlobViewer
self
.
partial_name
=
'notebook'
self
.
extensions
=
%w(ipynb)
self
.
text_based
=
tru
e
self
.
binary
=
fals
e
self
.
switcher_icon
=
'file-text-o'
self
.
switcher_title
=
'notebook'
end
...
...
app/models/blob_viewer/pdf.rb
View file @
0b3ff9c8
...
...
@@ -2,10 +2,10 @@ module BlobViewer
class
PDF
<
Base
include
Rich
include
ClientSide
self
.
partial_name
=
'pdf'
self
.
extensions
=
%w(pdf)
self
.
text_based
=
fals
e
self
.
binary
=
tru
e
self
.
switcher_icon
=
'file-pdf-o'
self
.
switcher_title
=
'PDF'
end
...
...
app/models/blob_viewer/sketch.rb
View file @
0b3ff9c8
...
...
@@ -5,7 +5,7 @@ module BlobViewer
self
.
partial_name
=
'sketch'
self
.
extensions
=
%w(sketch)
self
.
text_based
=
fals
e
self
.
binary
=
tru
e
self
.
switcher_icon
=
'file-image-o'
self
.
switcher_title
=
'preview'
end
...
...
app/models/blob_viewer/svg.rb
View file @
0b3ff9c8
...
...
@@ -5,7 +5,7 @@ module BlobViewer
self
.
partial_name
=
'svg'
self
.
extensions
=
%w(svg)
self
.
text_based
=
tru
e
self
.
binary
=
fals
e
self
.
switcher_icon
=
'picture-o'
self
.
switcher_title
=
'image'
end
...
...
app/models/blob_viewer/text.rb
View file @
0b3ff9c8
...
...
@@ -4,7 +4,7 @@ module BlobViewer
include
ServerSide
self
.
partial_name
=
'text'
self
.
text_based
=
tru
e
self
.
binary
=
fals
e
self
.
max_size
=
1
.
megabyte
self
.
absolute_max_size
=
10
.
megabytes
end
...
...
app/models/blob_viewer/text_stl.rb
View file @
0b3ff9c8
...
...
@@ -5,6 +5,6 @@ module BlobViewer
self
.
partial_name
=
'stl'
self
.
extensions
=
%w(stl)
self
.
text_based
=
tru
e
self
.
binary
=
fals
e
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment