{% load i18n %} {% if not err %} {% if filetype == 'Text' %} {% ifnotequal file_content None %} var editor = CodeMirror.fromTextArea($('#docu-view')[0], { {% include 'snippets/editor_set_mode.html' %} theme: 'default', indentUnit: 4, {% if fileext != 'txt' and fileext != 'text' %} lineNumbers: true, {% endif %} lineWrapping: true, readOnly: true }); {% endifnotequal %} {% endif %} {% if filetype == 'Image' %} var img_ht = {{file_content.img_h}}; var file_view_ht = parseInt($('#file-view').css('min-height')); var prev_next_ht = 0; if ($('#img-prev-next').length > 0) { prev_next_ht = $('#img-prev-next').outerHeight(true); } if (img_ht < file_view_ht - prev_next_ht) { $('#image-view').css({'margin-top':(file_view_ht - img_ht - prev_next_ht)/2}); } if ({{file_content.img_w}} > 946) { // for ie 6 $('#image-view').css('width', 946); } $('#image-view').removeClass('vh'); {% endif %} {% if filetype == 'SVG' %} if (!$.browser.mozilla && !$.browser.safari && !($.browser.msie && parseInt($.browser.version) > 8)) { $('#file-view').html('
{% trans "To view it online, you can use firefox, chrome or IE 9." %}
' + str + '
{% trans "You can use IE 10 or other browsers, for example, firefox, to view it online." %}
{% trans "This type of file cannot be viewed online." %}