2014-05-05 11:23:49 -04:00
|
|
|
if (active_page == 'catalog') $(function(){
|
2014-10-22 00:06:34 -04:00
|
|
|
if (localStorage.catalog !== undefined) {
|
|
|
|
var catalog = JSON.parse(localStorage.catalog);
|
|
|
|
} else {
|
|
|
|
var catalog = {};
|
|
|
|
localStorage.catalog = JSON.stringify(catalog);
|
|
|
|
}
|
|
|
|
|
2015-01-05 07:39:08 -05:00
|
|
|
if (localStorage.hiddenthreads) {
|
|
|
|
var hidden_data = JSON.parse(localStorage.hiddenthreads);
|
|
|
|
|
2015-01-23 05:24:04 -05:00
|
|
|
if (hidden_data[board_name] && !$.isEmptyObject(hidden_data[board_name])) {
|
2015-01-05 07:39:08 -05:00
|
|
|
$.each(hidden_data[board_name], function(k, v) {
|
2015-01-23 05:24:04 -05:00
|
|
|
$('a[href$="/'+k+'.html"]').parents('.mix').remove();
|
2015-01-05 07:39:08 -05:00
|
|
|
});
|
|
|
|
}
|
2015-02-01 02:30:59 -05:00
|
|
|
} else {
|
|
|
|
hidden_data = {};
|
2015-01-05 07:39:08 -05:00
|
|
|
}
|
|
|
|
|
2015-02-01 02:30:59 -05:00
|
|
|
$(document).on('click', '.mix', function(e) {
|
|
|
|
if (e.shiftKey) {
|
|
|
|
hidden_data[board_name][$(this).data('id')] = Math.round(Date.now() / 1000);
|
|
|
|
$(this).remove();
|
|
|
|
localStorage.hiddenthreads = JSON.stringify(hidden_data);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-08-08 16:48:38 -04:00
|
|
|
$("#sort_by").change(function(){
|
|
|
|
var value = this.value;
|
2014-10-22 00:06:34 -04:00
|
|
|
$('#Grid').mixItUp('sort', value);
|
|
|
|
catalog.sort_by = value;
|
|
|
|
localStorage.catalog = JSON.stringify(catalog);
|
2014-03-16 22:21:01 -04:00
|
|
|
});
|
|
|
|
|
2014-08-08 16:48:38 -04:00
|
|
|
$("#image_size").change(function(){
|
|
|
|
var value = this.value, old;
|
2014-09-20 00:40:43 -04:00
|
|
|
$(".grid-li").removeClass("grid-size-vsmall");
|
|
|
|
$(".grid-li").removeClass("grid-size-small");
|
|
|
|
$(".grid-li").removeClass("grid-size-large");
|
2014-08-08 16:48:38 -04:00
|
|
|
$(".grid-li").addClass("grid-size-"+value);
|
2014-10-22 00:06:34 -04:00
|
|
|
catalog.image_size = value;
|
|
|
|
localStorage.catalog = JSON.stringify(catalog);
|
2014-03-16 22:21:01 -04:00
|
|
|
});
|
|
|
|
|
2014-10-22 00:06:34 -04:00
|
|
|
$('#Grid').mixItUp({
|
|
|
|
animation: {
|
|
|
|
enable: false
|
|
|
|
},
|
2014-03-16 22:21:01 -04:00
|
|
|
});
|
|
|
|
|
2014-10-22 00:06:34 -04:00
|
|
|
if (catalog.sort_by !== undefined) {
|
|
|
|
$('#sort_by').val(catalog.sort_by).trigger('change');
|
|
|
|
}
|
|
|
|
if (catalog.image_size !== undefined) {
|
|
|
|
$('#image_size').val(catalog.image_size).trigger('change');
|
|
|
|
}
|
2014-03-16 22:21:01 -04:00
|
|
|
});
|