forked from e621ng/e621ng
[Notes] Remove note previews, replace with dtext previews
This commit is contained in:
parent
0a35264ad8
commit
0f8ec1de53
@ -1,14 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class NotePreviewsController < ApplicationController
|
||||
respond_to :json
|
||||
|
||||
def show
|
||||
@body = helpers.format_text(params[:body].to_s)
|
||||
respond_with(@body) do |format|
|
||||
format.json do
|
||||
render :json => {:body => @body}.to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -434,10 +434,11 @@ let Note = {
|
||||
var text = $textarea.val();
|
||||
$note_body.data("original-body", text);
|
||||
Note.Body.set_text($note_body, $note_box, "Loading...");
|
||||
$.get("/note_previews.json", {body: text}).then(function(data) {
|
||||
Note.Body.set_text($note_body, $note_box, data.body);
|
||||
$.post("/dtext_preview.json", {body: text}).then(function(data) {
|
||||
Note.Body.set_text($note_body, $note_box, data.html);
|
||||
Note.Box.resize_inner_border($note_box);
|
||||
$note_body.show();
|
||||
$(window).trigger("e621:add_deferred_posts", data.posts);
|
||||
});
|
||||
$this.dialog("close");
|
||||
|
||||
@ -467,9 +468,10 @@ let Note = {
|
||||
var $note_box = Note.Box.find(id);
|
||||
$note_box.find(".note-box-inner-border").addClass("unsaved");
|
||||
Note.Body.set_text($note_body, $note_box, "Loading...");
|
||||
$.get("/note_previews.json", {body: text}).then(function(data) {
|
||||
Note.Body.set_text($note_body, $note_box, data.body);
|
||||
$.post("/dtext_preview.json", {body: text}).then(function(data) {
|
||||
Note.Body.set_text($note_body, $note_box, data.html);
|
||||
$note_body.show();
|
||||
$(window).trigger("e621:add_deferred_posts", data.posts);
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -189,7 +189,6 @@ Rails.application.routes.draw do
|
||||
end
|
||||
end
|
||||
resources :note_versions, :only => [:index]
|
||||
resource :note_previews, :only => [:show]
|
||||
resources :pools do
|
||||
member do
|
||||
put :revert
|
||||
|
@ -1,14 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class NotePreviewsControllerTest < ActionDispatch::IntegrationTest
|
||||
context "The note previews controller" do
|
||||
context "show action" do
|
||||
should "work" do
|
||||
get note_previews_path, params: { body: "<b>test</b>", format: "json" }
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user