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

mbjspc

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mbjspc

javascript plugin item (jsplugin) dev tools

  • 6.4.12
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mbjspc

javascript plugin item (jsplugin) dev tools for motionboard

how to start

create typescript file has typename(classname)

e.g.

$ vi Yours.ts

import and declare its typename

// 1. default-import and declare your class.
import PluginObject from "mbjspc";

class Yours extends PluginObject {

    // 2. call constructor
    constructor(canvas: string) {
        super(canvas);
    }
}

output jsplugin source file

$ npx mbjspc Yours.ts
$ cat Yours.js # goal

before use

install typescript globally

$ npm i -g typescript
$ npx tsc # everywhere

display DOM in item window

create DOM and call this.itemDOM(div).

createChildren() { ...
    // the "div" what you created will follow item window on your screen.
    const div = document.createElement("div");
    this.itemDOM(div);
}

parse DOM as innerHTML and handle event with class method by calling this.macroHTML('').

    ...

    // macro __this___ will be instance of this on runtime
        d.innerHTML = this.macroHTML(`
<div>
    <button onclick='___this___.hoge()'>Click me</button>
    <button onclick='___this___.fuga()'>Click me</button>
</div>
        `);

        this.itemDOM(d);
    }
    hoge(){
        // your event handler of ___this___.hoge()
    }
    fuga(){
        // your event handler of ___this___.fuga()
    }

Keywords

FAQs

Package last updated on 01 Mar 2023

Did you know?

Socket

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.

Install

Related posts

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