2012-03-29 13:16:59 +02:00
|
|
|
/*
|
|
|
|
* smartphone-spoiler.js
|
2012-03-31 02:13:11 +02:00
|
|
|
* https://github.com/savetheinternet/Tinyboard/blob/master/js/smartphone-spoiler.js
|
2012-03-29 13:16:59 +02:00
|
|
|
*
|
|
|
|
* Released under the MIT license
|
|
|
|
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
|
2024-08-05 18:36:34 +02:00
|
|
|
* Copyright (c) 2013-2014 Marcin Łabanowski <marcin@6irc.net>
|
2012-03-29 13:16:59 +02:00
|
|
|
*
|
|
|
|
* Usage:
|
2013-01-02 06:05:44 +01:00
|
|
|
* $config['additional_javascript'][] = 'js/mobile-style.js';
|
2012-03-29 13:16:59 +02:00
|
|
|
* $config['additional_javascript'][] = 'js/smartphone-spoiler.js';
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2024-08-05 18:36:34 +02:00
|
|
|
onready(function() {
|
|
|
|
if (device_type == 'mobile') {
|
|
|
|
let fix_spoilers = function(where) {
|
|
|
|
let spoilers = where.getElementsByClassName('spoiler');
|
|
|
|
for (let i = 0; i < spoilers.length; i++) {
|
2013-07-03 07:18:44 +02:00
|
|
|
spoilers[i].onmousedown = function() {
|
|
|
|
this.style.color = 'white';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
fix_spoilers(document);
|
|
|
|
|
2024-08-05 18:36:34 +02:00
|
|
|
// allow to work with auto-reload.js, etc.
|
|
|
|
$(document).on('new_post', function(e, post) {
|
|
|
|
fix_spoilers(post);
|
|
|
|
});
|
|
|
|
|
2012-03-29 13:16:59 +02:00
|
|
|
}
|
|
|
|
});
|