1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-02 00:49:21 +03:00
ifhub.club/application/frontend/skin/developer/assets/js/init.js
2013-08-29 17:13:18 +07:00

225 lines
3.2 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($){
// Хук начала инициализации javascript-составляющих шаблона
ls.hook.run('ls_template_init_start',[],window);
/**
* Popovers
*/
$(document).popover({ selector: '.js-popover-default' });
/**
* Modals
*/
$('.js-modal-default').modal();
/**
* Datepicker
*/
$('.date-picker').datepicker();
/**
* Dropdowns
*/
$('.js-dropdown-default').dropdown();
/**
* Tooltips
*/
$(document).tooltip({
selector: '.js-tooltip, .js-tooltip-vote-topic'
});
$('.js-title-talk').tooltip({
alignX: 'left',
alignY: 'center'
});
$('.js-tip-help').tooltip({
alignX: 'right',
alignY: 'center'
});
if (ls.registry.get('block_stream_show_tip')) {
$(document).tooltip({
selector: '.js-title-comment, .js-title-topic',
alignX: 'left',
alignY: 'center',
delay: 1500
});
}
/**
* Autocomplete
*/
ls.autocomplete.add($(".autocomplete-tags-sep"), aRouter['ajax']+'autocompleter/tag/', true);
ls.autocomplete.add($(".autocomplete-tags"), aRouter['ajax']+'autocompleter/tag/', false);
ls.autocomplete.add($(".autocomplete-users-sep"), aRouter['ajax']+'autocompleter/user/', true);
ls.autocomplete.add($(".autocomplete-users"), aRouter['ajax']+'autocompleter/user/', false);
/**
* Scroll
*/
$(window)._scrollable();
/**
* Toolbar
*/
$('.js-toolbar').toolbar({
target: '#wrapper',
offsetX: 10
});
ls.toolbar.topic.init(); // Тул-бар топиков
ls.toolbar.up.init(); // Кнопка "UP"
/**
* Code highlight
*/
prettyPrint();
/**
* Blocks
*/
ls.blocks.init();
/**
* Activity
*/
ls.stream.init();
/**
* Userfeed
*/
ls.userfeed.init();
/**
* Comments
*/
ls.comments.init({
folding: false
});
/**
* User
*/
ls.user.init();
/**
* Captcha
*/
ls.captcha.init();
/**
* Talk
*/
ls.talk.init();
/**
* Poll
*/
ls.poll.init();
/**
* User Note
*/
ls.usernote.init();
/**
* Editor
*/
ls.editor.init();
/**
* Topic
*/
ls.topic.init();
/**
* Vote
*/
ls.vote.init();
/**
* Pagination
*/
ls.pagination.init();
/**
* Blog
*/
ls.blog.init();
/**
* Photoset
*/
ls.photoset.init();
/**
* Избраноое
*/
ls.favourite.init();
/**
* Photoset
*/
$('.js-photoset-type-default-image').prettyPhoto({
social_tools: '',
show_title: false,
slideshow: false,
deeplinking: false
});
/**
* Form validate
*/
$('.js-form-validate').parsley({
validators: {
rangetags: function (val, arrayRange) {
var tag_count = val.replace(/ /g, "").match(/[^\s,]+(,|)/gi);
return tag_count && tag_count.length >= arrayRange[0] && tag_count.length <= arrayRange[1];
}
},
// TODO: Вынести в лок-ию
messages: {
rangetags: "Кол-во тегов должно быть от %s до %s"
}
});
// Хук конца инициализации javascript-составляющих шаблона
ls.hook.run('ls_template_init_end',[],window);
});