From 1c5685d68f1b73270fb814fe04cbb490eb90ba5f Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 15:39:19 +0000 Subject: Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library) git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/grid/tests/yahooSearch.js | 137 ---------------------------- 1 file changed, 137 deletions(-) delete mode 100644 includes/js/dojox/grid/tests/yahooSearch.js (limited to 'includes/js/dojox/grid/tests/yahooSearch.js') diff --git a/includes/js/dojox/grid/tests/yahooSearch.js b/includes/js/dojox/grid/tests/yahooSearch.js deleted file mode 100644 index 1d57a8e..0000000 --- a/includes/js/dojox/grid/tests/yahooSearch.js +++ /dev/null @@ -1,137 +0,0 @@ -dojo.require("dojo.io.script") -dojo.require("dojox.rpc.Service"); - -// model that works with Yahoo Search API -dojo.declare("dojox.grid.data.yahooSearch", dojox.grid.data.Dynamic, { - constructor: function(inFields, inData, inSearchNode){ - this.rowsPerPage = 20; - this.searchNode = inSearchNode; - this.fieldNames = dojo.map(inFields, "return item.name;"); - this.yahoo = new dojox.rpc.Service( - dojo.moduleUrl("dojox.rpc.SMDLibrary", "yahoo.smd") - ); - }, - // server send / receive - send: function(inAsync, inParams, inOnReceive, inOnError){ - var d = this.yahoo.imageSearch( - dojo.mixin({ - results: this.rowsPerPage, - query: this.getQuery() - }, inParams) - ); - d.addCallbacks( - dojo.hitch(this, "receive", inOnReceive, inOnError), - dojo.hitch(this, "error", inOnError) - ); - this.onSend(inParams); - return d; - }, - receive: function(inOnReceive, inOnError, inData){ - try{ - inData = inData.ResultSet; - inOnReceive(inData); - this.onReceive(inData); - }catch(e){ - if(inOnError){ - inOnError(inData); - } - } - }, - error: function(inOnError, inErr) { - var m = 'io error: ' + inErr.message; - alert(m); - if (inOnError) - inOnError(m); - }, - encodeParam: function(inName, inValue) { - return dojo.string.substitute('&${0}=${1}', [inName, inValue]); - }, - getQuery: function(){ - return dojo.byId(this.searchNode).value.replace(/ /g, '+'); - }, - fetchRowCount: function(inCallback){ - this.send(true, inCallback); - }, - // request data - requestRows: function(inRowIndex, inCount){ - inRowIndex = (inRowIndex == undefined ? 0 : inRowIndex); - var params = { - start: inRowIndex + 1 - } - this.send(true, params, dojo.hitch(this, this.processRows)); - }, - // server callbacks - processRows: function(inData){ - for(var i=0, l=inData.totalResultsReturned, s=inData.firstResultPosition; i${text}', - { href: inData, text: text } - ); -}; - -formatImage = function(inData, inRowIndex){ - if(!inData){ return ' '; } - var info = getCellData(this, inRowIndex, this.extraField); - var o = { - href: inData, - src: info.Url, - width: info.Width, - height: info.Height - } - return dojo.string.substitute( - '', o); -}; - -formatDate = function(inDatum, inRowIndex){ - if(!inDatum){ return ' '; } - var d = new Date(inDatum * 1000); - return dojo.string.substitute( - "${0}/${1}/${2}", - [ d.getMonth()+1, d.getDate(), d.getFullYear() ] - ); -}; - -formatDimensions = function(inData, inRowIndex){ - if(!inData){ return ' '; } - var w = inData, h = getCellData(this, inRowIndex, this.extraField); - return w + ' x ' + h; -} -- cgit v1.2.3-54-g00ecf