r80304 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80303‎ | r80304 | r80305 >
Date:19:25, 14 January 2011
Author:krinkle
Status:deferred
Tags:
Comment:
wp-photocommons- prefix
Modified paths:
  • /trunk/tools/wp-photocommons/search.js (modified) (history)
  • /trunk/tools/wp-photocommons/search.php (modified) (history)

Diff [purge]

Index: trunk/tools/wp-photocommons/search.js
@@ -1,7 +1,9 @@
22 // Debug
33 window.log = (console && console.log) ? console.log : function(){};
44
5 -if (!window.Photocommons) window.Photocommons = {};
 5+if ( !window.Photocommons ) {
 6+ window.Photocommons = {};
 7+}
68
79 $.extend( Photocommons, {
810
@@ -67,10 +69,10 @@
6870 },
6971 init: function() {
7072
71 - $('#search').autocomplete({
 73+ $('#wp-photocommons-search').autocomplete({
7274 source : function(request, response) {
7375 var url = Photocommons.getQueryUrl('pagesearch', {
74 - 'search' : $('#search').val()
 76+ 'search' : $('#wp-photocommons-search').val()
7577 });
7678
7779 $.getJSON(url, function(data) {
@@ -79,8 +81,8 @@
8082 },
8183
8284 select : function(event, ui) {
83 - $('#images').empty();
84 - $('#loading').show();
 85+ $('#wp-photocommons-images').empty();
 86+ $('#wp-photocommons-loading').show();
8587
8688 var url = Photocommons.getQueryUrl('pageimages', {
8789 'title' : ui.item.value
@@ -91,7 +93,7 @@
9294 query = data.query.pages[pageid].images;
9395
9496 if (!query) {
95 - $('#images').html('No images found :(');
 97+ $('#wp-photocommons-images').html('No images found :(');
9698 }
9799
98100 $.each(query, function() {
@@ -103,11 +105,11 @@
104106 $.getJSON(url, function(data) {
105107 var pageid = data.query.pageids[0],
106108 src = data.query.pages[pageid].imageinfo[0].thumburl;
107 - $('#images').append('<img src="' + src + '" style="display:none;"/>').find('img').fadeIn();
 109+ $('#wp-photocommons-images').append('<img src="' + src + '" style="display:none;"/>').find('img').fadeIn();
108110 });
109111 });
110112
111 - $('#loading').hide();
 113+ $('#wp-photocommons-loading').hide();
112114 });
113115 }
114116 });
Index: trunk/tools/wp-photocommons/search.php
@@ -2,15 +2,20 @@
33 <html>
44 <head>
55 <meta charset="utf-8" />
 6+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
 7+ <script src="js/jquery-ui-1.8.5.custom.min.js"></script>
 8+ <script src="search.js"></script>
69 <link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.5.custom.css" />
710 </head>
811 <body>
9 -<input type="search" id="search" />
10 -<ul id="results"></ul>
11 -<img src="img/loading.gif" style="display:none;" id="loading" />
12 -<div id="images"></div>
13 -<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
14 -<script src="js/jquery-ui-1.8.5.custom.min.js"></script>
15 -<script src="search.js"></script>
 12+
 13+ <input type="search" id="wp-photocommons-search" />
 14+
 15+ <ul id="wp-photocommons-results"></ul>
 16+
 17+ <img src="img/loading.gif" style="display:none;" id="wp-photocommons-loading" />
 18+
 19+ <div id="wp-photocommons-images"></div>
 20+
1621 </body>
1722 </html>
\ No newline at end of file

Status & tagging log