Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

React victorpavlenko

🎯
Focusing
Block or report user

Report or block victorpavlenko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View club.js
function initViewPostEvents() {
var addedCommentCount = 0;
var $postCommentMessage = $('#postCommentMessage');
$postCommentMessage.autosize();
$('.clearTextArea').off('click').on('click', function () {
$postCommentMessage.val('').trigger('autosize.resize');
});
$('#submitPostComment').off('click').on('click', function () {
View common.js
function dispatchAction(action, onComplete) {
var reqType = 'GET';
if (
action['action'] == 'addPost' ||
action['action'] == 'addReview' ||
action['action'] == 'addReviewPhoto' ||
action['action'] == 'addRepost'
) reqType = 'POST';
$.ajax(
View common.m.js
var app = (function() {
'use strict';
var app = {
dom: {
ready: $.Deferred()
}
};
$(function() {
View common.s.js
window.__GLOBALS = {};
function popupScroll() {
var t = $(window).scrollTop();
var h = $(window).height();
var fix = 'elementFixed';
var tail = 'elementTailed';
if (t > 32) $('#popupsContainer .jsPopupRightColumn').addClass(fix); else $('#popupsContainer .jsPopupRightColumn').removeClass(fix);
if ($('#leftScrollableContainer1').length) {
var gH = document.getElementById('leftScrollableContainer1');
View handlebars-service.js
var HandlebarsService = (function(){
const PATH_TO_TEMPLATE = '/js/templates/';
var HandlebarsService = function() {
};
$.extend(HandlebarsService.prototype, {
get: function(templateName, data) {
View profile.js
$(function(){
var ProfileEdit = (function(){
var ProfileEdit = function($element) {
if (typeof($element) === 'string') {
this.$element = $($element);
} else if ($element) {
this.$element = $element;
}
View animations.js
var superScrollMaxY;
var disableAllScrollEffects = false;
var refreshWindowHeight = function () {
superScrollMaxY = document.body.scrollHeight - window.innerHeight;
};
// делает из элемента супер-скролл
var makeSuperScroll = function (elem, elTop, scrollElem) {
var w;
var scrollTop;
View scroll-filter.js
$(function(){
if ($('.sidebar-catalog-filter').length) {
var win = $(window),
winHeight = win.height(),
sb = $('.sidebar-catalog-filter'),
sbHeight,
hpHeight,
currScroll,
scrollTop,
View bracket
if (process.argv.length !== 3) {
console.error('Введено:\n\t' + process.argv[0] + ' ' + process.argv[1] + ' [аргуенты для функции]')
process.exit(1);
}
var str = process.argv[2];
if (checkBrackets(str)) {
console.log('Все верно!');
} else {
@victorpavlenko
victorpavlenko / ko_index.js
Created May 4, 2015
Задание 2 JSON to table
View ko_index.js
var jsn = require('./json.json');
function Table(jsn){
this.colWidths = function(jsn){
return jsn.map(function(arr, i) {
var mass = [];
return arr.reduce(function(max, row, item, ar) {
row = row.toString().length;
You can’t perform that action at this time.