sc-frank-cucumber 1.2.1.1a856ca.debug → 1.2.1.1dcc760

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. data/frank-skeleton/frank_static_resources.bundle/bundle/ViewAttributeMapping.plist +63 -0
  2. data/frank-skeleton/frank_static_resources.bundle/bundle/ViewAttributeMappingMac.plist +99 -0
  3. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/ViewAttributeMapping.plist +63 -0
  4. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/ViewAttributeMappingMac.plist +99 -0
  5. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/ajax-loader.gif +0 -0
  6. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/file.gif +0 -0
  7. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/folder-closed.gif +0 -0
  8. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/folder.gif +0 -0
  9. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/loader.gif +0 -0
  10. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/loader.png +0 -0
  11. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/minus.gif +0 -0
  12. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/plus.gif +0 -0
  13. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-black-line.gif +0 -0
  14. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-black.gif +0 -0
  15. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-default-line.gif +0 -0
  16. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-default.gif +0 -0
  17. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-famfamfam-line.gif +0 -0
  18. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-famfamfam.gif +0 -0
  19. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-gray-line.gif +0 -0
  20. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-gray.gif +0 -0
  21. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-red-line.gif +0 -0
  22. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/images/treeview-red.gif +0 -0
  23. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/index.html +86 -0
  24. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/index.html.haml +76 -0
  25. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/accessible_views_view.coffee +41 -0
  26. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/accessible_views_view.js +46 -0
  27. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/controller.coffee +134 -0
  28. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/controller.js +139 -0
  29. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/details_view.coffee +42 -0
  30. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/details_view.js +51 -0
  31. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/dropdown_control.coffee +64 -0
  32. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/dropdown_control.js +73 -0
  33. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/ersatz_model.coffee +46 -0
  34. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/ersatz_model.js +60 -0
  35. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/ersatz_view.coffee +167 -0
  36. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/ersatz_view.js +205 -0
  37. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/experiment_bar_model.coffee +10 -0
  38. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/experiment_bar_model.js +17 -0
  39. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/experiment_bar_view.coffee +44 -0
  40. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/experiment_bar_view.js +63 -0
  41. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/frank.coffee +96 -0
  42. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/frank.js +146 -0
  43. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/backbone.js +1431 -0
  44. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/coffee-script.js +8 -0
  45. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/jquery-ui.min.js +405 -0
  46. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/jquery.min.js +4 -0
  47. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/jquery.treeview.js +251 -0
  48. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/json2.js +481 -0
  49. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/raphael.js +5815 -0
  50. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/require.js +2053 -0
  51. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/lib/underscore.js +1059 -0
  52. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/main.coffee +27 -0
  53. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/main.js +29 -0
  54. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/tabs_controller.coffee +13 -0
  55. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/tabs_controller.js +22 -0
  56. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/toast_controller.coffee +15 -0
  57. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/toast_controller.js +28 -0
  58. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/transform_stack.coffee +59 -0
  59. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/transform_stack.js +78 -0
  60. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/tree_view.coffee +53 -0
  61. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/tree_view.js +64 -0
  62. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/view_hier_model.coffee +37 -0
  63. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/view_hier_model.js +48 -0
  64. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/view_model.coffee +39 -0
  65. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/js/view_model.js +62 -0
  66. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/pictos/index.html +329 -0
  67. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/pictos/pictos-web.eot +0 -0
  68. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/pictos/pictos-web.svg +114 -0
  69. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/pictos/pictos-web.ttf +0 -0
  70. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/pictos/pictos-web.woff +0 -0
  71. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/pictos/pictos.css +20 -0
  72. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/pictos/pictos_base64.css +18 -0
  73. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/css/symbiote.css +1 -0
  74. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_elements.scss +28 -0
  75. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_header.scss +61 -0
  76. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_inspect_tabs_list_tabs.scss +194 -0
  77. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_jquery.treeview.scss +68 -0
  78. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_jqui.scss +2 -0
  79. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_layout.scss +13 -0
  80. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_mixins.sass +137 -0
  81. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_reset.scss +32 -0
  82. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_selector_test_toolbar.scss +81 -0
  83. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_solarized.scss +16 -0
  84. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_typography.scss +11 -0
  85. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_unicode.scss +3 -0
  86. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/_z_index.scss +2 -0
  87. data/frank-skeleton/frank_static_resources.bundle/bundle/bundle/stylesheets/sass/symbiote.scss +26 -0
  88. data/frank-skeleton/frank_static_resources.bundle/bundle/images/ajax-loader.gif +0 -0
  89. data/frank-skeleton/frank_static_resources.bundle/bundle/images/file.gif +0 -0
  90. data/frank-skeleton/frank_static_resources.bundle/bundle/images/folder-closed.gif +0 -0
  91. data/frank-skeleton/frank_static_resources.bundle/bundle/images/folder.gif +0 -0
  92. data/frank-skeleton/frank_static_resources.bundle/bundle/images/loader.gif +0 -0
  93. data/frank-skeleton/frank_static_resources.bundle/bundle/images/loader.png +0 -0
  94. data/frank-skeleton/frank_static_resources.bundle/bundle/images/minus.gif +0 -0
  95. data/frank-skeleton/frank_static_resources.bundle/bundle/images/plus.gif +0 -0
  96. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-black-line.gif +0 -0
  97. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-black.gif +0 -0
  98. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-default-line.gif +0 -0
  99. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-default.gif +0 -0
  100. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-famfamfam-line.gif +0 -0
  101. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-famfamfam.gif +0 -0
  102. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-gray-line.gif +0 -0
  103. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-gray.gif +0 -0
  104. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-red-line.gif +0 -0
  105. data/frank-skeleton/frank_static_resources.bundle/bundle/images/treeview-red.gif +0 -0
  106. data/frank-skeleton/frank_static_resources.bundle/bundle/index.html +86 -0
  107. data/frank-skeleton/frank_static_resources.bundle/bundle/index.html.haml +76 -0
  108. data/frank-skeleton/frank_static_resources.bundle/bundle/js/accessible_views_view.coffee +41 -0
  109. data/frank-skeleton/frank_static_resources.bundle/bundle/js/accessible_views_view.js +46 -0
  110. data/frank-skeleton/frank_static_resources.bundle/bundle/js/controller.coffee +134 -0
  111. data/frank-skeleton/frank_static_resources.bundle/bundle/js/controller.js +139 -0
  112. data/frank-skeleton/frank_static_resources.bundle/bundle/js/details_view.coffee +42 -0
  113. data/frank-skeleton/frank_static_resources.bundle/bundle/js/details_view.js +51 -0
  114. data/frank-skeleton/frank_static_resources.bundle/bundle/js/dropdown_control.coffee +64 -0
  115. data/frank-skeleton/frank_static_resources.bundle/bundle/js/dropdown_control.js +73 -0
  116. data/frank-skeleton/frank_static_resources.bundle/bundle/js/ersatz_model.coffee +46 -0
  117. data/frank-skeleton/frank_static_resources.bundle/bundle/js/ersatz_model.js +60 -0
  118. data/frank-skeleton/frank_static_resources.bundle/bundle/js/ersatz_view.coffee +167 -0
  119. data/frank-skeleton/frank_static_resources.bundle/bundle/js/ersatz_view.js +205 -0
  120. data/frank-skeleton/frank_static_resources.bundle/bundle/js/experiment_bar_model.coffee +10 -0
  121. data/frank-skeleton/frank_static_resources.bundle/bundle/js/experiment_bar_model.js +17 -0
  122. data/frank-skeleton/frank_static_resources.bundle/bundle/js/experiment_bar_view.coffee +44 -0
  123. data/frank-skeleton/frank_static_resources.bundle/bundle/js/experiment_bar_view.js +63 -0
  124. data/frank-skeleton/frank_static_resources.bundle/bundle/js/frank.coffee +96 -0
  125. data/frank-skeleton/frank_static_resources.bundle/bundle/js/frank.js +146 -0
  126. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/backbone.js +1431 -0
  127. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/coffee-script.js +8 -0
  128. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/jquery-ui.min.js +405 -0
  129. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/jquery.min.js +4 -0
  130. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/jquery.treeview.js +251 -0
  131. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/json2.js +481 -0
  132. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/raphael.js +5815 -0
  133. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/require.js +2053 -0
  134. data/frank-skeleton/frank_static_resources.bundle/bundle/js/lib/underscore.js +1059 -0
  135. data/frank-skeleton/frank_static_resources.bundle/bundle/js/main.coffee +27 -0
  136. data/frank-skeleton/frank_static_resources.bundle/bundle/js/main.js +29 -0
  137. data/frank-skeleton/frank_static_resources.bundle/bundle/js/tabs_controller.coffee +13 -0
  138. data/frank-skeleton/frank_static_resources.bundle/bundle/js/tabs_controller.js +22 -0
  139. data/frank-skeleton/frank_static_resources.bundle/bundle/js/toast_controller.coffee +15 -0
  140. data/frank-skeleton/frank_static_resources.bundle/bundle/js/toast_controller.js +28 -0
  141. data/frank-skeleton/frank_static_resources.bundle/bundle/js/transform_stack.coffee +59 -0
  142. data/frank-skeleton/frank_static_resources.bundle/bundle/js/transform_stack.js +78 -0
  143. data/frank-skeleton/frank_static_resources.bundle/bundle/js/tree_view.coffee +53 -0
  144. data/frank-skeleton/frank_static_resources.bundle/bundle/js/tree_view.js +64 -0
  145. data/frank-skeleton/frank_static_resources.bundle/bundle/js/view_hier_model.coffee +37 -0
  146. data/frank-skeleton/frank_static_resources.bundle/bundle/js/view_hier_model.js +48 -0
  147. data/frank-skeleton/frank_static_resources.bundle/bundle/js/view_model.coffee +39 -0
  148. data/frank-skeleton/frank_static_resources.bundle/bundle/js/view_model.js +62 -0
  149. data/frank-skeleton/frank_static_resources.bundle/bundle/pictos/index.html +329 -0
  150. data/frank-skeleton/frank_static_resources.bundle/bundle/pictos/pictos-web.eot +0 -0
  151. data/frank-skeleton/frank_static_resources.bundle/bundle/pictos/pictos-web.svg +114 -0
  152. data/frank-skeleton/frank_static_resources.bundle/bundle/pictos/pictos-web.ttf +0 -0
  153. data/frank-skeleton/frank_static_resources.bundle/bundle/pictos/pictos-web.woff +0 -0
  154. data/frank-skeleton/frank_static_resources.bundle/bundle/pictos/pictos.css +20 -0
  155. data/frank-skeleton/frank_static_resources.bundle/bundle/pictos/pictos_base64.css +18 -0
  156. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/css/symbiote.css +1 -0
  157. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_elements.scss +28 -0
  158. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_header.scss +61 -0
  159. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_inspect_tabs_list_tabs.scss +194 -0
  160. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_jquery.treeview.scss +68 -0
  161. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_jqui.scss +2 -0
  162. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_layout.scss +13 -0
  163. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_mixins.sass +137 -0
  164. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_reset.scss +32 -0
  165. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_selector_test_toolbar.scss +81 -0
  166. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_solarized.scss +16 -0
  167. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_typography.scss +11 -0
  168. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_unicode.scss +3 -0
  169. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/_z_index.scss +2 -0
  170. data/frank-skeleton/frank_static_resources.bundle/bundle/stylesheets/sass/symbiote.scss +26 -0
  171. data/frank-skeleton/frankify.xcconfig.tt +1 -1
  172. data/frank-skeleton/libCocoaAsyncSocket.a +0 -0
  173. data/frank-skeleton/libCocoaAsyncSocketMac.a +0 -0
  174. data/frank-skeleton/libCocoaHTTPServer.a +0 -0
  175. data/frank-skeleton/libCocoaHTTPServerMac.a +0 -0
  176. data/frank-skeleton/libCocoaLumberjack.a +0 -0
  177. data/frank-skeleton/libCocoaLumberjackMac.a +0 -0
  178. data/frank-skeleton/libFrank.a +0 -0
  179. data/frank-skeleton/libFrankMac.a +0 -0
  180. data/frank-skeleton/libShelley.a +0 -0
  181. data/lib/frank-cucumber/version.rb +1 -1
  182. metadata +174 -4
@@ -0,0 +1,51 @@
1
+ (function() {
2
+ var INTERESTING_PROPERTIES, IRREGULAR_PROPERTIES, renderListItem;
3
+
4
+ INTERESTING_PROPERTIES = ['class', 'accessibilityLabel', 'tag', 'alpha', 'isHidden'];
5
+
6
+ IRREGULAR_PROPERTIES = INTERESTING_PROPERTIES.concat('parent', 'subviews', 'children');
7
+
8
+ renderListItem = function(propertyName, propertyValue, cssClass) {
9
+ if (propertyValue == null) {
10
+ propertyValue = 'null';
11
+ }
12
+ if (_.isObject(propertyValue)) {
13
+ propertyValue = JSON.stringify(propertyValue);
14
+ }
15
+ return $("<li>").addClass(cssClass).append($('<div/>').addClass('key').text(propertyName), $('<div/>').addClass('value').text(propertyValue));
16
+ };
17
+
18
+ define(function() {
19
+ var DetailsView;
20
+ DetailsView = Backbone.View.extend({
21
+ el: $('#dom-detail'),
22
+ updateModel: function(model) {
23
+ this.model = model;
24
+ return this.refresh();
25
+ },
26
+ refresh: function() {
27
+ var $ul, prop, val, _i, _j, _len, _len1, _ref;
28
+ $ul = $('<ul>');
29
+ for (_i = 0, _len = INTERESTING_PROPERTIES.length; _i < _len; _i++) {
30
+ prop = INTERESTING_PROPERTIES[_i];
31
+ if (this.model.has(prop)) {
32
+ val = this.model.get(prop);
33
+ $ul.append(renderListItem(prop, val, 'interesting'));
34
+ }
35
+ }
36
+ _ref = _.keys(this.model.attributes).sort();
37
+ for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
38
+ prop = _ref[_j];
39
+ if (_.contains(IRREGULAR_PROPERTIES, prop)) {
40
+ continue;
41
+ }
42
+ val = this.model.get(prop);
43
+ $ul.append(renderListItem(prop, val));
44
+ }
45
+ return this.$el.empty().append($ul);
46
+ }
47
+ });
48
+ return DetailsView;
49
+ });
50
+
51
+ }).call(this);
@@ -0,0 +1,64 @@
1
+ define ->
2
+
3
+ DropdownModel = Backbone.Model.extend
4
+ select: ->
5
+ @collection.each (model) =>
6
+ model.set( 'selected', model == @ )
7
+ @trigger('option-clicked',@)
8
+
9
+ DropdownCollection = Backbone.Collection.extend
10
+ model: DropdownModel
11
+
12
+ DropdownView = Backbone.View.extend
13
+ tagName: 'div'
14
+ className: 'dropdown'
15
+
16
+ events:
17
+ "click .drop-indicator": 'clickedDrop'
18
+ "click .button": 'clickedItem'
19
+
20
+ initialize: ->
21
+ @collection = new DropdownCollection()
22
+ @collection.on 'all', _.bind(@render,@)
23
+
24
+ # hackery :(
25
+ $('body').on 'click', _.bind(@clickedOutsideDropdown,@)
26
+
27
+ selectedModel: ->
28
+ selected = @collection.find (m)-> m.get('selected')
29
+ selected || @collection.at(0)
30
+ unselectedModels: ->
31
+ _(@collection.reject (m)-> m.get('selected'))
32
+
33
+ createButtonFor: (model)->
34
+ $("""<button>#{model.get('text')}</button>""")
35
+ .on 'click', => @clickedItem(model)
36
+
37
+ render: ->
38
+ @$el
39
+ .empty()
40
+ .append( @createButtonFor(@selectedModel()) )
41
+ .append( $ul = $("<ul>") )
42
+
43
+ @unselectedModels().each (model)=>
44
+ $ul.append( @createButtonFor(model) )
45
+
46
+ @$el.append( """<div class="drop-indicator">v</div>""" )
47
+
48
+ clickedDrop: (e)->
49
+ e.stopPropagation() #prevent clickedOutsideDropdown from firing
50
+ @$('ul').toggleClass('shown')
51
+
52
+ clickedOutsideDropdown: ->
53
+ @$('ul').removeClass('shown')
54
+
55
+ clickedItem: (model)->
56
+ model.select()
57
+
58
+
59
+
60
+
61
+ {
62
+ DropdownModel : DropdownModel
63
+ DropdownView : DropdownView
64
+ }
@@ -0,0 +1,73 @@
1
+ (function() {
2
+
3
+ define(function() {
4
+ var DropdownCollection, DropdownModel, DropdownView;
5
+ DropdownModel = Backbone.Model.extend({
6
+ select: function() {
7
+ var _this = this;
8
+ this.collection.each(function(model) {
9
+ return model.set('selected', model === _this);
10
+ });
11
+ return this.trigger('option-clicked', this);
12
+ }
13
+ });
14
+ DropdownCollection = Backbone.Collection.extend({
15
+ model: DropdownModel
16
+ });
17
+ DropdownView = Backbone.View.extend({
18
+ tagName: 'div',
19
+ className: 'dropdown',
20
+ events: {
21
+ "click .drop-indicator": 'clickedDrop',
22
+ "click .button": 'clickedItem'
23
+ },
24
+ initialize: function() {
25
+ this.collection = new DropdownCollection();
26
+ this.collection.on('all', _.bind(this.render, this));
27
+ return $('body').on('click', _.bind(this.clickedOutsideDropdown, this));
28
+ },
29
+ selectedModel: function() {
30
+ var selected;
31
+ selected = this.collection.find(function(m) {
32
+ return m.get('selected');
33
+ });
34
+ return selected || this.collection.at(0);
35
+ },
36
+ unselectedModels: function() {
37
+ return _(this.collection.reject(function(m) {
38
+ return m.get('selected');
39
+ }));
40
+ },
41
+ createButtonFor: function(model) {
42
+ var _this = this;
43
+ return $("<button>" + (model.get('text')) + "</button>").on('click', function() {
44
+ return _this.clickedItem(model);
45
+ });
46
+ },
47
+ render: function() {
48
+ var $ul,
49
+ _this = this;
50
+ this.$el.empty().append(this.createButtonFor(this.selectedModel())).append($ul = $("<ul>"));
51
+ this.unselectedModels().each(function(model) {
52
+ return $ul.append(_this.createButtonFor(model));
53
+ });
54
+ return this.$el.append("<div class=\"drop-indicator\">v</div>");
55
+ },
56
+ clickedDrop: function(e) {
57
+ e.stopPropagation();
58
+ return this.$('ul').toggleClass('shown');
59
+ },
60
+ clickedOutsideDropdown: function() {
61
+ return this.$('ul').removeClass('shown');
62
+ },
63
+ clickedItem: function(model) {
64
+ return model.select();
65
+ }
66
+ });
67
+ return {
68
+ DropdownModel: DropdownModel,
69
+ DropdownView: DropdownView
70
+ };
71
+ });
72
+
73
+ }).call(this);
@@ -0,0 +1,46 @@
1
+ define ["frank"], (frank)->
2
+
3
+ ErsatzModel = Backbone.Model.extend
4
+ default:
5
+ highlightFrames = []
6
+
7
+ initialize: ->
8
+ @refreshBaseScreenshot()
9
+
10
+ highlightSomeFramesForABit: (frames)->
11
+ @set('highlightFrames',frames)
12
+ @temporaryHighlightTimeout = window.setTimeout( =>
13
+ @set('highlightFrames',[])
14
+ @temporaryHighlightTimeout = undefined
15
+ , 1500 )
16
+
17
+ resetViews: (views,deviceFamily,orientation)->
18
+ @set('allViews',views)
19
+ @set('deviceFamily',deviceFamily)
20
+ @set('orientation',orientation)
21
+ @set('highlightFrames',[])
22
+ @configureAllViews(views)
23
+
24
+ refreshBaseScreenshot: ->
25
+ @set('baseScreenshotUrl',frank.baseScreenshotUrl())
26
+
27
+ toggleAsploded: ->
28
+ isAsploded = !(@get('isAsploded'))
29
+ @set('isAsploded',isAsploded)
30
+ if isAsploded
31
+ @updateAsplodedViews()
32
+
33
+ isAsploded
34
+
35
+ updateAsplodedViews: ()->
36
+ frank.requestSnapshotRefresh().done =>
37
+ @trigger('snapshots-refreshed',@)
38
+
39
+ configureAllViews: (allViews)->
40
+ allViews.on 'change:active', (subject,isActive)=>
41
+ window.clearTimeout(@temporaryHighlightTimeout) if @temporaryHighlightTimeout?
42
+
43
+ if isActive && !@get('isAsploded')
44
+ @set('highlightFrames',[subject.get('accessibilityFrame')])
45
+ else
46
+ @set('highlightFrames',[])
@@ -0,0 +1,60 @@
1
+ (function() {
2
+
3
+ define(["frank"], function(frank) {
4
+ var ErsatzModel, highlightFrames;
5
+ return ErsatzModel = Backbone.Model.extend({
6
+ "default": highlightFrames = [],
7
+ initialize: function() {
8
+ return this.refreshBaseScreenshot();
9
+ },
10
+ highlightSomeFramesForABit: function(frames) {
11
+ var _this = this;
12
+ this.set('highlightFrames', frames);
13
+ return this.temporaryHighlightTimeout = window.setTimeout(function() {
14
+ _this.set('highlightFrames', []);
15
+ return _this.temporaryHighlightTimeout = void 0;
16
+ }, 1500);
17
+ },
18
+ resetViews: function(views, resolution, deviceFamily, orientation) {
19
+ this.set('allViews', views);
20
+ this.set('resolution', resolution);
21
+ this.set('deviceFamily', deviceFamily);
22
+ this.set('orientation', orientation);
23
+ this.set('highlightFrames', []);
24
+ return this.configureAllViews(views);
25
+ },
26
+ refreshBaseScreenshot: function() {
27
+ return this.set('baseScreenshotUrl', frank.baseScreenshotUrl());
28
+ },
29
+ toggleAsploded: function() {
30
+ var isAsploded;
31
+ isAsploded = !(this.get('isAsploded'));
32
+ this.set('isAsploded', isAsploded);
33
+ if (isAsploded) {
34
+ this.updateAsplodedViews();
35
+ }
36
+ return isAsploded;
37
+ },
38
+ updateAsplodedViews: function() {
39
+ var _this = this;
40
+ return frank.requestSnapshotRefresh().done(function() {
41
+ return _this.trigger('snapshots-refreshed', _this);
42
+ });
43
+ },
44
+ configureAllViews: function(allViews) {
45
+ var _this = this;
46
+ return allViews.on('change:active', function(subject, isActive) {
47
+ if (_this.temporaryHighlightTimeout != null) {
48
+ window.clearTimeout(_this.temporaryHighlightTimeout);
49
+ }
50
+ if (isActive && !_this.get('isAsploded')) {
51
+ return _this.set('highlightFrames', [subject.get('accessibilityFrame')]);
52
+ } else {
53
+ return _this.set('highlightFrames', []);
54
+ }
55
+ });
56
+ }
57
+ });
58
+ });
59
+
60
+ }).call(this);
@@ -0,0 +1,167 @@
1
+ ISO_SKEW = 15
2
+ ISO_MAJOR_OFFSET = 50
3
+ ISO_MINOR_OFFSET = 5
4
+ SCREEN_BOUNDS = {
5
+ iphone: { x: 0, y: 0, width: 320, height: 480 }
6
+ ipad: { x: 0, y: 0, width: 768, height: 1024 }
7
+ }
8
+ #SCREENSHOT_URL = symbiote.baseUrlFor( "screenshot" )
9
+
10
+ define ['transform_stack','ersatz_model'], (transformStack,ErsatzModel)->
11
+
12
+ drawStaticBackdropAndReturnTransformer = (paper,deviceFamily,orientation,isoSkew) ->
13
+ paper.clear()
14
+ paper.canvas.setAttribute "width", "100%"
15
+ paper.canvas.setAttribute "height", "100%"
16
+
17
+ isiPhone = ('iphone' == deviceFamily)
18
+
19
+ if isiPhone
20
+ paper.canvas.setAttribute "viewBox", "0 0 380 720"
21
+ rotationPoint = [190,360]
22
+ else
23
+ paper.canvas.setAttribute "viewBox", "0 0 875 1200"
24
+ rotationPoint = [437,600]
25
+
26
+ transformer = transformStack()
27
+
28
+ transformer.skew(0, isoSkew).translate( 6, 6 )
29
+
30
+
31
+ rotation = switch orientation
32
+ when 'landscape_right' then 90
33
+ when 'portrait_upside_down' then 180
34
+ when 'landscape_left' then 270
35
+ else false
36
+
37
+ if rotation
38
+ transformer.rotateAroundPoint(rotation,rotationPoint...)
39
+
40
+ # main outline of device
41
+ if isiPhone
42
+ paper.rect(0, 0, 360, 708, 40).attr(
43
+ fill: "black"
44
+ stroke: "gray"
45
+ "stroke-width": 4
46
+ ).transform transformer.desc()
47
+ else
48
+ paper.rect( 10, 10, 855, 1110, 20 ).attr(
49
+ 'fill': 'black',
50
+ 'stroke': 'gray',
51
+ 'stroke-width': 6
52
+ ).transform transformer.desc()
53
+
54
+
55
+ if isiPhone
56
+ # home button
57
+ transformer.push().translate( 180, 655 )
58
+ paper.circle(0, 0, 34).transform(transformer.desc()).attr( "fill", "90-#303030-#101010" )
59
+
60
+ # square inside home button
61
+ paper.rect(0, 0, 22, 22, 5).attr(
62
+ stroke: "gray"
63
+ "stroke-width": 2
64
+ ).transform transformer.push().translate(-11, -11).descAndPop()
65
+
66
+ transformer.translate(20, 120)
67
+
68
+ else
69
+ transformer.translate(50,50)
70
+
71
+ if( isoSkew > 0 )
72
+ transformer.translate(-ISO_MAJOR_OFFSET, 0)
73
+ transformer
74
+
75
+
76
+ transformFromBaseForViewModel = (baseTransformer,viewModel,withSkew=false)->
77
+ {origin:{x,y}} = viewModel.get('accessibilityFrame')
78
+ baseTransformer.push().translate(x,y)
79
+ if( withSkew )
80
+ baseTransformer.translate(viewModel.get('depth')*-ISO_MINOR_OFFSET, 0)
81
+ baseTransformer.descAndPop()
82
+
83
+ ErsatzViewSnapshotView = Backbone.View.extend
84
+ initialize:->
85
+ @model.on('change:active',_.bind(@updateOpacity,@))
86
+ @render()
87
+
88
+ render: ->
89
+ frame = @model.get('accessibilityFrame')
90
+ @el
91
+ .attr
92
+ transform: transformFromBaseForViewModel( @options.baseTransformer, @model,true )
93
+ src: @model.getSnapshotUrl()
94
+ x: 0
95
+ y: 0
96
+ width: frame.size.width
97
+ height: frame.size.height
98
+ @updateOpacity()
99
+ @el
100
+
101
+ updateOpacity: ->
102
+ opacity = ( if @model.get('active') then 1.0 else 0.05 )
103
+ @el.attr('opacity',opacity)
104
+
105
+
106
+ ErsatzView = Backbone.View.extend
107
+ el: $('#ui-locator-view')
108
+
109
+ initialize: ->
110
+ _.bindAll( @, 'render' )
111
+ @model = new ErsatzModel()
112
+ @highlights = []
113
+ @paper = new Raphael(@.el)
114
+ @model.on 'change:baseScreenshotUrl', _.bind(@refreshBaseScreenshot,@)
115
+ @model.on 'change:isAsploded', _.bind(@render,@)
116
+ @model.on 'snapshots-refreshed', _.bind(@refreshSnapshots,@)
117
+ @model.on 'change:highlightFrames', _.bind(@refreshHighlightFrames,@)
118
+
119
+ render: ->
120
+ @highlights = []
121
+
122
+ isoSkew = (if @model.get('isAsploded') then ISO_SKEW else 0)
123
+ @backdropTransformer = drawStaticBackdropAndReturnTransformer(@paper,@model.get('deviceFamily'),@model.get('orientation'),isoSkew)
124
+ @backdrop = @paper.image()
125
+ @refreshBaseScreenshot()
126
+ if @model.get('isAsploded')
127
+ @backdrop.attr('opacity',0.5)
128
+ @refreshSnapshots()
129
+
130
+ @el
131
+
132
+ screenBounds: -> SCREEN_BOUNDS[@model.get('deviceFamily')]
133
+
134
+
135
+ refreshBaseScreenshot: ->
136
+ newScreenshotUrl = @model.get('baseScreenshotUrl')
137
+ return unless newScreenshotUrl?
138
+
139
+ @backdrop
140
+ .transform(@backdropTransformer.desc())
141
+ .attr( @screenBounds() )
142
+ .attr( 'src', newScreenshotUrl )
143
+ .toFront()
144
+
145
+ refreshSnapshots: ->
146
+ @model.get('allViews').each (viewModel) =>
147
+ snapshotView = new ErsatzViewSnapshotView(
148
+ model: viewModel
149
+ baseTransformer: @backdropTransformer
150
+ el: @paper.image()
151
+ )
152
+
153
+ refreshHighlightFrames: ->
154
+ h.remove() for h in @highlights
155
+ @highlights = []
156
+
157
+ @highlights = _.map @model.get('highlightFrames'), ({origin,size})=>
158
+ @paper.rect().attr(
159
+ fill: "#aaff00"
160
+ opacity: 0.8
161
+ stroke: "black"
162
+ transform: @backdropTransformer.push().translate(origin.x,origin.y).descAndPop()
163
+ x: 0
164
+ y: 0
165
+ width: size.width
166
+ height: size.height
167
+ )