1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-12 01:50:48 +01:00
vichan/js/smartphone-spoiler.js

29 lines
709 B
JavaScript
Raw Normal View History

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>
*
* Usage:
* $config['additional_javascript'][] = 'js/smartphone-spoiler.js';
*
*/
$(document).ready(function(){
/* This needs to be expanded upon: */
var is_mobile = navigator.userAgent.match(/iPhone|iPod|iPad|Android/i);
if(is_mobile) {
$('span.spoiler').each(function() {
$(this).click(function() {
if($(this).hasClass('show'))
$(this).css('color', 'black').removeClass('show');
else
$(this).css('color', 'white').addClass('show');
});
});
}
});