diff options
Diffstat (limited to 'extensions/BMO/web/js')
-rw-r--r-- | extensions/BMO/web/js/edit_bug.js | 15 | ||||
-rw-r--r-- | extensions/BMO/web/js/edituser_menu.js | 26 |
2 files changed, 41 insertions, 0 deletions
diff --git a/extensions/BMO/web/js/edit_bug.js b/extensions/BMO/web/js/edit_bug.js index 6f0bc4587..5fc2ab6f7 100644 --- a/extensions/BMO/web/js/edit_bug.js +++ b/extensions/BMO/web/js/edit_bug.js @@ -54,3 +54,18 @@ function bmo_show_tracking_flags() { } } } + +// -- make attachment table, comments, new comment textarea equal widths + +YAHOO.util.Event.onDOMReady(function() { + var comment_tables = Dom.getElementsByClassName('bz_comment_table', 'table', 'comments'); + if (comment_tables.length) { + var comment_width = comment_tables[0].getElementsByTagName('td')[0].clientWidth + 'px'; + var attachment_table = Dom.get('attachment_table'); + if (attachment_table) + attachment_table.style.width = comment_width; + var new_comment = Dom.get('comment'); + if (new_comment) + new_comment.style.width = comment_width; + } +}); diff --git a/extensions/BMO/web/js/edituser_menu.js b/extensions/BMO/web/js/edituser_menu.js new file mode 100644 index 000000000..9ce78d9ce --- /dev/null +++ b/extensions/BMO/web/js/edituser_menu.js @@ -0,0 +1,26 @@ +var admin_usermenu; + +YAHOO.util.Event.onDOMReady(function() { + admin_usermenu = new YAHOO.widget.Menu('admin_usermenu', { position : 'dynamic' }); + admin_usermenu.addItems([ + { text: 'Edit', url: '#', target: '_new' }, + { text: 'Activity', url: '#', target: '_new' }, + { text: 'Mail', url: '#', target: '_new' } + ]); + admin_usermenu.render(document.body); +}); + +function show_admin_username(event, id, email) { + if (!admin_usermenu) + return; + admin_usermenu.getItem(0).cfg.setProperty('url', 'editusers.cgi?action=edit&userid=' + id); + admin_usermenu.getItem(1).cfg.setProperty('url', + 'page.cgi?id=user_activity.html&action=run' + + '&from=' + YAHOO.util.Date.format(new Date(new Date() - (1000 * 60 * 60 * 24 * 14)), {format: '%Y-%m-%d'}) + + '&to=' + YAHOO.util.Date.format(new Date(), {format: '%Y-%m-%d'}) + + '&who=' + escape(email)); + admin_usermenu.getItem(2).cfg.setProperty('url', 'mailto:' + escape(email)); + admin_usermenu.cfg.setProperty('xy', YAHOO.util.Event.getXY(event)); + admin_usermenu.show(); +} + |