Skip to content

Instantly share code, notes, and snippets.

View govorov's full-sized avatar

Stanislav E. Govorov govorov

  • TomTom
  • Rotterdam, the Netherlands
View GitHub Profile
@govorov
govorov / stations.json
Created July 13, 2016 21:22 — forked from jarosluv/stations.json
List of Moscow Metro Stations — 2016 / Список станций Московского метро — 2016
[
{
"line": "Сокольническая",
"stations": ["Бульвар Рокоссовского", "Черкизовская", "Преображенская площадь", "Сокольники", "Красносельская", "Комсомольская", "Красные ворота", "Чистые пруды", "Лубянка", "Охотный ряд", "Библиотека имени Ленина", "Кропоткинская", "Парк культуры", "Фрунзенская", "Спортивная", "Воробьёвы горы", "Университет", "Проспект Вернадского", "Юго-Западная", "Тропарёво", "Румянцево", "Саларьево"]
},
{
"line": "Замоскворецкая",
"stations": ["Алма-Атинская", "Красногвардейская", "Домодедовская", "Орехово", "Царицыно", "Кантемировская", "Каширская", "Коломенская", "Технопарк", "Автозаводская", "Павелецкая", "Новокузнецкая", "Театральная", "Тверская", "Маяковская", "Белорусская", "Динамо", "Аэропорт", "Сокол", "Войковская", "Водный стадион", "Речной вокзал"]
},
{
#template for select option, I use it to show regions and draw country flags for each city
cityOptionTpl = (obj)->
_.tpl('CitySelectOption')(obj)
#helper for rendering option
renderCityOption = (entry)->
tplRes = cityOptionTpl({it:
title : entry.title
region : entry.region
country_name : entry.country_name
$.fn.select2.amd.define('select2/data/extended-ajax',['./ajax','../utils','jquery'], function(AjaxAdapter, Utils, $){
function ExtendedAjaxAdapter ($element,options) {
//we need explicitly process minimumInputLength value
//to decide should we use AjaxAdapter or return defaultResults,
//so it is impossible to use MinimumLength decorator here
this.minimumInputLength = options.get('minimumInputLength');
this.defaultResults = options.get('defaultResults');
ExtendedAjaxAdapter.__super__.constructor.call(this,$element,options);