ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Ecaradec's Software

Qatapult

<< < (39/67) > >>

ecaradec:
Tada ! I'm proud to say that the new version include the first part of the extension mecanism of Qatapult :

This part allows you to publish new items into Qatapult. You can read them in anything that is FAST to read. FAST is important because being slow here will impact everything you do in Qatapult.  I've attached an example that read a text file and returns results to Qatapult.The whole available api is demonstrated in the example as there is only 4 functions. You can also create your custom type by giving it a special name and adding extra parameters. Here is what the plugin look like :

function collect(query,results) {
    if(!results.expects('TEXT'))
        return;

    var fso=new ActiveXObject("Scripting.FileSystemObject");
    var f=fso.OpenTextFile("plugins\\snippets\\text.txt");

    var objects=[];
    while(!f.AtEndOfStream) {
        var l=f.ReadLine()
        if(qatapult.match(l,query)) {
            results.addObject('TEXT',l, {'key':l, 'text':l, 'icon':'plugins\\snippets\\text.png'}); // TEXT is the type here, you can use CONTACT or FILE or your own type
        }
    }
    f.Close();
}

--- End quote ---

Because this kind of plugin has to be fast, I think that there will be separate extension mecanism for indexing slower things than would run periodically and save the results inside the sqlite db.

pigeonlips:
downloaded and installed. I have no idea how to invoke it.  do we call this from a plugin.xml?

I'm not realy a dev so a little out my depth.

ewemoa:
New extension mechanism looks interesting!

Downloaded and installed latest Qatapult.zip and placed uncompressed content of snippets.zip in plugins folder -- as hinted at by the posted .js:


--- Code: Javascript ---var f=fso.OpenTextFile("plugins\\snippets\\text.txt");
Qatapult crashes on start up though -- this was with XP Pro SP3.

pigeonlips:
humm - i must be doing something wrong. Snippets extracted to plugins, qatapult loads a-ok but i have no idea how to make it work from here on out

pigeonlips:
do you have to run the .js first or is having it in the plugins folder enough?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version