Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #*** IMPORTS ***
- import os
- from Npp import *
- def addBlock(title, tabs):
- editor.addText(tabs + "// " + title + " //\n" + tabs + "\n" + tabs + "\n" + tabs + "\n")
- input = notepad.prompt("Specify a class name.", "Class Wizzard")
- input = input.split()
- className = input[0]
- input.pop(0)
- classExtends = input
- notepad.new()
- notepad.menuCommand(MENUCOMMAND.LANG_JS)
- editor.addText("\nfunction " + className + " () {\n")
- for inheritedClassName in classExtends:
- editor.addText("\t" + inheritedClassName + ".call(this);\n")
- addBlock("Constructor", "\t")
- editor.addText("}\n")
- for inheritedClassName in classExtends:
- editor.addText("Object.assign(" + className + ".prototype, " + inheritedClassName + ".prototype);\n")
- editor.addText("\n")
- addBlock("Functions", "")
- addBlock("Statics", "")
- notepad.save()
- # Supports inheritance. When creating a class simply enter the class name. All names that follow seperated by a space will be used to extend this class.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement