From fee6bf48af1f357ed68fd9470390c73ce10feaf6 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sat, 26 Oct 2013 14:56:15 -0700 Subject: [PATCH] better mobile alert --- src/js/app/index.js | 11 ++++++----- src/js/intl/strings.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/app/index.js b/src/js/app/index.js index 20ac425d..29b5f6d3 100644 --- a/src/js/app/index.js +++ b/src/js/app/index.js @@ -125,6 +125,12 @@ var initDemo = function(sandbox) { // being the smart programmer I am (not), I dont include a true value on demo, so // I have to check if the key exists here var commands; + if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent)) { + sandbox.mainVis.customEvents.on('gitEngineReady', function() { + eventBaton.trigger('commandSubmitted', 'mobile alert'); + }); + } + if (params.hasOwnProperty('demo')) { commands = [ "git commit; git checkout -b bugFix C1; git commit; git merge master; git checkout master; git commit; git rebase bugFix;", @@ -193,11 +199,6 @@ var initDemo = function(sandbox) { }); } - if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent)) { - sandbox.mainVis.customEvents.on('gitEngineReady', function() { - eventBaton.trigger('commandSubmitted', 'mobile alert'); - }); - } }; if (require('../util').isBrowser()) { diff --git a/src/js/intl/strings.js b/src/js/intl/strings.js index 7a2595bb..c7b7e206 100644 --- a/src/js/intl/strings.js +++ b/src/js/intl/strings.js @@ -371,7 +371,7 @@ exports.strings = { }, 'mobile-alert': { '__desc__': 'When someone comes to the site on a mobile device, they can not input commands so this is a nasty alert to tell them', - 'en_US': 'Can\'t bring up the keyboard on mobile / tablet :( try visiting on desktop! :D', + 'en_US': 'LGB cant receive input on mobile, its worth it to visit on desktop! :D", 'zh_CN': '无法在移动设备/平板上调出键盘 :( 请试试桌面版 :D', 'fr_FR': 'Impossible de faire apparaître le clavier sur mobile / tablette :( Essayez de passer sur un ordinateur de bureau :D' },