What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [IDEA] plusQuery

[IDEA] plusQuery
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: [IDEA] plusQuery
I've had a similar idea once, mainly because I would love to assign and remove event handlers like in jQuery (with bind() and unbind()).

However, if you would want to actually make such framework for Plus! scripts, you're going to need to find a way to create regular OnEvent_* functions in your script and mirror these to your framework. After some testing, I found that it was possible to create these in run-time by manually creating an extra script file and loading that with MsgPlus.LoadScriptFile. The problem is that you can't assign window event handlers without knowing their IDs to create OnWindowIdEvent_* handlers. To get these IDs, you'd need to ask the user of your framework to name all used windows in your script at initialization and whenever the user adds an extra window, he/she must remember to add it into the list.

One solution could be to ask for the paths to the interface XML files and collect all window IDs at initialization. The result of this scanning process could then be cached inside ScriptInfo.xml. The created script file with all mirrored events could be cached in a similar fashion. However these are all nasty workarounds, it is tough to do it right on top of the current scripting environment.

As for selecting objects with CSS-like queries, I don't think scripts would benefit from it that much. In the HTML DOM, it's good to have a selector engine since the current JavaScript functions aren't sufficient for modern scripts and there are many browser inconsistencies to overcome when crawling through the DOM. It's also a very logical way to select elements with CSS-like queries, since we're used to do that in CSS and thus we know exactly what we should expect.

I doubt this query language would make sense in Plus! scripting. Surely, you could have object types as tag names, attribute selectors and descendants, but why would you need all that? I think it's good to be able to plusQuerify an object and dynamically bind events on it, but why do you need to be able to select these objects like that? Most of the time, Plus! already gives you the object you need as event parameter, so just $(ChatWnd) should be enough.

quote:
Originally posted by Spunky
I like the idea, but it'd be hard to implement I think. Then you either have to ship the file with every script that uses it giving you multiple copies on the same user's PC, or find a way to download it from an online source and execute it into the current script.
I think such a library shouldn't get much larger than 10 to 15 kB when properly minified. Besides, if it's a good library which really makes scripting easier, the file size doesn't matter that much anyway.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
07-13-2010 07:55 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[IDEA] plusQuery - by Amec on 07-13-2010 at 04:43 AM
RE: [IDEA] plusQuery - by Spunky on 07-13-2010 at 06:29 AM
RE: [IDEA] plusQuery - by Matti on 07-13-2010 at 07:55 AM
RE: [IDEA] plusQuery - by CookieRevised on 07-13-2010 at 11:47 PM
RE: [IDEA] plusQuery - by Matti on 07-14-2010 at 10:28 AM
RE: [IDEA] plusQuery - by Amec on 04-06-2011 at 04:34 AM
RE: [IDEA] plusQuery - by Matti on 04-06-2011 at 09:43 AM
RE: RE: [IDEA] plusQuery - by Amec on 04-06-2011 at 11:12 AM
RE: [IDEA] plusQuery - by matty on 04-06-2011 at 12:46 PM
RE: [IDEA] plusQuery - by Amec on 04-06-2011 at 02:07 PM
RE: [IDEA] plusQuery - by Matti on 04-06-2011 at 03:03 PM
RE: RE: [IDEA] plusQuery - by Amec on 04-06-2011 at 04:11 PM
RE: [IDEA] plusQuery - by matty on 04-06-2011 at 05:19 PM
RE: [IDEA] plusQuery - by Eljay on 04-06-2011 at 06:03 PM
RE: [IDEA] plusQuery - by Matti on 04-06-2011 at 06:11 PM
RE: [IDEA] plusQuery - by Eljay on 04-06-2011 at 06:20 PM
RE: [IDEA] plusQuery - by CookieRevised on 04-06-2011 at 10:27 PM
RE: [IDEA] plusQuery - by Amec on 04-07-2011 at 05:43 AM
RE: [IDEA] plusQuery - by CookieRevised on 04-07-2011 at 09:36 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On