r80633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80632‎ | r80633 | r80634 >
Date:17:27, 20 January 2011
Author:husky
Status:ok
Tags:
Comment:
made the search panel a little nicer
Modified paths:
  • /trunk/tools/wp-photocommons/css/search.css (modified) (history)
  • /trunk/tools/wp-photocommons/js/admin.js (modified) (history)
  • /trunk/tools/wp-photocommons/js/jquery.suggestions.js (modified) (history)
  • /trunk/tools/wp-photocommons/js/search.js (modified) (history)
  • /trunk/tools/wp-photocommons/search.php (modified) (history)

Diff [purge]

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;
37 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;
417 }
518
 19+ #wp-photocommons-images .image:hover {
 20+ border: 2px solid #f99;
 21+ }
 22+
623 #wp-photocommons-search {
724 width: 500px;
825 }
\ No newline at end of file
Index: trunk/tools/wp-photocommons/search.php
@@ -16,7 +16,7 @@
1717 <body>
1818 <?php endif; ?>
1919
20 - <label for="wp-photoommons-search">Zoek:</label>
 20+ <label for="wp-photocommons-search">Zoek:</label>
2121 <input type="search" id="wp-photocommons-search" />
2222
2323 <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+ }
510 };
611
712 if ( !window.Photocommons ) {
@@ -51,6 +56,7 @@
5257
5358 return Photocommons.makeUrl(queries[type](args));
5459 },
 60+
5561 makeUrl: function( args ) {
5662 // default arguments
5763 args = $.extend({
@@ -78,6 +84,7 @@
7985 }
8086 return url;
8187 },
 88+
8289 init: function() {
8390
8491 /* jQuery suggestions */
@@ -86,8 +93,6 @@
8794 var url = Photocommons.getQueryUrl( 'pagesearch', {
8895 'search' : query
8996 });
90 - log('query', query);
91 - log('url', url);
9297 $.getJSON( url, function( data ) {
9398 $( '#wp-photocommons-search' ).suggestions( 'suggestions', data[1] );
9499 });
@@ -114,12 +119,10 @@
115120 $.each( data.query.pageids, function( key, pageid ) {
116121 var img = data.query.pages[pageid];
117122 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 + "');",
122125 'data-filename': img.title
123 - }).appendTo( '#wp-photocommons-images' ).fadeIn();
 126+ }).appendTo('#wp-photocommons-images');
124127
125128 }
126129 });
Index: trunk/tools/wp-photocommons/js/admin.js
@@ -23,7 +23,7 @@
2424 height : 500
2525 });
2626
27 - $("#wp-photocommons-images img").live('click', function() {
 27+ $("#wp-photocommons-images .image").live('click', function() {
2828 var file = $(this).attr('data-filename'),
2929 shortcode = '[photocommons file="' + file + '" size="300"]' + "\n";
3030
Index: trunk/tools/wp-photocommons/js/jquery.suggestions.js
@@ -299,7 +299,6 @@
300300 break;
301301 // Enter
302302 case 13:
303 - console.log('case 13');
304303 //debugger;
305304 context.data.$container.hide();
306305 preventDefault = wasVisible;

Status & tagging log