r82640 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82639‎ | r82640 | r82641 >
Date:23:12, 22 February 2011
Author:husky
Status:ok
Tags:
Comment:
fixed a bug with the relative paths
Modified paths:
  • /trunk/tools/wp-photocommons/js/search.js (modified) (history)
  • /trunk/tools/wp-photocommons/search.php (modified) (history)

Diff [purge]

Index: trunk/tools/wp-photocommons/search.php
@@ -1,5 +1,5 @@
22 <?php
3 -require_once '../../wp-load.php';
 3+require_once '../../../wp-load.php';
44
55 $path = dirname( $_SERVER['PHP_SELF'] );
66 // Standalone is used to debug/test this page directly,
Index: trunk/tools/wp-photocommons/js/search.js
@@ -1,23 +1,12 @@
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 - }
10 -};
11 -
122 if ( !window.PhotoCommons ) {
133 window.PhotoCommons = {};
144 }
155
166 (function($){
17 -
187 $.extend( PhotoCommons, {
19 -
208 getQueryUrl: function( type, args ) {
219 var queries = {
 10+ // Used for the suggestions
2211 'pagesearch' : function(q) {
2312 return {
2413 'action' : 'opensearch',
@@ -56,7 +45,7 @@
5746
5847 return PhotoCommons.makeUrl(queries[type](args));
5948 },
60 -
 49+
6150 makeUrl: function( args ) {
6251 // default arguments
6352 args = $.extend({
@@ -84,9 +73,9 @@
8574 }
8675 return url;
8776 },
88 -
 77+
8978 init: function() {
90 -
 79+
9180 /* jQuery suggestions */
9281 $( '#wp-photocommons-search' ).suggestions( {
9382 fetch: function( query ) {
@@ -110,9 +99,9 @@
111100 });
112101
113102 $( '#wp-photocommons-images' ).empty();
114 - $( '#wp-photocommons-loading' ).show();
 103+ $( '#wp-photocommons-loading' ).show();
115104 $.getJSON( url, function( data ) {
116 -
 105+
117106 if ( !data.query.pageids.length ) {
118107 $( '#wp-photocommons-images' ).html( 'No images found :(' );
119108 } else {
@@ -127,17 +116,17 @@
128117 'style': "background-image:url('" + img.imageinfo[0].thumburl + "');",
129118 'data-filename': pagetitle
130119 }).appendTo('#wp-photocommons-images');
131 -
 120+
132121 }
133122 });
134 -
 123+
135124 }
136 -
 125+
137126 $( '#wp-photocommons-loading' ).hide();
138127 });
139128 }
140129 }
141 -
 130+
142131 } );
143132 }
144133 });

Status & tagging log