Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16933] CSS/Javascript not rendering properly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2014-05-10T07:35:02.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 09, 2014 Sprint 09 Tooling
ComponentsWindows Hybrid
Labelsn/a
ReporterJamil Spain
AssigneeChris Barber
Created2014-05-08T18:23:18.000+0000
Updated2017-03-03T21:32:03.000+0000

Description

Comments

  1. Chris Barber 2014-05-08

    I need more information. I need a test case that proves that this bug is not just a problem with the way the application was designed.
  2. Chris Barber 2014-05-10

    This is a non-issue as far as Titanium is concerned. They are putting HTML into a native WP8 WebBrowser object and the content does not have a meta viewport tag, thus there's no initial scale and the device zooms in on the content. They can fix their app by detecting if the HTML content has a meta viewport tag and if not add it. Here's example code:
       // viewportify
       if (html) {
       	html = String(html);
       	var metaTags = html.match(/<meta\s*(?:(?:\b(?:\w|-)+\b\s*(?:=\s*(?:"[^"]*"|'[^']*'|[^"'<> ]+)\s*)?)*)\/?\s*>/g),
       		viewportExists = false,
       		viewport = '<meta name="viewport" content="width=device-width,initial-scale=1.0">',
       		i, j, k, l, attrs;
       	if (metaTags) {
       		for (i = 0, l = metaTags.length; i < l; i++) {
       			attrs = metaTags[i].match(/(?:\w|-)+\b\s*(?:=\s*(?:"[^"]*"|'[^']*'|[^"'<> ]+))?/g);
       			if (attrs) {
       				for (j = 0, k = attrs.length; j < k; j++) {
       					if (/name\s*=\s*(?:"viewport"|'viewport')/.test(attrs[j])) {
       						viewportExists = true;
       						break;
       					}
       				}
       			}
       		}
       	}
       	if (!viewportExists) {
       		var p = html.indexOf('</head>');
       		if (p != -1) {
       			html = html.substring(0, p - 1) + viewport + html.substring(p);
       		} else {
       			p = html.indexOf('<body');
       			if (p != -1) {
       				html = html.substring(0, p - 1) + '<head>' + viewport + '</head>' + html.substring(p);
       			} else {
       				// no body, skip
       			}
       		}
       		alert('Added viewport meta tag!\n\n' + html);
       	}
       }
       
  3. Eric Merriman 2017-03-03

    Closing as invalid.

JSON Source