Skip to content

Commit

Permalink
Make the "Keep Markup" section more user friendly FancyThemes#29
Browse files Browse the repository at this point in the history
  • Loading branch information
aprea committed May 16, 2014
1 parent bceb350 commit df70d0a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
12 changes: 11 additions & 1 deletion asset/js/advanced-excerpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@
$('#read-more').attr('disabled','disabled');
}
});


$('#dont-remove-any-markup').change(function(event){
if( $(this).is(':checked') ){
$('#tags-table tr').not(':first-child').hide();
$('.tags-control').hide();
} else {
$('#tags-table tr').not(':first-child').show();
$('.tags-control').show();
}
});

// Add a tag to the checkbox table
$('#add-tag').click(function(event){
event.preventDefault();
Expand Down
25 changes: 14 additions & 11 deletions template/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@
<table id="tags-table">
<tr>
<td colspan="<?php echo $tag_cols; ?>">
<label for="allowed-tags">
<input name="allowed_tags[]" type="checkbox" id="allowed-tags" value="_all" <?php echo ( in_array( '_all', $allowed_tags ) ) ? 'checked="checked" ' : ''; ?> />
<label for="dont-remove-any-markup">
<input name="allowed_tags[]" type="checkbox" id="dont-remove-any-markup" value="_all" <?php echo ( in_array( '_all', $allowed_tags ) ) ? 'checked="checked" ' : ''; ?> />
<?php _e( "Don't remove any markup", 'advanced-excerpt' ); ?>
</label>
</td>
Expand All @@ -166,7 +166,7 @@
foreach ( $tag_list as $tag ) :
if ( $tag == '_all' ) continue;
if ( 0 == $i % $tag_cols ) : ?>
<tr>
<tr<?php echo ( in_array( '_all', $allowed_tags ) ) ? ' style="display: none;"' : '' ?>>
<?php endif; $i++; ?>
<td>
<label for="<?php echo 'ae-' . $tag; ?>">
Expand All @@ -186,15 +186,18 @@
<?php endif; ?>
</table>

<a href="" id="select-all"><?php _e( "Select all", 'advanced-excerpt' ); ?></a> / <a href="" id="select-none"><?php _e( "Select none", 'advanced-excerpt' ); ?></a><br />
<?php _e( "More tags", 'advanced-excerpt' ); ?>
<select name="more_tags" id="more-tags">
<?php foreach ( array_diff( $this->options_all_tags, $this->options_basic_tags ) as $tag ) : ?>
<option value="<?php echo $tag; ?>"><?php echo $tag; ?></option>
<?php endforeach; ?>
</select>
<div class="tags-control"<?php echo ( in_array( '_all', $allowed_tags ) ) ? ' style="display: none;"' : '' ?>>
<a href="" id="select-all"><?php _e( "Select all", 'advanced-excerpt' ); ?></a> / <a href="" id="select-none"><?php _e( "Select none", 'advanced-excerpt' ); ?></a><br />
<?php _e( "More tags", 'advanced-excerpt' ); ?>
<select name="more_tags" id="more-tags">
<?php foreach ( array_diff( $this->options_all_tags, $this->options_basic_tags ) as $tag ) : ?>
<option value="<?php echo $tag; ?>"><?php echo $tag; ?></option>
<?php endforeach; ?>
</select>

<input type="button" name="add_tag" id="add-tag" class="button" value="<?php _e( "Add tag", 'advanced-excerpt' ); ?>" />
</div>

<input type="button" name="add_tag" id="add-tag" class="button" value="<?php _e( "Add tag", 'advanced-excerpt' ); ?>" />
</td>
</tr>
</table>
Expand Down

0 comments on commit df70d0a

Please sign in to comment.