Closed WinterSilence closed 4 years ago
If you only want to create output window you can use following snippet.
function CreateOutputView(name){
var view = new Dialog({
npp: Editor,
html: "<div id='output' style='margin:0; padding:0; width:100%; height:100%;'></div>",
title: "Output",
css: "body, html{background-color: buttonface; overflow:auto; padding:0em; margin:0em}",
oncreate: function(){
var outputEl = this.getElementById("output");
this.Dialog.log = function (msg){
outputEl.innerHTML += "<div>"+msg+"</div>";
if (!view.htmlDialog.visible)
console.show();
}
},
dockable:{
name: name,
docking:"bottom",
onclose:function(){
},
onbeforeclose:function(){
return false;
}
}
});
return view;
}
var console = CreateOutputView("PHP");
console.log("my cool output");
Take a look inside of jN/includes/Dialog.js
for more insights.
@sieukrem thanks, yet another few questions:
var fso = new ActiveXObject("Scripting.FileSystemObject");
Where find list of objects like as Scripting.FileSystemObject
? var plugin = new Library("../notepad++/plugins/foo/foo.dll");
Can I use something like this? And how grab/stub function from dll's?I assume you did not find the Wiki pages, they are not so present on github as the *.md files.
var fso = new ActiveXObject("Scripting.FileSystemObject");
Where find list of objects like asScripting.FileSystemObject
?
I linked some microsoft pages in Helpful scripts article
var plugin = new Library("../notepad++/plugins/foo/foo.dll");
Can I use something like this? And how grab/stub function from dll's?
Explanation how jN dispatches native calls.
I also use messages from scripts in N++ my implementation: https://github.com/trdm/jn-npp-scripts/blob/master/includes/intelMessage.js
@sieukrem little doto (: move Dialog.js
to lib/
- i think class Dialog
required somewhere in "core" and remove it :(
How display result in console of plugin
NppExec
? Or how create same console?