diff --git a/src/main/resources/js/segrada.js b/src/main/resources/js/segrada.js
index 05dd7270..d5bd75d5 100644
--- a/src/main/resources/js/segrada.js
+++ b/src/main/resources/js/segrada.js
@@ -1257,7 +1257,7 @@ function escapeHTML(myString) {
else graphShow();
e.preventDefault();
});
- $('#sg-graph-action-remove').click(function(e) {
+ $('.sg-graph-action-remove').click(function(e) {
const selection = graphNetwork.getSelection();
if (selection.edges.length > 0) graphEdges.remove(selection.edges);
if (selection.nodes.length > 0) graphNodes.remove(selection.nodes);
diff --git a/src/main/resources/less/single/segrada.less b/src/main/resources/less/single/segrada.less
index a8f3c55d..627e6c04 100644
--- a/src/main/resources/less/single/segrada.less
+++ b/src/main/resources/less/single/segrada.less
@@ -227,11 +227,17 @@ span.sg-color-icon {
z-index: 101;
border: 1px solid #666;
- padding: 0.5em;
background-color: #fff;
a {
+ padding: 0.25em 0.5em;
display: block;
+ color: #666;
+ }
+ a:hover {
+ color: #fff;
+ background-color: #666;
+ text-decoration: none;
}
}
diff --git a/src/main/webapp/WEB-INF/templates/partials/graph.html b/src/main/webapp/WEB-INF/templates/partials/graph.html
index 0d9a742c..bbda26a4 100644
--- a/src/main/webapp/WEB-INF/templates/partials/graph.html
+++ b/src/main/webapp/WEB-INF/templates/partials/graph.html
@@ -18,7 +18,7 @@
-
+
@@ -33,6 +33,7 @@
Add all
Fix
Unfix
+ Delete
diff --git a/src/main/webapp/css/segrada.css b/src/main/webapp/css/segrada.css
index 81c9a55c..249e41e8 100644
--- a/src/main/webapp/css/segrada.css
+++ b/src/main/webapp/css/segrada.css
@@ -1 +1 @@
-body{margin-top:2em}.form-group{margin-bottom:0}.form-pad{padding-top:7px}.twitter-typeahead{width:100%}.sg-margin-bottom{margin-bottom:1em}.sg-margin-top{margin-top:1em}.sg-margin-bottom-sm{margin-bottom:.5em}.sg-margin-top-sm{margin-top:.5em}.sg-disabled{z-index:1000;background-color:#d3d3d3;opacity:.6;pointer-events:none}div.sg-fileupload-small .file-preview-frame{height:auto;width:160px}div.sg-fileupload-small .file-caption-name{padding-right:0!important;width:auto!important}.sg-pictogram-modal-link{display:block;padding:15px 0;width:100%}.sg-pictogram-modal-link img{display:block}.col-xs-1.sg-no-padding-right{padding-right:0}.sg-dynamic-data{padding:1em;margin-bottom:.5em;border:2px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.sg-headbox-right{float:right;margin:-1em -.6em 0 0;display:none}a.btn-link{color:#000;opacity:.5;filter:alpha(opacity=50)}a.btn-link:focus,a.btn-link:hover{color:#000;opacity:.8;filter:alpha(opacity=80)}.sg-data-icon-bar{white-space:nowrap}a.sg-data-icon{padding-left:.15em;color:#000;font-size:16px;font-weight:700;opacity:.2;filter:alpha(opacity=20)}a.sg-data-icon:focus,a.sg-data-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.sg-headbox-right a{padding:.25em;float:right;font-size:21px;line-height:1}.sg-data-taglist span{margin-right:.25em;line-height:2.2em}td .sg-data-taglist span{line-height:1em}.sg-tag-show{cursor:pointer}.sg-tag-show:focus,.sg-tag-show:hover{opacity:.5;filter:alpha(opacity=50)}.sg-headbox-info{padding:.25em;color:#000;opacity:.2;filter:alpha(opacity=20);font-size:13px;line-height:31px}.sg-data-content{margin-top:1em}.sg-description{margin-top:20px}.sg-description hr{border-color:#000}.sg-map{height:400px;width:100%}.sg-lg-image{width:100%;cursor:pointer}.sg-stop-flow{overflow:hidden}.sg-highlight-list div{margin-bottom:.1ex}.sg-highlight-list div:hover{background:#eee}label.sg-subtag-label{font-weight:400}img.sg-img-pictogram{width:24px;height:24px;vertical-align:baseline}span.sg-color-icon{width:24px;height:24px;display:inline-block}.label a{color:#fff;text-decoration:none}#sg-graph-container{background-color:#fff;position:absolute;z-index:100;right:2%;top:6em;bottom:2%;left:43%;border:1px solid #999;border-radius:4px}#sg-graph{position:absolute;top:35px;bottom:0;left:0;right:0;z-index:98}#sg-graph-header{position:relative;border-bottom:1px solid #999;z-index:99;background-color:#fff;border-top-right-radius:4px;border-top-left-radius:4px}#sg-graph-context-menu{position:absolute;z-index:101;border:1px solid #666;padding:.5em;background-color:#fff}#sg-graph-context-menu a{display:block}#view-page-content img{max-width:100%;height:auto}.ol-popup{display:none;position:absolute;background-color:#fff;padding:15px 25px 15px 15px;border:1px solid #ccc;bottom:12px;left:-50px}.ol-popup:after,.ol-popup:before{top:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ol-popup:after{border-top-color:#fff;border-width:10px;left:48px;margin-left:-10px}.ol-popup:before{border-top-color:#ccc;border-width:11px;left:48px;margin-left:-11px}.ol-popup-content{min-width:170px;max-height:200px;overflow-x:auto}.ol-popup-closer{position:absolute;top:2px;right:2px;font-size:150%;padding:0 4px;color:gray;text-decoration:none}.ol-popup-closer:after{content:"\2716"}.ol-popup div.infoResult{min-width:130px}.ol-popup div.infoResult p{padding:.1em;margin:0}.ol-popup-content h3{margin:.25em 0}.ol-popup.marker{margin-bottom:30px}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{background-color:#ccc}#sg-pagination .navbar-right{margin:20px 0;padding-right:20px}#sg-pagination button{background:#fff!important}
\ No newline at end of file
+body{margin-top:2em}.form-group{margin-bottom:0}.form-pad{padding-top:7px}.twitter-typeahead{width:100%}.sg-margin-bottom{margin-bottom:1em}.sg-margin-top{margin-top:1em}.sg-margin-bottom-sm{margin-bottom:.5em}.sg-margin-top-sm{margin-top:.5em}.sg-disabled{z-index:1000;background-color:#d3d3d3;opacity:.6;pointer-events:none}div.sg-fileupload-small .file-preview-frame{height:auto;width:160px}div.sg-fileupload-small .file-caption-name{padding-right:0!important;width:auto!important}.sg-pictogram-modal-link{display:block;padding:15px 0;width:100%}.sg-pictogram-modal-link img{display:block}.col-xs-1.sg-no-padding-right{padding-right:0}.sg-dynamic-data{padding:1em;margin-bottom:.5em;border:2px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.sg-headbox-right{float:right;margin:-1em -.6em 0 0;display:none}a.btn-link{color:#000;opacity:.5;filter:alpha(opacity=50)}a.btn-link:focus,a.btn-link:hover{color:#000;opacity:.8;filter:alpha(opacity=80)}.sg-data-icon-bar{white-space:nowrap}a.sg-data-icon{padding-left:.15em;color:#000;font-size:16px;font-weight:700;opacity:.2;filter:alpha(opacity=20)}a.sg-data-icon:focus,a.sg-data-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}.sg-headbox-right a{padding:.25em;float:right;font-size:21px;line-height:1}.sg-data-taglist span{margin-right:.25em;line-height:2.2em}td .sg-data-taglist span{line-height:1em}.sg-tag-show{cursor:pointer}.sg-tag-show:focus,.sg-tag-show:hover{opacity:.5;filter:alpha(opacity=50)}.sg-headbox-info{padding:.25em;color:#000;opacity:.2;filter:alpha(opacity=20);font-size:13px;line-height:31px}.sg-data-content{margin-top:1em}.sg-description{margin-top:20px}.sg-description hr{border-color:#000}.sg-map{height:400px;width:100%}.sg-lg-image{width:100%;cursor:pointer}.sg-stop-flow{overflow:hidden}.sg-highlight-list div{margin-bottom:.1ex}.sg-highlight-list div:hover{background:#eee}label.sg-subtag-label{font-weight:400}img.sg-img-pictogram{width:24px;height:24px;vertical-align:baseline}span.sg-color-icon{width:24px;height:24px;display:inline-block}.label a{color:#fff;text-decoration:none}#sg-graph-container{background-color:#fff;position:absolute;z-index:100;right:2%;top:6em;bottom:2%;left:43%;border:1px solid #999;border-radius:4px}#sg-graph{position:absolute;top:35px;bottom:0;left:0;right:0;z-index:98}#sg-graph-header{position:relative;border-bottom:1px solid #999;z-index:99;background-color:#fff;border-top-right-radius:4px;border-top-left-radius:4px}#sg-graph-context-menu{position:absolute;z-index:101;border:1px solid #666;background-color:#fff}#sg-graph-context-menu a{padding:.25em .5em;display:block;color:#666}#sg-graph-context-menu a:hover{color:#fff;background-color:#666;text-decoration:none}#view-page-content img{max-width:100%;height:auto}.ol-popup{display:none;position:absolute;background-color:#fff;padding:15px 25px 15px 15px;border:1px solid #ccc;bottom:12px;left:-50px}.ol-popup:after,.ol-popup:before{top:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ol-popup:after{border-top-color:#fff;border-width:10px;left:48px;margin-left:-10px}.ol-popup:before{border-top-color:#ccc;border-width:11px;left:48px;margin-left:-11px}.ol-popup-content{min-width:170px;max-height:200px;overflow-x:auto}.ol-popup-closer{position:absolute;top:2px;right:2px;font-size:150%;padding:0 4px;color:gray;text-decoration:none}.ol-popup-closer:after{content:"\2716"}.ol-popup div.infoResult{min-width:130px}.ol-popup div.infoResult p{padding:.1em;margin:0}.ol-popup-content h3{margin:.25em 0}.ol-popup.marker{margin-bottom:30px}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{background-color:#ccc}#sg-pagination .navbar-right{margin:20px 0;padding-right:20px}#sg-pagination button{background:#fff!important}
\ No newline at end of file
diff --git a/src/main/webapp/js/segrada.min.js b/src/main/webapp/js/segrada.min.js
index f5f26ac7..2de01314 100644
--- a/src/main/webapp/js/segrada.min.js
+++ b/src/main/webapp/js/segrada.min.js
@@ -1 +1 @@
-function escapeHTML(t){return"string"==typeof t?t.replace(/&/g,"&").replace(//g,">"):""}!function(c){function n(n){return function(t,e,a){c.ajax({url:n+encodeURIComponent(t)}).done(function(t){a(t)})}}function e(){return function(t,e,a){let n=urlSegradaNodeSearch+encodeURIComponent(t);const i=c(".sg-node-search").filter(":focus"),o=c("#"+i.attr("data-select-id")+" option").filter(":selected");t=o.attr(i.attr("data-attr"));null!=t&&0
/i);function a(i,e,o,r,t){t=urlSegradaPictogramSearch+encodeURIComponent(t);c.getJSON(t,function(t){const n=[];c.each(t,function(t,e){var a=c("").text(e.title).html();n.push('')}),e.html(""+n.join("")+"
"),c("a",e).click(function(t){var e=c(this).attr("data-id"),a=c(this).attr("data-uid"),n=c("").text(c(this).attr("title")).html();c("#value-"+o,r).val(e),c("#preview-"+o,r).html(' '+n),c("#clear-"+o,r).show(),t.preventDefault(),i.modal("hide")})}).fail(function(){alert("ERROR")})}function h(t){c.get(t,function(t){var e=t.match(u);null!=e&&2<=e.length&&c("#"+e[2]).remove();const a=c("#sg-data");a.prepend(t);const n=a.children(":first");g(n),c("html, body").animate({scrollTop:n.offset().top},500)}).fail(function(){alert("ERROR")})}function g(s){s=s||c("body"),c(".sg-data").addClass("sg-dynamic-data"),c(".sg-headbox-right").show(),c(".sg-dynamic-hide").hide(),c(".sg-data-add",s).click(function(t){h(c(this).attr("href")),t.preventDefault()}),c(".sg-control-form",s).ajaxForm({beforeSubmit:function(t,e,a){let n=e.attr("data-target-id");void 0!==n&&null!==n&&0!==n.length||(n="#sg-control",m());const i=c(n);return i.wrapInner(""),i.prepend(c("#sg-wait").html()),!0},success:function(t,e,a,n){let i=n.attr("data-target-id");void 0!==i&&null!=i&&0!==i.length||(i="#sg-control");const o=c(i);o.html(t),g(o)},error:function(t,e,a,n){let i=n.attr("data-target-id");void 0!==i&&null!=i&&0!==i.length||(i="#sg-control");const o=c(i);o.html(t.statusText),alert("Error "+t.status+"\n"+t.statusText)}}),c(".sg-submit-form",s).change(function(){c(this).closest("form").submit()}),c(".sg-control-set",s).click(function(t){const e=c(this);let a=e.attr("data-target-id");void 0!==a&&null!=a&&0!=a.length||(a="#sg-control",m());const n=c(a);n.wrapInner(""),n.prepend(c("#sg-wait").html()),c.get(e.attr("href"),function(t){n.html(t),g(n)}).fail(function(){alert("ERROR")}),t.preventDefault()}),c("[data-data-dblclick]",s).dblclick(function(){c.get(c(this).attr("data-data-dblclick"),function(t){var e=t.match(u);null!=e&&2<=e.length&&c("#"+e[2]).remove();const a=c("#sg-data");a.prepend(t);const n=a.children(":first");g(n),c("html, body").animate({scrollTop:n.offset().top},500)}).fail(function(){alert("ERROR")})}),c("tr [data-confirm]",s).click(function(t){const e=c(this);if(confirm(e.attr("data-confirm"))){const a=e.closest("tr");a.addClass("sg-disabled"),c.get(e.attr("href"),function(t){a.slideUp("fast",function(){a.remove()})}).fail(function(){alert("ERROR")})}t.preventDefault()}),c(".sg-control-confirm",s).click(function(t){const e=c(this);if(confirm(e.attr("data-confirm"))){const a=c("#"+e.attr("data-target"));a.addClass("sg-disabled"),c.get(e.attr("href"),function(t){a.fadeOut("slow",function(){a.remove()})}).fail(function(){alert("ERROR")})}t.preventDefault()}),c(".sg-replace-content",s).on("shown.bs.tab",function(t){const e=c(c(this).attr("href"));var a=c(this).attr("data-url");c.get(a,function(t){e.html(t),g(e)}).fail(function(){alert("ERROR")}),c(this).removeClass("sg-replace-content"),c(this).unbind("shown.bs.tab")}),c(".sg-data-close",s).click(function(t){c(this).parent().parent().fadeOut("fast",function(){c(this).remove()})}),c("input.sg-fileupload",s).fileinput({showUpload:!1}),c("input.sg-fileupload-small",s).fileinput({showUpload:!1,previewSettings:{image:{width:"auto",height:"24px"}}}),c(".sg-pictogram-modal",s).on("shown.bs.modal",function(){const i=c(this),o=i.attr("id"),r=c("#container-"+o,i),t=c("#filter-"+o,i);t.on("input propertychange paste",function(){a(i,r,o,s,c(this).val())}).onEnter(function(){const t=c(".sg-pictogram-modal-link",r).first();var e,a,n;0").text(t.attr("title")).html(),c("#value-"+o,s).val(e),c("#preview-"+o,s).html(' '+n),c("#clear-"+o,s).show(),i.modal("hide"))}),""===t.val()&&a(i,r,o,s,"")}),c(".sg-pictogram-chooser",s).click(function(t){c("#"+c(this).attr("data-id")).modal("show"),t.preventDefault()}),c(".sg-pictogram-clearer",s).click(function(t){var e=c(this).attr("data-id");c("#value-"+e,s).val(""),c("#preview-"+e,s).html(""),c(this).hide(),t.preventDefault()}),c(".sg-source-ref-modal",s).on("shown.bs.modal",function(){const o=c(this),e=c(".modal-body",o);c.get(o.attr("data-href"),function(t){e.html(t),c("select.sg-colorpicker",o).simplepicker({theme:"fontawesome"}),c("form",e).ajaxForm({beforeSubmit:function(t,e,a){return e.wrapInner(""),e.prepend(c("#sg-wait").html()),!0},success:function(t,e,a,n){const i=c(o.attr("data-target"));i.html(t),g(i),o.modal("hide"),c(".modal-backdrop").remove(),c("body").removeClass("modal-open")},error:function(t,e,a,n){alert("Error "+t.status+"\n"+t.statusText)}})}).fail(function(){alert("ERROR")})}).on("hidden.bs.modal",function(){c(".modal-body",c(this)).html(c("#sg-wait").html())}),c(".sg-source-ref-editor",s).click(function(t){const e=c("#"+c(this).attr("data-id"));e.attr("data-href",c(this).attr("href")),e.modal("show"),t.preventDefault()}),c(".sg-taglist-contract",s).each(function(){const t=c("span",c(this));1'),c("span.sg-tag-show",c(this)).click(function(){c(this).remove(),t.show()}))}),c("select.sg-colorpicker",s).simplepicker({theme:"fontawesome"}),c("select.sg-tags",s).each(function(){const e=c(this);e.tagsinput({trimValue:!0,confirmKeys:[13],typeaheadjs:{name:"tags",limit:25,displayKey:"title",valueKey:"title",source:n(urlSegradaTagSearch),async:!0}}),e.on("itemRemoved",function(t){e.find('option[value="'+t.item+'"]').remove()})}),c("input.sg-node-search",s).each(function(){const t=c(this),a=c("#"+t.attr("data-id"));t.typeahead({hint:!0,highlight:!0,minLength:1},{async:!0,name:"node",limit:25,displayKey:"title",valueKey:"id",source:e()}).bind("typeahead:selected",function(t,e){a.val(e.id)}).bind("keyup",function(){this.value||a.val("")})}),c("input.sg-file-search",s).each(function(){const t=c(this),a=c("#"+t.attr("data-id"));t.typeahead({hint:!0,highlight:!0,minLength:1},{async:!0,name:"file",limit:25,displayKey:"title",valueKey:"id",source:n(urlSegradaFileSearch)}).bind("typeahead:selected",function(t,e){a.val(e.id)}).bind("keyup",function(){this.value||a.val("")})}),c("input.sg-source-search",s).each(function(){const t=c(this),a=c("#"+t.attr("data-id"));t.typeahead({hint:!0,highlight:!0,minLength:1},{async:!0,name:"source",limit:25,displayKey:"title",valueKey:"id",source:n(urlSegradaSourceSearch)}).bind("typeahead:selected",function(t,e){a.val(e.id)}).bind("keyup",function(){this.value||a.val("")})}),c(".sg-link-external",s).click(function(t){var e=c(this).attr("href");const a=window.open(e,"_blank");a.focus(),t.preventDefault()}),c("form.sg-data-form",s).ajaxForm({beforeSubmit:function(t,e,a){return c(":input",e).attr("disabled",!0),c("button.btn-primary",e).append(" "+c("#sg-wait-btn").html()),!0},success:function(t,e,a,n){let i=n.attr("data-id");void 0!==i&&(i=c("#"+i)),i=i||n,i.replaceWith(t);t=t.match(u);null!=t&&2<=t.length&&g(c("#"+t[2]))},error:function(t,e,a,n){c(":input",n).attr("disabled",!1),alert("Error "+t.status+"\n"+t.statusText)}}),c("form.sg-simple-form",s).ajaxForm({beforeSubmit:function(t,e,a){c(":input",e).attr("disabled",!0);let n=e.attr("data-id");return void 0!==n&&(n=c("#"+n)),n=n||e,n.html(c("#sg-wait")),!0},success:function(t,e,a,n){let i=n.attr("data-id");void 0!==i&&(i=c("#"+i)),i=i||n,i.html(t),c(":input",n).attr("disabled",!1)},error:function(t,e,a,n){c(":input",n).attr("disabled",!1),alert("Error "+t.status+"\n"+t.statusText)}}),c(".sg-periods").each(function(){const i=c(this),o=i.attr("id"),t=c(".sg-period-form",i);c(".sg-period-add",i).click(function(t){c(this).hide();const e=c(".sg-period-form-add",i);e.show(),c(".sg-period-form-period",e).change(function(t){c(this).is(":checked")?c(".sg-period-toggle",e).show():c(".sg-period-toggle",e).hide()}),t.preventDefault()}),t.ajaxForm({beforeSubmit:function(t,e,a){return i.addClass("disabled"),!0},success:function(t,e,a,n){i.replaceWith(t),g(c("#"+o))},error:function(t,e,a,n){i.removeClass("disabled"),alert("Error "+t.status+"\n"+t.statusText)}})}),c(".sg-ajax-modal",s).click(function(t){const e=c("#sg-modal"),a=c(".modal-body-inner",e),n=c(".modal-loading",e);c("h4",e).html(c(this).attr("data-title")),a.html(""),a.hide(),n.show(),e.modal("show"),c.get(c(this).attr("href"),function(t){n.hide(),a.html(t),a.show(),g(a)}).fail(function(){alert("ERROR")}),t.preventDefault()}),c(".sg-ajax-modal-form",s).ajaxForm({beforeSubmit:function(t,e,a){var n=c("#sg-modal");const i=c(".modal-body-inner",n),o=c(".modal-loading",n);return i.hide(),o.show(),!0},success:function(t,e,a,n){var i=c("#sg-modal");const o=c(".modal-body-inner",i),r=c(".modal-loading",i);o.html(t),o.show(),r.hide(),g(o),i=c("#sg-modal"),c(".sg-update-period",i).each(function(){var t=c(this).attr("data-id"),e=c(t);if(0o?0===i?1:i:o;e.css({width:"100%",height:50*t+"px",border:"1px solid #ccc"});const l={nodes:new vis.DataSet(r),edges:new vis.DataSet(s)};r=null,s=null;const d=new vis.Network(e.get(0),l,{edges:{smooth:{type:"cubicBezier",forceDirection:"horizontal",roundness:.6}},nodes:{shape:"box"},layout:{hierarchical:{direction:"LR"}}});d.on("doubleClick",function(t){let e=null;0':''),r.forEach(function(t){t.physics=f,r.update(t)}),t.preventDefault()}),c("#sg-graph-action-save").click(function(t){if(0"+t.title+""}),""!=a&&(a=""),i.html(a),c("a",i).click(function(t){y(),b(c(this).attr("href")),o=c(this).html(),d=c(this).attr("data-uid"),n.modal("hide"),t.preventDefault()})})}),c("#sg-graph-modal-save-frm").submit(function(t){t.preventDefault();const e=c("#title-sg-graph-save").val();let a=d;null!=d&&c("#save-as-new-sg-graph-save").is(":checked")&&(a=null),l.storePositions();const n=[],i=[];r.forEach(function(t){n.push({id:t.id,x:t.x,y:t.y,group:t.group,physics:t.physics})}),s.forEach(function(t){i.push({id:t.id,group:t.group})});c.post(c(this).attr("action"),{_csrf:c("#sg-graph-container").attr("data-csrf"),uid:a,title:e,type:"graph",data:JSON.stringify({nodes:n,edges:i})},function(t){o=e,d=t}).fail(function(){alert("ERROR")}),c("#sg-graph-modal-save").modal("hide")}),g(c("body"))})}(jQuery);
+function escapeHTML(t){return"string"==typeof t?t.replace(/&/g,"&").replace(//g,">"):""}!function(c){function n(n){return function(t,e,a){c.ajax({url:n+encodeURIComponent(t)}).done(function(t){a(t)})}}function e(){return function(t,e,a){let n=urlSegradaNodeSearch+encodeURIComponent(t);const i=c(".sg-node-search").filter(":focus"),o=c("#"+i.attr("data-select-id")+" option").filter(":selected");t=o.attr(i.attr("data-attr"));null!=t&&0/i);function a(i,e,o,r,t){t=urlSegradaPictogramSearch+encodeURIComponent(t);c.getJSON(t,function(t){const n=[];c.each(t,function(t,e){var a=c("").text(e.title).html();n.push('')}),e.html(""+n.join("")+"
"),c("a",e).click(function(t){var e=c(this).attr("data-id"),a=c(this).attr("data-uid"),n=c("").text(c(this).attr("title")).html();c("#value-"+o,r).val(e),c("#preview-"+o,r).html(' '+n),c("#clear-"+o,r).show(),t.preventDefault(),i.modal("hide")})}).fail(function(){alert("ERROR")})}function h(t){c.get(t,function(t){var e=t.match(u);null!=e&&2<=e.length&&c("#"+e[2]).remove();const a=c("#sg-data");a.prepend(t);const n=a.children(":first");g(n),c("html, body").animate({scrollTop:n.offset().top},500)}).fail(function(){alert("ERROR")})}function g(s){s=s||c("body"),c(".sg-data").addClass("sg-dynamic-data"),c(".sg-headbox-right").show(),c(".sg-dynamic-hide").hide(),c(".sg-data-add",s).click(function(t){h(c(this).attr("href")),t.preventDefault()}),c(".sg-control-form",s).ajaxForm({beforeSubmit:function(t,e,a){let n=e.attr("data-target-id");void 0!==n&&null!==n&&0!==n.length||(n="#sg-control",m());const i=c(n);return i.wrapInner(""),i.prepend(c("#sg-wait").html()),!0},success:function(t,e,a,n){let i=n.attr("data-target-id");void 0!==i&&null!=i&&0!==i.length||(i="#sg-control");const o=c(i);o.html(t),g(o)},error:function(t,e,a,n){let i=n.attr("data-target-id");void 0!==i&&null!=i&&0!==i.length||(i="#sg-control");const o=c(i);o.html(t.statusText),alert("Error "+t.status+"\n"+t.statusText)}}),c(".sg-submit-form",s).change(function(){c(this).closest("form").submit()}),c(".sg-control-set",s).click(function(t){const e=c(this);let a=e.attr("data-target-id");void 0!==a&&null!=a&&0!=a.length||(a="#sg-control",m());const n=c(a);n.wrapInner(""),n.prepend(c("#sg-wait").html()),c.get(e.attr("href"),function(t){n.html(t),g(n)}).fail(function(){alert("ERROR")}),t.preventDefault()}),c("[data-data-dblclick]",s).dblclick(function(){c.get(c(this).attr("data-data-dblclick"),function(t){var e=t.match(u);null!=e&&2<=e.length&&c("#"+e[2]).remove();const a=c("#sg-data");a.prepend(t);const n=a.children(":first");g(n),c("html, body").animate({scrollTop:n.offset().top},500)}).fail(function(){alert("ERROR")})}),c("tr [data-confirm]",s).click(function(t){const e=c(this);if(confirm(e.attr("data-confirm"))){const a=e.closest("tr");a.addClass("sg-disabled"),c.get(e.attr("href"),function(t){a.slideUp("fast",function(){a.remove()})}).fail(function(){alert("ERROR")})}t.preventDefault()}),c(".sg-control-confirm",s).click(function(t){const e=c(this);if(confirm(e.attr("data-confirm"))){const a=c("#"+e.attr("data-target"));a.addClass("sg-disabled"),c.get(e.attr("href"),function(t){a.fadeOut("slow",function(){a.remove()})}).fail(function(){alert("ERROR")})}t.preventDefault()}),c(".sg-replace-content",s).on("shown.bs.tab",function(t){const e=c(c(this).attr("href"));var a=c(this).attr("data-url");c.get(a,function(t){e.html(t),g(e)}).fail(function(){alert("ERROR")}),c(this).removeClass("sg-replace-content"),c(this).unbind("shown.bs.tab")}),c(".sg-data-close",s).click(function(t){c(this).parent().parent().fadeOut("fast",function(){c(this).remove()})}),c("input.sg-fileupload",s).fileinput({showUpload:!1}),c("input.sg-fileupload-small",s).fileinput({showUpload:!1,previewSettings:{image:{width:"auto",height:"24px"}}}),c(".sg-pictogram-modal",s).on("shown.bs.modal",function(){const i=c(this),o=i.attr("id"),r=c("#container-"+o,i),t=c("#filter-"+o,i);t.on("input propertychange paste",function(){a(i,r,o,s,c(this).val())}).onEnter(function(){const t=c(".sg-pictogram-modal-link",r).first();var e,a,n;0").text(t.attr("title")).html(),c("#value-"+o,s).val(e),c("#preview-"+o,s).html(' '+n),c("#clear-"+o,s).show(),i.modal("hide"))}),""===t.val()&&a(i,r,o,s,"")}),c(".sg-pictogram-chooser",s).click(function(t){c("#"+c(this).attr("data-id")).modal("show"),t.preventDefault()}),c(".sg-pictogram-clearer",s).click(function(t){var e=c(this).attr("data-id");c("#value-"+e,s).val(""),c("#preview-"+e,s).html(""),c(this).hide(),t.preventDefault()}),c(".sg-source-ref-modal",s).on("shown.bs.modal",function(){const o=c(this),e=c(".modal-body",o);c.get(o.attr("data-href"),function(t){e.html(t),c("select.sg-colorpicker",o).simplepicker({theme:"fontawesome"}),c("form",e).ajaxForm({beforeSubmit:function(t,e,a){return e.wrapInner(""),e.prepend(c("#sg-wait").html()),!0},success:function(t,e,a,n){const i=c(o.attr("data-target"));i.html(t),g(i),o.modal("hide"),c(".modal-backdrop").remove(),c("body").removeClass("modal-open")},error:function(t,e,a,n){alert("Error "+t.status+"\n"+t.statusText)}})}).fail(function(){alert("ERROR")})}).on("hidden.bs.modal",function(){c(".modal-body",c(this)).html(c("#sg-wait").html())}),c(".sg-source-ref-editor",s).click(function(t){const e=c("#"+c(this).attr("data-id"));e.attr("data-href",c(this).attr("href")),e.modal("show"),t.preventDefault()}),c(".sg-taglist-contract",s).each(function(){const t=c("span",c(this));1'),c("span.sg-tag-show",c(this)).click(function(){c(this).remove(),t.show()}))}),c("select.sg-colorpicker",s).simplepicker({theme:"fontawesome"}),c("select.sg-tags",s).each(function(){const e=c(this);e.tagsinput({trimValue:!0,confirmKeys:[13],typeaheadjs:{name:"tags",limit:25,displayKey:"title",valueKey:"title",source:n(urlSegradaTagSearch),async:!0}}),e.on("itemRemoved",function(t){e.find('option[value="'+t.item+'"]').remove()})}),c("input.sg-node-search",s).each(function(){const t=c(this),a=c("#"+t.attr("data-id"));t.typeahead({hint:!0,highlight:!0,minLength:1},{async:!0,name:"node",limit:25,displayKey:"title",valueKey:"id",source:e()}).bind("typeahead:selected",function(t,e){a.val(e.id)}).bind("keyup",function(){this.value||a.val("")})}),c("input.sg-file-search",s).each(function(){const t=c(this),a=c("#"+t.attr("data-id"));t.typeahead({hint:!0,highlight:!0,minLength:1},{async:!0,name:"file",limit:25,displayKey:"title",valueKey:"id",source:n(urlSegradaFileSearch)}).bind("typeahead:selected",function(t,e){a.val(e.id)}).bind("keyup",function(){this.value||a.val("")})}),c("input.sg-source-search",s).each(function(){const t=c(this),a=c("#"+t.attr("data-id"));t.typeahead({hint:!0,highlight:!0,minLength:1},{async:!0,name:"source",limit:25,displayKey:"title",valueKey:"id",source:n(urlSegradaSourceSearch)}).bind("typeahead:selected",function(t,e){a.val(e.id)}).bind("keyup",function(){this.value||a.val("")})}),c(".sg-link-external",s).click(function(t){var e=c(this).attr("href");const a=window.open(e,"_blank");a.focus(),t.preventDefault()}),c("form.sg-data-form",s).ajaxForm({beforeSubmit:function(t,e,a){return c(":input",e).attr("disabled",!0),c("button.btn-primary",e).append(" "+c("#sg-wait-btn").html()),!0},success:function(t,e,a,n){let i=n.attr("data-id");void 0!==i&&(i=c("#"+i)),i=i||n,i.replaceWith(t);t=t.match(u);null!=t&&2<=t.length&&g(c("#"+t[2]))},error:function(t,e,a,n){c(":input",n).attr("disabled",!1),alert("Error "+t.status+"\n"+t.statusText)}}),c("form.sg-simple-form",s).ajaxForm({beforeSubmit:function(t,e,a){c(":input",e).attr("disabled",!0);let n=e.attr("data-id");return void 0!==n&&(n=c("#"+n)),n=n||e,n.html(c("#sg-wait")),!0},success:function(t,e,a,n){let i=n.attr("data-id");void 0!==i&&(i=c("#"+i)),i=i||n,i.html(t),c(":input",n).attr("disabled",!1)},error:function(t,e,a,n){c(":input",n).attr("disabled",!1),alert("Error "+t.status+"\n"+t.statusText)}}),c(".sg-periods").each(function(){const i=c(this),o=i.attr("id"),t=c(".sg-period-form",i);c(".sg-period-add",i).click(function(t){c(this).hide();const e=c(".sg-period-form-add",i);e.show(),c(".sg-period-form-period",e).change(function(t){c(this).is(":checked")?c(".sg-period-toggle",e).show():c(".sg-period-toggle",e).hide()}),t.preventDefault()}),t.ajaxForm({beforeSubmit:function(t,e,a){return i.addClass("disabled"),!0},success:function(t,e,a,n){i.replaceWith(t),g(c("#"+o))},error:function(t,e,a,n){i.removeClass("disabled"),alert("Error "+t.status+"\n"+t.statusText)}})}),c(".sg-ajax-modal",s).click(function(t){const e=c("#sg-modal"),a=c(".modal-body-inner",e),n=c(".modal-loading",e);c("h4",e).html(c(this).attr("data-title")),a.html(""),a.hide(),n.show(),e.modal("show"),c.get(c(this).attr("href"),function(t){n.hide(),a.html(t),a.show(),g(a)}).fail(function(){alert("ERROR")}),t.preventDefault()}),c(".sg-ajax-modal-form",s).ajaxForm({beforeSubmit:function(t,e,a){var n=c("#sg-modal");const i=c(".modal-body-inner",n),o=c(".modal-loading",n);return i.hide(),o.show(),!0},success:function(t,e,a,n){var i=c("#sg-modal");const o=c(".modal-body-inner",i),r=c(".modal-loading",i);o.html(t),o.show(),r.hide(),g(o),i=c("#sg-modal"),c(".sg-update-period",i).each(function(){var t=c(this).attr("data-id"),e=c(t);if(0o?0===i?1:i:o;e.css({width:"100%",height:50*t+"px",border:"1px solid #ccc"});const l={nodes:new vis.DataSet(r),edges:new vis.DataSet(s)};r=null,s=null;const d=new vis.Network(e.get(0),l,{edges:{smooth:{type:"cubicBezier",forceDirection:"horizontal",roundness:.6}},nodes:{shape:"box"},layout:{hierarchical:{direction:"LR"}}});d.on("doubleClick",function(t){let e=null;0':''),r.forEach(function(t){t.physics=f,r.update(t)}),t.preventDefault()}),c("#sg-graph-action-save").click(function(t){if(0"+t.title+""}),""!=a&&(a=""),i.html(a),c("a",i).click(function(t){y(),b(c(this).attr("href")),o=c(this).html(),d=c(this).attr("data-uid"),n.modal("hide"),t.preventDefault()})})}),c("#sg-graph-modal-save-frm").submit(function(t){t.preventDefault();const e=c("#title-sg-graph-save").val();let a=d;null!=d&&c("#save-as-new-sg-graph-save").is(":checked")&&(a=null),l.storePositions();const n=[],i=[];r.forEach(function(t){n.push({id:t.id,x:t.x,y:t.y,group:t.group,physics:t.physics})}),s.forEach(function(t){i.push({id:t.id,group:t.group})});c.post(c(this).attr("action"),{_csrf:c("#sg-graph-container").attr("data-csrf"),uid:a,title:e,type:"graph",data:JSON.stringify({nodes:n,edges:i})},function(t){o=e,d=t}).fail(function(){alert("ERROR")}),c("#sg-graph-modal-save").modal("hide")}),g(c("body"))})}(jQuery);