2012-07-30 02:25:46 +00:00
|
|
|
|
{% extends base_template %}
|
2012-08-26 03:48:43 +00:00
|
|
|
|
{% load seahub_tags avatar_tags%}
|
2012-08-13 07:58:54 +00:00
|
|
|
|
{% load url from future %}
|
2012-07-02 14:45:21 +00:00
|
|
|
|
|
2012-08-13 09:40:27 +00:00
|
|
|
|
{% block main_panel %}
|
2012-08-10 13:16:55 +00:00
|
|
|
|
{% if messages %}
|
2012-08-14 05:27:27 +00:00
|
|
|
|
{% autoescape off %}
|
2012-08-13 09:40:27 +00:00
|
|
|
|
<ul class="messages hide">
|
2012-08-10 13:16:55 +00:00
|
|
|
|
{% for message in messages %}
|
2012-08-13 09:40:27 +00:00
|
|
|
|
<li class="info">{{ message }}</li>
|
2012-08-10 13:16:55 +00:00
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
2012-08-14 05:27:27 +00:00
|
|
|
|
{% endautoescape %}
|
2012-08-10 13:16:55 +00:00
|
|
|
|
{% endif %}
|
|
|
|
|
|
2012-07-13 09:26:33 +00:00
|
|
|
|
<h2>
|
|
|
|
|
{% if not view_history %}
|
|
|
|
|
{{ u_filename }}
|
|
|
|
|
{% else %}
|
|
|
|
|
{{repo.props.name}} 历史浏览<span class="latest-commit-time-author">({{ current_commit.props.ctime|tsstr_sec }})</span>
|
2012-07-03 13:48:33 +00:00
|
|
|
|
{% endif %}
|
2012-07-02 14:45:21 +00:00
|
|
|
|
</h2>
|
2012-07-13 09:26:33 +00:00
|
|
|
|
<div class="w100 ovhd">
|
|
|
|
|
<p class="path fleft">
|
|
|
|
|
当前路径:
|
|
|
|
|
{% for name, link in zipped %}
|
2012-07-02 14:45:21 +00:00
|
|
|
|
{% if not forloop.last %}
|
2012-07-13 09:26:33 +00:00
|
|
|
|
{% if view_history %}
|
|
|
|
|
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?commit_id={{ current_commit.id }}&p={{ link|urlencode }}">{{ name }}</a> / {% else %}
|
|
|
|
|
<a href="{{ SITE_ROOT }}repo/{{ repo.id }}/?p={{ link|urlencode }}">{{ name }}</a> /
|
|
|
|
|
{% endif %}
|
2012-07-02 14:45:21 +00:00
|
|
|
|
{% else %}
|
2012-07-13 09:26:33 +00:00
|
|
|
|
{{ name }}
|
2012-07-02 14:45:21 +00:00
|
|
|
|
{% endif %}
|
2012-07-13 09:26:33 +00:00
|
|
|
|
{% endfor %}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div class="file-op fright">
|
|
|
|
|
{% if not view_history %}
|
2012-09-07 11:50:29 +00:00
|
|
|
|
<input id="shared-link" class="hide" type="text" readonly="readonly" value="{{ file_shared_link }}" />
|
2012-07-13 09:26:33 +00:00
|
|
|
|
<button data="{{ SITE_ROOT }}sharedlink/get/?repo_id={{ repo.id }}&p={{ path|urlencode }}&file_name={{ file_name }}" id="get-shared-link">获取分享地址</button>
|
|
|
|
|
<button id="send-shared-link" class="hide">发送</button>
|
|
|
|
|
<button data="{{ SITE_ROOT }}sharedlink/remove/?t={{ fileshare.token }}" id="rm-shared-link" class="hide">删除</button>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2012-08-10 13:35:58 +00:00
|
|
|
|
|
|
|
|
|
<div id="file">
|
2012-08-15 02:44:15 +00:00
|
|
|
|
<div id="file-op">
|
2012-08-12 03:22:42 +00:00
|
|
|
|
<button id="open-local" data="{{path}}{{dirent.obj_name}}">打开本地文件</button>
|
2012-08-15 02:44:15 +00:00
|
|
|
|
{% if filetype == 'Text' or filetype == 'Image' or filetype == 'SVG' or filetype == 'Markdown' %}
|
2012-08-11 03:20:26 +00:00
|
|
|
|
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=view" id="view-original">原始文件</button>
|
2012-08-15 02:44:15 +00:00
|
|
|
|
{% endif %}
|
2012-08-10 13:35:58 +00:00
|
|
|
|
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/{{ obj_id }}/?file_name={{ file_name }}&op=download" id="download">下载</button>
|
|
|
|
|
{% if not view_history and request.user.is_authenticated %}
|
2012-08-11 05:39:16 +00:00
|
|
|
|
<button data="{{ SITE_ROOT }}repo/file_revisions/{{ repo.id }}/?p={{ path }}" id="history">历史</button>
|
2012-08-10 13:35:58 +00:00
|
|
|
|
{% if filetype == 'Text' or filetype == 'Markdown' %}
|
|
|
|
|
<button data="{{ SITE_ROOT }}repo/{{ repo.id }}/file/edit/?p={{ path }}" id="edit">编辑</button>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
<div id="file-view">
|
|
|
|
|
<p>文件内容读取中...</p>
|
|
|
|
|
</div>
|
2012-07-02 14:45:21 +00:00
|
|
|
|
</div>
|
2012-07-11 14:39:36 +00:00
|
|
|
|
|
2012-08-08 09:14:04 +00:00
|
|
|
|
{% if not view_history %}
|
2012-07-11 14:39:36 +00:00
|
|
|
|
<form id="link-send-form" action="" method="post" name="link-send-form" class="hide">
|
2012-07-13 09:26:33 +00:00
|
|
|
|
<label>邮箱(多个邮箱以,分隔):</label><br />
|
|
|
|
|
<textarea id="email" name="email"></textarea><br />
|
|
|
|
|
<input type="hidden" name="file_shared_link" value="{{ file_shared_link }}" />
|
|
|
|
|
<p id="error" class="hide">输入不能为空。</p>
|
|
|
|
|
<input type="submit" value="提交" class="submit" />
|
|
|
|
|
<p id="sending" class="hide">发送中...</p>
|
|
|
|
|
<p id="success" class="hide"></p>
|
2012-07-11 14:39:36 +00:00
|
|
|
|
</form>
|
2012-08-13 07:58:54 +00:00
|
|
|
|
|
|
|
|
|
{% with attach_type='file' %}
|
|
|
|
|
{% include "snippets/group_recommend_form.html" %}
|
|
|
|
|
{% endwith %}
|
2012-08-08 09:14:04 +00:00
|
|
|
|
{% endif %}
|
2012-08-12 03:22:42 +00:00
|
|
|
|
|
|
|
|
|
<div id="open-local-file-error-dlg" class="hide">
|
2012-09-05 03:40:19 +00:00
|
|
|
|
<p id="open-local-file-error" class=""></p>
|
2012-08-12 03:22:42 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
2012-08-18 09:27:48 +00:00
|
|
|
|
<div id="redirect-download" class="hide">
|
2012-08-21 09:48:49 +00:00
|
|
|
|
<p class="error">您还没有将同步目录 {{repo.name}} 同步到本地</p>
|
|
|
|
|
<button data="{{ SITE_ROOT }}download/repo/?repo_id={{ repo.id }}" id="download-repo">点此同步</button>
|
2012-08-18 09:27:48 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
2012-08-26 03:48:43 +00:00
|
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
|
<div id="file-comment">
|
2012-08-27 03:06:32 +00:00
|
|
|
|
<h3>评论</h3>
|
2012-08-26 03:48:43 +00:00
|
|
|
|
<form id="file-comment-form" action="" method="post">
|
|
|
|
|
<input name="repo_id" type="hidden" value="{{ repo.id }}"/>
|
|
|
|
|
<input name="file_path" type="hidden" value="{{ path|urlencode }}" />
|
|
|
|
|
<textarea name="message" id="message">{{ form.data.message }}</textarea><br />
|
|
|
|
|
{% for error in form.message.errors %}
|
|
|
|
|
<p class="error">{{ error|escape }}</p>
|
|
|
|
|
{% endfor %}
|
2012-08-27 03:06:32 +00:00
|
|
|
|
<input type="submit" value="提交" class="submit" />
|
2012-08-26 03:48:43 +00:00
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if comments %}
|
|
|
|
|
<!-- file comments list -->
|
|
|
|
|
<ul class="msg-list">
|
|
|
|
|
{% for comment in comments %}
|
|
|
|
|
<li class="msg w100 ovhd">
|
|
|
|
|
<div class="pic fleft">
|
|
|
|
|
<a href="{% url 'user_profile' comment.from_email %}">{% avatar comment.from_email 48 %}</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="filecomment-{{comment.id}}" class="txt fright">
|
|
|
|
|
<div class="msg-hd">
|
|
|
|
|
<span class="time">{{ comment.timestamp|translate_commit_time }}</span>
|
|
|
|
|
<a href="{% url 'user_profile' comment.from_email %}" title="{{ comment.from_email }}">{{ comment.from_email|email2nickname }}</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="msg-bd">
|
|
|
|
|
<p>
|
|
|
|
|
{{ comment.message|seahub_urlize|find_at|linebreaksbr }}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% endif %}
|
|
|
|
|
<div id="paginator">
|
|
|
|
|
{% if current_page != 1 %}
|
|
|
|
|
<a href="{% url 'repo_view_file' repo.id %}?p={{ path|urlencode }}&page={{ prev_page }}&per_page={{ per_page }}">上一页</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% if page_next %}
|
|
|
|
|
<a href="{% url 'repo_view_file' repo.id %}?p={{ path|urlencode }}&page={{ next_page }}&per_page={{ per_page }}">下一页</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
|
2012-07-02 14:45:21 +00:00
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block extra_script %}
|
2012-07-31 08:48:55 +00:00
|
|
|
|
{% include "snippets/file_view_js.html" %}
|
2012-07-02 14:45:21 +00:00
|
|
|
|
<script type="text/javascript">
|
2012-08-08 09:14:04 +00:00
|
|
|
|
{% include "snippets/repo_file_get.html" %}
|
2012-08-10 13:35:58 +00:00
|
|
|
|
$('#view-original, #download').click(function() {
|
|
|
|
|
window.open($(this).attr('data'));
|
|
|
|
|
});
|
2012-08-08 09:14:04 +00:00
|
|
|
|
{% if not view_history %}
|
2012-08-11 05:39:16 +00:00
|
|
|
|
$('#edit, #history').click(function() {
|
2012-08-10 13:35:58 +00:00
|
|
|
|
location.href = $(this).attr('data');
|
|
|
|
|
});
|
2012-07-11 14:39:36 +00:00
|
|
|
|
function showLink() {
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#get-shared-link').addClass('hide');
|
|
|
|
|
$('#shared-link, #send-shared-link, #rm-shared-link').removeClass('hide');
|
2012-07-11 14:39:36 +00:00
|
|
|
|
}
|
|
|
|
|
function hideLink() {
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#shared-link, #send-shared-link, #rm-shared-link').addClass('hide');
|
|
|
|
|
$('#get-shared-link').removeClass('hide');
|
2012-07-11 14:39:36 +00:00
|
|
|
|
}
|
2012-09-07 11:50:29 +00:00
|
|
|
|
function setLinkWidth() {
|
|
|
|
|
var link = $('#shared-link');
|
|
|
|
|
link.before('<p class="hide">' + link.val() + '</p>');
|
|
|
|
|
link.css('width', link.prev().width() + 2);
|
|
|
|
|
link.prev().remove();
|
|
|
|
|
}
|
|
|
|
|
if ($.trim($('#shared-link').val())) {
|
|
|
|
|
setLinkWidth();
|
|
|
|
|
}
|
2012-07-11 14:39:36 +00:00
|
|
|
|
|
2012-08-06 12:29:14 +00:00
|
|
|
|
{% if fileshare.token %}
|
|
|
|
|
showLink();
|
|
|
|
|
{% else %}
|
|
|
|
|
hideLink();
|
|
|
|
|
{% endif %}
|
2012-07-11 14:39:36 +00:00
|
|
|
|
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#get-shared-link').click(function() {
|
2012-07-11 14:39:36 +00:00
|
|
|
|
var url = $(this).attr('data');
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
cache: false,
|
|
|
|
|
contentType: 'application/json; charset=utf-8',
|
|
|
|
|
success: function(data) {
|
|
|
|
|
if (data.length > 0) {
|
2012-07-13 09:26:33 +00:00
|
|
|
|
var t = data[0]['token'],
|
|
|
|
|
shared_link = '{{ protocol }}://{{ domain }}{{ SITE_ROOT }}f/' + t + '/';
|
2012-09-07 11:50:29 +00:00
|
|
|
|
$('#shared-link').val(shared_link);
|
|
|
|
|
setLinkWidth();
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#rm-shared-link').attr('data', '{{ SITE_ROOT }}sharedlink/remove/?t='+t);
|
|
|
|
|
$('input[name="file_shared_link"]').val(shared_link);
|
2012-07-11 14:39:36 +00:00
|
|
|
|
showLink();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function(xhr, ajaxOptions, thrownError) {
|
|
|
|
|
var jsonVal = jQuery.parseJSON(xhr.responseText);
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#get-shared-link').replaceWith('<span class="error">' + jsonVal[0]['error'] + '</span>');
|
2012-07-11 14:39:36 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#rm-shared-link').click(function() {
|
2012-07-11 14:39:36 +00:00
|
|
|
|
var url = $(this).attr('data');
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
cache: false,
|
|
|
|
|
contentType: 'application/json; charset=utf-8',
|
|
|
|
|
success: function(data) {
|
|
|
|
|
hideLink();
|
2012-09-07 11:50:29 +00:00
|
|
|
|
$('#shared-link').val('');
|
2012-07-11 14:39:36 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#send-shared-link').click(function() {
|
2012-07-11 14:39:36 +00:00
|
|
|
|
$("#link-send-form").modal({appendTo: "#main"});
|
2012-08-03 06:00:43 +00:00
|
|
|
|
|
|
|
|
|
// link-send-form email autocomplete
|
|
|
|
|
var share_list = [];
|
|
|
|
|
{% for contact in contacts %}
|
|
|
|
|
share_list.push('{{ contact.contact_email }}');
|
|
|
|
|
{% endfor %}
|
|
|
|
|
addAutocomplete('#email', '#link-send-form', share_list);
|
2012-07-11 14:39:36 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#link-send-form").submit(function(event) {
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#error, #sending, #success').attr('class', 'hide');
|
2012-07-11 14:39:36 +00:00
|
|
|
|
var form = $(this),
|
|
|
|
|
file_shared_link = form.children('input[name="file_shared_link"]').val(),
|
2012-07-13 09:26:33 +00:00
|
|
|
|
email = $.trim(form.children('textarea[name="email"]').val());
|
|
|
|
|
|
|
|
|
|
if (!email) {
|
|
|
|
|
$('#error').attr('class', 'error');
|
|
|
|
|
$('#simplemodal-container').css('height', $('#link-send-form').height());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#sending').removeClass('hide');
|
|
|
|
|
$('#simplemodal-container').css('height', $('#link-send-form').height());
|
|
|
|
|
|
|
|
|
|
if (email.length <= 512) {
|
2012-07-11 14:39:36 +00:00
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "{{ SITE_ROOT }}sharedlink/send/",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
cache: false,
|
|
|
|
|
contentType: 'application/json; charset=utf-8',
|
2012-07-17 09:54:05 +00:00
|
|
|
|
beforeSend: prepareCSRFToken,
|
2012-07-12 08:14:21 +00:00
|
|
|
|
data: {file_shared_link: file_shared_link, email: email},
|
2012-07-11 14:39:36 +00:00
|
|
|
|
success: function(data) {
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#sending').attr('class', 'hide');
|
|
|
|
|
$('#success').html(data[0]['msg']).removeClass('hide');
|
2012-07-11 14:39:36 +00:00
|
|
|
|
$('#simplemodal-container').css('height', $('#link-send-form').height());
|
|
|
|
|
},
|
|
|
|
|
error: function(xhr, ajaxOptions, thrownError) {
|
|
|
|
|
var jsonVal = jQuery.parseJSON(xhr.responseText);
|
2012-07-13 09:26:33 +00:00
|
|
|
|
$('#sending').attr('class', 'hide');
|
|
|
|
|
$('#error').html(jsonVal[0]['error']).attr('class','error');
|
2012-07-11 14:39:36 +00:00
|
|
|
|
$('#simplemodal-container').css('height', $('#link-send-form').height());
|
|
|
|
|
}
|
|
|
|
|
});
|
2012-07-13 09:26:33 +00:00
|
|
|
|
}
|
2012-07-11 14:39:36 +00:00
|
|
|
|
return false;
|
|
|
|
|
});
|
2012-08-08 09:14:04 +00:00
|
|
|
|
|
2012-09-07 11:50:29 +00:00
|
|
|
|
$('#shared-link').click(function() {
|
|
|
|
|
$(this).select();
|
|
|
|
|
});
|
|
|
|
|
|
2012-08-08 09:14:04 +00:00
|
|
|
|
{% include "snippets/bottom_bar.html" %}
|
|
|
|
|
{% endif %}
|
2012-08-12 03:22:42 +00:00
|
|
|
|
|
|
|
|
|
function send_open_local_file_request(path) {
|
|
|
|
|
var callback = 'xx';
|
2012-09-05 03:40:19 +00:00
|
|
|
|
url = '{{ applet_root }}/open-local-file/?repo_id={{ repo.id }}&commit_id={{current_commit.id}}';
|
2012-08-12 03:22:42 +00:00
|
|
|
|
url += '&path=' + encodeURIComponent(path);
|
|
|
|
|
url += '&callback=' + callback;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
dataType: 'jsonp',
|
|
|
|
|
jsonpCallback: callback,
|
|
|
|
|
crossDomain: true,
|
|
|
|
|
success: function(data) {
|
|
|
|
|
if (data['exists'] === false) {
|
|
|
|
|
// repo doesn't exist on local machine
|
|
|
|
|
$('#redirect-download').modal({appendTo:'#main'});
|
|
|
|
|
|
|
|
|
|
} else if (data['no_assoc'] === true) {
|
|
|
|
|
// no application to open the file
|
2012-09-05 03:40:19 +00:00
|
|
|
|
$('#open-local-file-error').removeClass();
|
|
|
|
|
$('#open-local-file-error').addClass('notification');
|
2012-08-12 03:22:42 +00:00
|
|
|
|
$('#open-local-file-error').html('找不到打开该类型文件的程序。\nSeafile 将为你打开该文件所在目录');
|
|
|
|
|
$('#open-local-file-error-dlg').modal({appendTo:'#main'});
|
|
|
|
|
|
2012-09-05 03:40:19 +00:00
|
|
|
|
} else if (data['outdated'] === true) {
|
|
|
|
|
// local repo not in sync yet
|
|
|
|
|
$('#open-local-file-error').removeClass();
|
|
|
|
|
$('#open-local-file-error').addClass('notification');
|
|
|
|
|
|
|
|
|
|
if (data['auto-sync'] === false) {
|
|
|
|
|
hint = '本地文件尚未与服务器同步。\n请打开本地目录的自动同步,或者手动进行同步';
|
|
|
|
|
} else {
|
|
|
|
|
hint = '本地文件尚未与服务器同步,请稍后再试';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#open-local-file-error').html(hint);
|
|
|
|
|
$('#open-local-file-error-dlg').modal({appendTo:'#main'});
|
|
|
|
|
|
2012-08-12 03:22:42 +00:00
|
|
|
|
} else if (data['error']) {
|
|
|
|
|
// other error
|
2012-09-05 03:40:19 +00:00
|
|
|
|
$('#open-local-file-error').removeClass();
|
|
|
|
|
$('#open-local-file-error').addClass('error');
|
2012-08-12 03:22:42 +00:00
|
|
|
|
$('#open-local-file-error').html('打开本地文件时出错');
|
|
|
|
|
$('#open-local-file-error-dlg').modal({appendTo:'#main'});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// open file successfully, nothing to do
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2012-08-21 09:48:49 +00:00
|
|
|
|
$('#download-repo').click(function() {
|
|
|
|
|
location.href = $(this).attr('data');
|
|
|
|
|
});
|
2012-08-12 03:22:42 +00:00
|
|
|
|
|
|
|
|
|
// When user clicks 'open local file':
|
|
|
|
|
//
|
|
|
|
|
// - First, check client version to determine is this operation supported by client
|
|
|
|
|
// - second check whether repo exists on local machine, then:
|
|
|
|
|
// - if exists, send an open local file requst
|
|
|
|
|
// - if not exits, redirect to repo download page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#open-local').click(function () {
|
|
|
|
|
var path = $(this).attr('data');
|
|
|
|
|
var local_applet_running = false;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
2012-08-16 09:37:18 +00:00
|
|
|
|
url: '{{ applet_root }}/seafile_rpc_version/',
|
2012-08-12 03:22:42 +00:00
|
|
|
|
dataType: 'jsonp',
|
|
|
|
|
jsonpCallback: 'xx',
|
|
|
|
|
crossDomain: true,
|
|
|
|
|
success: function(version) {
|
|
|
|
|
local_applet_running = true;
|
2012-08-16 09:37:18 +00:00
|
|
|
|
if (version < 1) {
|
2012-08-12 03:22:42 +00:00
|
|
|
|
update_url = '<a href="http://www.seafile.com/download/">升级</a>';
|
|
|
|
|
$('#open-local-file-error').html('您的 Seafile 客户端版本太低,请' + update_url + '到最新版本');
|
|
|
|
|
$('#open-local-file-error-dlg').modal({appendTo:'#main'});
|
|
|
|
|
} else {
|
|
|
|
|
send_open_local_file_request(path);
|
|
|
|
|
}
|
2012-08-23 02:52:53 +00:00
|
|
|
|
}
|
2012-08-12 03:22:42 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// if jsonp response doesn't arrive in 2 seconds, we can say local client
|
|
|
|
|
// is not running yet.
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
if (!local_applet_running) {
|
2012-08-16 09:37:18 +00:00
|
|
|
|
$('#open-local-file-error').html('Seafile 客户端程序未启动或者版本过低');
|
2012-08-12 03:22:42 +00:00
|
|
|
|
$('#open-local-file-error-dlg').modal({appendTo:'#main'});
|
|
|
|
|
}
|
|
|
|
|
}, 2000);
|
|
|
|
|
});
|
2012-07-02 14:45:21 +00:00
|
|
|
|
</script>
|
|
|
|
|
{% endblock %}
|