77 lines
2.3 KiB
HTML
77 lines
2.3 KiB
HTML
{% extends "gadjo/base.html" %}
|
|
{% load static i18n %}
|
|
|
|
{% block css %}
|
|
<link rel="stylesheet" type="text/css" media="all" href="{% static "css/combo.manager.css" %}"/>
|
|
{% endblock %}
|
|
|
|
{% block extrascripts %}
|
|
<script src="{% static "js/combo.manager.js" %}"></script>
|
|
{% endblock %}
|
|
|
|
{% block user-links %}{% endblock %}
|
|
{% block sidepage %}{% endblock %}
|
|
{% block site-header %}{% endblock %}
|
|
{% block bodyargs %}class="no-header"{% endblock %}
|
|
{% block footer %}{% endblock %}
|
|
|
|
{% block appbar %}
|
|
<h2>{% trans "Browse for the file you want, then click 'Embed File' to continue..." %}</h2>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
{% if not object_list and not query %}
|
|
<div class="big-msg-info">
|
|
{% trans "No files found. Upload files using the 'Image Button' or 'Link Button' dialog's 'Upload' tab." %}
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<form>
|
|
{% for k, v in request.GET.items %}
|
|
{% if k != 'q' %}<input type="hidden" name="{{ k }}" value="{{ v }}" />{% endif %}
|
|
{% endfor %}
|
|
<p><input name="q" type="search" value="{{query}}"> <button>{% trans 'Search' %}</button>
|
|
<span class="help_text">{% trans "(case insensitive search over filenames)" %}</span>
|
|
</p>
|
|
</form>
|
|
|
|
<div id="assets-browser" class="assets-ckeditor">
|
|
<div id="assets-listing">
|
|
{% with asset_for_ckeditor=True %}
|
|
{% include "combo/manager_assets_fragment.html" %}
|
|
{% endwith %}
|
|
</div>
|
|
<div id="asset-preview"></div>
|
|
</div>
|
|
|
|
{% include "gadjo/pagination.html" %}
|
|
|
|
<div class="buttons">
|
|
<input href="" id="asset-ckeditor-embed" type="submit" name="_embed" value="{% trans "Embed File" %}" disabled />
|
|
</div>
|
|
|
|
{% endif %}
|
|
<script type="text/javascript">
|
|
// helper functions
|
|
function getUrlParam(paramName) {
|
|
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i') ;
|
|
var match = window.location.search.match(reParam) ;
|
|
|
|
return (match && match.length > 1) ? match[1] : '' ;
|
|
}
|
|
|
|
// embedder
|
|
$(document).on('click', '#asset-ckeditor-embed', function() {
|
|
var funcNum = getUrlParam('CKEditorFuncNum');
|
|
var fileUrl = $(this).attr('href');
|
|
console.log(funcNum)
|
|
console.log(fileUrl)
|
|
window.opener.CKEDITOR.tools.callFunction(funcNum, fileUrl);
|
|
window.close();
|
|
});
|
|
console.log(window.opener.CKEDITOR)
|
|
</script>
|
|
{% endblock %}
|