Windmill Extensions

14 views
Skip to first unread message

sophiedmr

unread,
Nov 17, 2010, 6:54:40 AM11/17/10
to Windmill Developers
I am trying to write an extension but I can't seem to call to it.
The extensions.setWindowByName is there in the IDE but it doesn't seem
to be calling the javascript.
Am I missing something?

Thanks.

In my extensions.js I have:

windmill.controller.extensions = new function () {};


// Set the windmill.testWindow by iterating through the windowReg to
find a matching title
// @param {Object} paramObject The JavaScript object providing: title
//
windmill.controller.extensions.setWindowByName = function(paramObject)
{
alert("in function");

var name = paramObject.name;
var newW = windmill.testWin();
for (var i = 0; i < windmill.windowReg.length; i++)
{
try {
if (windmill.windowReg[i].name == name){
newW = windmill.windowReg[i];
}
} catch(err){
// The window reference is no longer valid, remove it
windmill.windowReg.splice(i,i);
}
}
windmill.controller.reWritePopups();
windmill.popup = newW;
};

windmill.registry.methods['extensions.setWindowByName'] = {
'locator': false,
'option': 'name'
};

Adam Christian

unread,
Nov 18, 2010, 6:02:27 PM11/18/10
to windmi...@googlegroups.com
Hi Sophie,

Can you show me the command you are using to start Windmill?

According to our wiki page you need to tell windmill where to find the extension: windmill shell firefox extensions=/path/to/ext tests=/path/to/tests http://www.example.com


Other than that, this looks correct, you aren't seeing this method in the drop down?

You can always check to see if the JS is there by opening firebug in the IDE and typing windmill.controller.extensions and see if it exists.

Adam

On Nov 17, 2010, at 3:54 AM, sophiedmr wrote:

I am trying to write an extension but I  can't seem to call to it.
The extensions.setWindowByName is there in the IDE but it doesn't seem
to be calling the javascript.
Am I missing something?

Thanks.

In my extensions.js I have:

windmill.controller.extensions = new function () {};


// Set the windmill.testWindow by iterating through the windowReg to
find a matching title
// @param {Object} paramObject The JavaScript object providing: title
//
windmill.controller.extensions.setWHi indowByName = function(paramObject)

{
alert("in function");

var name = paramObject.name;
var newW = windmill.testWin();
for (var i = 0; i < windmill.windowReg.length; i++)
{
try {
if (windmill.windowReg[i].name == name){
newW = windmill.windowReg[i];
}
} catch(err){
// The window reference is no longer valid, remove it
windmill.windowReg.splice(i,i);
}
}
windmill.controller.reWritePopups();
windmill.popup = newW;
};

windmill.registry.methods['extensions.setWindowByName'] = {
 'locator': false,
 'option': 'name'
};

--
You received this message because you are subscribed to the Google Groups "Windmill Developers" group.
To post to this group, send email to windmi...@googlegroups.com.
To unsubscribe from this group, send email to windmill-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/windmill-dev?hl=en.


Reply all
Reply to author
Forward
0 new messages