JxLib Blog entry on MooTools.net

19 views
Skip to first unread message

Jon Bomgardner

unread,
Dec 26, 2011, 4:39:26 PM12/26/11
to jx...@googlegroups.com
All,

Be sure to check out and spread the word... JxLib now has a blog entry on Mootools.net. See it here: http://mootools.net/blog/2011/12/26/jxlib-an-introduction/

Jon

Paul Spencer

unread,
Dec 26, 2011, 10:20:28 PM12/26/11
to jx...@googlegroups.com
Excellent article, great work Jon!  Gave us a significant bump in traffic too, hopefully that will mean some new users and participants on the list!

Merry Christmas all

Paul

--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/w_Jb208iTe4J.
To post to this group, send email to jx...@googlegroups.com.
To unsubscribe from this group, send email to jxlib+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jxlib?hl=en.

Trevor Orr

unread,
Dec 26, 2011, 10:36:31 PM12/26/11
to jx...@googlegroups.com
I would have to agree, great article, makes me want to convert my old JxLib and MooTools  app to the latest JxLib and MooTools now hearing that it is probably not as big of a deal as thought it would be.

Jon Bomgardner

unread,
Dec 27, 2011, 10:43:06 AM12/27/11
to jx...@googlegroups.com
Exactly what I was hoping for.... I will say that I was a little surprised that they asked me to write it and I was quite grateful that they did.

Jon

Trevor Orr

unread,
Dec 27, 2011, 11:31:42 AM12/27/11
to jx...@googlegroups.com
Do you have any blog posts written about upgrading to the latest version of JxLib?  I guess my app was using version 2, not exactly what specific version since I can't seem to find a version number in the JxLib source.



On Tue, Dec 27, 2011 at 7:43 AM, Jon Bomgardner <jo...@comcast.net> wrote:
Exactly what I was hoping for.... I will say that I was a little surprised that they asked me to write it and I was quite grateful that they did.

Jon
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/GTkKGsVlQ-cJ.

Jon Bomgardner

unread,
Dec 27, 2011, 11:45:53 AM12/27/11
to jx...@googlegroups.com
There were no versions in the source prior to 3.0. I don't have anything on upgrading from 2 to 3 but am more than willing to answer any questions. There was a HUGE rewrite between 2 and 3 but we tried to keep the API as backwards compatible as possible though there are probably numerous places were we broke things. Probably the best thing to do is give it a try and ask questions as you need. I could try and write something up but it's been so long since we've had 3.0 that I don't remember much of 2....


Jon

Trevor Orr

unread,
Dec 27, 2011, 12:14:10 PM12/27/11
to jx...@googlegroups.com
No worries about writing anything if you haven't already, I just figured if you had something already done it would be worth reading before proceeding to update my app.  I will just fire off emails to you.



On Tue, Dec 27, 2011 at 8:45 AM, Jon Bomgardner <jo...@comcast.net> wrote:
There were no versions in the source prior to 3.0. I don't have anything on upgrading from 2 to 3 but am more than willing to answer any questions. There was a HUGE rewrite between 2 and 3 but we tried to keep the API as backwards compatible as possible though there are probably numerous places were we broke things. Probably the best thing to do is give it a try and ask questions as you need. I could try and write something up but it's been so long since we've had 3.0 that I don't remember much of 2....


Jon
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/TeSW0wxPj70J.

Jon Bomgardner

unread,
Dec 27, 2011, 1:10:51 PM12/27/11
to jx...@googlegroups.com
Sounds good!

Jon

Trevor Orr

unread,
Dec 27, 2011, 3:03:22 PM12/27/11
to jx...@googlegroups.com
Actually I don have one question before I start, in my app I use the context menu and I also have hot keys and a toolbar icon for everything as well, so I have the three eways to perform pretty much any action.  I was just wondering if there is anything in version 3 to process the handling of these in one place?  Right now I have 3 functions for handling these actions, 1 function for the actions for each place, context menu, keyboard or toolbar.



On Tue, Dec 27, 2011 at 10:10 AM, Jon Bomgardner <jo...@comcast.net> wrote:
Sounds good!

Jon
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/z0rydsz_DfAJ.

Jon Bomgardner

unread,
Dec 27, 2011, 3:55:07 PM12/27/11
to jx...@googlegroups.com
Unfortunately not at the moment. If each place uses the exact same code you could simply put the action in a class (or function) and then bind that single class method (or function) to the click handler in each place (though I imagine you're already doing something similar).

If you were going to design a solution to this, what would you do? I've run into this several times myself and perhaps having a single solution in the library would be well worth the work.

Jon

Trevor Orr

unread,
Dec 27, 2011, 4:37:57 PM12/27/11
to jx...@googlegroups.com
I was thinking of maybe dropping the context menu and then maybe adding a hot key to the toolbar icon, have not looked into any code at all so not sure how much would be involved in that.




Jon
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/y1_c5qnNle8J.

Trevor Orr

unread,
Dec 28, 2011, 12:23:07 PM12/28/11
to jx...@googlegroups.com
So my first thought to implementing hot keys would be to extend the Jx.Button class since the Jx.Menu.Item extends Jx.Button and the Menu Bar and Content Menus both use Jx.Menu.Item 

I thought using the Element.Event.Pseudo :keys would work but I was unable to get it to work.

I created a new class that extended Jx.Button and added this to the class and hard coded it just to see if it would work but it only works if the focus is currently on the button. So I guess I would have to use the MooTools Keyboard class instead.


initialize: function(options) {
this.parent(options);

  this.toElement().addEvent('keydown:keys(shift+a)', function(){
  alert('You pressed the following keys: shift a');
});
}

Jon Bomgardner

unread,
Dec 28, 2011, 9:42:11 PM12/28/11
to jx...@googlegroups.com
Actually, come to think of it, Conrad implemented keyboard support in dialogs using the Keyboard class so you might want to have a look at that. We may also want to think about a generalized keyboard utility class or methods (perhaps in Jx.Widget) that could provide an easy way to implement keyboard support for any widget that needs it.

Jon.

Jon Bomgardner

unread,
Dec 28, 2011, 9:45:02 PM12/28/11
to jx...@googlegroups.com
also, you could try adding the keydown listener to the window instead of the element itself (and do it in the init() method not in intialize):

init: function() {
  this.parent(options);

  window.addEvent('keydown:keys(shift+a)', function(){

    alert('You pressed the following keys: shift a');
  });
}

I didn't test this... just a shot in the dark.

Jon

Trevor Orr

unread,
Dec 28, 2011, 10:47:41 PM12/28/11
to jx...@googlegroups.com
From what I have been reading about the Keyboard class is that only one keyboard class instance can be active in a window at a time.  So if that is the case then you
 would not be able to have each button have it's own instance of a Keyboard class unless it was to be activated on focus and deactivated on blur.  

The only other thing I can think of would be to have a master event handler class that you could pass in an array of objects that would then assign the events functions, so something like the following, this is just something I thought about and sure it is even a good idea yet or not, but you could do something like:

var appEvents = new Array(
{
key: 'ctrl+c'
  ids: ['button_copy_id', 'context_copy_id', 'menu_copy_id']
func: doCopy
},
{
key: 'ctrl+x'
ids: ['button_cut_id', 'context_cut_id', 'menu_cut_id']
func: doCut
},
{
key: 'ctrl+v'
ids: ['button_paste_id', 'context_paste_id', 'menu_paste_id']
func: doPaste
 }
);


Then the class would assign the keydown events to a master keyboard instance using key as the key and func as the function to call and also add onclick handlers to the element specified in ids. 

Any of that make sense? or even worth while building to see if it would be useful functionality?



On Wed, Dec 28, 2011 at 6:42 PM, Jon Bomgardner <jo...@comcast.net> wrote:

Actually, come to think of it, Conrad implemented keyboard support in dialogs using the Keyboard class so you might want to have a look at that. We may also want to think about a generalized keyboard utility class or methods (perhaps in Jx.Widget) that could provide an easy way to implement keyboard support for any widget that needs it.

Jon.
--
You received this message because you are subscribed to the Google Groups "JxLib" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jxlib/-/ZQVR8_vR09QJ.
Reply all
Reply to author
Forward
0 new messages