Refine Options page

* "Default Display Style" option - Update control label
 * "ThickBox on Text Links" option - Change from radio button to checkbox
 * Page title, CSS, etc.
This commit is contained in:
attosoft committed 2012-05-20 12:56:54 +00:00
1 parent efa4582324
commit bc62f4c4ba
3 files changed
+25 -23

No files matched your search

+15 -19
View File
@@ -77,32 +77,30 @@ jQuery(function($) {
<table class="form-table">
<tr>
<th scope="row"><?php _e('Default Display Style', 'auto-thickbox'); ?></th>
<td colspan="2">
<td>
<label><input type="radio" name="auto-thickbox-plus[thickbox_style]" value="single"<?php $this->checked($this->options['thickbox_style'], 'single'); ?> />
<?php _e('Single Image (explicitly specify a@rel attribute as needed)', 'auto-thickbox'); ?></label><br />
<?php _e('Single Image', 'auto-thickbox'); ?> (<code>&lt;a href="image">&lt;img />&lt;/a></code>)</label><br />
<label><input type="radio" name="auto-thickbox-plus[thickbox_style]" value="gallery"<?php $this->checked($this->options['thickbox_style'], 'gallery'); ?> />
<?php _e('Gallery Images (automatically set a@rel attribute in \'gallery-id\' format)', 'auto-thickbox'); ?></label>
<?php _e('Gallery Images', 'auto-thickbox'); ?> (<code>&lt;a href="image" rel="gallery-id">&lt;img />&lt;/a></code>)</label>
</td>
</tr>
<tr>
<th scope="row"><?php _e('ThickBox on Text Links', 'auto-thickbox'); ?></th>
<td colspan="2">
<label><input type="radio" name="auto-thickbox-plus[thickbox_text]" value="auto"<?php $this->checked($this->options['thickbox_text'], 'auto'); ?> />
<?php _e('Auto (automatically set a@class=&quot;thickbox&quot;)', 'auto-thickbox'); ?></label><br />
<label><input type="radio" name="auto-thickbox-plus[thickbox_text]" value="manual"<?php $this->checked($this->options['thickbox_text'], 'manual'); ?> />
<?php _e('Manual (explicitly specify a@class=&quot;thickbox&quot; as needed)', 'auto-thickbox'); ?></label>
<th scope="row"><?php _e('Auto ThickBox', 'auto-thickbox'); ?></th>
<td>
<label><input type="checkbox" name="auto-thickbox-plus[thickbox_text]"<?php $this->checked($this->options['thickbox_text'], 'on'); ?> />
<?php _e('Text links to images', 'auto-thickbox'); ?> (<code>&lt;a href="image">text&lt;/a></code>)</label>
</td>
</tr>
<tr>
<th scope="row"><?php _e('Auto Resize', 'auto-thickbox'); ?></th>
<td colspan="2">
<td>
<label><input type="checkbox" name="auto-thickbox-plus[auto_resize]"<?php $this->checked($this->options['auto_resize'], 'on'); ?> />
<?php _e('Enabled'); ?></label>
</td>
</tr>
<tr>
<th scope="row"><?php _e('ThickBox Resources', 'auto-thickbox'); ?></th>
<td colspan="2">
<td>
<label class="item"><input type="radio" name="auto-thickbox-plus[script_place]" value="header"<?php $this->checked($this->options['script_place'], 'header'); $this->disabled($builtin_res_checked); ?> />
<?php _e('Header'); ?></label>
<label class="item"><input type="radio" name="auto-thickbox-plus[script_place]" value="footer"<?php $this->checked($this->options['script_place'], 'footer'); $this->disabled($builtin_res_checked); ?> />
@@ -111,7 +109,7 @@ jQuery(function($) {
</tr>
<tr>
<th scope="row"></th>
<td colspan="2">
<td>
<label><input type="checkbox" name="auto-thickbox-plus[builtin_res]"<?php $this->checked($builtin_res_checked); ?> onclick="disablePlaceOption(this)" />
<?php _e('Use WordPress built-in thickbox.js/css (some extra features will be disabled)', 'auto-thickbox'); ?></label>
</td>
@@ -729,7 +727,7 @@ jQuery(function($) {
<?php _e('Fade', 'auto-thickbox'); ?></label>
<label class="item"><input type="radio" name="auto-thickbox-plus[effect_title]" value="none"<?php $this->checked($this->options['effect_title'], 'none'); $this->disabled($effect_title_disabled); ?> onclick="disableHideInitOption(this)" />
<?php echo $this->texts['none']; ?></label>
<label class="item" style="margin-left:3px"><input type="checkbox" name="auto-thickbox-plus[hide_title]" <?php $this->checked($this->options['hide_title'], 'on'); $this->disabled($this->options['effect_title'], 'none'); ?> />
<label class="item" style="margin-left:3px"><input type="checkbox" name="auto-thickbox-plus[hide_title]"<?php $this->checked($this->options['hide_title'], 'on'); $this->disabled($this->options['effect_title'], 'none'); ?> />
<?php _e('Hide initially', 'auto-thickbox'); ?></label>
</td>
</tr>
@@ -744,7 +742,7 @@ jQuery(function($) {
<?php _e('Fade', 'auto-thickbox'); ?></label>
<label class="item"><input type="radio" name="auto-thickbox-plus[effect_cap]" value="none"<?php $this->checked($this->options['effect_cap'], 'none'); $this->disabled($effect_cap_disabled); ?> onclick="disableHideInitOption(this)" />
<?php echo $this->texts['none']; ?></label>
<label class="item" style="margin-left:3px"><input type="checkbox" name="auto-thickbox-plus[hide_cap]" <?php $this->checked($this->options['hide_cap'], 'on'); $this->disabled($this->options['effect_cap'], 'none'); ?> />
<label class="item" style="margin-left:3px"><input type="checkbox" name="auto-thickbox-plus[hide_cap]"<?php $this->checked($this->options['hide_cap'], 'on'); $this->disabled($this->options['effect_cap'], 'none'); ?> />
<?php _e('Hide initially', 'auto-thickbox'); ?></label>
</td>
</tr>
@@ -825,12 +823,10 @@ jQuery(function($) {
register_setting( 'auto-thickbox-plus-options', 'auto-thickbox-plus', array(&$this, 'options_callback') );
}
var $checkboxes_on = array('auto_resize', 'builtin_res',
'drag_img_move', 'drag_img_resize',
'drag_content_move', 'drag_content_resize',
var $checkboxes_on = array('thickbox_text', 'auto_resize',
'key_close_esc', 'key_close_enter',
'key_prev_angle', 'key_prev_left', 'key_prev_tab', 'key_prev_space', 'key_prev_bs',
'key_next_angle', 'key_next_right', 'key_next_tab', 'key_next_space',
'key_prev_angle', 'key_prev_left',
'key_next_angle', 'key_next_right',
'key_end_home_end');
function options_callback($options) {
+1 -1
View File
@@ -7,7 +7,7 @@
label.item, input.button { margin-right:3px; }
.form-table th { width: 190px; }
.form-table th { width: 180px; font-weight: bold; }
.colorpreview {
-moz-border-radius: 4px;
+9 -3
View File
@@ -64,7 +64,7 @@ class auto_thickbox {
* @return anchor $anchor
**/
function image($anchor) {
if ( $this->options['thickbox_text'] == 'manual' && !preg_match("/^\s*<\s*img\s.+?>\s*$/is", $anchor['body']) )
if ( $this->options['thickbox_text'] == 'off' && !preg_match("/^\s*<\s*img\s.+?>\s*$/is", $anchor['body']) )
return $anchor;
if ( !$anchor['attr']['class'] ) {
@@ -422,7 +422,7 @@ SCRIPT;
$this->options_def = array(
'thickbox_style' => 'single',
'thickbox_text' => 'auto',
'thickbox_text' => 'on',
'auto_resize' => 'on',
'builtin_res' => 'off',
'script_place' => 'header',
@@ -535,6 +535,12 @@ SCRIPT;
update_option('auto-thickbox-plus', $this->options);
}
// XXX: transition code for v1.5 or earlier
if ($this->options['thickbox_text'] == 'auto' || $this->options['thickbox_text'] == 'manual') {
$this->options['thickbox_text'] = $this->options['thickbox_text'] == 'auto' ? 'on' : 'off';
update_option('auto-thickbox-plus', $this->options);
}
$this->is_en_locale = strpos(get_locale(), 'en') !== false;
$this->texts['next'] = $this->gettext('Next &gt;', array('Next &raquo;'));
$this->texts['next2'] = trim(str_replace(array('&gt;', '&raquo;'), '', $this->texts['next']));
@@ -547,7 +553,7 @@ SCRIPT;
$this->texts['close'] = ucfirst($this->gettext('Close', array('close')));
$full_colon = html_entity_decode('&#xFF1A;', ENT_NOQUOTES, 'UTF-8');
$this->texts['options'] = $this->gettext('Options:', array('Options', 'Settings'));
$this->texts['options'] = AUTO_THICKBOX_PLUS . ' - ' . str_replace(array(':', $full_colon), '', $this->texts['options']);
$this->texts['options'] = AUTO_THICKBOX_PLUS . ' ' . str_replace(array(':', $full_colon), '', $this->texts['options']);
$this->texts['action'] = $this->gettext('Action', array('Actions'));
$this->texts['load'] = $this->gettext('Loading&#8230;', array('Loading...'));