Version Description
- Changed the default ADMIN CSS.
- Textarea resizer.
Download this release
Release Info
Developer | Hiroaki Miyashita |
Plugin | Custom Field Template |
Version | 1.6.4 |
Comparing to | |
See all releases |
Code changes from version 1.6.3 to 1.6.4
- custom-field-template.php +44 -16
- js/grippie.png +0 -0
- js/jquery.textarearesizer.js +78 -0
- readme.txt +5 -1
custom-field-template.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Field Template
|
|
4 |
Plugin URI: http://wpgogo.com/development/custom-field-template.html
|
5 |
Description: This plugin adds the default custom fields on the Write Post/Page.
|
6 |
Author: Hiroaki Miyashita
|
7 |
-
Version: 1.6.
|
8 |
Author URI: http://wpgogo.com/
|
9 |
*/
|
10 |
|
@@ -499,6 +499,7 @@ class custom_field_template {
|
|
499 |
wp_enqueue_script( 'date', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/date.js', array('jquery') );
|
500 |
wp_enqueue_script( 'bgiframe', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.bgiframe.js', array('jquery') ) ;
|
501 |
wp_enqueue_script( 'datePicker', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.datePicker.js', array('jquery') );
|
|
|
502 |
}
|
503 |
|
504 |
function install_custom_field_template_data() {
|
@@ -565,14 +566,16 @@ type = file';
|
|
565 |
|
566 |
function install_custom_field_template_css() {
|
567 |
$options = get_option('custom_field_template_data');
|
568 |
-
$options['css'] = '#cft dl {
|
569 |
-
#cft
|
|
|
570 |
#cft dt .hideKey { visibility:hidden; }
|
571 |
-
#cft dd {
|
572 |
#cft dd p.label { font-weight:bold; margin:0; }
|
573 |
#cft_instruction { margin:10px; }
|
574 |
#cft fieldset { border:1px solid #CCC; margin:5px; padding:5px; }
|
575 |
#cft .mceStatusbar { padding-bottom:22px; }
|
|
|
576 |
';
|
577 |
update_option('custom_field_template_data', $options);
|
578 |
}
|
@@ -822,7 +825,32 @@ type = file';
|
|
822 |
$options = $this->get_custom_field_template_data();
|
823 |
$message = __('Options deleted.', 'custom-field-template');
|
824 |
endif;
|
|
|
|
|
|
|
|
|
|
|
825 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
826 |
<?php if ($message) : ?>
|
827 |
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
|
828 |
<?php endif; ?>
|
@@ -853,7 +881,7 @@ type = file';
|
|
853 |
<p><label for="custom_field_template_title[<?php echo $i; ?>]"><?php echo sprintf(__('Template Title', 'custom-field-template'), $i); ?></label>:<br />
|
854 |
<input type="text" name="custom_field_template_title[<?php echo $i; ?>]" id="custom_field_template_title[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['custom_fields'][$i]['title'])); ?>" size="80" /></p>
|
855 |
<p><label for="custom_field_template_instruction[<?php echo $i; ?>]"><a href="javascript:void(0);" onclick="jQuery(this).parent().next().next().toggle();"><?php echo sprintf(__('Template Instruction', 'custom-field-template'), $i); ?></a></label>:<br />
|
856 |
-
<textarea name="custom_field_template_instruction[<?php echo $i; ?>]" class="large-text" id="custom_field_template_instruction[<?php echo $i; ?>]" rows="5" cols="80"<?php if ( empty($options['custom_fields'][$i]['instruction']) ) : echo ' style="display:none;"'; endif; ?>><?php echo stripcslashes($options['custom_fields'][$i]['instruction']); ?></textarea></p>
|
857 |
<p><label for="custom_field_template_post_type[<?php echo $i; ?>]"><a href="javascript:void(0);" onclick="jQuery(this).parent().next().next().toggle();"><?php echo sprintf(__('Post Type', 'custom-field-template'), $i); ?></a></label>:<br />
|
858 |
<span<?php if ( empty($options['custom_fields'][$i]['post_type']) ) : echo ' style="display:none;"'; endif; ?>>
|
859 |
<input type="radio" name="custom_field_template_post_type[<?php echo $i; ?>]" id="custom_field_template_post_type[<?php echo $i; ?>]" value=""<?php if ( !$options['custom_fields'][$i]['post_type'] ) : echo ' checked="checked"'; endif; ?> /> <?php _e('Both', 'custom-field-template'); ?>
|
@@ -868,7 +896,7 @@ type = file';
|
|
868 |
<p><label for="custom_field_template_template_files[<?php echo $i; ?>]"><a href="javascript:void(0);" onclick="jQuery(this).parent().next().next().toggle();"><?php echo sprintf(__('Page Template file name(s) (comma-deliminated)', 'custom-field-template'), $i); ?></a></label>:<br />
|
869 |
<input type="text" name="custom_field_template_template_files[<?php echo $i; ?>]" id="custom_field_template_template_files[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['custom_fields'][$i]['template_files'])); ?>" size="80"<?php if ( empty($options['custom_fields'][$i]['template_files']) ) : echo ' style="display:none;"'; endif; ?> /></p>
|
870 |
<p><label for="custom_field_template_content[<?php echo $i; ?>]"><?php echo sprintf(__('Template Content', 'custom-field-template'), $i); ?></label>:<br />
|
871 |
-
<textarea name="custom_field_template_content[<?php echo $i; ?>]" class="large-text" id="custom_field_template_content[<?php echo $i; ?>]" rows="10" cols="80"><?php echo stripcslashes($options['custom_fields'][$i]['content']); ?></textarea></p>
|
872 |
</td></tr>
|
873 |
<?php
|
874 |
}
|
@@ -991,7 +1019,7 @@ type = file';
|
|
991 |
<table class="form-table" style="margin-bottom:5px;">
|
992 |
<tbody>
|
993 |
<tr><td>
|
994 |
-
<p><textarea name="custom_field_template_css" class="large-text" id="custom_field_template_css" rows="10" cols="80"><?php echo stripcslashes($options['css']); ?></textarea></p>
|
995 |
</td></tr>
|
996 |
<tr><td>
|
997 |
<p><input type="submit" name="custom_field_template_css_submit" value="<?php _e('Update Options »', 'custom-field-template'); ?>" class="button-primary" /></p>
|
@@ -1016,7 +1044,7 @@ type = file';
|
|
1016 |
?>
|
1017 |
<tr><th><strong>FORMAT #<?php echo $i; ?></strong></th></tr>
|
1018 |
<tr><td>
|
1019 |
-
<p><textarea name="custom_field_template_shortcode_format[<?php echo $i; ?>]" class="large-text" rows="10" cols="80"><?php echo stripcslashes($options['shortcode_format'][$i]); ?></textarea></p>
|
1020 |
<p><label><input type="checkbox" name="custom_field_template_shortcode_format_use_php[<?php echo $i; ?>]" value="1" <?php if ($options['shortcode_format_use_php'][$i]) { echo ' checked="checked"'; } ?> /> <?php _e('Use PHP', 'custom-field-template'); ?></label></p>
|
1021 |
</td></tr>
|
1022 |
<?php
|
@@ -1048,7 +1076,7 @@ ex. `radio` and `select`:</dt><dd>$values = array('dog', 'cat', 'monkey'); $defa
|
|
1048 |
?>
|
1049 |
<tr><th><strong>CODE #<?php echo $i; ?></strong></th></tr>
|
1050 |
<tr><td>
|
1051 |
-
<p><textarea name="custom_field_template_php[]" class="large-text" rows="10" cols="80"><?php echo stripcslashes($options['php'][$i]); ?></textarea></p>
|
1052 |
</td></tr>
|
1053 |
<?php
|
1054 |
endfor;
|
@@ -1087,7 +1115,7 @@ ex. `radio` and `select`:</dt><dd>$values = array('dog', 'cat', 'monkey'); $defa
|
|
1087 |
<input type="text" name="custom_field_template_hook_custom_post_type[<?php echo $i; ?>]" id="custom_field_template_hook_custom_post_type[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['hook'][$i]['custom_post_type'])); ?>" size="80" /></p>
|
1088 |
<p><label for="custom_field_template_hook_category[<?php echo $i; ?>]"><?php echo sprintf(__('Category ID (comma-deliminated)', 'custom-field-template'), $i); ?></label>:<br />
|
1089 |
<input type="text" name="custom_field_template_hook_category[<?php echo $i; ?>]" id="custom_field_template_hook_category[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['hook'][$i]['category'])); ?>" size="80" /></p>
|
1090 |
-
<p><label for="custom_field_template_hook_content[<?php echo $i; ?>]"><?php echo sprintf(__('Content', 'custom-field-template'), $i); ?></label>:<br /><textarea name="custom_field_template_hook_content[<?php echo $i; ?>]" class="large-text" rows="5" cols="80"><?php echo stripcslashes($options['hook'][$i]['content']); ?></textarea></p>
|
1091 |
<p><input type="checkbox" name="custom_field_template_hook_use_php[<?php echo $i; ?>]" id="custom_field_template_hook_use_php[<?php echo $i; ?>]" value="1" <?php if ($options['hook'][$i]['use_php']) { echo ' checked="checked"'; } ?> /> <?php _e('Use PHP', 'custom-field-template'); ?></p>
|
1092 |
<p><input type="checkbox" name="custom_field_template_hook_feed[<?php echo $i; ?>]" id="custom_field_template_hook_feed[<?php echo $i; ?>]" value="1" <?php if ($options['hook'][$i]['feed']) { echo ' checked="checked"'; } ?> /> <?php _e('Apply to feeds', 'custom-field-template'); ?></p>
|
1093 |
</td></tr>
|
@@ -1472,7 +1500,7 @@ jQuery(this).addClass("closed");
|
|
1472 |
endif;
|
1473 |
|
1474 |
$out .=
|
1475 |
-
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '">' .
|
1476 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span>'.$addfield.'</dt>' .
|
1477 |
'<dd>';
|
1478 |
|
@@ -1534,7 +1562,7 @@ jQuery(this).addClass("closed");
|
|
1534 |
$id = $name . $sid . '_' . $cftnum . '_' . $this->sanitize_name( $value );
|
1535 |
|
1536 |
$out .=
|
1537 |
-
'<dl id="dl_' . $id . '">' .
|
1538 |
'<dt><span' . $hide . '>' . $title . '</span></dt>' .
|
1539 |
'<dd>';
|
1540 |
|
@@ -1593,7 +1621,7 @@ jQuery(this).addClass("closed");
|
|
1593 |
endif;
|
1594 |
|
1595 |
$out .=
|
1596 |
-
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '">' .
|
1597 |
'<dt><span' . $hide . '>' . $title . '</span>'.$addfield;
|
1598 |
|
1599 |
if( $clearButton == true ) {
|
@@ -1673,7 +1701,7 @@ jQuery(this).addClass("closed");
|
|
1673 |
endif;
|
1674 |
|
1675 |
$out .=
|
1676 |
-
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '">' .
|
1677 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span>'.$addfield.'</dt>' .
|
1678 |
'<dd>';
|
1679 |
|
@@ -1795,7 +1823,7 @@ jQuery(this).addClass("closed");
|
|
1795 |
endforeach;
|
1796 |
|
1797 |
$out .=
|
1798 |
-
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '">' .
|
1799 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span><br />' . $media . $switch . '</dt>' .
|
1800 |
'<dd>';
|
1801 |
|
@@ -1847,7 +1875,7 @@ jQuery(this).addClass("closed");
|
|
1847 |
endif;
|
1848 |
|
1849 |
$out .=
|
1850 |
-
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '">' .
|
1851 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span>'.$addfield.'</dt>' .
|
1852 |
'<dd>';
|
1853 |
|
4 |
Plugin URI: http://wpgogo.com/development/custom-field-template.html
|
5 |
Description: This plugin adds the default custom fields on the Write Post/Page.
|
6 |
Author: Hiroaki Miyashita
|
7 |
+
Version: 1.6.4
|
8 |
Author URI: http://wpgogo.com/
|
9 |
*/
|
10 |
|
499 |
wp_enqueue_script( 'date', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/date.js', array('jquery') );
|
500 |
wp_enqueue_script( 'bgiframe', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.bgiframe.js', array('jquery') ) ;
|
501 |
wp_enqueue_script( 'datePicker', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.datePicker.js', array('jquery') );
|
502 |
+
wp_enqueue_script( 'textarearesizer', '/' . PLUGINDIR . '/' . $plugin_dir . '/js/jquery.textarearesizer.js', array('jquery') );
|
503 |
}
|
504 |
|
505 |
function install_custom_field_template_data() {
|
566 |
|
567 |
function install_custom_field_template_css() {
|
568 |
$options = get_option('custom_field_template_data');
|
569 |
+
$options['css'] = '#cft dl { margin:10px 0; }
|
570 |
+
#cft dl:after { content:" "; clear:both; height:0; display:block; visibility:hidden; }
|
571 |
+
#cft dt { width:20%; clear:both; float:left; display:inline; font-weight:bold; text-align:center; }
|
572 |
#cft dt .hideKey { visibility:hidden; }
|
573 |
+
#cft dd { margin:0 0 0 21%; }
|
574 |
#cft dd p.label { font-weight:bold; margin:0; }
|
575 |
#cft_instruction { margin:10px; }
|
576 |
#cft fieldset { border:1px solid #CCC; margin:5px; padding:5px; }
|
577 |
#cft .mceStatusbar { padding-bottom:22px; }
|
578 |
+
#cft .dl_checkbox { margin:0; }
|
579 |
';
|
580 |
update_option('custom_field_template_data', $options);
|
581 |
}
|
825 |
$options = $this->get_custom_field_template_data();
|
826 |
$message = __('Options deleted.', 'custom-field-template');
|
827 |
endif;
|
828 |
+
|
829 |
+
if ( !defined('WP_PLUGIN_DIR') )
|
830 |
+
$plugin_dir = str_replace( ABSPATH, '', dirname(__FILE__) );
|
831 |
+
else
|
832 |
+
$plugin_dir = dirname( plugin_basename(__FILE__) );
|
833 |
?>
|
834 |
+
<style type="text/css">
|
835 |
+
div.grippie {
|
836 |
+
background:#EEEEEE url(<?php echo '../' . PLUGINDIR . '/' . $plugin_dir . '/js/'; ?>grippie.png) no-repeat scroll center 2px;
|
837 |
+
border-color:#DDDDDD;
|
838 |
+
border-style:solid;
|
839 |
+
border-width:0pt 1px 1px;
|
840 |
+
cursor:s-resize;
|
841 |
+
height:9px;
|
842 |
+
overflow:hidden;
|
843 |
+
}
|
844 |
+
.resizable-textarea textarea {
|
845 |
+
display:block;
|
846 |
+
margin-bottom:0pt;
|
847 |
+
}
|
848 |
+
</style>
|
849 |
+
<script type="text/javascript">
|
850 |
+
jQuery(document).ready(function() {
|
851 |
+
jQuery('textarea.resizable:not(.processed)').TextAreaResizer();
|
852 |
+
});
|
853 |
+
</script>
|
854 |
<?php if ($message) : ?>
|
855 |
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
|
856 |
<?php endif; ?>
|
881 |
<p><label for="custom_field_template_title[<?php echo $i; ?>]"><?php echo sprintf(__('Template Title', 'custom-field-template'), $i); ?></label>:<br />
|
882 |
<input type="text" name="custom_field_template_title[<?php echo $i; ?>]" id="custom_field_template_title[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['custom_fields'][$i]['title'])); ?>" size="80" /></p>
|
883 |
<p><label for="custom_field_template_instruction[<?php echo $i; ?>]"><a href="javascript:void(0);" onclick="jQuery(this).parent().next().next().toggle();"><?php echo sprintf(__('Template Instruction', 'custom-field-template'), $i); ?></a></label>:<br />
|
884 |
+
<textarea class="large-text" name="custom_field_template_instruction[<?php echo $i; ?>]" class="large-text" id="custom_field_template_instruction[<?php echo $i; ?>]" rows="5" cols="80"<?php if ( empty($options['custom_fields'][$i]['instruction']) ) : echo ' style="display:none;"'; endif; ?>><?php echo stripcslashes($options['custom_fields'][$i]['instruction']); ?></textarea></p>
|
885 |
<p><label for="custom_field_template_post_type[<?php echo $i; ?>]"><a href="javascript:void(0);" onclick="jQuery(this).parent().next().next().toggle();"><?php echo sprintf(__('Post Type', 'custom-field-template'), $i); ?></a></label>:<br />
|
886 |
<span<?php if ( empty($options['custom_fields'][$i]['post_type']) ) : echo ' style="display:none;"'; endif; ?>>
|
887 |
<input type="radio" name="custom_field_template_post_type[<?php echo $i; ?>]" id="custom_field_template_post_type[<?php echo $i; ?>]" value=""<?php if ( !$options['custom_fields'][$i]['post_type'] ) : echo ' checked="checked"'; endif; ?> /> <?php _e('Both', 'custom-field-template'); ?>
|
896 |
<p><label for="custom_field_template_template_files[<?php echo $i; ?>]"><a href="javascript:void(0);" onclick="jQuery(this).parent().next().next().toggle();"><?php echo sprintf(__('Page Template file name(s) (comma-deliminated)', 'custom-field-template'), $i); ?></a></label>:<br />
|
897 |
<input type="text" name="custom_field_template_template_files[<?php echo $i; ?>]" id="custom_field_template_template_files[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['custom_fields'][$i]['template_files'])); ?>" size="80"<?php if ( empty($options['custom_fields'][$i]['template_files']) ) : echo ' style="display:none;"'; endif; ?> /></p>
|
898 |
<p><label for="custom_field_template_content[<?php echo $i; ?>]"><?php echo sprintf(__('Template Content', 'custom-field-template'), $i); ?></label>:<br />
|
899 |
+
<textarea name="custom_field_template_content[<?php echo $i; ?>]" class="resizable large-text" id="custom_field_template_content[<?php echo $i; ?>]" rows="10" cols="80"><?php echo stripcslashes($options['custom_fields'][$i]['content']); ?></textarea></p>
|
900 |
</td></tr>
|
901 |
<?php
|
902 |
}
|
1019 |
<table class="form-table" style="margin-bottom:5px;">
|
1020 |
<tbody>
|
1021 |
<tr><td>
|
1022 |
+
<p><textarea name="custom_field_template_css" class="large-text resizable" id="custom_field_template_css" rows="10" cols="80"><?php echo stripcslashes($options['css']); ?></textarea></p>
|
1023 |
</td></tr>
|
1024 |
<tr><td>
|
1025 |
<p><input type="submit" name="custom_field_template_css_submit" value="<?php _e('Update Options »', 'custom-field-template'); ?>" class="button-primary" /></p>
|
1044 |
?>
|
1045 |
<tr><th><strong>FORMAT #<?php echo $i; ?></strong></th></tr>
|
1046 |
<tr><td>
|
1047 |
+
<p><textarea name="custom_field_template_shortcode_format[<?php echo $i; ?>]" class="large-text resizable" rows="10" cols="80"><?php echo stripcslashes($options['shortcode_format'][$i]); ?></textarea></p>
|
1048 |
<p><label><input type="checkbox" name="custom_field_template_shortcode_format_use_php[<?php echo $i; ?>]" value="1" <?php if ($options['shortcode_format_use_php'][$i]) { echo ' checked="checked"'; } ?> /> <?php _e('Use PHP', 'custom-field-template'); ?></label></p>
|
1049 |
</td></tr>
|
1050 |
<?php
|
1076 |
?>
|
1077 |
<tr><th><strong>CODE #<?php echo $i; ?></strong></th></tr>
|
1078 |
<tr><td>
|
1079 |
+
<p><textarea name="custom_field_template_php[]" class="large-text resizable" rows="10" cols="80"><?php echo stripcslashes($options['php'][$i]); ?></textarea></p>
|
1080 |
</td></tr>
|
1081 |
<?php
|
1082 |
endfor;
|
1115 |
<input type="text" name="custom_field_template_hook_custom_post_type[<?php echo $i; ?>]" id="custom_field_template_hook_custom_post_type[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['hook'][$i]['custom_post_type'])); ?>" size="80" /></p>
|
1116 |
<p><label for="custom_field_template_hook_category[<?php echo $i; ?>]"><?php echo sprintf(__('Category ID (comma-deliminated)', 'custom-field-template'), $i); ?></label>:<br />
|
1117 |
<input type="text" name="custom_field_template_hook_category[<?php echo $i; ?>]" id="custom_field_template_hook_category[<?php echo $i; ?>]" value="<?php echo attribute_escape(stripcslashes($options['hook'][$i]['category'])); ?>" size="80" /></p>
|
1118 |
+
<p><label for="custom_field_template_hook_content[<?php echo $i; ?>]"><?php echo sprintf(__('Content', 'custom-field-template'), $i); ?></label>:<br /><textarea name="custom_field_template_hook_content[<?php echo $i; ?>]" class="large-text resizable" rows="5" cols="80"><?php echo stripcslashes($options['hook'][$i]['content']); ?></textarea></p>
|
1119 |
<p><input type="checkbox" name="custom_field_template_hook_use_php[<?php echo $i; ?>]" id="custom_field_template_hook_use_php[<?php echo $i; ?>]" value="1" <?php if ($options['hook'][$i]['use_php']) { echo ' checked="checked"'; } ?> /> <?php _e('Use PHP', 'custom-field-template'); ?></p>
|
1120 |
<p><input type="checkbox" name="custom_field_template_hook_feed[<?php echo $i; ?>]" id="custom_field_template_hook_feed[<?php echo $i; ?>]" value="1" <?php if ($options['hook'][$i]['feed']) { echo ' checked="checked"'; } ?> /> <?php _e('Apply to feeds', 'custom-field-template'); ?></p>
|
1121 |
</td></tr>
|
1500 |
endif;
|
1501 |
|
1502 |
$out .=
|
1503 |
+
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '" class="dl_text">' .
|
1504 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span>'.$addfield.'</dt>' .
|
1505 |
'<dd>';
|
1506 |
|
1562 |
$id = $name . $sid . '_' . $cftnum . '_' . $this->sanitize_name( $value );
|
1563 |
|
1564 |
$out .=
|
1565 |
+
'<dl id="dl_' . $id . '" class="dl_checkbox">' .
|
1566 |
'<dt><span' . $hide . '>' . $title . '</span></dt>' .
|
1567 |
'<dd>';
|
1568 |
|
1621 |
endif;
|
1622 |
|
1623 |
$out .=
|
1624 |
+
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '" class="dl_radio">' .
|
1625 |
'<dt><span' . $hide . '>' . $title . '</span>'.$addfield;
|
1626 |
|
1627 |
if( $clearButton == true ) {
|
1701 |
endif;
|
1702 |
|
1703 |
$out .=
|
1704 |
+
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '" class="dl_select">' .
|
1705 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span>'.$addfield.'</dt>' .
|
1706 |
'<dd>';
|
1707 |
|
1823 |
endforeach;
|
1824 |
|
1825 |
$out .=
|
1826 |
+
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '" class="dl_textarea">' .
|
1827 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span><br />' . $media . $switch . '</dt>' .
|
1828 |
'<dd>';
|
1829 |
|
1875 |
endif;
|
1876 |
|
1877 |
$out .=
|
1878 |
+
'<dl id="dl_' . $name . $sid . '_' . $cftnum . '" class="dl_file">' .
|
1879 |
'<dt><span' . $hide . '><label for="' . $name . $sid . '_' . $cftnum . '">' . $title . '</label></span>'.$addfield.'</dt>' .
|
1880 |
'<dd>';
|
1881 |
|
js/grippie.png
ADDED
Binary file
|
js/jquery.textarearesizer.js
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
jQuery TextAreaResizer plugin
|
3 |
+
Created on 17th January 2008 by Ryan O'Dell
|
4 |
+
Version 1.0.4
|
5 |
+
|
6 |
+
Converted from Drupal -> textarea.js
|
7 |
+
Found source: http://plugins.jquery.com/misc/textarea.js
|
8 |
+
$Id: textarea.js,v 1.11.2.1 2007/04/18 02:41:19 drumm Exp $
|
9 |
+
|
10 |
+
1.0.1 Updates to missing global 'var', added extra global variables, fixed multiple instances, improved iFrame support
|
11 |
+
1.0.2 Updates according to textarea.focus
|
12 |
+
1.0.3 Further updates including removing the textarea.focus and moving private variables to top
|
13 |
+
1.0.4 Re-instated the blur/focus events, according to information supplied by dec
|
14 |
+
|
15 |
+
|
16 |
+
*/
|
17 |
+
(function($) {
|
18 |
+
/* private variable "oHover" used to determine if you're still hovering over the same element */
|
19 |
+
var textarea, staticOffset; // added the var declaration for 'staticOffset' thanks to issue logged by dec.
|
20 |
+
var iLastMousePos = 0;
|
21 |
+
var iMin = 32;
|
22 |
+
var grip;
|
23 |
+
/* TextAreaResizer plugin */
|
24 |
+
$.fn.TextAreaResizer = function() {
|
25 |
+
return this.each(function() {
|
26 |
+
textarea = $(this).addClass('processed'), staticOffset = null;
|
27 |
+
|
28 |
+
// 18-01-08 jQuery bind to pass data element rather than direct mousedown - Ryan O'Dell
|
29 |
+
// When wrapping the text area, work around an IE margin bug. See:
|
30 |
+
// http://jaspan.com/ie-inherited-margin-bug-form-elements-and-haslayout
|
31 |
+
$(this).wrap('<div class="resizable-textarea"><span></span></div>')
|
32 |
+
.parent().append($('<div class="grippie"></div>').bind("mousedown",{el: this} , startDrag));
|
33 |
+
|
34 |
+
var grippie = $('div.grippie', $(this).parent())[0];
|
35 |
+
grippie.style.marginRight = (grippie.offsetWidth - $(this)[0].offsetWidth) +'px';
|
36 |
+
|
37 |
+
});
|
38 |
+
};
|
39 |
+
/* private functions */
|
40 |
+
function startDrag(e) {
|
41 |
+
textarea = $(e.data.el);
|
42 |
+
textarea.blur();
|
43 |
+
iLastMousePos = mousePosition(e).y;
|
44 |
+
staticOffset = textarea.height() - iLastMousePos;
|
45 |
+
textarea.css('opacity', 0.25);
|
46 |
+
$(document).mousemove(performDrag).mouseup(endDrag);
|
47 |
+
return false;
|
48 |
+
}
|
49 |
+
|
50 |
+
function performDrag(e) {
|
51 |
+
var iThisMousePos = mousePosition(e).y;
|
52 |
+
var iMousePos = staticOffset + iThisMousePos;
|
53 |
+
if (iLastMousePos >= (iThisMousePos)) {
|
54 |
+
iMousePos -= 5;
|
55 |
+
}
|
56 |
+
iLastMousePos = iThisMousePos;
|
57 |
+
iMousePos = Math.max(iMin, iMousePos);
|
58 |
+
textarea.height(iMousePos + 'px');
|
59 |
+
if (iMousePos < iMin) {
|
60 |
+
endDrag(e);
|
61 |
+
}
|
62 |
+
return false;
|
63 |
+
}
|
64 |
+
|
65 |
+
function endDrag(e) {
|
66 |
+
$(document).unbind('mousemove', performDrag).unbind('mouseup', endDrag);
|
67 |
+
textarea.css('opacity', 1);
|
68 |
+
textarea.focus();
|
69 |
+
textarea = null;
|
70 |
+
staticOffset = null;
|
71 |
+
iLastMousePos = 0;
|
72 |
+
}
|
73 |
+
|
74 |
+
function mousePosition(e) {
|
75 |
+
return { x: e.clientX + document.documentElement.scrollLeft, y: e.clientY + document.documentElement.scrollTop };
|
76 |
+
};
|
77 |
+
})(jQuery);
|
78 |
+
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpgogo.com/development/custom-field-template.html
|
|
4 |
Tags: custom, fields, field, template, meta, custom field, custom fields, custom field template
|
5 |
Requires at least: 2.1
|
6 |
Tested up to: 3.0
|
7 |
-
Stable tag: 1.6.
|
8 |
|
9 |
This plugin adds the default custom fields on the Write Post/Page.
|
10 |
|
@@ -101,6 +101,10 @@ See the default template and modify it.
|
|
101 |
|
102 |
== Changelog ==
|
103 |
|
|
|
|
|
|
|
|
|
104 |
= 1.6.3 =
|
105 |
* Bugfix: useb disable button.
|
106 |
|
4 |
Tags: custom, fields, field, template, meta, custom field, custom fields, custom field template
|
5 |
Requires at least: 2.1
|
6 |
Tested up to: 3.0
|
7 |
+
Stable tag: 1.6.4
|
8 |
|
9 |
This plugin adds the default custom fields on the Write Post/Page.
|
10 |
|
101 |
|
102 |
== Changelog ==
|
103 |
|
104 |
+
= 1.6.4 =
|
105 |
+
* Changed the default ADMIN CSS.
|
106 |
+
* Textarea resizer.
|
107 |
+
|
108 |
= 1.6.3 =
|
109 |
* Bugfix: useb disable button.
|
110 |
|