Index: trunk/tools/wp-photocommons/css/search.css |
— | — | @@ -1,7 +1,24 @@ |
2 | | -#wp-photocommons-images img:hover { |
| 2 | +#wp-photocommons-images .image { |
| 3 | + width: 200px; |
| 4 | + height: 200px; |
| 5 | + float: left; |
| 6 | + margin: 10px; |
3 | 7 | cursor: pointer; |
| 8 | + background-position: center center; |
| 9 | + background-repeat: no-repeat; |
| 10 | + border: 2px solid #999; |
| 11 | + |
| 12 | + -webkit-border-radius: 10px; |
| 13 | + -moz-border-radius: 10px; |
| 14 | + -o-border-radius: 10px; |
| 15 | + -ms-border-radius: 10px; |
| 16 | + border-radius: 10px; |
4 | 17 | } |
5 | 18 | |
| 19 | + #wp-photocommons-images .image:hover { |
| 20 | + border: 2px solid #f99; |
| 21 | + } |
| 22 | + |
6 | 23 | #wp-photocommons-search { |
7 | 24 | width: 500px; |
8 | 25 | } |
\ No newline at end of file |
Index: trunk/tools/wp-photocommons/search.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | <body> |
18 | 18 | <?php endif; ?> |
19 | 19 | |
20 | | - <label for="wp-photoommons-search">Zoek:</label> |
| 20 | + <label for="wp-photocommons-search">Zoek:</label> |
21 | 21 | <input type="search" id="wp-photocommons-search" /> |
22 | 22 | |
23 | 23 | <ul id="wp-photocommons-results"></ul> |
Index: trunk/tools/wp-photocommons/js/search.js |
— | — | @@ -1,6 +1,11 @@ |
2 | | -// Debug |
3 | | -window.log = function( a, b ) { |
4 | | - //console.log( a, b ); |
| 2 | +// usage: log('inside coolFunc',this,arguments); |
| 3 | +// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ |
| 4 | +window.log = function(){ |
| 5 | + log.history = log.history || []; // store logs to an array for reference |
| 6 | + log.history.push(arguments); |
| 7 | + if(this.console){ |
| 8 | + console.log( Array.prototype.slice.call(arguments) ); |
| 9 | + } |
5 | 10 | }; |
6 | 11 | |
7 | 12 | if ( !window.Photocommons ) { |
— | — | @@ -51,6 +56,7 @@ |
52 | 57 | |
53 | 58 | return Photocommons.makeUrl(queries[type](args)); |
54 | 59 | }, |
| 60 | + |
55 | 61 | makeUrl: function( args ) { |
56 | 62 | // default arguments |
57 | 63 | args = $.extend({ |
— | — | @@ -78,6 +84,7 @@ |
79 | 85 | } |
80 | 86 | return url; |
81 | 87 | }, |
| 88 | + |
82 | 89 | init: function() { |
83 | 90 | |
84 | 91 | /* jQuery suggestions */ |
— | — | @@ -86,8 +93,6 @@ |
87 | 94 | var url = Photocommons.getQueryUrl( 'pagesearch', { |
88 | 95 | 'search' : query |
89 | 96 | }); |
90 | | - log('query', query); |
91 | | - log('url', url); |
92 | 97 | $.getJSON( url, function( data ) { |
93 | 98 | $( '#wp-photocommons-search' ).suggestions( 'suggestions', data[1] ); |
94 | 99 | }); |
— | — | @@ -114,12 +119,10 @@ |
115 | 120 | $.each( data.query.pageids, function( key, pageid ) { |
116 | 121 | var img = data.query.pages[pageid]; |
117 | 122 | if ( img.imageinfo && img.imageinfo[0] ) { |
118 | | - $( '<img>' ).attr({ |
119 | | - 'style': 'display:none', |
120 | | - 'src': img.imageinfo[0].thumburl, |
121 | | - 'title': img.title, |
| 123 | + $('<div class="image">').attr({ |
| 124 | + 'style': "background-image:url('" + img.imageinfo[0].thumburl + "');", |
122 | 125 | 'data-filename': img.title |
123 | | - }).appendTo( '#wp-photocommons-images' ).fadeIn(); |
| 126 | + }).appendTo('#wp-photocommons-images'); |
124 | 127 | |
125 | 128 | } |
126 | 129 | }); |
Index: trunk/tools/wp-photocommons/js/admin.js |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | height : 500 |
25 | 25 | }); |
26 | 26 | |
27 | | - $("#wp-photocommons-images img").live('click', function() { |
| 27 | + $("#wp-photocommons-images .image").live('click', function() { |
28 | 28 | var file = $(this).attr('data-filename'), |
29 | 29 | shortcode = '[photocommons file="' + file + '" size="300"]' + "\n"; |
30 | 30 | |
Index: trunk/tools/wp-photocommons/js/jquery.suggestions.js |
— | — | @@ -299,7 +299,6 @@ |
300 | 300 | break; |
301 | 301 | // Enter |
302 | 302 | case 13: |
303 | | - console.log('case 13'); |
304 | 303 | //debugger; |
305 | 304 | context.data.$container.hide(); |
306 | 305 | preventDefault = wasVisible; |