Browse Source

Improved iOS standalone experience

master
Igor Zhukov 11 years ago
parent
commit
dc973f594a
  1. 3
      app/css/app.css
  2. 29
      app/js/app.js
  3. 1
      app/js/lib/config.js
  4. 2
      app/webogram.appcache

3
app/css/app.css

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

29
app/js/app.js

@ -7,16 +7,6 @@
'use strict'; '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 // Declare app level module which depends on filters, and services
angular.module('myApp', [ angular.module('myApp', [
'ngRoute', 'ngRoute',
@ -51,10 +41,6 @@ config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvi
} }
} }
if (Config.Modes.test) {
StorageProvider.setPrefix('t_');
}
$.emojiarea.spritesheetPath = 'img/emojisprite_!.png'; $.emojiarea.spritesheetPath = 'img/emojisprite_!.png';
$.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens; $.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens;
$.emojiarea.iconSize = 20; $.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.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\//); $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('/', {templateUrl: 'partials/welcome.html', controller: 'AppWelcomeController'});
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'AppLoginController'}); $routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'AppLoginController'});
@ -71,3 +60,15 @@ config(['$locationProvider', '$routeProvider', '$compileProvider', 'StorageProvi
$routeProvider.otherwise({redirectTo: '/'}); $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(' '));
})();

1
app/js/lib/config.js

@ -28,6 +28,7 @@ Config.Modes = {
test: location.search.indexOf('test=1') > 0, test: location.search.indexOf('test=1') > 0,
debug: location.search.indexOf('debug=1') > 0, debug: location.search.indexOf('debug=1') > 0,
packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:', 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 chrome_packed: window.chrome && chrome.app && chrome.app.window && true || false
}; };

2
app/webogram.appcache

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

Loading…
Cancel
Save