|
@@ -0,0 +1,56 @@
|
|
|
|
+$(function () {
|
|
|
|
+ initSingle();
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+initSingle=function () {
|
|
|
|
+ $('.nodes').html("");
|
|
|
|
+ $('.links').html(""); // clear content of node, in order to refresh
|
|
|
|
+ function createImg(src) {
|
|
|
|
+ var $img = $('<img />')
|
|
|
|
+ $img.attr("src", src);
|
|
|
|
+ $img.attr("class", "my-img-thumbnail pointer to-delete");
|
|
|
|
+ $img.on("click", function (){
|
|
|
|
+ showimage(src);
|
|
|
|
+ });
|
|
|
|
+ return $img;
|
|
|
|
+ }
|
|
|
|
+ $(".to-add").on("dragend", function (e) {
|
|
|
|
+
|
|
|
|
+ var src = $(e.target).attr("src");
|
|
|
|
+ if (images.indexOf(src) < 0) {
|
|
|
|
+
|
|
|
|
+ images.push(src);
|
|
|
|
+
|
|
|
|
+ var $img = createImg(src);
|
|
|
|
+ $img.on("dragend", function (e) {
|
|
|
|
+ var src = $(e.target).attr("src");
|
|
|
|
+ var idx = images.indexOf(src);
|
|
|
|
+ if (idx >= 0) {
|
|
|
|
+ images.splice(idx, 1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $(e.target).remove();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $("#new-report-img").append($img)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ $('.sup-collapse').click(function () {
|
|
|
|
+ var dupTitle = $(this).parents('li').find('.sup-title');
|
|
|
|
+ dupTitle.toggle();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var color = {
|
|
|
|
+ 1: '#E36402',
|
|
|
|
+ 2: '#1995CF',
|
|
|
|
+ 3 : '#FFC000',
|
|
|
|
+ 2.1: '#FFC000'
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ var urlParams = new URLSearchParams(window.location.search);
|
|
|
|
+
|
|
|
|
+}
|