1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-08 01:14:24 +03:00
ifhub.club/application/frontend/common/js/init.js

62 lines
1.4 KiB
JavaScript
Raw Normal View History

/**
* Основной файл инициализации
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
2013-04-09 01:30:54 +03:00
jQuery(document).ready(function($) {
$('html').removeClass('no-js');
/**
* Определение браузера
*/
2013-04-09 01:30:54 +03:00
if ($.browser.opera) {
$('body').addClass('opera opera' + parseInt($.browser.version, 10));
2013-04-09 01:30:54 +03:00
}
2013-04-09 01:30:54 +03:00
if ($.browser.mozilla) {
$('body').addClass('mozilla mozilla' + parseInt($.browser.version, 10));
2013-04-09 01:30:54 +03:00
}
2013-04-09 01:30:54 +03:00
if ($.browser.webkit) {
$('body').addClass('webkit webkit' + parseInt($.browser.version, 10));
2013-04-09 01:30:54 +03:00
}
2013-04-09 01:30:54 +03:00
if ($.browser.msie) {
$('body').addClass('ie');
if (parseInt($.browser.version, 0) > 8) {
$('body').addClass('ie' + parseInt($.browser.version, 10));
2013-04-09 01:30:54 +03:00
}
}
/**
* Фикс бага с z-index у встроенных видео
*/
2013-04-09 01:30:54 +03:00
$("iframe").each(function(){
var ifr_source = $(this).attr('src');
if(ifr_source) {
var wmode = "wmode=opaque";
if (ifr_source.indexOf('?') != -1)
$(this).attr('src',ifr_source+'&'+wmode);
else
$(this).attr('src',ifr_source+'?'+wmode);
}
});
2013-07-02 05:58:58 +03:00
/**
* Поиск по тегам
2013-07-02 05:58:58 +03:00
*/
$('.js-tag-search-form').submit(function(){
var val=$(this).find('.js-tag-search').val();
if (val) {
window.location = aRouter['tag']+encodeURIComponent(val)+'/';
}
return false;
});
2013-04-09 01:30:54 +03:00
});