Permalink
Browse files

code in place for sizing options

  • Loading branch information...
1 parent b5414b6 commit aef442be5eb97f52f4b62fb7f92e57d2674ee562 @randyjensen committed Dec 2, 2011
Showing with 10 additions and 9 deletions.
  1. +10 −9 openphoto-wordpress.php
View
@@ -76,11 +76,12 @@ function media_render_openphoto_tab() {
caption_text.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
url_text = parent_el.find('.url-text').val();
alignment = parent_el.find('.alignment-area input[type="radio"]]:checked').val();
- size = parent_el.find('.size-area input[type="radio"]]:checked').val();
+ size_height = parent_el.find('.size-area input[type="radio"]]:checked').attr('data-image-height');
+ size_width = parent_el.find('.size-area input[type="radio"]]:checked').attr('data-image-width');
size_alt = parent_el.find('.size-area input[type="radio"]]:checked').attr('alt');
size_class = 'size-' + size;
- height = 100;
- width = 150;
+ height = size_height;
+ width = size_width;
op_single = parent_el.find('#op-single').attr('name');
img = '';
@@ -154,7 +155,7 @@ function media_render_openphoto_tab() {
echo '<a class="page-numbers" href="?post_id=' . $post_id . '&amp;type=image&amp;tab=openphoto&amp;m=' . $m . '&amp;pg='. $i . '">'. $i . '</a> ';
}
}
-
+
if ($current_page < $total_pages) {
echo '<a class="next page-numbers" href="?post_id='. $post_id . '&amp;type=image&amp;tab=openphoto&amp;m=' . $m . '&amp;pg='. ($current_page+1) . '">&raquo;</a> ';
}
@@ -281,14 +282,14 @@ function media_render_openphoto_tab() {
echo '<td class="field size-area">';
$thumbnail_width = 150;
$thumbnail_height = 150;
- echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-thumbnail-'.$unique_id.'" value="thumbnail" alt="'.$photo->{"path".$sizes['thumbnail']} . '" checked="checked"><label for="image-size-thumbnail-'.$unique_id.'">Thumbnail</label> <label for="image-size-thumbnail-'.$unique_id.'" class="help">(' . $thumbnail_width. '&nbsp;×&nbsp;' . $thumbnail_height . ')</label></div>';
+ echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-thumbnail-'.$unique_id.'" value="thumbnail" alt="'.$photo->{"path".$sizes['thumbnail']} . '" data-image-height="'.$thumbnail_height.'" data-image-width="'.$thumbnail_width.'" checked="checked"><label for="image-size-thumbnail-'.$unique_id.'">Thumbnail</label> <label for="image-size-thumbnail-'.$unique_id.'" class="help">(' . $thumbnail_width. '&nbsp;×&nbsp;' . $thumbnail_height . ')</label></div>';
$medium_width = 300;
$medium_height = 187;
- echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-medium-'.$unique_id.'" value="medium" alt="'.$photo->{"path".$sizes['medium']}.'"><label for="image-size-medium-'.$unique_id.'">Medium</label> <label for="image-size-medium-'.$unique_id.'" class="help">(' . $medium_width . '&nbsp;×&nbsp;' . $medium_height . ')</label></div>';
+ echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-medium-'.$unique_id.'" value="medium" alt="'.$photo->{"path".$sizes['medium']}.'" data-image-height="'.$medium_height.'" data-image-width="'.$medium_width.'"><label for="image-size-medium-'.$unique_id.'">Medium</label> <label for="image-size-medium-'.$unique_id.'" class="help">(' . $medium_width . '&nbsp;×&nbsp;' . $medium_height . ')</label></div>';
$large_width = 600;
$large_height = 400;
- echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-large-'.$unique_id.'" value="large" alt="'.$photo->{"path".$sizes['large']}.'"><label for="image-size-large-'.$unique_id.'">Large</label> <label for="image-size-large-'.$unique_id.'" class="help">('. $large_width . '&nbsp;×&nbsp;'. $large_height . ')</label></div>';
- echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-full-'.$unique_id.'" value="full" alt="'.$photo->pathOriginal.'"><label for="image-size-full-'.$unique_id.'">Full Size</label> <label for="image-size-full-'.$unique_id.'" class="help">('.$photo->height.'&nbsp;×&nbsp;'.$photo->width.')</label></div>';
+ echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-large-'.$unique_id.'" value="large" alt="'.$photo->{"path".$sizes['large']}.'" data-image-height="'.$large_height.'" data-image-width="'.$large_width.'"><label for="image-size-large-'.$unique_id.'">Large</label> <label for="image-size-large-'.$unique_id.'" class="help">('. $large_width . '&nbsp;×&nbsp;'. $large_height . ')</label></div>';
+ echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-full-'.$unique_id.'" value="full" alt="'.$photo->pathOriginal.'" data-image-height="'.$photo->height.'" data-image-width="'.$photo->width.'"><label for="image-size-full-'.$unique_id.'">Full Size</label> <label for="image-size-full-'.$unique_id.'" class="help">('.$photo->height.'&nbsp;×&nbsp;'.$photo->width.')</label></div>';
echo '</td>';
echo '</tr>';
echo '<tr class="submit">';
@@ -497,4 +498,4 @@ function settings_validate_submission( $input ) {
}
new WP_OpenPhoto;
-require_once('openphoto-php/OpenPhotoOAuth.php');
+require_once('openphoto-php/OpenPhotoOAuth.php');

0 comments on commit aef442b

Please sign in to comment.