1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-16 21:34:25 +03:00
ifhub.club/application/frontend/common/js/init.js
Denis Shakhov d6029b1b12 Доработки и исправления
* Оптимизировано добавление\удаление из избранного
* Документирование
* Мелкие доработки и исправления
2013-08-29 16:30:04 +07:00

72 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Основной файл инициализации
*
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com>
*/
jQuery(document).ready(function($) {
$('html').removeClass('no-js');
/**
* Определение браузера
*/
if ($.browser.opera) {
$('body').addClass('opera opera' + parseInt($.browser.version, 10));
}
if ($.browser.mozilla) {
$('body').addClass('mozilla mozilla' + parseInt($.browser.version, 10));
}
if ($.browser.webkit) {
$('body').addClass('webkit webkit' + parseInt($.browser.version, 10));
}
if ($.browser.msie) {
$('body').addClass('ie');
if (parseInt($.browser.version, 0) > 8) {
$('body').addClass('ie' + parseInt($.browser.version, 10));
}
}
/**
* Фикс бага с z-index у встроенных видео
*/
$("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);
}
});
/**
* Поиск по тегам
*/
$('.js-tag-search-form').submit(function(){
var val=$(this).find('.js-tag-search').val();
if (val) {
window.location = aRouter['tag']+encodeURIComponent(val)+'/';
}
return false;
});
/**
* Эмуляция placeholder'ов в IE
*
* TODO: Вынести в ie.js
*/
if ($('html').hasClass('oldie')) {
$('input[type=text], textarea').placeholder();
}
});