From 0f68e6fc21bd981cf57b263e94d92b712fc84e63 Mon Sep 17 00:00:00 2001 From: Jan Szejko <janek37@gmail.com> Date: Tue, 21 Mar 2017 14:03:22 +0100 Subject: [PATCH] disable cover urls --- .../templates/wiki/tabs/summary_view.html | 10 --------- redakcja/static/js/wiki/view_summary.js | 15 ------------- redakcja/static/js/wiki/wikiapi.js | 22 ------------------- redakcja/urls.py | 1 - 4 files changed, 48 deletions(-) diff --git a/apps/wiki/templates/wiki/tabs/summary_view.html b/apps/wiki/templates/wiki/tabs/summary_view.html index 8a57769e..c05040da 100644 --- a/apps/wiki/templates/wiki/tabs/summary_view.html +++ b/apps/wiki/templates/wiki/tabs/summary_view.html @@ -3,16 +3,6 @@ <!-- <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" diff --git a/redakcja/static/js/wiki/view_summary.js b/redakcja/static/js/wiki/view_summary.js index 099a0e81..151b10b9 100644 --- a/redakcja/static/js/wiki/view_summary.js +++ b/redakcja/static/js/wiki/view_summary.js @@ -6,11 +6,6 @@ options.callback = function() { var self = this; - // first time page is rendered - $('#summary-cover-refresh').click(function() { - self.refreshCover(); - }); - old_callback.call(this); } @@ -19,16 +14,6 @@ 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 { diff --git a/redakcja/static/js/wiki/wikiapi.js b/redakcja/static/js/wiki/wikiapi.js index d901e847..4a4da5a7 100644 --- a/redakcja/static/js/wiki/wikiapi.js +++ b/redakcja/static/js/wiki/wikiapi.js @@ -50,9 +50,6 @@ 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"; }; @@ -386,25 +383,6 @@ }); }; - 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(); diff --git a/redakcja/urls.py b/redakcja/urls.py index 43881059..a381caa6 100644 --- a/redakcja/urls.py +++ b/redakcja/urls.py @@ -28,7 +28,6 @@ urlpatterns = patterns( 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'])), ) -- 2.20.1