Permalink
Browse files

* Fixes to make jquery mobile work on symbian

  • Loading branch information...
1 parent 09ed600 commit bde27d50aa52f487cf3de4e861846cdb82f5b37a @bnolan committed Nov 24, 2010
Showing with 28 additions and 8 deletions.
  1. 0 favicon.ico
  2. +10 −1 index.html
  3. +4 −4 jquery-mobile.js
  4. +14 −3 jquery.js
View
No changes.
View
@@ -12,16 +12,23 @@
<script type="text/javascript" charset="utf-8" src="jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="jquery-mobile.js"></script>
+ <script type="text/javascript" charset="utf-8" src="application.js"></script>
<script type="text/javascript" charset="utf-8" src="underscore.js"></script>
<script type="text/javascript" charset="utf-8" src="backbone.js"></script>
<script type="text/javascript" charset="utf-8" src="foursquare.json"></script>
- <script type="text/javascript" charset="utf-8" src="application.js"></script>
<link rel="stylesheet" href="jquery-mobile.css" />
<script type="text/javascript" charset="utf-8">
+ // document.write("<script type='text/javascript' charset='utf-8' src='jquery.js?" + Math.random() + "'></" + "script>");
+ // document.write("<script type='text/javascript' charset='utf-8' src='jquery-mobile.js?" + Math.random() + "'></" + "script>");
+ // document.write("<script type='text/javascript' charset='utf-8' src='application.js?" + Math.random() + "'></" + "script>");
+
function onBodyLoad(){
document.addEventListener("deviceready",onDeviceReady,false);
+
+ // Call jquery.ready() for symbian devices that don't seem to trigger it
+ jQuery.ready();
}
function onDeviceReady(){
@@ -31,6 +38,8 @@
</head>
<body onload="onBodyLoad()">
+ <a href="javascript:window.location.reload()">Reload</a>
+
<div data-role="page" id="home">
<div data-role="header">
View
@@ -2948,7 +2948,7 @@ $.fn.grid = function(options){
//support conditions that must be met in order to proceed
gradeA: function(){
- return $.support.mediaquery;
+ return true; // $.support.mediaquery;
}
});
@@ -2959,7 +2959,7 @@ $.fn.grid = function(options){
//otherwise, proceed with the enhancements
if ( !$.mobile.gradeA() ) {
return;
- }
+ }
//define vars for interal use
var $window = $(window),
@@ -3323,7 +3323,7 @@ $.fn.grid = function(options){
*
*/
if(to.length == 0){ // Page could not be found
- console.log("Routing to " + url + "...");
+ // console.log("Routing to " + url + "...");
to = $("<div data-role='page' id='" + url + "'><div data-role='header'><h1>&nbsp;</h1></div><div data-role='content'><img src='images/ajax-loader.png' /></div></div>").appendTo('body')
@@ -3529,7 +3529,7 @@ $.fn.grid = function(options){
});
//dom-ready
- $(function(){
+ $(document).ready(function(){
var $pages = $("[data-role='page']");
//set up active page
$startPage = $.mobile.activePage = $pages.first();
View
@@ -7148,9 +7148,20 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
- elem.document.body[ "client" + name ];
-
+
+ /*
+ * @bnolan hack to make jquery mobile work on nokia
+ */
+ if(window.screen){
+ return window.screen.height;
+ }else{
+ return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+ elem.document.body[ "client" + name ];
+ }
+ /*
+ * end @bnolan hack.
+ */
+
// Get document width or height
} else if ( elem.nodeType === 9 ) {
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater

0 comments on commit bde27d5

Please sign in to comment.