OSDN Git Service

implement auto redirect when device is mobile.
authorgn64_jp <gn64@rec10.org>
Thu, 2 May 2013 12:26:56 +0000 (21:26 +0900)
committergn64_jp <gn64@rec10.org>
Thu, 2 May 2013 12:26:56 +0000 (21:26 +0900)
template/desktop_top.tmpl

index 841e3cc..ab868fe 100644 (file)
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script>
                $(function(){
+                       var agent = navigator.userAgent;
+                       var redirectPass = "pdfsearch.pl?mode=mobile";
+                       if (agent.search(/iPhone/) != -1 || agent.search(/iPod/) != -1 ||agent.search(/iPad/) != -1 ||agent.search(/Android/) != -1 ){
+                               location.href=redirectPass;
+                       }
                        $("#blink").button({
                                label:"back",
                                icons:{