-
9 Jun 2010 6:04 PM #1
0.82 Ext.setup() should check for meta tags before it adds them.
0.82 Ext.setup() should check for meta tags before it adds them.
I've made comments in red where needed...
Code:Ext.setup = function(config) { if (Ext.isObject(config)) { var appendString ='', viewport = Ext.get(document.createElement('meta')), app = Ext.get(document.createElement('meta')), statusBar = Ext.get(document.createElement('meta')), startupScreen = Ext.get(document.createElement('link')), appIcon = Ext.get(document.createElement('link')); //does user-scalable=no, user-scalable=0 translate different on different platforms? viewport.set({ name: 'viewport', content: 'width=device-width, user-scalable=no, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' }); if (config.fullscreen !== false) { app.set({ name: 'apple-mobile-web-app-capable', content: 'yes' }); if (Ext.isString(config.statusBarStyle)) { statusBar.set({ name: 'apple-mobile-web-app-status-bar-style', content: config.statusBarStyle }) } } if (Ext.isString(config.tabletStartupScreen) && Ext.platform.isTablet) { startupScreen.set({ rel: 'apple-touch-startup-image', href: config.tabletStartupScreen }); } else if (Ext.isString(config.phoneStartupScreen) && Ext.platform.isPhone) { startupScreen.set({ rel: 'apple-touch-startup-image', href: config.phoneStartupScreen }); } if (config.icon) { config.phoneIcon = config.tabletIcon = config.icon; } var precomposed = (config.glossOnIcon == false) ? '-precomposed' : ''; if (Ext.isString(config.tabletIcon) && Ext.platform.isTablet) { appIcon.set({ rel: 'apple-touch-icon' + precomposed, href: config.tabletIcon }); } else if (Ext.isString(config.phoneIcon) && Ext.platform.isPhone) { appIcon.set({ rel: 'apple-touch-icon' + precomposed, href: config.phoneIcon }); } if (Ext.isArray(config.preloadImages)) { for (var i = config.preloadImages.length - 1; i >= 0; i--) { (new Image()).src = config.preloadImages[i]; }; } //I have an app that is already built that I am layering Touch on top of. Because of this I already have the meta viewport tag setup. With this block it duplicates the tag. Same *could* be said about the others. var attachTags = function(){ var head = Ext.get(document.getElementsByTagName('head')[0]); head.appendChild(viewport); if (app.getAttribute('name')) head.appendChild(app); if (statusBar.getAttribute('name')) head.appendChild(statusBar); if (appIcon.getAttribute('href')) head.appendChild(appIcon); if (startupScreen.getAttribute('href')) head.appendChild(startupScreen); }; if (Ext.platform.isAndroidOS) { attachTags(); } else { Ext.onReady(attachTags); } if (Ext.isFunction(config.onReady)) { Ext.onReady(config.onReady, config.scope || window); } } };
-
9 Jun 2010 6:41 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
Good idea. Will look into doing this.
-
9 Jun 2010 6:45 PM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
For now I have added an addMetaTags configuration option to setup. It defaults to true. Somehow looping over all meta tags and check for attributes felt a bit dirty.
-
9 Jun 2010 11:49 PM #4
I like. Def better than individual checks.
Tommy, any idea about the user-scalable = 0|no? Is it a requirement to have both? Like does 0 only work on iPhone|iPad and no works on Android or something like that?
-
10 Jun 2010 9:52 AM #5Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
No, that was a bug. Also the mixing of semicolons and commas was wrong. This is al
Fixed in the next release.
-
10 Jun 2010 1:51 PM #6
I believe they are suppose to be commas correct? and which one is correct the 0 or the no?
-
10 Jun 2010 2:37 PM #7Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
I think "no" is the correct one, and commas.
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
Meta form with monitorValid and formBind fails in ext 2.2x but it's working in ext 3
By danutungureanu.dgs in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 4 Jan 2010, 4:25 AM -
[FIXED-152][3.x/2.x] Ext sometimes adds hashmarks to my URLs
By mschwartz in forum Ext 3.x: BugsReplies: 46Last Post: 10 Nov 2009, 1:32 PM -
How do Ext.nd convert notes form check/radio box into one that uses Check/Radioboxs?
By forefront in forum Ext.nd for Notes/DominoReplies: 5Last Post: 26 Feb 2009, 9:32 AM



Reply With Quote
