Skip to content

Commit

Permalink
Improve CSS styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mureev committed Aug 22, 2012
1 parent 14d5686 commit 2fe89d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMHTMLView/CMHTMLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

#define kNativeShame @"native"

#define kDefaultDocumentMeta @"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0; user-scalable=0; minimum-scale=1.0; maximum-scale=1.0\"/>"
#define kDefaultDocumentMeta @"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0; user-scalable=0; minimum-scale=1.0; maximum-scale=1.0\"/><meta name=\"apple-mobile-web-app-capable\" content=\"yes\"/>"

#define kDefaultDocumentHtmlStyle @"html {-webkit-tap-highlight-color:rgba(0,0,0,0); -webkit-text-size-adjust:none; word-wrap:break-word;}"

#define kDefaultDocumentBodyStyle @"body {margin:0; padding:10px 9px; font-family:%@; font-size:%.0f; line-height:%.1f;} a:link {color: #3A75C4; text-decoration: underline;} img,video,iframe {display:block; padding:0 0 5px; margin:0 auto;} table {font-size:10px;}"
#define kDefaultDocumentBodyStyle @"body {margin:0; padding:10px 9px; font-family:%@; font-size:%.0f; line-height:%.1f;} a:link {color: #3A75C4; text-decoration: underline;} img,video,iframe {display:block; padding:0 0 5px; margin:0 auto;} table {font-size:10px;} * {overflow-x:hidden;}"

#define kDefaultDocumentRotateStyle @"@media (orientation:portrait) { img,video,iframe {max-width:%.0fpx; height:auto;}} @media (orientation:landscape) { img,video,iframe {max-width:%.0fpx; height:auto;}}"
#define kDefaultDocumentRotateStyle @"@media (orientation:portrait) { img,video,iframe,div {max-width:%.0fpx; height:auto;}} @media (orientation:landscape) { img,video,iframe,div {max-width:%.0fpx; height:auto;}}"

#define kFastClickJs @"self.FastClick=function(){function k(a){return/\bneedsclick\b/.test(a.className)||{select:!0,input:!0,label:!0,video:!0}[a.nodeName.toLowerCase()]}var l=-1===navigator.userAgent.indexOf(\"PlayBook\")?5:20;return function(a){var d=0,e=0,g=0,h=0,b=!1,m=Math.pow(37,2),n=function(c){b=!0;d=c.targetTouches[0].pageX;e=c.targetTouches[0].pageY;d===c.targetTouches[0].clientX&&(d+=window.pageXOffset);e===c.targetTouches[0].clientY&&(e+=window.pageYOffset);g=window.pageXOffset;h=window.pageYOffset;return!0},o=function(c){if(!b)return!0;Math.pow(c.targetTouches[0].pageX-d,2)+Math.pow(c.targetTouches[0].pageY-e,2)>m&&(b=!1);if(Math.abs(window.pageXOffset-g)>l||Math.abs(window.pageYOffset-h)>l)b=!1;return!0},p=function(c){var a,j,f,i;if(!b)return!0;b=!1;a=d-g;j=e-h;f=document.elementFromPoint(a,j);if(!f)return!1;f.nodeType===Node.TEXT_NODE&&(f=f.parentElement);if(k(f))return!1;i=document.createEvent(\"MouseEvents\");i.initMouseEvent(\"click\",!0,!0,window,1,0,0,a,j,!1,!1,!1,!1,0,null);i.forwardedTouchEvent=!0;f.dispatchEvent(i);c.preventDefault();return!1},q=function(){b=!1},r=function(a){var b;if(a.forwardedTouchEvent||!a.cancelable)return!0;b=document.elementFromPoint(d-g,e-h);return!b||!k(b)?(a.stopPropagation(),a.preventDefault(),a.stopImmediatePropagation&&a.stopImmediatePropagation(),!1):!0};if(!a||!a.nodeType)throw new TypeError(\"Layer must be a document node\");\"undefined\"!==typeof window.ontouchstart&&(a.addEventListener(\"click\",r,!0),a.addEventListener(\"touchstart\",n,!0),a.addEventListener(\"touchmove\",o,!0),a.addEventListener(\"touchend\",p,!0),a.addEventListener(\"touchcancel\",q,!0),\"function\"===typeof a.onclick&&(a.addEventListener(\"click\",a.onclick,!1),a.onclick=null))}}(); window.addEventListener('load', function() {new FastClick(document.body);}, false);"

Expand Down

0 comments on commit 2fe89d6

Please sign in to comment.