File tree 9 files changed +53
-331
lines changed
9 files changed +53
-331
lines changed Original file line number Diff line number Diff line change 1
1
* file upload bug
2
2
* omniauth and google/weibo integration
3
3
* EpicEditor
4
+ * ajax tag suggestion
4
5
* model validation
5
6
6
7
* favicon
7
- * ferret search
8
8
* original source if article isn't written by me
Original file line number Diff line number Diff line change 22
22
if @blog . save
23
23
@blog . attach! ( current_account )
24
24
flash [ :notice ] = "创建成功"
25
- # TODO test blog search ping in production environment.
26
- # ping_search_engine(@blog)
25
+ ping_search_engine ( @blog ) if APP_CONFIG [ 'blog_search_ping' ] # only ping search engine in production environment
27
26
redirect url ( :blog , :show , :id => @blog . id )
28
27
else
29
28
render 'admin/new_blog'
Original file line number Diff line number Diff line change 18
18
get :me do
19
19
render 'home/me'
20
20
end
21
+
22
+ get :search do
23
+
24
+ render 'home/search'
25
+ end
21
26
22
27
get :rss do
23
28
content_type :xml
Original file line number Diff line number Diff line change
1
+ < div id ="search_result ">
2
+ < div id ="cse-search-results "> </ div >
3
+ < script type ="text/javascript ">
4
+ var googleSearchIframeName = "cse-search-results" ;
5
+ var googleSearchFormName = "cse-search-box" ;
6
+ var googleSearchFrameWidth = 950 ;
7
+ var googleSearchDomain = "www.google.com" ;
8
+ var googleSearchPath = "/cse" ;
9
+ </ script >
10
+ < script type ="text/javascript " src ="http://www.google.com/afsonline/show_afs_search.js "> </ script >
11
+ </ div >
Original file line number Diff line number Diff line change 28
28
< div class ="nav ">
29
29
< div class ="warp clearfix ">
30
30
< div class ="search fr ">
31
- < input name ="search " type ="text " placeholder ="Search "> < button > </ button >
31
+ < form action ="/search " id ="cse-search-box " method ="get ">
32
+ < input type ="hidden " name ="cx " value ="<%= APP_CONFIG [ 'google_cse' ] %> " />
33
+ < input type ="hidden " name ="cof " value ="FORID:10 " />
34
+ < input type ="hidden " name ="ie " value ="UTF-8 " />
35
+ < input id ="search-box " name ="q " type ="text " placeholder ="Search " value ="<%= params [ :q ] %> ">
36
+ < button id ="search-button ">
37
+ </ form >
32
38
</ div >
33
39
< ul >
34
40
< li > < a href ="/ " <%= "class='current'" . html_safe if @nav == 'home' %> > Home</ a > </ li >
55
61
</ div > <!-- footer -->
56
62
<%= javascript_include_tag 'jquery' , 'jquery-ujs' , 'application' %>
57
63
</ body >
58
- </ html >
64
+ </ html >
Original file line number Diff line number Diff line change @@ -3,6 +3,22 @@ $(function(){
3
3
$ ( 'button.close' ) . click ( function ( ) {
4
4
$ ( 'div.box' ) . hide ( ) ;
5
5
} ) ;
6
+
7
+ $ ( 'button#search-button' ) . click ( function ( ) {
8
+ var keyword = $ . trim ( $ ( 'input#search-box' ) . val ( ) ) ;
9
+ if ( keyword != null && keyword != '' ) {
10
+ $ ( 'form#cse-search-box' ) . submit ( ) ;
11
+ }
12
+ } ) ;
13
+
14
+ $ ( 'input#search-box' ) . keyup ( function ( event ) {
15
+ if ( event . keyCode == 13 ) {
16
+ var keyword = $ . trim ( $ ( 'input#search-box' ) . val ( ) ) ;
17
+ if ( keyword != null && keyword != '' ) {
18
+ $ ( 'form#cse-search-box' ) . submit ( ) ;
19
+ }
20
+ }
21
+ } ) ;
6
22
} ) ;
7
23
8
24
( function ( $ ) {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ User-agent: *
3
+ Disallow: /login
4
+ Disallow: /search
5
+ Disallow: /rss
6
+ Disallow: /admin/
7
+ Disallow: /uploads/
8
+ Disallow: /stylesheets/
9
+ Disallow: /javascripts/
10
+ Disallow: /images/
11
+ Disallow: /skins/
You can’t perform that action at this time.
0 commit comments