mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:23:10 +00:00
Show apology message instead of raw binary files
This commit is contained in:
parent
8b9f3268b1
commit
692182c784
3 changed files with 18 additions and 3 deletions
|
@ -165,7 +165,7 @@ div#history(ng-show="ui.view == 'history'")
|
|||
|
||||
.diff-panel.full-size(ng-controller="HistoryDiffController")
|
||||
.diff(
|
||||
ng-show="!!history.diff && !history.diff.loading && !history.diff.deleted && !history.diff.error"
|
||||
ng-if="!!history.diff && !history.diff.loading && !history.diff.deleted && !history.diff.error && !history.diff.binary"
|
||||
)
|
||||
.toolbar.toolbar-alt
|
||||
span.name
|
||||
|
@ -197,6 +197,13 @@ div#history(ng-show="ui.view == 'history'")
|
|||
resize-on="layout:main:resize",
|
||||
navigate-highlights="true"
|
||||
)
|
||||
|
||||
.diff.diff-binary(ng-show="history.diff.binary")
|
||||
.toolbar.toolbar-alt
|
||||
span.name
|
||||
strong {{history.diff.pathname}}
|
||||
.alert.alert-info We're still working on showing image and binary changes, sorry. Stay tuned!
|
||||
|
||||
.diff-deleted.text-centered(
|
||||
ng-show="history.diff.deleted && !history.diff.restoreDeletedSuccess"
|
||||
)
|
||||
|
|
|
@ -111,7 +111,8 @@ define [
|
|||
.then (response) =>
|
||||
{ data } = response
|
||||
diff.loading = false
|
||||
{text, highlights} = @_parseDiff(data)
|
||||
{text, highlights, binary} = @_parseDiff(data.diff)
|
||||
diff.binary = binary
|
||||
diff.text = text
|
||||
diff.highlights = highlights
|
||||
.catch () ->
|
||||
|
@ -119,11 +120,13 @@ define [
|
|||
diff.error = true
|
||||
|
||||
_parseDiff: (diff) ->
|
||||
if diff.binary
|
||||
return { binary: true }
|
||||
row = 0
|
||||
column = 0
|
||||
highlights = []
|
||||
text = ""
|
||||
for entry, i in diff.diff or []
|
||||
for entry, i in diff or []
|
||||
content = entry.u or entry.i or entry.d
|
||||
content ||= ""
|
||||
text += content
|
||||
|
|
|
@ -73,6 +73,11 @@
|
|||
padding: @line-height-computed / 2;
|
||||
margin-right: @line-height-computed / 4;
|
||||
}
|
||||
&-binary {
|
||||
.alert {
|
||||
margin: @line-height-computed / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aside.change-list {
|
||||
|
|
Loading…
Reference in a new issue