overleaf/services/web/app/views/project/editor/binary-file.pug

45 lines
1.5 KiB
Text
Raw Normal View History

2014-07-03 12:05:50 -04:00
div.binary-file.full-size(
ng-controller="BinaryFileController"
ng-show="ui.view == 'file'"
ng-if="openFile"
)
img(
ng-show="!failedLoad"
2014-07-03 12:05:50 -04:00
ng-src="/project/{{ project_id }}/file/{{ openFile.id }}"
ng-if="['png', 'jpg', 'jpeg', 'gif'].indexOf(extension(openFile)) > -1"
ng-class="{'img-preview': !imgLoaded}"
onerror="sl_binaryFilePreviewError()"
onabort="sl_binaryFilePreviewError()"
onload="sl_binaryFilePreviewLoaded()"
2014-07-03 12:05:50 -04:00
)
2016-05-17 12:00:14 -04:00
2014-07-03 12:05:50 -04:00
img(
ng-show="!failedLoad"
2014-07-03 12:05:50 -04:00
ng-src="/project/{{ project_id }}/file/{{ openFile.id }}?format=png"
ng-if="['pdf', 'eps'].indexOf(extension(openFile)) > -1"
ng-class="{'img-preview': !imgLoaded}"
onerror="sl_binaryFilePreviewError()"
onabort="sl_binaryFilePreviewError()"
onload="sl_binaryFilePreviewLoaded()"
2014-07-03 12:05:50 -04:00
)
2016-05-17 12:00:14 -04:00
2016-05-19 06:11:23 -04:00
div(ng-if="(['bib'].indexOf(extension(openFile)) > -1) && !bibtexPreview.error")
div.bib-loading(ng-show="bibtexPreview.loading && !bibtexPreview.error")
2016-05-17 12:00:14 -04:00
| #{translate('loading')}...
2016-05-19 06:11:23 -04:00
div.bib-preview(ng-show="bibtexPreview.data && !bibtexPreview.loading && !bibtexPreview.error")
2016-05-17 12:00:14 -04:00
div.scroll-container
p
| {{ bibtexPreview.data }}
p(ng-show="bibtexPreview.shouldShowDots")
2016-05-17 12:00:14 -04:00
| ...
2014-07-03 12:05:50 -04:00
p.no-preview(
2016-05-19 06:11:23 -04:00
ng-if="failedLoad || bibtexPreview.error || ['bib', 'png', 'jpg', 'jpeg', 'gif', 'pdf', 'eps'].indexOf(extension(openFile)) == -1"
2014-07-31 12:07:43 -04:00
) #{translate("no_preview_available")}
2016-05-17 12:00:14 -04:00
2014-07-03 12:05:50 -04:00
a.btn.btn-info(
ng-href="/project/{{ project_id }}/file/{{ openFile.id }}"
2014-07-31 12:07:43 -04:00
) #{translate("download")} {{ openFile.name }}