bring back copy and paste of artifacts

This commit is contained in:
mntmn 2020-04-09 17:33:23 +02:00
parent 643b75ebe9
commit 9750f08606

View File

@ -2286,9 +2286,6 @@ var SpacedeckSections = {
}, },
handle_section_paste: function(evt) { handle_section_paste: function(evt) {
// TODO: very confusing
return;
if (this.editing_artifact_id) return; if (this.editing_artifact_id) return;
var pastedText = null; var pastedText = null;
@ -2299,11 +2296,6 @@ var SpacedeckSections = {
if (!pastedText) return; if (!pastedText) return;
if (!pastedText.match(/<[a-zA-Z]+>/g)) {
// crappy heuristic if this is actually HTML
pastedText = pastedText.replace(/\n/g,"<br>");
}
this.insert_embedded_artifact(pastedText); this.insert_embedded_artifact(pastedText);
}, },
@ -2350,32 +2342,6 @@ var SpacedeckSections = {
this.create_artifact_via_embed_url(text); this.create_artifact_via_embed_url(text);
return; return;
} }
var new_item = {
mime: "text/html",
description: text.replace("\n", "<br />"),
title: "",
space_id: space._id
};
var w = 400;
var h = 300;
var point = this.find_place_for_item(w,h);
new_item.x = point.x;
new_item.y = point.y;
new_item.w = w;
new_item.h = h;
new_item.z = point.z;
if (this.guest_nickname) {
new_item.editor_name = this.guest_nickname;
}
save_artifact(new_item, function(saved_item) {
this.update_board_artifact_viewmodel(saved_item);
this.active_space_artifacts.push(saved_item);
}.bind(this));
}, },
create_artifact_via_embed_url: function(url) { create_artifact_via_embed_url: function(url) {