|
| 1 | +.. This displays the search results from the Google Custom Search engine. |
| 2 | + Don't link to it directly. |
| 3 | + |
| 4 | +Search results |
| 5 | +============== |
| 6 | + |
| 7 | +.. raw:: html |
| 8 | + |
| 9 | + <div id="cse" style="width: 100%;">Loading</div> |
| 10 | + <script src="http://www.google.co.uk/jsapi" type="text/javascript"></script> |
| 11 | + <script type="text/javascript"> |
| 12 | + function parseQueryFromUrl () { |
| 13 | + var queryParamName = "q"; |
| 14 | + var search = window.location.search.substr(1); |
| 15 | + var parts = search.split('&'); |
| 16 | + for (var i = 0; i < parts.length; i++) { |
| 17 | + var keyvaluepair = parts[i].split('='); |
| 18 | + if (decodeURIComponent(keyvaluepair[0]) == queryParamName) { |
| 19 | + return decodeURIComponent(keyvaluepair[1].replace(/\+/g, ' ')); |
| 20 | + } |
| 21 | + } |
| 22 | + return ''; |
| 23 | + } |
| 24 | + google.load('search', '1', {language : 'en'}); |
| 25 | + google.setOnLoadCallback(function() { |
| 26 | + var customSearchControl = new google.search.CustomSearchControl( |
| 27 | + '017950022472296044740:wfr9nyfshwo'); |
| 28 | + customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); |
| 29 | + customSearchControl.draw('cse'); |
| 30 | + var queryFromUrl = parseQueryFromUrl(); |
| 31 | + if (queryFromUrl) { |
| 32 | + customSearchControl.execute(queryFromUrl); |
| 33 | + } |
| 34 | + }, true); |
| 35 | + </script> |
| 36 | + <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" /> <style type="text/css"> |
| 37 | + .gsc-control-cse { |
| 38 | + font-family: Arial, sans-serif; |
| 39 | + border-color: #FFFFFF; |
| 40 | + background-color: #FFFFFF; |
| 41 | + } |
| 42 | + input.gsc-input { |
| 43 | + border-color: #BCCDF0; |
| 44 | + } |
| 45 | + input.gsc-search-button { |
| 46 | + border-color: #666666; |
| 47 | + background-color: #CECECE; |
| 48 | + } |
| 49 | + .gsc-tabHeader.gsc-tabhInactive { |
| 50 | + border-color: #E9E9E9; |
| 51 | + background-color: #E9E9E9; |
| 52 | + } |
| 53 | + .gsc-tabHeader.gsc-tabhActive { |
| 54 | + border-top-color: #FF9900; |
| 55 | + border-left-color: #E9E9E9; |
| 56 | + border-right-color: #E9E9E9; |
| 57 | + background-color: #FFFFFF; |
| 58 | + } |
| 59 | + .gsc-tabsArea { |
| 60 | + border-color: #E9E9E9; |
| 61 | + } |
| 62 | + .gsc-webResult.gsc-result, |
| 63 | + .gsc-results .gsc-imageResult { |
| 64 | + border-color: #FFFFFF; |
| 65 | + background-color: #FFFFFF; |
| 66 | + } |
| 67 | + .gsc-webResult.gsc-result:hover, |
| 68 | + .gsc-imageResult:hover { |
| 69 | + border-color: #FFFFFF; |
| 70 | + background-color: #FFFFFF; |
| 71 | + } |
| 72 | + .gs-webResult.gs-result a.gs-title:link, |
| 73 | + .gs-webResult.gs-result a.gs-title:link b, |
| 74 | + .gs-imageResult a.gs-title:link, |
| 75 | + .gs-imageResult a.gs-title:link b { |
| 76 | + color: #0000CC; |
| 77 | + } |
| 78 | + .gs-webResult.gs-result a.gs-title:visited, |
| 79 | + .gs-webResult.gs-result a.gs-title:visited b, |
| 80 | + .gs-imageResult a.gs-title:visited, |
| 81 | + .gs-imageResult a.gs-title:visited b { |
| 82 | + color: #0000CC; |
| 83 | + } |
| 84 | + .gs-webResult.gs-result a.gs-title:hover, |
| 85 | + .gs-webResult.gs-result a.gs-title:hover b, |
| 86 | + .gs-imageResult a.gs-title:hover, |
| 87 | + .gs-imageResult a.gs-title:hover b { |
| 88 | + color: #0000CC; |
| 89 | + } |
| 90 | + .gs-webResult.gs-result a.gs-title:active, |
| 91 | + .gs-webResult.gs-result a.gs-title:active b, |
| 92 | + .gs-imageResult a.gs-title:active, |
| 93 | + .gs-imageResult a.gs-title:active b { |
| 94 | + color: #0000CC; |
| 95 | + } |
| 96 | + .gsc-cursor-page { |
| 97 | + color: #0000CC; |
| 98 | + } |
| 99 | + a.gsc-trailing-more-results:link { |
| 100 | + color: #0000CC; |
| 101 | + } |
| 102 | + .gs-webResult .gs-snippet, |
| 103 | + .gs-imageResult .gs-snippet, |
| 104 | + .gs-fileFormatType { |
| 105 | + color: #000000; |
| 106 | + } |
| 107 | + .gs-webResult div.gs-visibleUrl, |
| 108 | + .gs-imageResult div.gs-visibleUrl { |
| 109 | + color: #008000; |
| 110 | + } |
| 111 | + .gs-webResult div.gs-visibleUrl-short { |
| 112 | + color: #008000; |
| 113 | + } |
| 114 | + .gs-webResult div.gs-visibleUrl-short { |
| 115 | + display: none; |
| 116 | + } |
| 117 | + .gs-webResult div.gs-visibleUrl-long { |
| 118 | + display: block; |
| 119 | + } |
| 120 | + .gsc-cursor-box { |
| 121 | + border-color: #FFFFFF; |
| 122 | + } |
| 123 | + .gsc-results .gsc-cursor-box .gsc-cursor-page { |
| 124 | + border-color: #E9E9E9; |
| 125 | + background-color: #FFFFFF; |
| 126 | + color: #0000CC; |
| 127 | + } |
| 128 | + .gsc-results .gsc-cursor-box .gsc-cursor-current-page { |
| 129 | + border-color: #FF9900; |
| 130 | + background-color: #FFFFFF; |
| 131 | + color: #0000CC; |
| 132 | + } |
| 133 | + .gs-promotion { |
| 134 | + border-color: #336699; |
| 135 | + background-color: #FFFFFF; |
| 136 | + } |
| 137 | + .gs-promotion a.gs-title:link, |
| 138 | + .gs-promotion a.gs-title:link *, |
| 139 | + .gs-promotion .gs-snippet a:link { |
| 140 | + color: #0000CC; |
| 141 | + } |
| 142 | + .gs-promotion a.gs-title:visited, |
| 143 | + .gs-promotion a.gs-title:visited *, |
| 144 | + .gs-promotion .gs-snippet a:visited { |
| 145 | + color: #0000CC; |
| 146 | + } |
| 147 | + .gs-promotion a.gs-title:hover, |
| 148 | + .gs-promotion a.gs-title:hover *, |
| 149 | + .gs-promotion .gs-snippet a:hover { |
| 150 | + color: #0000CC; |
| 151 | + } |
| 152 | + .gs-promotion a.gs-title:active, |
| 153 | + .gs-promotion a.gs-title:active *, |
| 154 | + .gs-promotion .gs-snippet a:active { |
| 155 | + color: #0000CC; |
| 156 | + } |
| 157 | + .gs-promotion .gs-snippet, |
| 158 | + .gs-promotion .gs-title .gs-promotion-title-right, |
| 159 | + .gs-promotion .gs-title .gs-promotion-title-right * { |
| 160 | + color: #000000; |
| 161 | + } |
| 162 | + .gs-promotion .gs-visibleUrl, |
| 163 | + .gs-promotion .gs-visibleUrl-short { |
| 164 | + color: #008000; |
| 165 | + } |
| 166 | + /* Manually added - the layout goes wrong without this */ |
| 167 | + .gsc-tabsArea, |
| 168 | + .gsc-webResult:after, |
| 169 | + .gsc-resultsHeader { |
| 170 | + clear: none; |
| 171 | + } |
| 172 | + </style> |
0 commit comments