This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Вычисляем общую сумму **/ | |
var setSumm = { | |
sum : function(dataObject){ | |
var summary = [], | |
sum = 0; | |
for( var i = 0; i < Object.keys(dataObject).length - 1; i++){ | |
summary.push(dataObject[i].summ) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
if ($('.sidebar-catalog-filter').length) { | |
var win = $(window), | |
winHeight = win.height(), | |
sb = $('.sidebar-catalog-filter'), | |
sbHeight, | |
hpHeight, | |
currScroll, | |
scrollTop, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var superScrollMaxY; | |
var disableAllScrollEffects = false; | |
var refreshWindowHeight = function () { | |
superScrollMaxY = document.body.scrollHeight - window.innerHeight; | |
}; | |
// делает из элемента супер-скролл | |
var makeSuperScroll = function (elem, elTop, scrollElem) { | |
var w; | |
var scrollTop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var ProfileEdit = (function(){ | |
var ProfileEdit = function($element) { | |
if (typeof($element) === 'string') { | |
this.$element = $($element); | |
} else if ($element) { | |
this.$element = $element; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var HandlebarsService = (function(){ | |
const PATH_TO_TEMPLATE = '/js/templates/'; | |
var HandlebarsService = function() { | |
}; | |
$.extend(HandlebarsService.prototype, { | |
get: function(templateName, data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = (function() { | |
'use strict'; | |
var app = { | |
dom: { | |
ready: $.Deferred() | |
} | |
}; | |
$(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dispatchAction(action, onComplete) { | |
var reqType = 'GET'; | |
if ( | |
action['action'] == 'addPost' || | |
action['action'] == 'addReview' || | |
action['action'] == 'addReviewPhoto' || | |
action['action'] == 'addRepost' | |
) reqType = 'POST'; | |
$.ajax( |