forked from zotonic/zotonic
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:zotonic/zotonic
- Loading branch information
Showing
4 changed files
with
30 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,12 +1,12 @@ | |||
{# Javascript that probes the user-agent and performs a callback with the results. #} | {# Javascript that probes the user-agent and performs a callback with the results. #} | ||
{% with m.req.ua_props as ua_props %} | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
(function() { | var ua_probe = "w="+window.screen.width | ||
var ua_curr = {w: window.screen.width, h: window.screen.height, t: (('ontouchstart' in window)?"1":"0")}; | + "&h="+window.screen.height | ||
if(({{ ua_props.displayWidth|default:0 }} == ua_curr.w) | + "&t="+(('ontouchstart' in window)?"1":"0"); | ||
&& ({{ ua_props.displayHeight|default:0 }} == ua_curr.h) && ({{ ua_props.is_touch|if:1:0 }} == ua_curr.t)) | var ua_curr = "w="+{{ m.req.ua_props.displayWidth|default:0 }} | ||
return; | + "&h="+{{ m.req.ua_props.displayHeight|default:0 }} | ||
z_post("/useragent/probe", ua_curr); | + "&t="+{{ m.req.ua_props.is_touch|if:1:0 }}; | ||
})(); | if (ua_probe != ua_curr) { | ||
document.write(unescape("%3Cscript src='/useragent/probe.js?"+ua_probe+"' type='text/javascript'%3E%3C/script%3E")); | |||
} | |||
</script> | </script> | ||
{% endwith %} |