Skip to content
Snippets Groups Projects
Commit 5cfbefe1 authored by Seth Meranda's avatar Seth Meranda
Browse files

If we're doing a mobile search, rewrite all the URLs in the search results to use the mobile proxy.

parent e72fafc7
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,11 @@ $page->head .= '
<link rel="stylesheet" type="text/css" href="searchCSS.css" />
';
if ($template == 'Mobile') {
$page->head .='<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />';
};
$page->head .='<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" >
<script type="text/javascript">var mobileSearch = true;</script>';
} else {
$page->head .='<script type="text/javascript">var mobileSearch = false;</script>';
}
$page->addScript('searchFunc.js');
if (isset($_GET['u']) //u is referring site
......
......@@ -119,6 +119,14 @@ UNL_Search.handleResults = function (result_div, searchobj) {
}
resultsDIV.appendChild(searchobj.results[i].html);
}
if (mobileSearch) { //if we're doing a mobile search, rewrite link URLs to use mobile proxy
WDN.jQuery(resultsDIV).find('a.gs-title').each(function(){
//href= WDN.jQuery(this).attr('href');
WDN.jQuery(this).attr('href', function(i, val){
return 'http://m.unl.edu/?view=proxy&u='+val;
});
});
}
var nav = document.createElement("ul");
nav.className = "wdn_pagination";
var search_name = 'unl_search';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment