This file contains hidden or 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 goToStep(env, step) { | |
| var handler = function() { | |
| // Launch animation | |
| transition(env, step); | |
| // Update first step | |
| env.steps.first = step; | |
| // Update buttons status | |
| updateButtonsState(env); |
This file contains hidden or 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 data = { | |
| id: 1, | |
| name: 'test', | |
| posts: [{ | |
| id: 1, | |
| text: 'test' | |
| }] | |
| }, | |
| model = new Backbone.Model(data), | |
| posts = model.getAsCollection('posts') |
This file contains hidden or 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
| // При объявлении метода сразу же вызывается функция которая создает массив с месяцами и | |
| // одновремено возвращает другую функция которая будет доступна при обращении к методу и в которой | |
| // через замыкание будет доступен массив с месяцами. | |
| getDeclinatedMonths: (function() { | |
| var months = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря']; | |
| return function(month) { | |
| // Если переменная передана, то возвращаем значение массива иначе весь массив | |
| return month != null ? months[month] : months; | |
| } |
This file contains hidden or 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 (isNext) { | |
| stepPosition++; | |
| } else { | |
| stepPosition--; | |
| } | |
| if (stepPosition >= 0 || stepPosition <= slides) { | |
| scrollbar.slider('option', 'value', stepPosition); | |
| } |
This file contains hidden or 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
| jshint: { | |
| options: { | |
| indent: 4, | |
| expr: true, | |
| boss: true, | |
| undef: true, | |
| curly: true, | |
| forin: true, | |
| unused: true, | |
| newcap: true, |
This file contains hidden or 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
| { | |
| "ErrorCode": "", | |
| "Success": true, | |
| "Result": [{ | |
| "Id": "14a08298-16d6-11e2-9dbd-10246288709b", | |
| "NameRu": "Ширина, м.", | |
| "NameEn": "width", | |
| "Data": [{ | |
| "NameEn": "width", | |
| "NameRu": "Ширина, м.", |
This file contains hidden or 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
| app.prototype.beforeInit = function(input) { | |
| if (!this.global.google) { | |
| this.global.gInit = this.bind(function() { | |
| this.core.observatory.trigger('...'); | |
| delete this.global.gInit; | |
| }, this) | |
| } | |
| } |
This file contains hidden or 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
| // To make the benchmark results predictable, we replace Math.random | |
| // with a 100% deterministic alternative. | |
| Math.random = (function() { | |
| var seed = 49734321; | |
| return function() { | |
| // Robert Jenkins' 32 bit integer hash function. | |
| seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; | |
| seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; | |
| seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff; | |
| seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff; |
This file contains hidden or 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
| Result: { | |
| List: [ | |
| { | |
| Id: null, | |
| ListFields: [] | |
| }, { | |
| Id: null, | |
| ListFields: [] | |
| } | |
| ], |
This file contains hidden or 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 method = 'get' + section[0].toUpperCase() + section.substring(1) | |
| if (typeof(this[method]) === 'function') { | |
| this[method](params, function() { | |
| callback(a, b, c); | |
| }); | |
| } |