diff --git a/build/bundle.js b/build/bundle.js index 02e79320..e2f19a95 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -6391,6 +6391,16 @@ var init = function() { eventBaton.trigger('commandSubmitted', "gc; git checkout HEAD~1; git commit; git checkout -b bugFix; gc; gc; git rebase -i HEAD~2; git rebase master; git checkout master; gc; gc; git merge bugFix"); }, 500); } + if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent)) { + alert(1); + var Views = require('../views'); + setTimeout(function() { + eventBaton.trigger('commandSubmitted', 'iOS keyboardPop'); + }, 600); + setTimeout(function() { + new Views.iOSKeyboardView(); + }, 1000); + } }; $(document).ready(init); @@ -9789,11 +9799,15 @@ var ModalView = Backbone.View.extend({ var ModalTerminal = ContainedBase.extend({ tagName: 'div', - className: 'box flex1', + className: 'modalTerminal box flex1', template: _.template($('#terminal-window-template').html()), + events: { + 'click div.inside': 'onClick' + }, initialize: function(options) { options = options || {}; + this.navEvents = options.events || _.clone(Backbone.Events); this.container = new ModalView(); this.JSON = { @@ -9803,6 +9817,10 @@ var ModalTerminal = ContainedBase.extend({ this.render(); }, + onClick: function() { + this.navEvents.trigger('click'); + }, + getInsideElement: function() { return this.$('.inside'); } @@ -9845,11 +9863,32 @@ var ModalAlert = ContainedBase.extend({ } }); +var iOSKeyboardView = Backbone.View.extend({ + initialize: function(options) { + options = options || {}; + this.deferred = options.deferred || Q.defer(); + + this.modalAlert = new ModalAlert({ + markdowns: [ + '## iOS device', + '', + 'On iOS, user input is needed to bring up the keyboard. Click ', + 'on this window to bring up the keyboard so you can type commands' + ] + }); + this.modalAlert.container.navEvents.on('click', this.clicked, this); + }, + + clicked: function() { + this.modalAlert.close(); + $('#commandTextField').focus(); + } +}); + var ConfirmCancelTerminal = Backbone.View.extend({ initialize: function(options) { options = options || {}; - this.deferred = options.deferred || Q.defer(); this.modalAlert = new ModalAlert(_.extend( {}, @@ -10132,6 +10171,8 @@ exports.CanvasTerminalHolder = CanvasTerminalHolder; exports.LevelToolbar = LevelToolbar; exports.NextLevelConfirm = NextLevelConfirm; +exports.iOSKeyboardView = iOSKeyboardView; + }); @@ -16669,6 +16710,16 @@ var init = function() { eventBaton.trigger('commandSubmitted', "gc; git checkout HEAD~1; git commit; git checkout -b bugFix; gc; gc; git rebase -i HEAD~2; git rebase master; git checkout master; gc; gc; git merge bugFix"); }, 500); } + if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent)) { + alert(1); + var Views = require('../views'); + setTimeout(function() { + eventBaton.trigger('commandSubmitted', 'iOS keyboardPop'); + }, 600); + setTimeout(function() { + new Views.iOSKeyboardView(); + }, 1000); + } }; $(document).ready(init); @@ -21561,11 +21612,15 @@ var ModalView = Backbone.View.extend({ var ModalTerminal = ContainedBase.extend({ tagName: 'div', - className: 'box flex1', + className: 'modalTerminal box flex1', template: _.template($('#terminal-window-template').html()), + events: { + 'click div.inside': 'onClick' + }, initialize: function(options) { options = options || {}; + this.navEvents = options.events || _.clone(Backbone.Events); this.container = new ModalView(); this.JSON = { @@ -21575,6 +21630,10 @@ var ModalTerminal = ContainedBase.extend({ this.render(); }, + onClick: function() { + this.navEvents.trigger('click'); + }, + getInsideElement: function() { return this.$('.inside'); } @@ -21617,11 +21676,32 @@ var ModalAlert = ContainedBase.extend({ } }); +var iOSKeyboardView = Backbone.View.extend({ + initialize: function(options) { + options = options || {}; + this.deferred = options.deferred || Q.defer(); + + this.modalAlert = new ModalAlert({ + markdowns: [ + '## iOS device', + '', + 'On iOS, user input is needed to bring up the keyboard. Click ', + 'on this window to bring up the keyboard so you can type commands' + ] + }); + this.modalAlert.container.navEvents.on('click', this.clicked, this); + }, + + clicked: function() { + this.modalAlert.close(); + $('#commandTextField').focus(); + } +}); + var ConfirmCancelTerminal = Backbone.View.extend({ initialize: function(options) { options = options || {}; - this.deferred = options.deferred || Q.defer(); this.modalAlert = new ModalAlert(_.extend( {}, @@ -21904,6 +21984,8 @@ exports.CanvasTerminalHolder = CanvasTerminalHolder; exports.LevelToolbar = LevelToolbar; exports.NextLevelConfirm = NextLevelConfirm; +exports.iOSKeyboardView = iOSKeyboardView; + }); require("/src/js/views/index.js"); diff --git a/src/js/app/index.js b/src/js/app/index.js index 8f8aca7f..4952a553 100644 --- a/src/js/app/index.js +++ b/src/js/app/index.js @@ -117,6 +117,16 @@ var init = function() { eventBaton.trigger('commandSubmitted', "gc; git checkout HEAD~1; git commit; git checkout -b bugFix; gc; gc; git rebase -i HEAD~2; git rebase master; git checkout master; gc; gc; git merge bugFix"); }, 500); } + if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent)) { + alert(1); + var Views = require('../views'); + setTimeout(function() { + eventBaton.trigger('commandSubmitted', 'iOS keyboardPop'); + }, 600); + setTimeout(function() { + new Views.iOSKeyboardView(); + }, 1000); + } }; $(document).ready(init); diff --git a/src/js/views/index.js b/src/js/views/index.js index 65b77ead..3e4770b4 100644 --- a/src/js/views/index.js +++ b/src/js/views/index.js @@ -224,11 +224,15 @@ var ModalView = Backbone.View.extend({ var ModalTerminal = ContainedBase.extend({ tagName: 'div', - className: 'box flex1', + className: 'modalTerminal box flex1', template: _.template($('#terminal-window-template').html()), + events: { + 'click div.inside': 'onClick' + }, initialize: function(options) { options = options || {}; + this.navEvents = options.events || _.clone(Backbone.Events); this.container = new ModalView(); this.JSON = { @@ -238,6 +242,10 @@ var ModalTerminal = ContainedBase.extend({ this.render(); }, + onClick: function() { + this.navEvents.trigger('click'); + }, + getInsideElement: function() { return this.$('.inside'); } @@ -280,11 +288,32 @@ var ModalAlert = ContainedBase.extend({ } }); +var iOSKeyboardView = Backbone.View.extend({ + initialize: function(options) { + options = options || {}; + this.deferred = options.deferred || Q.defer(); + + this.modalAlert = new ModalAlert({ + markdowns: [ + '## iOS device', + '', + 'On iOS, user input is needed to bring up the keyboard. Click ', + 'on this window to bring up the keyboard so you can type commands' + ] + }); + this.modalAlert.container.navEvents.on('click', this.clicked, this); + }, + + clicked: function() { + this.modalAlert.close(); + $('#commandTextField').focus(); + } +}); + var ConfirmCancelTerminal = Backbone.View.extend({ initialize: function(options) { options = options || {}; - this.deferred = options.deferred || Q.defer(); this.modalAlert = new ModalAlert(_.extend( {}, @@ -567,3 +596,5 @@ exports.CanvasTerminalHolder = CanvasTerminalHolder; exports.LevelToolbar = LevelToolbar; exports.NextLevelConfirm = NextLevelConfirm; +exports.iOSKeyboardView = iOSKeyboardView; +