Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 30th, 2012  |  syntax: None  |  size: 1.11 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  Prefetch = {
  2.     init: function() {
  3.       return this.dialog();
  4.     },
  5.     dialog: function() {
  6.       var controls, first, input;
  7.       controls = $.el('label', {
  8.         id: 'prefetch',
  9.         innerHTML: "Prefetch Images<input type=checkbox id=prefetch>"
  10.       });
  11.       input = $('input', controls);
  12.       $.on(input, 'change', Prefetch.change);
  13.       first = $.id('delform').firstElementChild;
  14.       if (first.id === 'imgControls') {
  15.         return $.after(first, controls);
  16.       } else {
  17.         return $.before(first, controls);
  18.       }
  19.     },
  20.     change: function() {
  21.       var img, thumb, _i, _len, _ref;
  22.       $.off(this, 'change', Prefetch.change);
  23.       _ref = $$('a.fileThumb');
  24.       for (_i = 0, _len = _ref.length; _i < _len; _i++) {
  25.         thumb = _ref[_i];
  26.         img = $.el('img', {
  27.           src: thumb.href
  28.         });
  29.       }
  30.       return Main.callbacks.push(Prefetch.node);
  31.     },
  32.     node: function(post) {
  33.       var img;
  34.       img = post.img;
  35.       if (!img) {
  36.         return;
  37.       }
  38.       return $.el('img', {
  39.         src: img.parentNode.href
  40.       });
  41.     }
  42.   };