Commit 78ee741c authored by Taddeus Kroes's avatar Taddeus Kroes

Removed generated file from repo index (really now)

parent b89c305e
// Generated by CoffeeScript 1.3.3
(function() {
var STORAGE_NAME, setall, visible;
STORAGE_NAME = 'tvgids-channels';
visible = localStorage.hasOwnProperty(STORAGE_NAME) ? localStorage.getItem(STORAGE_NAME).split(';') : _.pluck(CHANNELS, 'id');
_.each(CHANNELS, function(channel) {
var elem, input, is_visible;
is_visible = _.contains(visible, channel.id);
input = $('<input type="checkbox" name="channels[]" value="' + channel.id + '">');
input.attr('checked', is_visible);
input.change(function() {
return $(this).parent().toggleClass('disabled', !$(this).is(':checked'));
});
input.change(function() {
return $('#select-channels').submit();
});
elem = $('<label/>').html(channel.name);
elem.prepend(input);
elem.toggleClass('disabled', !is_visible);
return elem.appendTo('#select-channels .options');
});
$('#select-channels').submit(function(e) {
var i, selected;
e.preventDefault();
selected = (function() {
var _i, _len, _ref, _results;
_ref = $('input', this);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
i = _ref[_i];
if ($(i).is(':checked')) {
_results.push($(i).val());
}
}
return _results;
}).call(this);
return localStorage.setItem(STORAGE_NAME, selected.join(';'));
});
setall = function(c) {
return $('#select-channels input').prop('checked', c).change();
};
$('#select-all').click(function() {
return setall(true);
});
$('#select-none').click(function() {
return setall(false);
});
}).call(this);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment