Updated class names
authorThierry Florac <thierry.florac@onf.fr>
Fri, 28 Dec 2018 10:18:44 +0100
changeset 102 882b5db98946
parent 101 19635af1ecec
child 103 d0d658d566d8
Updated class names
src/pyams_thesaurus/zmi/resources/js/pyams_thesaurus.js
src/pyams_thesaurus/zmi/resources/js/pyams_thesaurus.min.js
--- a/src/pyams_thesaurus/zmi/resources/js/pyams_thesaurus.js	Fri Dec 28 10:13:41 2018 +0100
+++ b/src/pyams_thesaurus/zmi/resources/js/pyams_thesaurus.js	Fri Dec 28 10:18:44 2018 +0100
@@ -52,12 +52,12 @@
 								  .css('color', 'silver');
 						}
 					}
-					var span = $('<span></span>').addClass('label label-success')
+					var span = $('<span></span>').addClass('label')
 												 .addClass(node.css_class)
 												 .attr('data-ams-url', node.view)
 												 .attr('data-toggle', 'modal');
 					if (node.expand) {
-						$('<i></i>').addClass('fa fa-lg fa-plus-circle')
+						$('<i></i>').addClass('fa fa-fw fa-plus-circle')
 									.attr('data-ams-click-handler', 'PyAMS_thesaurus.tree.expand')
 									.attr('data-ams-stop-propagation', true)
 									.appendTo(span);
--- a/src/pyams_thesaurus/zmi/resources/js/pyams_thesaurus.min.js	Fri Dec 28 10:13:41 2018 +0100
+++ b/src/pyams_thesaurus/zmi/resources/js/pyams_thesaurus.min.js	Fri Dec 28 10:18:44 2018 +0100
@@ -1,1 +1,1 @@
-!function(a,s){"use strict";var e={tree:{displaySubNodes:function(s,t,r){void 0===r&&(r=a('span.term:withtext("'+s+'")').siblings("i[data-ams-click-handler]"));var l=r.parents("span.label").siblings("ul.group"),i=l.closest("ul.group").closest("li");l.empty();for(var d in t)if(t.hasOwnProperty(d)){var n=t[d],c=a("<li></li>");n.extracts.reverse();for(var o in n.extracts)if(n.extracts.hasOwnProperty(o)){var u=n.extracts[o],m=a("<div></div>").addClass("pull-right margin-right-2").appendTo(c),p=a("<i></i>").attr("data-ams-extract-name",u.name).addClass("fa fa-fw fa-square extract-checker").css("color","#"+u.color).appendTo(m);a('>div i.extract-checker[data-ams-extract-name="'+u.name+'"]',i).hasClass("used")?(u.used?p.addClass("used"):p.removeClass("fa-square").addClass("fa-square-o"),a("i.switcher",'table.extracts tr[data-ams-element-name="'+u.name+'"]').hasClass("fa-eye")||p.css("visibility","hidden")):p.addClass("disabled").css("color","silver")}var f=a("<span></span>").addClass("label label-success").addClass(n.css_class).attr("data-ams-url",n.view).attr("data-toggle","modal");if(n.expand&&a("<i></i>").addClass("fa fa-lg fa-plus-circle").attr("data-ams-click-handler","PyAMS_thesaurus.tree.expand").attr("data-ams-stop-propagation",!0).appendTo(f),a("<span></span>").addClass("term").html(n.label).appendTo(f),f.appendTo(c),n.extensions)for(var h=0;h<n.extensions.length;h++){var v=n.extensions[h];a(v.icon).addClass("hint opaque align-base padding-left-5").attr("data-ams-url",v.view).attr("data-toggle","modal").attr("title",v.title).appendTo(c)}a("<ul></ul>").addClass("hidden group").appendTo(c),c.appendTo(l),n.subnodes&&e.tree.displaySubNodes(n.label,n.subnodes)}l.removeClass("hidden"),r.removeClass("fa-gear").addClass("fa-minus-circle")},expand:function(){var s=a(this);if(s.hasClass("fa-plus-circle")){s.removeClass("fa-plus-circle").addClass("fa-gear");var t=s.siblings("span.term").text(),r=s.closest("div.tree").data("ams-tree-context");MyAMS.ajax.post(r+"/get-nodes.json",{term:t},function(a){e.tree.displaySubNodes(t,a.nodes,s)})}else e.tree.collapse.call(this)},collapse:function(){var s=a(this);s.parents("span.label").siblings("ul.group").addClass("hidden"),s.removeClass("fa-minus-circle").addClass("fa-plus-circle")},updateTerm:function(s){var t=a('span.term:withtext("'+s.term+'")').siblings("i[data-ams-click-handler]");t.hasClass("fa-minus-circle")&&e.tree.collapse.call(t),e.tree.expand.call(t)},findTerm:function(s){MyAMS.ajax.post("get-parent-nodes.json",{term:s.term},function(s){e.tree.displaySubNodes(s.parent,s.nodes);var t=a('span.term:withtext("'+s.term+'")').parents("span.label");a("html,body").animate({scrollTop:t.offset().top-100},1e3),t.css("background-color","darkgreen").off("mouseover").on("mouseover",function(){a(this).css("background-color","")})})},switchExtract:function(){return function(){var s=a("i.fa",a(this)),t=s.parents("tr:first").data("ams-element-name");s.hasClass("fa-eye-slash")?e.tree.showExtract.call(this,t,s):e.tree.hideExtract.call(this,t,s)}},showExtract:function(s,e){a('i.extract-checker[data-ams-extract-name="'+s+'"]').css("visibility",""),e.removeClass("fa-eye-slash").removeClass("text-danger").addClass("fa-eye")},hideExtract:function(s,e){a('i.extract-checker[data-ams-extract-name="'+s+'"]').css("visibility","hidden"),e.removeClass("fa-eye").addClass("fa-eye-slash").addClass("text-danger")}},search:function(){var s=a(this).val();e.tree.findTerm({term:s})}};a(document).on("click","i.extract-checker",function(s){var e=a(this);if(!e.hasClass("disabled")){var t=a("span.term",e.closest("div").siblings("span"));MyAMS.ajax.post("switch-extract.json",{term:t.text(),extract:e.data("ams-extract-name")},function(s){s.status?MyAMS.ajax.handleJSON(s):s.used?(e.removeClass("fa-square-o").addClass("fa-square used"),a('>li >div i.extract-checker[data-ams-extract-name="'+s.extract+'"]',e.closest("div").siblings("ul.group")).removeClass("fa-square disabled").addClass("fa-square-o").css("color","#"+s.color)):(e.removeClass("fa-square used").addClass("fa-square-o"),a('i.extract-checker[data-ams-extract-name="'+s.extract+'"]',e.closest("div").siblings("ul.group")).removeClass("fa-square-o").addClass("fa-square disabled").css("color","silver"))})}}),s.PyAMS_thesaurus=e}(jQuery,this);
+!function(a,s){"use strict";var e={tree:{displaySubNodes:function(s,t,r){void 0===r&&(r=a('span.term:withtext("'+s+'")').siblings("i[data-ams-click-handler]"));var l=r.parents("span.label").siblings("ul.group"),i=l.closest("ul.group").closest("li");l.empty();for(var d in t)if(t.hasOwnProperty(d)){var n=t[d],c=a("<li></li>");n.extracts.reverse();for(var o in n.extracts)if(n.extracts.hasOwnProperty(o)){var u=n.extracts[o],m=a("<div></div>").addClass("pull-right margin-right-2").appendTo(c),p=a("<i></i>").attr("data-ams-extract-name",u.name).addClass("fa fa-fw fa-square extract-checker").css("color","#"+u.color).appendTo(m);a('>div i.extract-checker[data-ams-extract-name="'+u.name+'"]',i).hasClass("used")?(u.used?p.addClass("used"):p.removeClass("fa-square").addClass("fa-square-o"),a("i.switcher",'table.extracts tr[data-ams-element-name="'+u.name+'"]').hasClass("fa-eye")||p.css("visibility","hidden")):p.addClass("disabled").css("color","silver")}var f=a("<span></span>").addClass("label").addClass(n.css_class).attr("data-ams-url",n.view).attr("data-toggle","modal");if(n.expand&&a("<i></i>").addClass("fa fa-fw fa-plus-circle").attr("data-ams-click-handler","PyAMS_thesaurus.tree.expand").attr("data-ams-stop-propagation",!0).appendTo(f),a("<span></span>").addClass("term").html(n.label).appendTo(f),f.appendTo(c),n.extensions)for(var h=0;h<n.extensions.length;h++){var v=n.extensions[h];a(v.icon).addClass("hint opaque align-base padding-left-5").attr("data-ams-url",v.view).attr("data-toggle","modal").attr("title",v.title).appendTo(c)}a("<ul></ul>").addClass("hidden group").appendTo(c),c.appendTo(l),n.subnodes&&e.tree.displaySubNodes(n.label,n.subnodes)}l.removeClass("hidden"),r.removeClass("fa-gear").addClass("fa-minus-circle")},expand:function(){var s=a(this);if(s.hasClass("fa-plus-circle")){s.removeClass("fa-plus-circle").addClass("fa-gear");var t=s.siblings("span.term").text(),r=s.closest("div.tree").data("ams-tree-context");MyAMS.ajax.post(r+"/get-nodes.json",{term:t},function(a){e.tree.displaySubNodes(t,a.nodes,s)})}else e.tree.collapse.call(this)},collapse:function(){var s=a(this);s.parents("span.label").siblings("ul.group").addClass("hidden"),s.removeClass("fa-minus-circle").addClass("fa-plus-circle")},updateTerm:function(s){var t=a('span.term:withtext("'+s.term+'")').siblings("i[data-ams-click-handler]");t.hasClass("fa-minus-circle")&&e.tree.collapse.call(t),e.tree.expand.call(t)},findTerm:function(s){MyAMS.ajax.post("get-parent-nodes.json",{term:s.term},function(s){e.tree.displaySubNodes(s.parent,s.nodes);var t=a('span.term:withtext("'+s.term+'")').parents("span.label");a("html,body").animate({scrollTop:t.offset().top-100},1e3),t.css("background-color","darkgreen").off("mouseover").on("mouseover",function(){a(this).css("background-color","")})})},switchExtract:function(){return function(){var s=a("i.fa",a(this)),t=s.parents("tr:first").data("ams-element-name");s.hasClass("fa-eye-slash")?e.tree.showExtract.call(this,t,s):e.tree.hideExtract.call(this,t,s)}},showExtract:function(s,e){a('i.extract-checker[data-ams-extract-name="'+s+'"]').css("visibility",""),e.removeClass("fa-eye-slash").removeClass("text-danger").addClass("fa-eye")},hideExtract:function(s,e){a('i.extract-checker[data-ams-extract-name="'+s+'"]').css("visibility","hidden"),e.removeClass("fa-eye").addClass("fa-eye-slash").addClass("text-danger")}},search:function(){var s=a(this).val();e.tree.findTerm({term:s})}};a(document).on("click","i.extract-checker",function(s){var e=a(this);if(!e.hasClass("disabled")){var t=a("span.term",e.closest("div").siblings("span"));MyAMS.ajax.post("switch-extract.json",{term:t.text(),extract:e.data("ams-extract-name")},function(s){s.status?MyAMS.ajax.handleJSON(s):s.used?(e.removeClass("fa-square-o").addClass("fa-square used"),a('>li >div i.extract-checker[data-ams-extract-name="'+s.extract+'"]',e.closest("div").siblings("ul.group")).removeClass("fa-square disabled").addClass("fa-square-o").css("color","#"+s.color)):(e.removeClass("fa-square used").addClass("fa-square-o"),a('i.extract-checker[data-ams-extract-name="'+s.extract+'"]',e.closest("div").siblings("ul.group")).removeClass("fa-square-o").addClass("fa-square disabled").css("color","silver"))})}}),s.PyAMS_thesaurus=e}(jQuery,this);