| | |
| | | // turn a group of fieldsets into tabs |
| | | $('.tabbed').each(function(idx, elem){ init_tabs(elem); }) |
| | | |
| | | $(document.body).bind('mouseup', body_mouseup) |
| | | .bind('keyup', function(e){ |
| | | if (e.keyCode == 27) { |
| | | for (var id in popups) { |
| | | if (popups[id].is(':visible')) |
| | | show_popup(id, false); |
| | | // decorate select elements |
| | | if (!bw.opera) { |
| | | $('select.decorated').each(function(){ |
| | | var title = $('option', this).first().text(); |
| | | if ($('option:selected', this).val() != '') |
| | | title = $('option:selected', this).text(); |
| | | var select = $(this) |
| | | .change(function(){ |
| | | var val = $('option:selected', this).text(); |
| | | $(this).next().children().html(val); |
| | | }); |
| | | |
| | | $('<a class="menuselector dropdownselector"><span class="handle">' + title + '</span></a>') |
| | | .css('position', 'absolute') |
| | | .offset(select.position()) |
| | | .insertAfter(select) |
| | | .children().width(select.outerWidth() - 40); |
| | | |
| | | select.parent().css('position', 'relative'); |
| | | }); |
| | | } |
| | | |
| | | $(document.body) |
| | | .bind('mouseup', body_mouseup) |
| | | .bind('keyup', function(e){ |
| | | if (e.keyCode == 27) { |
| | | for (var id in popups) { |
| | | if (popups[id].is(':visible')) |
| | | show_popup(id, false); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | $('iframe').load(function(e){ |
| | | // this = iframe |
| | |
| | | function toggle_preview_headers(button) |
| | | { |
| | | $('#preview-shortheaders').toggle(); |
| | | var full = $('#preview-allheaders').toggle(); |
| | | |
| | | var full = $('#preview-allheaders').toggle(), |
| | | button = $('a#previewheaderstoggle'); |
| | | |
| | | // add toggle button to full headers table |
| | | if (!full.data('mod')) { |
| | | $('<a>').attr('href', '#hide') |
| | | .addClass('iconlink remove') |
| | | .html('Hide') |
| | | .appendTo($('<td>').appendTo($('tr:first', full))) |
| | | .click(function(){ toggle_preview_headers(this);return false }); |
| | | full.data('mod', true); |
| | | } |
| | | if (full.is(':visible')) |
| | | button.attr('href', '#hide').removeClass('add').addClass('remove') |
| | | else |
| | | button.attr('href', '#details').removeClass('remove').addClass('add') |
| | | } |
| | | |
| | | |