admin.php
15 years ago
edit.php
16 years ago
scripts.js
15 years ago
styles-rtl.css
15 years ago
styles.css
15 years ago
taggenerator.js
16 years ago
scripts.js
116 lines
| 1 | (function($) { |
| 2 | |
| 3 | $(function() { |
| 4 | try { |
| 5 | $.extend($.tgPanes, _wpcf7.tagGenerators); |
| 6 | $('#taggenerator').tagGenerator(_wpcf7L10n.generateTag, |
| 7 | { dropdownIconUrl: _wpcf7.pluginUrl + '/images/dropdown.gif' }); |
| 8 | |
| 9 | $('input#wpcf7-title:enabled').css({ |
| 10 | cursor: 'pointer' |
| 11 | }); |
| 12 | |
| 13 | $('input#wpcf7-title').mouseover(function() { |
| 14 | $(this).not('.focus').css({ |
| 15 | 'background-color': '#ffffdd' |
| 16 | }); |
| 17 | }); |
| 18 | |
| 19 | $('input#wpcf7-title').mouseout(function() { |
| 20 | $(this).css({ |
| 21 | 'background-color': '#fff' |
| 22 | }); |
| 23 | }); |
| 24 | |
| 25 | $('input#wpcf7-title').focus(function() { |
| 26 | $(this).addClass('focus'); |
| 27 | $(this).css({ |
| 28 | cursor: 'text', |
| 29 | color: '#333', |
| 30 | border: '1px solid #777', |
| 31 | font: 'normal 13px Verdana, Arial, Helvetica, sans-serif', |
| 32 | 'background-color': '#fff' |
| 33 | }); |
| 34 | }); |
| 35 | |
| 36 | $('input#wpcf7-title').blur(function() { |
| 37 | $(this).removeClass('focus'); |
| 38 | $(this).css({ |
| 39 | cursor: 'pointer', |
| 40 | color: '#555', |
| 41 | border: 'none', |
| 42 | font: 'bold 20px serif', |
| 43 | 'background-color': '#fff' |
| 44 | }); |
| 45 | }); |
| 46 | |
| 47 | $('input#wpcf7-title').change(function() { |
| 48 | updateTag(); |
| 49 | }); |
| 50 | |
| 51 | updateTag(); |
| 52 | |
| 53 | if ($.support.objectAll) { |
| 54 | if (! $('#wpcf7-mail-2-active').is(':checked')) |
| 55 | $('#mail-2-fields').hide(); |
| 56 | |
| 57 | $('#wpcf7-mail-2-active').click(function() { |
| 58 | if ($('#mail-2-fields').is(':hidden') |
| 59 | && $('#wpcf7-mail-2-active').is(':checked')) { |
| 60 | $('#mail-2-fields').slideDown('fast'); |
| 61 | } else if ($('#mail-2-fields').is(':visible') |
| 62 | && $('#wpcf7-mail-2-active').not(':checked')) { |
| 63 | $('#mail-2-fields').slideUp('fast'); |
| 64 | } |
| 65 | }); |
| 66 | } |
| 67 | |
| 68 | $('#message-fields-toggle-switch').text(_wpcf7L10n.show); |
| 69 | $('#message-fields').hide(); |
| 70 | |
| 71 | $('#message-fields-toggle-switch').click(function() { |
| 72 | if ($('#message-fields').is(':hidden')) { |
| 73 | $('#message-fields').slideDown('fast'); |
| 74 | $('#message-fields-toggle-switch').text(_wpcf7L10n.hide); |
| 75 | } else { |
| 76 | $('#message-fields').hide('fast'); |
| 77 | $('#message-fields-toggle-switch').text(_wpcf7L10n.show); |
| 78 | } |
| 79 | }); |
| 80 | |
| 81 | if ('' == $.trim($('#wpcf7-additional-settings').text())) { |
| 82 | $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.show); |
| 83 | $('#additional-settings-fields').hide(); |
| 84 | } else { |
| 85 | $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.hide); |
| 86 | $('#additional-settings-fields').show(); |
| 87 | } |
| 88 | |
| 89 | $('#additional-settings-fields-toggle-switch').click(function() { |
| 90 | if ($('#additional-settings-fields').is(':hidden')) { |
| 91 | $('#additional-settings-fields').slideDown('fast'); |
| 92 | $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.hide); |
| 93 | } else { |
| 94 | $('#additional-settings-fields').hide('fast'); |
| 95 | $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.show); |
| 96 | } |
| 97 | }); |
| 98 | |
| 99 | } catch (e) { |
| 100 | } |
| 101 | }); |
| 102 | |
| 103 | function updateTag() { |
| 104 | var title = $('input#wpcf7-title').val(); |
| 105 | |
| 106 | if (title) |
| 107 | title = title.replace(/["'\[\]]/g, ''); |
| 108 | |
| 109 | $('input#wpcf7-title').val(title); |
| 110 | var current = $('input#wpcf7-id').val(); |
| 111 | var tag = '[contact-form ' + current + ' "' + title + '"]'; |
| 112 | |
| 113 | $('input#contact-form-anchor-text').val(tag); |
| 114 | } |
| 115 | |
| 116 | })(jQuery); |