
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
TreeView is a little plugin to generate a tree view. TreeView is powered by jQuery and jQuery drawing plugin. It only supports Rails 3.1.
http://benzhang.me/files/medium_tree_view.jpg
Add this line to your gemfile
gem 'tree_view'
then run the install command to copy the assets to vendor.
rails g tree_view:install
include necessary javascript and stylesheet files.
Add these files to your application.js
//= require jquery.dimensions.min.js
//= require jquery.drawinglibrary.js
//= require jquery.svg.min.js
//= require tree_view.drawline.js
Add the stylesheet to your application.css
//= require tree_view
If you have a model with tree structure (you might use tree or ancestry gem), you can simple invoke tree_view helper, and pass the root node of the tree.
In controller
@root = Policy.root
In View
<%= tree_view(@root) %>
To customise the content or each view you can simple pass a block and can
# generate html tree view helper
#
# @param root [model instance] the root node of the tree structure
# @param opt [Hash] the options to generate tree nodes
# :css [String] the wrapper div's css
# :drawline [true, false] whether draw lines among each nodes
# :node_css [String] the css for each node
# :order_by [sym] the order of the children
# @param &block [code block] if you want to customise the content of each tree node, just passing a code block
def tree_view(root, opt = {}, &block)
Copyright (c) 2011 Ben Zhang, released under the MIT license
FAQs
Unknown package
We found that tree_view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.