Skip to content

Commit

Permalink
Read more options revisions FancyThemes#28
Browse files Browse the repository at this point in the history
  • Loading branch information
aprea committed May 16, 2014
1 parent c8bd4ca commit bceb350
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions asset/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
.advanced-excerpt #tags-table td {
padding: 0px 20px 30px 0px;
}
.advanced-excerpt #read-more {
margin-top: 7px;
}
.advanced-excerpt .monospaced {
font-family: Consolas,Monaco,monospace;
}
Expand Down
8 changes: 8 additions & 0 deletions asset/js/advanced-excerpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
$('#the-content-no-break').attr('checked', false);
}
});

$('#add-link').change(function(event){
if( $(this).is(':checked') ){
$('#read-more').removeAttr('disabled');
} else {
$('#read-more').attr('disabled','disabled');
}
});

// Add a tag to the checkbox table
$('#add-tag').click(function(event){
Expand Down
4 changes: 4 additions & 0 deletions asset/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
}
}

#read-more {
margin-top: 7px;
}

.monospaced {
font-family: Consolas,Monaco,monospace;
}
Expand Down
2 changes: 1 addition & 1 deletion class/advanced-excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function update_options() {
$this->options['length_type'] = $_POST['length_type'];
$this->options['finish'] = $_POST['finish'];
$this->options['ellipsis'] = $_POST['ellipsis'];
$this->options['read_more'] = $_POST['read_more'];
$this->options['read_more'] = isset( $_POST['read_more'] ) ? $_POST['read_more'] : $this->options['read_more'];
$this->options['allowed_tags'] = ( isset( $_POST['allowed_tags'] ) ) ? array_unique( (array) $_POST['allowed_tags'] ) : array();
$this->options['exclude_pages'] = ( isset( $_POST['exclude_pages'] ) ) ? array_unique( (array) $_POST['exclude_pages'] ) : array();

Expand Down
10 changes: 4 additions & 6 deletions template/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,14 @@
</tr>
<tr valign="top">
<th scope="row">
<label for="read-more">
<?php _e( "&lsquo;Read-more&rsquo; Text:", 'advanced-excerpt' ); ?>
</label>
<?php _e( "Read More Link:", 'advanced-excerpt' ); ?>
</th>
<td>
<input name="read_more" type="text" id="read-more" value="<?php echo $read_more; ?>" />
<label for="add-link">
<input name="add_link" type="checkbox" id="add-link" value="on" <?php echo ( 1 == $add_link ) ? 'checked="checked"' : ''; ?> />
<?php _e( "Add link to excerpt", 'advanced-excerpt' ); ?>
</label>
<?php _e( "Add read more link to excerpt", 'advanced-excerpt' ); ?>
</label><br />
<input name="read_more" type="text" id="read-more" value="<?php echo $read_more; ?>" <?php echo ( 1 !== $add_link ) ? 'disabled="disabled"' : ''; ?> />
</td>
</tr>
<tr valign="top">
Expand Down

0 comments on commit bceb350

Please sign in to comment.