- var action = button.attr('ui:action').split(':');
- var action_name = action[0];
- var action_data = action[1];
+ var hk = button.attr('ui:hotkey');
+ if(hk) hk = new Hotkey( parseInt(hk) );
+
+ try {
+ var params = $.evalJSON(button.attr('ui:action-params'));
+ } catch(object) {
+ $.log('JSON exception in ', button, ': ', object);
+ button.attr('disabled', 'disabled');
+ return;
+ }
+
+ var callback = function() {
+ editor.callScriptlet(button.attr('ui:action'), self, params);
+ };
+
+ // connect button
+ button.click(callback);
+
+ // connect hotkey
+ if(hk) {
+ self.hotkeys[hk.code] = callback;
+ // $.log('hotkey', hk);
+ }