This commit is contained in:
Peter Cottle 2013-01-21 20:31:04 -08:00
parent 576823dbfd
commit ab5a752691
7 changed files with 35 additions and 31 deletions

View file

@ -139,10 +139,10 @@ var init = function() {
eventBaton.trigger('commandSubmitted', command);
});
}
if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent)) {
setTimeout(function() {
eventBaton.trigger('commandSubmitted', 'iOS alert');
}, 600);
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');
});
}
};

View file

@ -7,6 +7,7 @@ var Main = require('../app');
var Errors = require('../util/errors');
var Sandbox = require('../level/sandbox').Sandbox;
var Constants = require('../util/constants');
var Visualization = require('../visuals/visualization').Visualization;
var ParseWaterfall = require('../level/parseWaterfall').ParseWaterfall;

View file

@ -205,7 +205,7 @@ var Sandbox = Backbone.View.extend({
'level': this.startLevel,
'sandbox': this.exitLevel,
'levels': this.showLevels,
'iosAlert': this.iosAlert,
'mobileAlert': this.mobileAlert,
'build level': this.buildLevel,
'export tree': this.exportTree,
'import tree': this.importTree,
@ -335,10 +335,9 @@ var Sandbox = Backbone.View.extend({
}
},
iosAlert: function(command, deferred) {
var whenClosed = Q.defer();
alert("Can't bring up the keyboard on iOS, try visiting on desktop! :D");
whenClosed.resolve();
mobileAlert: function(command, deferred) {
alert("Can't bring up the keyboard on mobile / tablet :( try visiting on desktop! :D");
command.finishWith(deferred);
},
delay: function(command, deferred) {

View file

@ -53,7 +53,7 @@ var regexMap = {
'sandbox': /^sandbox($|\s)/,
'level': /^level\s?([a-zA-Z0-9]*)/,
'levels': /^levels($|\s)/,
'iosAlert': /^iOS alert($|\s)/,
'mobileAlert': /^mobile alert($|\s)/,
'build level': /^build level($|\s)/,
'export tree': /^export tree$/,
'import tree': /^import tree$/,