From 17ecc2b7e180babc0d1827469e442254b5482613 Mon Sep 17 00:00:00 2001 From: Konloch Date: Sun, 13 Feb 2022 13:47:35 -0600 Subject: [PATCH] Updated JavaScript Template --- .../resources/templates/Template_Plugin.js | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/main/resources/templates/Template_Plugin.js b/src/main/resources/templates/Template_Plugin.js index ad9d1baf..80f3d39a 100644 --- a/src/main/resources/templates/Template_Plugin.js +++ b/src/main/resources/templates/Template_Plugin.js @@ -3,34 +3,45 @@ var PluginConsole = Java.type("the.bytecode.club.bytecodeviewer.api.PluginConsol var gui; /** - * Main function + ** [plugin description goes here] + ** + ** @author [your name goes here] + **/ + +/** + * execute function - this gets executed when the plugin is ran */ function execute(classNodeList) { + //create & show the console gui = new PluginConsole("Javascript Template"); - gui.setVisible(true); //show the console - out("Class Nodes: " + classNodeList.size()); + gui.setVisible(true); + + //print to the console + print("Class Nodes: " + classNodeList.size()); //iterate through each class node for (index = 0; index < classNodeList.length; index++) - process(classNodeList[index]); + processClassNode(classNodeList[index]); - BCV.hideFrame(gui, 10000); //hides the console after 10 seconds + //hide the console after 10 seconds + BCV.hideFrame(gui, 10000); } /** - * Process each class node + * process each class node */ -function process(cn) +function processClassNode(cn) { - out("Node: " + cn.name + ".class"); + print("Node: " + cn.name + ".class"); + //TODO developer plugin code goes here } /** - * Print to console + * print to console */ -function out(text) +function print(text) { gui.appendText(text); } \ No newline at end of file