
Untitled
By: a guest on
Jun 30th, 2012 | syntax:
None | size: 1.11 KB | hits: 13 | expires: Never
Prefetch = {
init: function() {
return this.dialog();
},
dialog: function() {
var controls, first, input;
controls = $.el('label', {
id: 'prefetch',
innerHTML: "Prefetch Images<input type=checkbox id=prefetch>"
});
input = $('input', controls);
$.on(input, 'change', Prefetch.change);
first = $.id('delform').firstElementChild;
if (first.id === 'imgControls') {
return $.after(first, controls);
} else {
return $.before(first, controls);
}
},
change: function() {
var img, thumb, _i, _len, _ref;
$.off(this, 'change', Prefetch.change);
_ref = $$('a.fileThumb');
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
thumb = _ref[_i];
img = $.el('img', {
src: thumb.href
});
}
return Main.callbacks.push(Prefetch.node);
},
node: function(post) {
var img;
img = post.img;
if (!img) {
return;
}
return $.el('img', {
src: img.parentNode.href
});
}
};