disable cover urls
authorJan Szejko <janek37@gmail.com>
Tue, 21 Mar 2017 13:03:22 +0000 (14:03 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 21 Mar 2017 13:03:22 +0000 (14:03 +0100)
apps/wiki/templates/wiki/tabs/summary_view.html
redakcja/static/js/wiki/view_summary.js
redakcja/static/js/wiki/wikiapi.js
redakcja/urls.py

index 8a57769..c05040d 100644 (file)
@@ -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"
index 099a0e8..151b10b 100644 (file)
@@ -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);
                }
 
 
     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 {
index d901e84..4a4da5a 100644 (file)
@@ -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";
        };
                });
        };
 
-       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();
index 4388105..a381caa 100644 (file)
@@ -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'])),
 )