Browse files

Remove Yahoo Images search

  • Loading branch information...
1 parent 74d2418 commit 0bcb07467490aec6c7b740dde096c8a1e7fe969e @retro retro committed Sep 8, 2011
View
2 index.html
@@ -19,12 +19,10 @@
<ul id='resultsTab'>
<li><a href='#flickr'>Flickr</a></li>
- <li><a href='#yahoo'>Yahoo</a></li>
<li><a href='#upcoming'>Upcoming</a></li>
<li><a href='#twitter'>Twitter</a></li>
</ul>
<div id='flickr'></div>
- <div id='yahoo'></div>
<div id='upcoming'></div>
<div id='twitter'></div>
View
0 src/css/styles.css
No changes.
View
44 src/index.html
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>srchr</title>
- <link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" charset="utf-8" />
-</head>
-<body>
- <header>
- <h1>srchr</h1>
- <fieldset>
- <input type="search" name="search" id="search" />
- <input type="submit" id="search_submit" />
- </fieldset>
-
- <fieldset>
- <ul>
- <li>
- <input type="checkbox" name="flickr" value="1" />
- <label for="flickr">Flickr</label>
- </li>
- <li>
- <input type="checkbox" name="yahoo" value="1" />
- <label for="flickr">Yahoo! Search</label>
- </li>
- <li>
- <input type="checkbox" name="upcoming" value="1" />
- <label for="flickr">Upcoming</label>
- </li>
- </ul>
- </fieldset>
- </header>
-
- <ul id="search_terms">
- </ul>
-
- <ul id="search_results">
- </ul>
-
- <!-- use google-hosted javascript library of your choice -->
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script src="js/srchr.js"></script>
-</body>
-</html>
View
0 src/js/srchr.js
No changes.
View
1 srchr/disabler/disabler.html
@@ -33,7 +33,6 @@
<ul id='resultsTab'>
<li><a href='#flickr'>Flickr</a></li>
- <li><a href='#yahoo'>Yahoo</a></li>
<li><a href='#upcoming'>Upcoming</a></li>
</ul>
View
8 srchr/disabler/funcunit/disabler_test.js
@@ -11,21 +11,17 @@ steal.plugins('funcunit').then(function(){
// make sure that only flickr looks enabled
S('button').click(function(){
ok(!S('li:eq(0)').hasClass('disabled'), "Flicker is enabled.")
- ok(S('li:eq(1)').hasClass('disabled'), "Yahoo is disabled.")
- ok(S('li:eq(2)').hasClass('disabled'), "Upcoming is disabled.")
+ ok(S('li:eq(1)').hasClass('disabled'), "Upcoming is disabled.")
});
})
test('Is default prevented?', function(){
- S("a:contains(Yahoo)").click(function(){
- ok(S('#out').text(), "Activated Yahoo", "Before disabled, default activate is run")
- });
S('button').click();
S("a:contains(Upcoming)").click(function(){
- ok(S('#out').text(), "Activated Yahoo", "Default is prevented")
+ ok(S('#out').text(), "Activated Upcoming", "Default is prevented")
});
S("a:contains(Flickr)").click(function(){
View
22 srchr/models/yahoo.js
@@ -1,22 +0,0 @@
-
-steal("jquery/model/service/yql").then(function(){
-//get the yql service
-var yahoo = $.Model.service.yql({from: "search.images"})
-
-$.Model.extend("Srchr.Models.Yahoo",{
- findAll : function(params, success, error){
-
- // convert our query param for use in the flickr service
- yahoo.findAll.call( this,
- {where: ["query='#{query}' and appid='YahooDemo'",params]},
- success,
- error);
-
- }
-},{
-
-});
-
-
-
-});
View
4 srchr/search/views/init.ejs
@@ -5,10 +5,6 @@
</li>
<li>
- <label for="cb_yahoo"><input id="cb_yahoo" type='checkbox' name='types' value='Srchr.Models.Yahoo'/> Yahoo</label>
-
- </li>
- <li>
<label for="cb_upcoming"><input id="cb_upcoming" type='checkbox' name='types' value='Srchr.Models.Upcoming'/> Upcoming</label>
</li>
<li>
View
10 srchr/search_result/search_result.js
@@ -49,7 +49,7 @@ $.Controller.extend("Srchr.SearchResult",
// and our search is new ...
if(this.searched != this.currentSearch){
// put placeholder text in the panel...
- this.element.html("Searching for "+this.currentSearch);
+ this.element.html("Searching for <b>"+this.currentSearch+"</b>");
// and set a callback to render the results.
this.options.modelType.findAll({query: this.currentSearch}, this.callback('renderResults'));
this.searched = this.currentSearch;
@@ -67,7 +67,13 @@ $.Controller.extend("Srchr.SearchResult",
* @param {Object} data The data to bind.
*/
renderResults: function(data){
- this.element.html(this.view('results',{data: data, options: this.options }));
+ if(data.length > 0){
+ this.element.html(this.view('results',{data: data, options: this.options }));
+ } else {
+ this.element.html("No data found for <b>" + this.currentSearch + "</b>")
+
+ }
+
}
});
View
1 srchr/search_tabs/modelLoader.js
@@ -1 +0,0 @@
-steal.models('../../models/flickr.js', '../../models/yahoo.js', '../../models/upcoming.js', '../../models/twitter.js')
View
2 srchr/srchr.html
@@ -19,12 +19,10 @@
<ul id='resultsTab'>
<li><a href='#flickr'>Flickr</a></li>
- <li><a href='#yahoo'>Yahoo</a></li>
<li><a href='#upcoming'>Upcoming</a></li>
<li><a href='#twitter'>Twitter</a></li>
</ul>
<div id='flickr'></div>
- <div id='yahoo'></div>
<div id='upcoming'></div>
<div id='twitter'></div>
View
9 srchr/srchr.js
@@ -5,7 +5,7 @@ steal('srchr/search',
'srchr/tabs',
'srchr/disabler',
'steal/less',
- 'srchr/models/flickr.js','srchr/models/yahoo.js','srchr/models/upcoming.js','srchr/models/twitter.js')
+ 'srchr/models/flickr.js','srchr/models/upcoming.js','srchr/models/twitter.js')
.then('srchr/srchr.less', function($){
@@ -18,7 +18,6 @@ steal('srchr/search',
// just print out the first letter
var typePrettyNames = {
"Srchr.Models.Flickr" : "f",
- "Srchr.Models.Yahoo" : "y",
"Srchr.Models.Upcoming" : "u",
"Srchr.Models.Twitter" : "t"
};
@@ -52,12 +51,6 @@ steal('srchr/search',
resultView : "//srchr/views/flickr.ejs"
});
- // Create new Search Results controller on the #yahoo element
- $("#yahoo").srchr_search_result({
- modelType : Srchr.Models.Yahoo,
- resultView : "//srchr/views/yahoo.ejs"
- });
-
// Create new Search Results controller on the #upcoming element
$("#upcoming").srchr_search_result({
modelType : Srchr.Models.Upcoming,
View
1 srchr/tabs/tabs.js
@@ -6,7 +6,6 @@ steal('jquery/controller', 'jquery/event/default', './tabs.css').then(function()
* @codestart
&lt;ul id='resultsTab'&gt;
&lt;li&gt;&lt;a href='#flickr'&gt;Flickr&lt;/a&gt;&lt;/li&gt;
- &lt;li&gt;&lt;a href='#yahoo'&gt;Yahoo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='#upcoming'&gt;Upcoming&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
View
5 srchr/views/yahoo.ejs
@@ -1,5 +0,0 @@
-<a href='<%= url %>'>
- <img src='<%= thumbnail_url %>' />
- <%=title%>
-</a>
-<div class="clear"></div>

0 comments on commit 0bcb074

Please sign in to comment.