| 41 | | |
|---|
| | 61 | var cp = new ColorPicker(); |
|---|
| | 62 | |
|---|
| | 63 | function pickColor(color) { |
|---|
| | 64 | $('name').style.color = color; |
|---|
| | 65 | $('desc').style.color = color; |
|---|
| | 66 | $('textcolor').value = color; |
|---|
| | 67 | } |
|---|
| | 68 | function PopupWindow_hidePopup(magicword) { |
|---|
| | 69 | if ( magicword != 'prettyplease' ) |
|---|
| | 70 | return false; |
|---|
| | 71 | if (this.divName != null) { |
|---|
| | 72 | if (this.use_gebi) { |
|---|
| | 73 | document.getElementById(this.divName).style.visibility = "hidden"; |
|---|
| | 74 | } |
|---|
| | 75 | else if (this.use_css) { |
|---|
| | 76 | document.all[this.divName].style.visibility = "hidden"; |
|---|
| | 77 | } |
|---|
| | 78 | else if (this.use_layers) { |
|---|
| | 79 | document.layers[this.divName].visibility = "hidden"; |
|---|
| | 80 | } |
|---|
| | 81 | } |
|---|
| | 82 | else { |
|---|
| | 83 | if (this.popupWindow && !this.popupWindow.closed) { |
|---|
| | 84 | this.popupWindow.close(); |
|---|
| | 85 | this.popupWindow = null; |
|---|
| | 86 | } |
|---|
| | 87 | } |
|---|
| | 88 | return false; |
|---|
| | 89 | } |
|---|
| | 90 | function colorSelect(t,p) { |
|---|
| | 91 | if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" ) { |
|---|
| | 92 | cp.hidePopup('prettyplease'); |
|---|
| | 93 | } else { |
|---|
| | 94 | cp.p = p; |
|---|
| | 95 | cp.select(t,p); |
|---|
| | 96 | } |
|---|
| | 97 | } |
|---|
| | 98 | function colorDefault() { |
|---|
| | 99 | pickColor('#<?php echo HEADER_TEXTCOLOR; ?>'); |
|---|
| | 100 | } |
|---|
| | 101 | |
|---|
| | 102 | function hide_text() { |
|---|
| | 103 | $('name').style.display = 'none'; |
|---|
| | 104 | $('desc').style.display = 'none'; |
|---|
| | 105 | $('pickcolor').style.display = 'none'; |
|---|
| | 106 | $('defaultcolor').style.display = 'none'; |
|---|
| | 107 | $('textcolor').value = 'blank'; |
|---|
| | 108 | $('hidetext').value = '<?php _e('Show Text'); ?>'; |
|---|
| | 109 | // $('hidetext').onclick = 'show_text()'; |
|---|
| | 110 | Event.observe( $('hidetext'), 'click', show_text ); |
|---|
| | 111 | } |
|---|
| | 112 | |
|---|
| | 113 | function show_text() { |
|---|
| | 114 | $('name').style.display = 'block'; |
|---|
| | 115 | $('desc').style.display = 'block'; |
|---|
| | 116 | $('pickcolor').style.display = 'inline'; |
|---|
| | 117 | $('defaultcolor').style.display = 'inline'; |
|---|
| | 118 | $('textcolor').value = '<?php echo HEADER_TEXTCOLOR; ?>'; |
|---|
| | 119 | $('hidetext').value = '<?php _e('Hide Text'); ?>'; |
|---|
| | 120 | Event.stopObserving( $('hidetext'), 'click', show_text ); |
|---|
| | 121 | Event.observe( $('hidetext'), 'click', hide_text ); |
|---|
| | 122 | } |
|---|
| | 123 | |
|---|
| | 124 | <?php if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) ) { ?> |
|---|
| | 125 | Event.observe( window, 'load', hide_text ); |
|---|
| | 126 | <?php } ?> |
|---|
| | 127 | |
|---|
| | 128 | </script> |
|---|
| | 129 | <?php |
|---|
| | 130 | } |
|---|
| | 131 | |
|---|
| | 132 | function js_2() { ?> |
|---|
| | 133 | <script type="text/javascript"> |
|---|
| 80 | | |
|---|
| 81 | | var cp = new ColorPicker(); |
|---|
| 82 | | |
|---|
| 83 | | function pickColor(color) { |
|---|
| 84 | | $('name').style.color = color; |
|---|
| 85 | | $('desc').style.color = color; |
|---|
| 86 | | $('textcolor').value = color; |
|---|
| 87 | | } |
|---|
| 88 | | function PopupWindow_hidePopup(magicword) { |
|---|
| 89 | | if ( magicword != 'prettyplease' ) |
|---|
| 90 | | return false; |
|---|
| 91 | | if (this.divName != null) { |
|---|
| 92 | | if (this.use_gebi) { |
|---|
| 93 | | document.getElementById(this.divName).style.visibility = "hidden"; |
|---|
| 94 | | } |
|---|
| 95 | | else if (this.use_css) { |
|---|
| 96 | | document.all[this.divName].style.visibility = "hidden"; |
|---|
| 97 | | } |
|---|
| 98 | | else if (this.use_layers) { |
|---|
| 99 | | document.layers[this.divName].visibility = "hidden"; |
|---|
| 100 | | } |
|---|
| 101 | | } |
|---|
| 102 | | else { |
|---|
| 103 | | if (this.popupWindow && !this.popupWindow.closed) { |
|---|
| 104 | | this.popupWindow.close(); |
|---|
| 105 | | this.popupWindow = null; |
|---|
| 106 | | } |
|---|
| 107 | | } |
|---|
| 108 | | return false; |
|---|
| 109 | | } |
|---|
| 110 | | function colorSelect(t,p) { |
|---|
| 111 | | if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" ) { |
|---|
| 112 | | cp.hidePopup('prettyplease'); |
|---|
| 113 | | } else { |
|---|
| 114 | | cp.p = p; |
|---|
| 115 | | cp.select(t,p); |
|---|
| 116 | | } |
|---|
| 117 | | } |
|---|
| 118 | | function colorDefault() { |
|---|
| 119 | | pickColor('<?php echo HEADER_TEXTCOLOR; ?>'); |
|---|
| 120 | | } |
|---|
| 121 | | |
|---|
| 122 | | function hide_text() { |
|---|
| 123 | | $('name').style.display = 'none'; |
|---|
| 124 | | $('desc').style.display = 'none'; |
|---|
| 125 | | $('pickcolor').style.display = 'none'; |
|---|
| 126 | | $('defaultcolor').style.display = 'none'; |
|---|
| 127 | | $('textcolor').value = 'blank'; |
|---|
| 128 | | $('hidetext').value = '<?php _e('Show Text'); ?>'; |
|---|
| 129 | | // $('hidetext').onclick = 'show_text()'; |
|---|
| 130 | | Event.observe( $('hidetext'), 'click', show_text ); |
|---|
| 131 | | } |
|---|
| 132 | | |
|---|
| 133 | | function show_text() { |
|---|
| 134 | | $('name').style.display = 'block'; |
|---|
| 135 | | $('desc').style.display = 'block'; |
|---|
| 136 | | $('pickcolor').style.display = 'inline'; |
|---|
| 137 | | $('defaultcolor').style.display = 'inline'; |
|---|
| 138 | | $('textcolor').value = '<?php echo HEADER_TEXTCOLOR; ?>'; |
|---|
| 139 | | $('hidetext').value = '<?php _e('Hide Text'); ?>'; |
|---|
| 140 | | Event.stopObserving( $('hidetext'), 'click', show_text ); |
|---|
| 141 | | Event.observe( $('hidetext'), 'click', hide_text ); |
|---|
| 142 | | } |
|---|
| 143 | | |
|---|
| 144 | | <?php if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) ) { ?> |
|---|
| 145 | | Event.observe( window, 'load', hide_text ); |
|---|
| 146 | | <?php } ?> |
|---|
| 147 | | |
|---|