<!-- <div class="toolbar">
</div> -->
<div id="summary-view">
- <div class="summary-cover-area">
- <p><img id="summary-cover" class="book-cover"
- {% if revision %}
- src="{% url 'cover_preview' chunk.book.slug chunk.slug revision %}"
- {% else %}
- src="{% url 'cover_preview' chunk.book.slug chunk.slug %}"
- {% endif %}></p>
- <p><button id="summary-cover-refresh">{% trans "Refresh from working copy" %}</button></p>
- </div>
-
<h2>
<label for="title">{% trans "Title" %}:</label>
<span data-ui-editable="true" data-edit-target="meta.displayTitle"
options.callback = function() {
var self = this;
- // first time page is rendered
- $('#summary-cover-refresh').click(function() {
- self.refreshCover();
- });
-
old_callback.call(this);
}
SummaryPerspective.prototype = new $.wiki.Perspective();
- SummaryPerspective.prototype.refreshCover = function() {
- $('#summary-cover-refresh').attr('disabled', 'disabled');
- this.doc.refreshCover({
- success: function(text) {
- $('#summary-cover').attr('src', text);
- $('#summary-cover-refresh').removeAttr('disabled');
- }
- });
- };
-
SummaryPerspective.prototype.showCharCount = function() {
var cc;
try {
if (vname == "ajax_document_pubmark")
return base_path + "/pubmark/" + arguments[1] + '/';
- if (vname == "ajax_cover_preview")
- return "/cover/preview/";
-
console.log("Couldn't reverse match:", vname);
return "/404.html";
};
});
};
- WikiDocument.prototype.refreshCover = function(params) {
- var self = this;
- var data = {
- xml: self.text // TODO: send just DC
- };
- $.ajax({
- url: reverse("ajax_cover_preview"),
- type: "POST",
- data: data,
- success: function(data) {
- params.success(data);
- },
- error: function(xhr) {
- // params.failure("Nie udało się odświeżyć okładki - błąd serwera.");
- }
- });
- };
-
-
WikiDocument.prototype.getLength = function(params) {
var xml = this.text.replace(/\/(\s+)/g, '<br />$1');
var parser = new DOMParser();
url(r'^documents/', include('catalogue.urls')),
url(r'^apiclient/', include('apiclient.urls')),
url(r'^editor/', include('wiki.urls')),
- url(r'^cover/', include('cover.urls')),
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', dict(packages=['wiki'])),
)