com web/php: Make the search results page friendlier to users without JS.: include/prepend.inc
| From: | Adam Harvey | Date: | Thu, 21 Nov 2013 01:17:23 +0000 |
| Subject: | com web/php: Make the search results page friendlier to users without JS.: include/prepend.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-17114@lists.php.net to get a copy of this message | ||
Commit: c8ca8630ebb0aad0e4ea355fbcc5b6efddc44877
Author: Adam Harvey <aharvey@php.net> Wed, 20 Nov 2013 17:17:23 -0800
Parents: 34d617ae533100d4637b88276eaff0f277085201
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=c8ca8630ebb0aad0e4ea355fbcc5b6efddc44877
Log:
Make the search results page friendlier to users without JS.
Fixes bug #66133 (Search silently brokes is Javascript is not enabled).
Bugs:
https://bugs.php.net/66133
Changed paths:
M include/prepend.inc
Diff:
diff --git a/include/prepend.inc b/include/prepend.inc
index e10f5a5..80b09bb 100644
--- a/include/prepend.inc
+++ b/include/prepend.inc
@@ -159,9 +159,14 @@ function myphpnet_save()
// TODO: Possible $default escaping issues
function google_cse($default = '', $lang = 'en') {
?>
-<div id="cse" style="width: 100%;">Loading</div>
+<noscript>
+ php.net's search functionality requires JavaScript to operate. Please enable
+ JavaScript and reload to continue.
+</noscript>
+<div id="cse" style="width: 100%;"></div>
<script src="http://www.google.com/jsapi"
type="text/javascript"></script>
<script type="text/javascript">
+ document.getElementById("cse").innerHTML = "Loading...";
google.load('search', '1', {language : '<?php echo $lang;
?>', style : google.loader.themes.MINIMALIST});
google.setOnLoadCallback(function() {
var customSearchOptions = {};