overlay_me 0.13.0 → 0.13.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/CHANGELOG.md +10 -1
  2. data/Gemfile +10 -1
  3. data/Gemfile.lock +32 -12
  4. data/Guardfile +13 -0
  5. data/README.md +32 -16
  6. data/Rakefile +67 -88
  7. data/javascripts/{addons → coffeescripts/addons}/layout_resizer.js.coffee +0 -0
  8. data/javascripts/coffeescripts/basics_panel.js.coffee +42 -0
  9. data/javascripts/{draggable.js.coffee → coffeescripts/draggable.js.coffee} +0 -0
  10. data/javascripts/{init.js.coffee → coffeescripts/init.js.coffee} +11 -2
  11. data/javascripts/{lib → coffeescripts/lib}/backbone.js +0 -0
  12. data/javascripts/{lib → coffeescripts/lib}/html5slider.js +0 -0
  13. data/javascripts/{lib → coffeescripts/lib}/jquery.js +0 -0
  14. data/javascripts/{lib → coffeescripts/lib}/underscore.js +0 -0
  15. data/javascripts/{menu.js.coffee → coffeescripts/menu.js.coffee} +8 -3
  16. data/javascripts/{menu_item.js.coffee → coffeescripts/menu_item.js.coffee} +5 -5
  17. data/javascripts/{mixins → coffeescripts/mixins}/hideable.js.coffee +0 -0
  18. data/javascripts/{mixins → coffeescripts/mixins}/storable.js.coffee +0 -0
  19. data/javascripts/coffeescripts/overlay_me.js.coffee +7 -0
  20. data/javascripts/{overlays → coffeescripts/overlays}/content_div_mngmt.js.coffee +0 -0
  21. data/javascripts/{overlays → coffeescripts/overlays}/draggable_image.js.coffee +0 -0
  22. data/javascripts/{overlays → coffeescripts/overlays}/dynamic_images_mngmt.js.coffee +0 -0
  23. data/javascripts/{overlays → coffeescripts/overlays}/image.js.coffee +0 -0
  24. data/javascripts/{overlays → coffeescripts/overlays}/images_container.js.coffee +0 -0
  25. data/javascripts/{overlays → coffeescripts/overlays}/images_directory.js.coffee +0 -0
  26. data/javascripts/{overlays → coffeescripts/overlays}/images_mngt_div.js.coffee +0 -0
  27. data/javascripts/{overlays → coffeescripts/overlays}/init.js.coffee +0 -0
  28. data/javascripts/coffeescripts/overlays_panel.js.coffee +90 -0
  29. data/javascripts/overlay_me.css_embedded.js +13166 -0
  30. data/{overlay_me.js → javascripts/overlay_me.js} +216 -150
  31. data/lib/overlay_me.rb +15 -0
  32. data/lib/overlay_me/version.rb +1 -1
  33. data/spec/SpecRunner.html +56 -0
  34. data/spec/javascripts/coffeescripts/init.spec.js.coffee +21 -0
  35. data/spec/javascripts/coffeescripts/menu.spec.js.coffee +36 -0
  36. data/spec/javascripts/coffeescripts/menu_item.spec.js.coffee +66 -0
  37. data/spec/javascripts/init.spec.js +25 -0
  38. data/spec/javascripts/menu.spec.js +38 -0
  39. data/spec/javascripts/menu_item.spec.js +81 -0
  40. data/spec/lib/jasmine-1.2.0.rc3/MIT.LICENSE +20 -0
  41. data/spec/lib/jasmine-1.2.0.rc3/jasmine-html.js +616 -0
  42. data/spec/lib/jasmine-1.2.0.rc3/jasmine.css +81 -0
  43. data/spec/lib/jasmine-1.2.0.rc3/jasmine.js +2530 -0
  44. data/{overlay_me.css → stylesheets/overlay_me.css} +27 -78
  45. data/stylesheets/{overlay_me.css.scss → scss/overlay_me.css.scss} +2 -1
  46. data/vendor/assets/javascripts/overlay_me/addons/layout_resizer.js +0 -51
  47. data/vendor/assets/javascripts/overlay_me/overlay_me.min.js +10 -8
  48. metadata +42 -29
  49. data/javascripts/basics.js.coffee +0 -38
  50. data/javascripts/overlay_me.js.coffee +0 -7
  51. data/javascripts/overlays.js.coffee +0 -87
@@ -11887,7 +11887,7 @@ function style(element, styles) {
11887
11887
  })();
11888
11888
  (function() {
11889
11889
 
11890
- $o('head').append('<style rel="stylesheet" type="text/css">button{font-size:9px;margin:0 3px;padding:0 3px}#overlay_me_page_container{position:relative}#overlay_me_menu{position:fixed;right:0;z-index:990}#overlay_me_menu *{line-height:14px}#overlay_me_menu .drag-me{line-height:100%;display:block;color:black;font-size:.7em;text-align:center;background-image:-webkit-gradient(linear,0deg,0deg,color-stop(0%,#999),color-stop(30%,#ddd),color-stop(70%,#ddd),color-stop(100%,#999));background-image:-webkit-linear-gradient(0deg,#999,#ddd 30%,#ddd 70%,#999 100%);background-image:-moz-linear-gradient(0deg,#999,#ddd 30%,#ddd 70%,#999 100%);background-image:-o-linear-gradient(0deg,#999,#ddd 30%,#ddd 70%,#999 100%);background-image:-ms-linear-gradient(0deg,#999,#ddd 30%,#ddd 70%,#999 100%);background-image:linear-gradient(0deg,#999,#ddd 30%,#ddd 70%,#999 100%);padding:1px}#overlay_me_menu .drag-me:hover{cursor:move}#overlay_me_menu ul{list-style:none;margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}.menu-item{text-align:left;background-color:#CCC;border:1px solid rgba(255,255,255,0.2);width:200px}.menu-item a.collaps-button{cursor:pointer;position:absolute;padding-top:9px;padding-left:5px;width:13px;height:9px;border:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAJCAYAAADpeqZqAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIlJREFUeNpivHDhQujz589TmZiYvjMQAP/+/eOQkZGZyfD//38ZIL77nzhwG4ilQJpA2BiIPxHQ8BGIDUHqYZpAOIWApiSYWmRNIDfPxaYaKD4bWR2KJiDmA+KzaHrOQMVxagJhfSD+ALXhA5TPQEgTCCcD8V+gpmRs8rg0MQI1eANpJmzyAAEGAKD/bax/HrzbAAAAAElFTkSuQmCC) no-repeat center 3px}.menu-item a.collaps-button span{display:none;color:yellow}.menu-item a.collaps-button span:hover{color:yellow}.menu-item label.title{padding-left:20px;color:white;cursor:pointer;width:187px;line-height:1.1em;font-size:14px;background:none}.menu-item.collapsed .item-content{display:none}.menu-item.collapsed a.collaps-button{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAANCAYAAAB7AEQGAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKtJREFUeNpiuHz5ctD///+lgJgBF2Z68uRJOgMDw0EgNmTAAZiA4AeQVgHiA0CchFUREpsPiOcCjZ8NZWNVBAaMjIwpQGofEOvjVAQFxkATDwJxMkgNCy7HAk3kB1KzgApf4DIJBD4CcRpQ8TZcJp2D+vQiVjcBjZ8HpBxhCtAVfQbiVKDxIMd+QtbI8u/fP04gfQ+Iw4D4LDa7WSQlJUGBdxyIn+DyAUCAAQDxsEXD9kreLQAAAABJRU5ErkJggg==) no-repeat center top}#overlay_panel .content-mgnt-block{position:relative;line-height:10px}#overlay_panel .content-mgnt-block .unicorns{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAklJREFUeNqEks1u00AQx3d27V3HdezY+SBpkKBFoBZxQEKIOwfegBs3rtwoPABvw3sgceKAuFWtUBBSaT6ctvHXer2zOElTVaoKI/2lWWl/O//ZGZi8jgSPxFv3JX93+CJvfJ4/09++vzH6S/SVH59+IohH5JagxBilC4zNHHigSLvtTCPRnLYxtB4b29ojGglBc1PG1PAyLfUxzszIX7B86MwLP/iVkS566DWeEgo+gfrWdV1VJoZgpUdqon84p1a+wxI1CA+l3Z+yqu89N5a9v65EVgK8TOpgH/edZS6JAZ97/AkfKjF3pTpRkUrlfQFnoGlaHNc2F0sAzPIFWIl9WMEGTYUZJfyB12ED2l9UE6bkDAcoy+0QznXJ8nIEBosNuIb3xLoBNIlRhNlc7Ho9dDA6l1OC8gKGUGEnhAyBFmpSu8zqf9jAzqZ/RIUxFDR0G2LQ6ueIwUzGFIuE95livS4p2RaUVQYas/p+xQ4eiavPqO2nKPUcCrvlCR50uqlirXGeiUWeua4uva6vebNDwHIJErq2fW0Mdfcxpjqmqe37Nnd73US64Ummt8a5bCpZhh5UrZanfS9gBw/5tcorGSz1TJ/rCTljoomOGDTLsh+NUz8Ypdz/ndBwlpFeIdn7Hevm9miD9QNxdVGNSQzGSR3ao6Duekm23fqT3Al/Ju3waAEnr1xyayxnymhgNcU9Z7sx5LtWA+6bquxXaeLr5J+wMZebRQwDiwW2x0O7I1y7ZxOrS+X/4Y0DXJ0pANhgM4sKRv4KMACD6UDbVgTzkgAAAABJRU5ErkJggg==) no-repeat center center;width:15px;height:15px;position:absolute;right:0;top:6px}#overlay_panel label{margin:0;font-size:14px}#overlay_panel .content-mgnt-block,#overlay_panel #images_mgnt{text-align:left;padding:3px 4px;margin:2px;border:1px #777 solid;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#overlay_panel .content-mgnt-block legend,#overlay_panel #images_mgnt legend{font-size:10px;padding:0 3px;margin-left:10px}#overlay_panel .slider-block{display:block}#overlay_panel .slider-block label{font-size:60%;margin:0 5px 0 0;vertical-align:top}#overlay_panel .slider-block input[type=range]{margin:0;height:14px;width:120px}#overlay_panel #images_mgnt{width:186px}#overlay_panel #images_mgnt .controls{padding-bottom:2px}#overlay_panel #images_mgnt .controls label{margin-right:5px}#overlay_panel #images_mgnt .overlay-image-block,#overlay_panel #images_mgnt .images_dir{border:1px solid rgba(255,255,255,0.2);border-right:none;border-left:none;padding-top:2px}#overlay_panel #images_mgnt .overlay-image-block:first-child,#overlay_panel #images_mgnt .images_dir:first-child{border-top:none;padding-top:0}#overlay_panel #images_mgnt .overlay-image-block{text-align:left;position:relative;width:186px}#overlay_panel #images_mgnt .overlay-image-block.hovered{background-color:rgba(255,255,0,0.5)}#overlay_panel #images_mgnt .overlay-image-block .del-button{position:absolute;right:0;top:0;margin:1px;cursor:pointer;border:1px #AAA solid;font-size:10px;line-height:13px;background-color:#444;color:white;font-weight:bold;padding:0 3px}#overlay_panel #images_mgnt .images_dir{line-height:18px}#overlay_panel #images_mgnt .images_dir .sub-block{border-left:2px white solid;padding-left:2px;margin-left:5px}#overlay_panel #images_mgnt .images_dir>input[type=checkbox]{-webkit-appearance:none;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAANCAYAAAB7AEQGAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKtJREFUeNpiuHz5ctD///+lgJgBF2Z68uRJOgMDw0EgNmTAAZiA4AeQVgHiA0CchFUREpsPiOcCjZ8NZWNVBAaMjIwpQGofEOvjVAQFxkATDwJxMkgNCy7HAk3kB1KzgApf4DIJBD4CcRpQ8TZcJp2D+vQiVjcBjZ8HpBxhCtAVfQbiVKDxIMd+QtbI8u/fP04gfQ+Iw4D4LDa7WSQlJUGBdxyIn+DyAUCAAQDxsEXD9kreLQAAAABJRU5ErkJggg==) no-repeat center center;display:inline-block;width:13px;height:13px}#overlay_panel #images_mgnt .images_dir>input[type=checkbox]:checked{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAJCAYAAADpeqZqAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIlJREFUeNpivHDhQujz589TmZiYvjMQAP/+/eOQkZGZyfD//38ZIL77nzhwG4ilQJpA2BiIPxHQ8BGIDUHqYZpAOIWApiSYWmRNIDfPxaYaKD4bWR2KJiDmA+KzaHrOQMVxagJhfSD+ALXhA5TPQEgTCCcD8V+gpmRs8rg0MQI1eANpJmzyAAEGAKD/bax/HrzbAAAAAElFTkSuQmCC) no-repeat center center;width:13px;height:13px;margin:-2px 5px 0 0}#overlay_panel #images_mgnt .dynamic-adds{padding-top:4px}#overlay_panel #images_mgnt .dynamic-adds label{font-size:75%}#overlay_panel #images_mgnt .dynamic-adds input{width:95px;font-size:10px;margin-left:2px}#overlay_panel #images_mgnt .dynamic-adds button{font-size:10px}#overlay_panel input[type=checkbox],#overlay_panel label,#overlay_panel #contentSlider,#overlay_panel .zindex-switch{display:inline}#overlay_panel input[type=checkbox]{vertical-align:middle;margin:-3px 5px 0 0}#overlay_me_images_container{position:absolute;z-index:4;top:0;left:0}#overlay_me_images_container div{position:absolute}#overlay_me_images_container div.highlight{border:2px solid red;margin-top:-2px;margin-left:-2px}#overlay_me_images_container div:hover{cursor:move}#overlay_me_images_container img{position:absolute;top:0;left:0}#overlay_me_menu.collapsed .drag-me,#overlay_me_menu.collapsed .menu-item{width:25px}#overlay_me_menu.collapsed .drag-me{height:10px;overflow:hidden}#overlay_me_menu.collapsed button{height:10px;overflow:hidden}#overlay_me_menu.collapsed .overlay-image-block{height:14px;margin-top:3px}#overlay_me_menu.collapsed .overlay-image-block label,#overlay_me_menu.collapsed #content_div_management_block,#overlay_me_menu.collapsed .controls,#overlay_me_menu.collapsed input[type=range],#overlay_me_menu.collapsed #overlay_panel #contentSlider,#overlay_me_menu.collapsed legend,#overlay_me_menu.collapsed .dynamic-adds,#overlay_me_menu.collapsed .unicorns,#overlay_me_menu.collapsed button.reset,#overlay_me_menu.collapsed button.hide,#overlay_me_menu.collapsed button.del-button{display:none}</style>');
11890
+ $o('head').append('<style rel="stylesheet" type="text/css">#CSS_BLOB#</style>');
11891
11891
 
11892
11892
  window.OverlayMe = {};
11893
11893
 
@@ -11897,8 +11897,12 @@ function style(element, styles) {
11897
11897
  return window.overlay_me_loaded;
11898
11898
  };
11899
11899
 
11900
+ OverlayMe.setLoaded = function() {
11901
+ return window.overlay_me_loaded = true;
11902
+ };
11903
+
11900
11904
  OverlayMe.isMobile = function() {
11901
- return navigator.userAgent.match(/(iPhone|iPod|iPad|Android)/);
11905
+ return OverlayMe.userAgent().match(/(iPhone|iPod|iPad|Android)/);
11902
11906
  };
11903
11907
 
11904
11908
  OverlayMe.mustLoad = function() {
@@ -11907,9 +11911,17 @@ function style(element, styles) {
11907
11911
 
11908
11912
  OverlayMe.clearAndReload = function() {
11909
11913
  localStorage.clear();
11914
+ return OverlayMe.pageReload();
11915
+ };
11916
+
11917
+ OverlayMe.pageReload = function() {
11910
11918
  return window.location.reload();
11911
11919
  };
11912
11920
 
11921
+ OverlayMe.userAgent = function() {
11922
+ return navigator.userAgent;
11923
+ };
11924
+
11913
11925
  }).call(this);
11914
11926
  (function() {
11915
11927
 
@@ -12121,21 +12133,27 @@ function style(element, styles) {
12121
12133
  };
12122
12134
 
12123
12135
  MenuClass.prototype.toggleCollapse = function() {
12124
- if ($o(this.el).hasClass('collapsed')) {
12136
+ if (this.collapsed()) {
12125
12137
  return $o(this.el).removeClass('collapsed');
12126
12138
  } else {
12127
12139
  return $o(this.el).addClass('collapsed');
12128
12140
  }
12129
12141
  };
12130
12142
 
12143
+ MenuClass.prototype.collapsed = function() {
12144
+ return $o(this.el).hasClass('collapsed');
12145
+ };
12146
+
12131
12147
  return MenuClass;
12132
12148
 
12133
12149
  })(OverlayMe.Draggable);
12134
12150
 
12135
12151
  if (OverlayMe.mustLoad()) {
12136
- if (!OverlayMe.menu_box) {
12137
- OverlayMe.menu = new OverlayMe.MenuClass();
12138
- }
12152
+ $o(function() {
12153
+ if (!OverlayMe.menu) {
12154
+ return OverlayMe.menu = new OverlayMe.MenuClass();
12155
+ }
12156
+ });
12139
12157
  }
12140
12158
 
12141
12159
  }).call(this);
@@ -12160,6 +12178,7 @@ function style(element, styles) {
12160
12178
  MenuItem.prototype.initialize = function(attributes, options) {
12161
12179
  var _this = this;
12162
12180
  this.id = attributes.id;
12181
+ $o(this.el).addClass(attributes.id);
12163
12182
  this.el.appendChild(this.collapseButton());
12164
12183
  this.title = this.make('label', {
12165
12184
  "class": 'title'
@@ -12172,8 +12191,7 @@ function style(element, styles) {
12172
12191
  "class": 'item-content'
12173
12192
  });
12174
12193
  this.el.appendChild(this.content);
12175
- this.collapsed = (localStorage.getItem("" + this.id + "-collapsed") === '' ? false : true);
12176
- return this.setCollapse(this.collapsed);
12194
+ return this.setCollapse((localStorage.getItem("" + this.id + "-collapsed") === '1' ? true : false));
12177
12195
  };
12178
12196
 
12179
12197
  MenuItem.prototype.collapseButton = function() {
@@ -12188,12 +12206,12 @@ function style(element, styles) {
12188
12206
  };
12189
12207
 
12190
12208
  MenuItem.prototype.toggleCollapse = function() {
12191
- this.collapsed = !this.collapsed;
12192
- this.setCollapse(this.collapsed);
12209
+ this.setCollapse(!this.collapsed);
12193
12210
  return this.saveState();
12194
12211
  };
12195
12212
 
12196
12213
  MenuItem.prototype.setCollapse = function(toCollapse) {
12214
+ this.collapsed = toCollapse;
12197
12215
  if (toCollapse) {
12198
12216
  return $o(this.el).addClass('collapsed');
12199
12217
  } else {
@@ -12210,7 +12228,7 @@ function style(element, styles) {
12210
12228
  };
12211
12229
 
12212
12230
  MenuItem.prototype.saveState = function() {
12213
- return localStorage.setItem("" + this.id + "-collapsed", (this.collapsed ? 1 : ''));
12231
+ return localStorage.setItem("" + this.id + "-collapsed", (this.collapsed ? 1 : 0));
12214
12232
  };
12215
12233
 
12216
12234
  return MenuItem;
@@ -12219,50 +12237,72 @@ function style(element, styles) {
12219
12237
 
12220
12238
  }).call(this);
12221
12239
  (function() {
12222
- var basics_panel, clear_all_button, collapse_button, hide_button, toggle_all_display,
12223
- _this = this;
12240
+ var __hasProp = {}.hasOwnProperty,
12241
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
12224
12242
 
12225
- if (OverlayMe.mustLoad()) {
12226
- basics_panel = new OverlayMe.MenuItem({
12227
- id: "bacis-options",
12228
- title: "Basics"
12229
- });
12230
- collapse_button = (new Backbone.View).make('button', {
12231
- "class": 'collapse'
12232
- }, 'Collapse (c)');
12233
- $o(collapse_button).bind('click', function(event) {
12234
- return OverlayMe.menu.toggleCollapse();
12235
- });
12236
- basics_panel.append(collapse_button);
12237
- clear_all_button = (new Backbone.View).make('button', {
12238
- "class": 'reset',
12239
- onClick: "javascript: OverlayMe.clearAndReload()"
12240
- }, 'Reset All (r)');
12241
- basics_panel.append(clear_all_button);
12242
- toggle_all_display = function() {
12243
- $o(window).trigger('overlay_me:toggle_all_display');
12244
- return $o(window).trigger('overlay_me:toggle_overlay_me_images_container_display');
12243
+ OverlayMe.BasicsPanel = (function(_super) {
12244
+
12245
+ __extends(BasicsPanel, _super);
12246
+
12247
+ BasicsPanel.name = 'BasicsPanel';
12248
+
12249
+ function BasicsPanel() {
12250
+ return BasicsPanel.__super__.constructor.apply(this, arguments);
12251
+ }
12252
+
12253
+ BasicsPanel.prototype.initialize = function(attributes, options) {
12254
+ var clear_all_button, collapse_button, hide_button, toggle_all_display,
12255
+ _this = this;
12256
+ BasicsPanel.__super__.initialize.call(this, {
12257
+ id: "basics-options-panel",
12258
+ title: "Basics"
12259
+ }, options);
12260
+ collapse_button = (new Backbone.View).make('button', {
12261
+ "class": 'collapse'
12262
+ }, 'Collapse (c)');
12263
+ $o(collapse_button).bind('click', function(event) {
12264
+ return OverlayMe.menu.toggleCollapse();
12265
+ });
12266
+ this.append(collapse_button);
12267
+ clear_all_button = (new Backbone.View).make('button', {
12268
+ "class": 'reset',
12269
+ onClick: "javascript: OverlayMe.clearAndReload()"
12270
+ }, 'Reset All (r)');
12271
+ this.append(clear_all_button);
12272
+ toggle_all_display = function() {
12273
+ $o(window).trigger('overlay_me:toggle_all_display');
12274
+ return $o(window).trigger('overlay_me:toggle_overlay_me_images_container_display');
12275
+ };
12276
+ hide_button = (new Backbone.View).make('button', {
12277
+ "class": 'hide'
12278
+ }, 'Hide (h)');
12279
+ $o(hide_button).bind('click', function(event) {
12280
+ return toggle_all_display();
12281
+ });
12282
+ this.append(hide_button);
12283
+ OverlayMe.menu.append(this.render());
12284
+ return $o(window).bind('keypress', function(event) {
12285
+ if (event.charCode === 104) {
12286
+ toggle_all_display();
12287
+ }
12288
+ if (event.charCode === 99) {
12289
+ OverlayMe.menu.toggleCollapse();
12290
+ }
12291
+ if (event.charCode === 114) {
12292
+ return OverlayMe.clearAndReload();
12293
+ }
12294
+ });
12245
12295
  };
12246
- hide_button = (new Backbone.View).make('button', {
12247
- "class": 'hide'
12248
- }, 'Hide (h)');
12249
- $o(hide_button).bind('click', function(event) {
12250
- return toggle_all_display();
12251
- });
12252
- basics_panel.append(hide_button);
12253
- OverlayMe.menu.append(basics_panel.render());
12254
- $o(window).bind('keypress', function(event) {
12255
- if (event.charCode === 104) {
12256
- toggle_all_display();
12257
- }
12258
- if (event.charCode === 99) {
12259
- OverlayMe.menu.toggleCollapse();
12260
- }
12261
- if (event.charCode === 114) {
12262
- return OverlayMe.clearAndReload();
12263
- }
12264
- });
12265
- }
12296
+
12297
+ return BasicsPanel;
12298
+
12299
+ })(OverlayMe.MenuItem);
12300
+
12301
+ $o(function() {
12302
+ if (!OverlayMe.basics_panel) {
12303
+ return OverlayMe.basics_panel = new OverlayMe.BasicsPanel();
12304
+ }
12305
+ });
12266
12306
 
12267
12307
  }).call(this);
12268
12308
  (function() {
@@ -12985,116 +13025,142 @@ function style(element, styles) {
12985
13025
 
12986
13026
  }).call(this);
12987
13027
  (function() {
12988
- var buildTree, displayTree, files_tree, overlay_panel, shiftTofiles;
13028
+ var __hasProp = {}.hasOwnProperty,
13029
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
12989
13030
 
12990
- if (OverlayMe.mustLoad()) {
12991
- overlay_panel = new OverlayMe.MenuItem({
12992
- id: "overlay_panel",
12993
- title: "Overlays"
12994
- });
12995
- overlay_panel.append(new OverlayMe.Overlays.ContentDivManagementBlock().render());
12996
- OverlayMe.images_management_div = new OverlayMe.Overlays.ImagesManagementDiv();
12997
- overlay_panel.append(OverlayMe.images_management_div.render());
12998
- OverlayMe.menu.append(overlay_panel.render());
12999
- $o(window).bind('mousemove', function(event) {
13000
- return $o(window).trigger('mymousemove', event);
13001
- });
13002
- OverlayMe.dyn_manager = new OverlayMe.Overlays.DynamicManager();
13003
- OverlayMe.dyn_manager.loadAll();
13004
- OverlayMe.loadDefaultImage = function() {
13005
- if (OverlayMe.dyn_manager.isEmpty()) {
13006
- return OverlayMe.dyn_manager.addImage('https://a248.e.akamai.net/assets.github.com/images/modules/about_page/octocat.png');
13007
- }
13008
- };
13009
- $o.ajax({
13010
- url: '/overlay_images',
13011
- dataType: 'json',
13012
- success: function(data) {
13013
- if (data.length === 0) {
13014
- return OverlayMe.loadDefaultImage();
13015
- } else {
13016
- return buildTree(data);
13031
+ OverlayMe.OverlaysPanel = (function(_super) {
13032
+
13033
+ __extends(OverlaysPanel, _super);
13034
+
13035
+ OverlaysPanel.name = 'OverlaysPanel';
13036
+
13037
+ function OverlaysPanel() {
13038
+ return OverlaysPanel.__super__.constructor.apply(this, arguments);
13039
+ }
13040
+
13041
+ OverlaysPanel.prototype.initialize = function(attributes, options) {
13042
+ var buildTree, displayTree, files_tree, shiftTofiles;
13043
+ OverlaysPanel.__super__.initialize.call(this, {
13044
+ id: "overlays-panel",
13045
+ title: "Overlays"
13046
+ }, options);
13047
+ this.append(new OverlayMe.Overlays.ContentDivManagementBlock().render());
13048
+ OverlayMe.images_management_div = new OverlayMe.Overlays.ImagesManagementDiv();
13049
+ this.append(OverlayMe.images_management_div.render());
13050
+ OverlayMe.menu.append(this.render());
13051
+ $o(window).bind('mousemove', function(event) {
13052
+ return $o(window).trigger('mymousemove', event);
13053
+ });
13054
+ OverlayMe.dyn_manager = new OverlayMe.Overlays.DynamicManager();
13055
+ OverlayMe.dyn_manager.loadAll();
13056
+ OverlayMe.loadDefaultImage = function() {
13057
+ if (OverlayMe.dyn_manager.isEmpty()) {
13058
+ return OverlayMe.dyn_manager.addImage('https://a248.e.akamai.net/assets.github.com/images/modules/about_page/octocat.png', {
13059
+ default_css: {
13060
+ left: "" + (window.document.width * .6) + "px"
13061
+ }
13062
+ });
13017
13063
  }
13018
- },
13019
- error: function() {
13020
- return OverlayMe.loadDefaultImage();
13021
- }
13022
- });
13023
- files_tree = {};
13024
- buildTree = function(data) {
13025
- $o.each(data, function(index, img_path) {
13026
- var bit, bits, parent_path, position, _results;
13027
- bits = img_path.split('/');
13028
- position = files_tree;
13029
- parent_path = '/';
13030
- _results = [];
13031
- while (bits.length > 0) {
13032
- bit = bits[0];
13033
- bits = bits.slice(1);
13034
- if (bit === "") {
13035
- continue;
13064
+ };
13065
+ $o.ajax({
13066
+ url: '/overlay_images',
13067
+ dataType: 'json',
13068
+ success: function(data) {
13069
+ if (data.length === 0) {
13070
+ return OverlayMe.loadDefaultImage();
13071
+ } else {
13072
+ return buildTree(data);
13036
13073
  }
13037
- parent_path += bit + '/';
13038
- if (position[bit] === void 0) {
13039
- if (bits.length > 0) {
13040
- position[bit] = {
13041
- parent_path: parent_path
13042
- };
13043
- } else {
13044
- if (position['files'] === void 0) {
13045
- position['files'] = [];
13074
+ },
13075
+ error: function() {
13076
+ return OverlayMe.loadDefaultImage();
13077
+ }
13078
+ });
13079
+ files_tree = {};
13080
+ buildTree = function(data) {
13081
+ $o.each(data, function(index, img_path) {
13082
+ var bit, bits, parent_path, position, _results;
13083
+ bits = img_path.split('/');
13084
+ position = files_tree;
13085
+ parent_path = '/';
13086
+ _results = [];
13087
+ while (bits.length > 0) {
13088
+ bit = bits[0];
13089
+ bits = bits.slice(1);
13090
+ if (bit === "") {
13091
+ continue;
13092
+ }
13093
+ parent_path += bit + '/';
13094
+ if (position[bit] === void 0) {
13095
+ if (bits.length > 0) {
13096
+ position[bit] = {
13097
+ parent_path: parent_path
13098
+ };
13099
+ } else {
13100
+ if (position['files'] === void 0) {
13101
+ position['files'] = [];
13102
+ }
13103
+ position['files'].push(bit);
13046
13104
  }
13047
- position['files'].push(bit);
13048
13105
  }
13106
+ _results.push(position = position[bit]);
13049
13107
  }
13050
- _results.push(position = position[bit]);
13108
+ return _results;
13109
+ });
13110
+ files_tree = shiftTofiles(files_tree);
13111
+ return displayTree(OverlayMe.images_management_div, files_tree);
13112
+ };
13113
+ shiftTofiles = function(tree) {
13114
+ var keys;
13115
+ if (tree.files) {
13116
+ return tree;
13051
13117
  }
13052
- return _results;
13053
- });
13054
- files_tree = shiftTofiles(files_tree);
13055
- return displayTree(OverlayMe.images_management_div, files_tree);
13056
- };
13057
- shiftTofiles = function(tree) {
13058
- var keys;
13059
- if (tree.files) {
13060
- return tree;
13061
- }
13062
- keys = Object.keys(tree);
13063
- if (keys.length > 2) {
13064
- return tree;
13065
- }
13066
- keys = _.without(keys, 'parent_path');
13067
- return shiftTofiles(tree[keys[0]]);
13068
- };
13069
- displayTree = function(parent, tree) {
13070
- var dir, img, sub_dir, _i, _j, _len, _len1, _ref, _ref1, _results;
13071
- _ref = Object.keys(tree);
13072
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
13073
- dir = _ref[_i];
13074
- if (dir === 'files' || dir === 'parent_path') {
13075
- continue;
13118
+ keys = Object.keys(tree);
13119
+ if (keys.length > 2) {
13120
+ return tree;
13076
13121
  }
13077
- sub_dir = new OverlayMe.Overlays.ImagesDirectory(dir);
13078
- parent.append(sub_dir.render());
13079
- displayTree(sub_dir, tree[dir]);
13080
- }
13081
- if (tree.files) {
13082
- _ref1 = tree.files;
13083
- _results = [];
13084
- for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
13085
- img = _ref1[_j];
13086
- _results.push(parent.append(new OverlayMe.Overlays.Image(tree.parent_path + img, {
13087
- parent_path: tree.parent_path
13088
- }).render()));
13122
+ keys = _.without(keys, 'parent_path');
13123
+ return shiftTofiles(tree[keys[0]]);
13124
+ };
13125
+ return displayTree = function(parent, tree) {
13126
+ var dir, img, sub_dir, _i, _j, _len, _len1, _ref, _ref1, _results;
13127
+ _ref = Object.keys(tree);
13128
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
13129
+ dir = _ref[_i];
13130
+ if (dir === 'files' || dir === 'parent_path') {
13131
+ continue;
13132
+ }
13133
+ sub_dir = new OverlayMe.Overlays.ImagesDirectory(dir);
13134
+ parent.append(sub_dir.render());
13135
+ displayTree(sub_dir, tree[dir]);
13089
13136
  }
13090
- return _results;
13091
- }
13137
+ if (tree.files) {
13138
+ _ref1 = tree.files;
13139
+ _results = [];
13140
+ for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
13141
+ img = _ref1[_j];
13142
+ _results.push(parent.append(new OverlayMe.Overlays.Image(tree.parent_path + img, {
13143
+ parent_path: tree.parent_path
13144
+ }).render()));
13145
+ }
13146
+ return _results;
13147
+ }
13148
+ };
13092
13149
  };
13093
- }
13150
+
13151
+ return OverlaysPanel;
13152
+
13153
+ })(OverlayMe.MenuItem);
13154
+
13155
+ $o(function() {
13156
+ if (!OverlayMe.overlay_panel) {
13157
+ return OverlayMe.overlay_panel = new OverlayMe.OverlaysPanel();
13158
+ }
13159
+ });
13094
13160
 
13095
13161
  }).call(this);
13096
13162
  (function() {
13097
13163
 
13098
- window.overlay_me_loaded = true;
13164
+ OverlayMe.setLoaded();
13099
13165
 
13100
13166
  }).call(this);