New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jstree-actions

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstree-actions - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

15

jstree-actions.js

@@ -1,3 +0,14 @@

(function ($, undefined) {
(function (factory) {
"use strict";
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
}
else if(typeof module !== 'undefined' && module.exports) {
module.exports = factory(require('jquery'));
}
else {
factory(jQuery);
}
}(function ($, undefined) {
"use strict";

@@ -166,2 +177,2 @@ $.jstree.defaults.actions = $.noop;

})(jQuery);
}));

2

jstree-actions.min.js

@@ -1,1 +0,1 @@

!function(a,b){"use strict";a.jstree.defaults.actions=a.noop,a.jstree.plugins.actions=function(a,b){this._actions={},this.add_action=function(a,b){var c=this;a="object"==typeof a?a:[a];for(var d=0;d<a.length;d++){var e=a[d],f=c._actions[e]=c._actions[e]||[];c._has_action(e,b.id)||f.push(b)}this.redraw(!0)},this.remove_action=function(a,b){for(var c=this,d="object"==typeof a?a:"all"===a?Object.keys(this._actions).concat("all"):[a],e=0;e<d.length;e++){a=d[e];for(var f=c._actions[a]||[],g=[],h=0;h<f.length;h++){var i=f[h];i.id!==b&&"all"!==b&&g.push(i)}c._actions[a]=g}this.redraw(!0)},this._create_action=function(a,b){var c=this,d=this._get_action(a,b);if(null===d)return null;var e=document.createElement("i");return e.className=d.class,e.textContent=d.text,e.onclick=function(){var f=c.get_node(e);d.callback(a,f,b,e)},{action:d,action_el:e}},this._get_action=function(a,b){for(var c=this._actions[a]||[],d=null,e=0;e<c.length;e++){var f=c[e];f.id===b&&(d=f)}return d},this._set_action=function(a,b,c){if(null!==c){var d=b.querySelector(c.action.selector);c.action.after?d.parentNode.insertBefore(c.action_el,d.nextSibling):b.insertBefore(c.action_el,d)}},this._has_action=function(a,b){var c=!1,d=this._actions;if(d.hasOwnProperty(a))for(var e=0;e<d[a].length;e++)d[a][e].id===b&&(c=!0);if(this._actions.hasOwnProperty("all"))for(e=0;e<d.all.length;e++)d.all[e].id===b&&(c=!0);return c},this.redraw_node=function(a,c,d,e){var f=this,g="object"==typeof a?a.id:a,h=b.redraw_node.call(this,a,c,d,e);if(h){for(var i=this._actions[g]||[],j=0;j<i.length;j++){var k=f._create_action(g,i[j].id);f._set_action(g,h,k)}for(i=this._actions.all||[],j=0;j<i.length;j++)k=f._create_action("all",i[j].id),f._set_action(g,h,k)}return h}}}(jQuery);
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";t.jstree.defaults.actions=t.noop,t.jstree.plugins.actions=function(t,e){this._actions={},this.add_action=function(t,e){var n=this;t=typeof t===Object?t:[t];for(var i=0;i<t.length;i++){var a=t[i],o=n._actions[a]=n._actions[a]||[];n._has_action(a,e.id)||o.push(e)}this.redraw(!0)},this.remove_action=function(t,e){for(var n=this,i=typeof t===Object?t:"all"===t?Object.keys(this._actions).concat("all"):[t],a=0;a<i.length;a++){t=i[a];for(var o=n._actions[t]||[],r=[],c=0;c<o.length;c++){var s=o[c];s.id!==e&&"all"!==e&&r.push(s)}n._actions[t]=r}this.redraw(!0)},this._create_action=function(t,e){var n=this,i=this._get_action(t,e);if(null===i)return null;var a=document.createElement("i");return a.className=i["class"],a.textContent=i.text,a.onclick=function(){var o=n.get_node(a);i.callback(t,o,e,a)},{action:i,action_el:a}},this._get_action=function(t,e){for(var n=this._actions[t]||[],i=null,a=0;a<n.length;a++){var o=n[a];o.id===e&&(i=o)}return i},this._set_action=function(t,e,n){if(null!==n){var i=e.querySelector(n.action.selector);n.action.after?i.parentNode.insertBefore(n.action_el,i.nextSibling):e.insertBefore(n.action_el,i)}},this._has_action=function(t,e){var n=!1,i=this._actions;if(i.hasOwnProperty(t))for(var a=0;a<i[t].length;a++)i[t][a].id===e&&(n=!0);if(this._actions.hasOwnProperty("all"))for(a=0;a<i.all.length;a++)i.all[a].id===e&&(n=!0);return n},this.redraw_node=function(t,n,i,a){var o=this,r="object"==typeof t?t.id:t,c=e.redraw_node.call(this,t,n,i,a);if(c){for(var s=this._actions[r]||[],l=0;l<s.length;l++){var _=o._create_action(r,s[l].id);o._set_action(r,c,_)}for(s=this._actions.all||[],l=0;l<s.length;l++)_=o._create_action("all",s[l].id),o._set_action(r,c,_)}return c}}});
{
"name": "jstree-actions",
"version": "0.1.1",
"version": "0.1.2",
"description": "jstree plugin that allows adding actions on each node",

@@ -5,0 +5,0 @@ "main": "jstree-actions.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc