From da1844affc9d77a825dc49c8e04f913371cb26ba Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Fri, 11 Jan 2013 18:53:48 -0800 Subject: [PATCH] Allow symbiote to load Mac view hierarchies. Does not yet load screenshots from the Mac --- bundle/ViewAttributeMappingMac.plist | 2 -- bundle/js/controller.js | 16 ++++++++-------- bundle/js/view_model.js | 3 ++- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/bundle/ViewAttributeMappingMac.plist b/bundle/ViewAttributeMappingMac.plist index f89866b..ca130c8 100644 --- a/bundle/ViewAttributeMappingMac.plist +++ b/bundle/ViewAttributeMappingMac.plist @@ -20,7 +20,6 @@ isRotatedOrScaledFromBase isInFullScreenMode isOpaque - tooltip canBecomeKeyView acceptsTouchEvents wantsRestingTouches @@ -39,7 +38,6 @@ NSControl - value stringValue attributedStringValue diff --git a/bundle/js/controller.js b/bundle/js/controller.js index 2ed97ac..d645cf1 100644 --- a/bundle/js/controller.js +++ b/bundle/js/controller.js @@ -4,14 +4,14 @@ RELOAD_INTERVAL = 500; - guessAtDeviceFamilyBasedOnViewDump = function(viewHier) { - switch (viewHier.accessibilityFrame.size.height) { + guessAtDeviceFamilyBasedOnViewDump = function(viewHeir) { + switch (viewHeir.accessibilityFrame.size.height) { case 1024: return 'ipad'; case 480: return 'iphone'; default: - console.warn("couldn't recognize device family based on screen height of " + data.accessibilityFrame.size.height + "px"); + console.warn("couldn't recognize device family based on screen height of " + viewHeir.accessibilityFrame.size.height + "px"); return 'unknown'; } }; @@ -116,11 +116,11 @@ reload = function() { var deferable; deferable = $.Deferred(); - $.when(frank.fetchViewHierarchy(), frank.fetchOrientation()).done(function(_arg1, orientation) { - var accessibleViews, deviceFamily, rawHier; - rawHier = _arg1[0]; - deviceFamily = guessAtDeviceFamilyBasedOnViewDump(rawHier); - treeView.model.resetViewHier(rawHier); + $.when(frank.fetchViewHeirarchy(), frank.fetchOrientation()).done(function(_arg1, orientation) { + var accessibleViews, deviceFamily, rawHeir; + rawHeir = _arg1[0]; + deviceFamily = guessAtDeviceFamilyBasedOnViewDump(rawHeir); + treeView.model.resetViewHeir(rawHeir); ersatzView.model.resetViews(treeView.model.get('allViews'), deviceFamily, orientation); accessibleViews = treeView.model.getAccessibleViews(); accessibleViewsView.collection.reset(accessibleViews); diff --git a/bundle/js/view_model.js b/bundle/js/view_model.js index 7972be3..9e3fd6d 100644 --- a/bundle/js/view_model.js +++ b/bundle/js/view_model.js @@ -14,7 +14,8 @@ var _i, _len, _ref, _results; _ref = attributes.subviews; _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { + _length = _ref.length; + for (_i = 0, _len = _length; _i < _len; _i++) { subview = _ref[_i]; _results.push(new ViewModel(_.extend(subview, { parent: this,