made big progress

This commit is contained in:
Peter Cottle 2013-01-08 13:01:54 -08:00
parent 9b77632faf
commit d7bb4064dc
6 changed files with 3392 additions and 2249 deletions

File diff suppressed because it is too large Load diff

View file

@ -63,7 +63,7 @@ var init = function() {
events.trigger('resize', e); events.trigger('resize', e);
}); });
$(window).on('windowSizeCheck', _.throttle(function(e) { $(window).on('resize', _.throttle(function(e) {
var width = $(window).width(); var width = $(window).width();
var height = $(window).height(); var height = $(window).height();
eventBaton.trigger('windowSizeCheck', {w: width, h: height}); eventBaton.trigger('windowSizeCheck', {w: width, h: height});
@ -109,6 +109,7 @@ var init = function() {
$('#commandTextField').on('keydown', makeKeyListener('keydown')); $('#commandTextField').on('keydown', makeKeyListener('keydown'));
$('#commandTextField').on('keyup', makeKeyListener('keyup')); $('#commandTextField').on('keyup', makeKeyListener('keyup'));
$(window).trigger('resize');
/* hacky demo functionality */ /* hacky demo functionality */
if (/\?demo/.test(window.location.href)) { if (/\?demo/.test(window.location.href)) {

View file

@ -12,7 +12,9 @@ var GLOBAL = {
var VIEWPORT = { var VIEWPORT = {
minZoom: 0.66, minZoom: 0.66,
maxZoom: 1.25 maxZoom: 1.25,
minWidth: 600,
minHeight: 600
}; };
var GRAPHICS = { var GRAPHICS = {

View file

@ -149,7 +149,6 @@ var CommandPromptView = Backbone.View.extend({
// now for positioning // now for positioning
var leftOffset = String(widthPerChar * (selectionStart % numCharsPerLine)) + 'px'; var leftOffset = String(widthPerChar * (selectionStart % numCharsPerLine)) + 'px';
var topOffset = String(Math.floor(selectionStart / numCharsPerLine) * heightPerRow) + 'px'; var topOffset = String(Math.floor(selectionStart / numCharsPerLine) * heightPerRow) + 'px';
console.log('height per row', heightPerRow, 'selection start', selectionStart, 'num chars perline', numCharsPerLine);
// one reflow? :D // one reflow? :D
$(this.commandCursor).css({ $(this.commandCursor).css({

View file

@ -1,4 +1,4 @@
qvar GitError = require('../util/errors').GitError; var GitError = require('../util/errors').GitError;
var _ = require('underscore'); var _ = require('underscore');
var Q = require('q'); var Q = require('q');
// horrible hack to get localStorage Backbone plugin // horrible hack to get localStorage Backbone plugin
@ -417,7 +417,7 @@ var ViewportAlert = Backbone.View.extend({
} }
}); });
var WindowSizeAlertWindow = Backbone.View.extend({ var WindowSizeAlertWindow = ViewportAlert.extend({
initialize: function(options) { initialize: function(options) {
this.eventBatonName = 'windowSizeCheck'; this.eventBatonName = 'windowSizeCheck';
this.markdowns = [ this.markdowns = [
@ -425,19 +425,19 @@ var WindowSizeAlertWindow = Backbone.View.extend({
'Please resize your window back to a supported size', 'Please resize your window back to a supported size',
'', '',
'(and of course, pull requests to fix this are appreciated :D)' '(and of course, pull requests to fix this are appreciated :D)'
] ];
ZoomAlertWindow.__super__.initialize.apply(this, [options]); WindowSizeAlertWindow.__super__.initialize.apply(this, [options]);
}, },
batonFired: function(size) { batonFired: function(size) {
if (size.w < Constants.VIEWPORT.minWidth || if (size.w > Constants.VIEWPORT.minWidth &&
size.h < Constants.VIEWPORT.minHeight) { size.h > Constants.VIEWPORT.minHeight) {
this.finish(); this.finish();
} }
} }
}); });
var ZoomAlertWindow = Backbone.View.extend({ var ZoomAlertWindow = ViewportAlert.extend({
initialize: function(options) { initialize: function(options) {
this.eventBatonName = 'zoomChange'; this.eventBatonName = 'zoomChange';
this.markdowns = [ this.markdowns = [
@ -445,7 +445,7 @@ var ZoomAlertWindow = Backbone.View.extend({
'Please zoom back to a supported zoom level with Ctrl + and Ctrl -', 'Please zoom back to a supported zoom level with Ctrl + and Ctrl -',
'', '',
'(and of course, pull requests to fix this are appreciated :D)' '(and of course, pull requests to fix this are appreciated :D)'
] ];
ZoomAlertWindow.__super__.initialize.apply(this, [options]); ZoomAlertWindow.__super__.initialize.apply(this, [options]);
}, },

View file

@ -4,7 +4,6 @@ Big Things
* basically just an extension of level (or sandbox), that has commands like * basically just an extension of level (or sandbox), that has commands like
```save tree beginning``` or ```save tree goal``` and then a final ```save tree beginning``` or ```save tree goal``` and then a final
dialog typing area thingy dialog typing area thingy
[ ] warning for window size
Medium things: Medium things:
@ -30,11 +29,12 @@ Ideas for cleaning
/************************************* /*************************************
** Publish Things ** ** Publish Things **
************************************/ ************************************/
- fix terminal input field in general
Done things: Done things:
(I only started this on Dec 17th 2012 to get a better sense of what was done) (I only started this on Dec 17th 2012 to get a better sense of what was done)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[x] fix terminal input field in general
[x] warning for window size
[x] esc on multiview quits absolutely [x] esc on multiview quits absolutely
[x] cross browser support... firefox only LULZ. should be just css right? WRONG [x] cross browser support... firefox only LULZ. should be just css right? WRONG
[x] keyboard navigation for level selector [x] keyboard navigation for level selector