Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
2 parents 1ffbd1b + 1f96bc2 commit b36b61b8148a8e1353b10acf13a4ce6d11013f2b @founddrama committed Feb 10, 2012
Showing with 69 additions and 47 deletions.
  1. +5 −7 css/wp-flickr-badge.css
  2. +3 −1 js/wp-flickr-badge.js
  3. +29 −30 src/js/wp-flickr-badge.js
  4. +5 −7 src/scss/wp-flickr-badge.scss
  5. +27 −2 widget.php
View
@@ -28,27 +28,25 @@
#flickr_www_wrapper {
background: #fff;
bottom: 2px;
- font-family: "Arial" "Helvetica" sans-serif !important;
- font-weight: bold;
padding: 1px;
position: absolute;
right: 1px;
z-index: 201; }
- #flickr_www_wrapper * {
- font-family: "Arial" "Helvetica" sans-serif !important;
- font-weight: bold; }
#flickr_www {
color: #3993ff !important;
display: block;
- font: 11px "Arial" "Helvetica" sans-serif !important;
+ font: 11px "Arial", "Helvetica", sans-serif !important;
font-weight: bold; }
+ #flickr_www * {
+ font: 11px "Arial", "Helvetica", sans-serif !important;
+ font-weight: bold !important; }
#flickr_badge_source {
margin: 0 10px 0 10px;
text-align: left;
color: #666666 !important;
- font: 11px "Arial" "Helvetica" sans-serif !important;
+ font: 11px "Arial", "Helvetica", sans-serif !important;
padding: 0 !important; }
.flickr_badge_image {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,35 +1,34 @@
/**
* @requires {jQuery}
*/
-flickr = {
- onHover: function(){
- var i, w = $('#flickr_www_wrapper');
+if (window.jQuery) {
+ (function($){
+ $(document).ready(function(){
+ var i, w = $('#flickr_www_wrapper');
- $('.flickr_badge_image').hover(function(){
- i = $(this).children('a').children('img');
- var t = $(this).find('img').attr('title');
-
- i.css({
- border: '4px solid #ff1c92',
- margin: '-4px',
- zIndex: '200'
- });
+ $('.flickr_badge_image').hover(function(){
+ i = $(this).children('a').children('img');
+ var t = $(this).find('img').attr('title');
+
+ i.css({
+ border: '4px solid #ff1c92',
+ margin: '-4px',
+ zIndex: '200'
+ });
- w.fadeOut('slow', function(){
- w.empty().append(t).fadeIn('slow');
- });
- }, function(){
- i.css({
- border: 'none',
- margin: '0',
- zIndex: '100'
- });
- w.fadeOut('fast', function(){
- w.empty().append('flick<span style="color:#ff1c92;">r</span>').fadeIn('fast');
- });
- });
- }
-};
-
-// instead of : $(document).ready(flickr.onHover); - tru:
-$(flickr.onHover);
+ w.fadeOut('slow', function(){
+ w.empty().append(t).fadeIn('slow');
+ });
+ }, function(){
+ i.css({
+ border: 'none',
+ margin: '0',
+ zIndex: '100'
+ });
+ w.fadeOut('fast', function(){
+ w.empty().append('flick<span style="color:#ff1c92;">r</span>').fadeIn('fast');
+ });
+ });
+ });
+ })(jQuery);
+}
@@ -4,7 +4,7 @@
* @todo - test in a few different themes - remove any of the CSS that is specific to Orin/Ortho (make it flexible)
*/
-$_font_family: 'Arial' 'Helvetica' sans-serif !important;
+$_font_family: "Arial","Helvetica",sans-serif !important;
#flickr_badge_uber_wrapper {
height: 81px;
@@ -34,22 +34,20 @@ $_font_family: 'Arial' 'Helvetica' sans-serif !important;
#flickr_www_wrapper {
background: #fff;
bottom: 2px;
- font-family: $_font_family;
- font-weight: bold;
padding: 1px;
position: absolute;
right: 1px;
z-index: 201;
- * {
- font-family: $_font_family;
- font-weight: bold;
- }
}
#flickr_www {
color: #3993ff !important;
display: block;
font: 11px $_font_family;
font-weight: bold;
+ * {
+ font: 11px $_font_family;
+ font-weight: bold !important;
+ }
}
#flickr_badge_source {
margin: 0 10px 0 10px;
View
@@ -20,23 +20,48 @@ function widget($args, $instance) {
extract($args);
/* 28555778%40N00 */
$flickr_user = $instance['flickr_user'];
+ $count = $instance['photo_count'];
+ $display = $instance['photo_display'];
+ $size = $instance['photo_size'];
echo $before_widget;
if ( $flickr_user ) ?>
- <div id="flickr_badge_uber_wrapper"><div id="flickr_badge_wrapper"><script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=10&display=random&size=s&layout=x&source=user&user=<?php echo $flickr_user; ?>"></script></div><a href="http://www.flickr.com" id=flickr_www><span id="flickr_www_wrapper">flick<span style="color:#ff1c92;">r</span></span></a></div>
+ <div id="flickr_badge_uber_wrapper"><div id="flickr_badge_wrapper"><script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=<?php echo $count; ?>&display=<?php echo $display; ?>&size=<?php echo $size; ?>&layout=x&source=user&user=<?php echo $flickr_user; ?>"></script></div><a href="http://www.flickr.com" id=flickr_www><span id="flickr_www_wrapper">flick<span style="color:#ff1c92;">r</span></span></a></div>
<?php
echo $after_widget;
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['flickr_user'] = $new_instance['flickr_user'];
+ $instance['photo_count'] = $new_instance['photo_count'];
+ $instance['photo_display'] = $new_instance['photo_display'];
+ $instance['photo_size'] = $new_instance['photo_size'];
return $instance;
}
function form($instance) {
$flickr_user = esc_attr($instance['flickr_user']);
+ $photo_count = esc_attr($instance['photo_count']);
+ $photo_display = esc_attr($instance['photo_display']);
+ $photo_size = esc_attr($instance['photo_size']);
?>
- <p><label for="<?php echo $this->get_field_id('flickr_user'); ?>"><?php _e('Flickr User ID:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('flickr_user'); ?>" name="<?php echo $this->get_field_name('flickr_user'); ?>" type="text" value="<?php echo $flickr_user; ?>" /></label></p>
+ <p>
+ <label for="<?php echo $this->get_field_id('flickr_user'); ?>"><?php _e('Flickr User ID:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('flickr_user'); ?>" name="<?php echo $this->get_field_name('flickr_user'); ?>" type="text" value="<?php echo $flickr_user; ?>" /></label>
+ <label for="<?php echo $this->get_field_id('photo_count'); ?>"><?php _e('Number of Photos:'); ?> <select class="widefat" id="<?php echo $this->get_field_id('photo_count'); ?>" name="<?php echo $this->get_field_name('photo_count'); ?>"><?php
+ for ( $i = 1; $i <= 10; ++$i ) {
+ echo "<option value=\"$i\" " . ( $photo_count == $i ? 'selected="selected"' : '' ) . ">$i</option>";
+ }
+ ?></select></label>
+ <label for="<?php echo $this->get_field_id('photo_display'); ?>"><?php _e('Which Photos:'); ?> <select class="widefat" id="<?php echo $this->get_field_id('photo_display'); ?>" name="<?php echo $this->get_field_name('photo_display'); ?>">
+ <option value="latest" <?php echo ( $photo_display == 'latest' ? 'selected="selected"' : '' ) ; ?>>Most Recent</option>
+ <option value="random" <?php echo ( $photo_display == 'random' ? 'selected="selected"' : '' ) ; ?>>Random Selection</option>
+ </select></label>
+ <label for="<?php echo $this->get_field_id('photo_size'); ?>"><?php _e('Photo Size:'); ?> <select class="widefat" id="<?php echo $this->get_field_id('photo_size'); ?>" name="<?php echo $this->get_field_name('photo_size'); ?>">
+ <option value="s" <?php echo ( $photo_size == 's' ? 'selected="selected"' : '' ) ; ?>>Small Square</option>
+ <option value="t" <?php echo ( $photo_size == 't' ? 'selected="selected"' : '' ) ; ?>>Thumbnail</option>
+ <option value="m" <?php echo ( $photo_size == 'm' ? 'selected="selected"' : '' ) ; ?>>Mid-size</option>
+ </select></label>
+ </p>
<?php
}

0 comments on commit b36b61b

Please sign in to comment.