Improved iOS standalone experience

This commit is contained in:
Igor Zhukov 2014-06-25 15:24:47 +04:00
parent 55b1bacb21
commit dc973f594a
4 changed files with 20 additions and 15 deletions

View File

@ -194,6 +194,9 @@ input[type="number"] {
margin: 0;
}
.ios_standalone .tg_page_head .navbar > .container {
margin-top: 20px;
}
.tg_page_head .navbar > .container .navbar-brand {
padding: 9px 15px;
opacity: 0.9;

View File

@ -7,16 +7,6 @@
'use strict';
$(document.body)
.addClass(Config.Navigator.osX ? 'osx' : 'non_osx')
.addClass(Config.Navigator.retina ? 'is_2x' : 'is_1x');
$(window).on('load', function () {
setTimeout(function () {
window.scrollTo(0,1);
}, 0);
});
// Declare app level module which depends on filters, and services
angular.module('myApp', [
'ngRoute',
@ -51,10 +41,6 @@ config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvi
}
}
if (Config.Modes.test) {
StorageProvider.setPrefix('t_');
}
$.emojiarea.spritesheetPath = 'img/emojisprite_!.png';
$.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens;
$.emojiarea.iconSize = 20;
@ -64,6 +50,9 @@ config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvi
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|filesystem|chrome-extension|app):|data:image\//);
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|file|mailto|blob|filesystem|chrome-extension|app):|data:image\//);
if (Config.Modes.test) {
StorageProvider.setPrefix('t_');
}
$routeProvider.when('/', {templateUrl: 'partials/welcome.html', controller: 'AppWelcomeController'});
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'AppLoginController'});
@ -71,3 +60,15 @@ config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvi
$routeProvider.otherwise({redirectTo: '/'});
}]);
(function () {
var classes = [
Config.Navigator.osX ? 'osx' : 'non_osx',
Config.Navigator.retina ? 'is_2x' : 'is_1x'
];
if (Config.Modes.ios_standalone) {
classes.push('ios_standalone');
}
$(document.body).addClass(classes.join(' '));
})();

View File

@ -28,6 +28,7 @@ Config.Modes = {
test: location.search.indexOf('test=1') > 0,
debug: location.search.indexOf('debug=1') > 0,
packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:',
ios_standalone: window.navigator.standalone && navigator.userAgent.match(/iOS|iPhone|iPad/),
chrome_packed: window.chrome && chrome.app && chrome.app.window && true || false
};

View File

@ -1,6 +1,6 @@
CACHE MANIFEST
# 15
# 18
NETWORK:
*