├── ui ├── build │ ├── css │ │ ├── .keep │ │ ├── maps-popup │ │ │ ├── module.json │ │ │ └── maps-popup.css │ │ ├── maps-zoom │ │ │ ├── module.json │ │ │ └── maps-zoom.css │ │ ├── maps-button │ │ │ ├── module.json │ │ │ └── maps-button.css │ │ ├── maps-listbox │ │ │ ├── module.json │ │ │ └── maps-listbox.css │ │ └── maps-button-icon │ │ │ ├── module.json │ │ │ └── maps-button-icon.css │ ├── images │ │ ├── .keep │ │ ├── 3e13d027c9578c4190aa6fddaaa49022.jpg │ │ ├── 72a5b596b1ef5da75d408fb6203fea79.svg │ │ ├── f6745dfd61fd0cd8512d60d4ab5cb3c1.svg │ │ ├── 772ca48fc800fe30916e8ede02694586.svg │ │ ├── 30f0cf500cf7d5455a8f9eb6ac42c24f.svg │ │ ├── 60398ca40abf8fb542dc405ccaece64d.svg │ │ ├── a461646892fbbb874e5948b24aca0a78.svg │ │ ├── 57c38c6a54e7b5cf02a3c53596c08c16.svg │ │ ├── 9daecb3c9362cb8c987028971d9857a5.svg │ │ ├── 36a8b646292617a0950c451a1dde0684.svg │ │ ├── 7e124202af7510c53851d21888632893.svg │ │ ├── 96af1f9df9b29c2092ee464736b2a070.svg │ │ ├── 81de10e069a79157ce9656a7a7ea4b44.svg │ │ ├── ee1fe2e811d247c1f8cc55772909d92e.svg │ │ └── 733f8c03d37dfbccbccecd0dcc1577c8.svg │ └── layouts │ │ ├── .keep │ │ ├── round.listbox.layout.item.html │ │ ├── round.listbox.layout.item.html │ │ └── module.json │ │ ├── round.zoom.layout.html │ │ ├── module.json │ │ └── round.zoom.layout.html │ │ ├── round.button.layout.html │ │ ├── module.json │ │ └── round.button.layout.html │ │ └── round.listbox.layout.html │ │ ├── module.json │ │ └── round.listbox.layout.html └── src │ └── bevis │ ├── build │ └── api │ │ ├── common │ │ └── .gitkeep │ │ ├── fragments │ │ └── .gitkeep │ │ └── layouts │ │ └── .gitkeep │ ├── configs │ ├── current │ ├── development │ │ ├── logger.js │ │ ├── config.js │ │ ├── env.js │ │ └── assets.js │ └── production │ │ ├── logger.js │ │ ├── config.js │ │ ├── env.js │ │ └── assets.js │ ├── blocks │ ├── maps-button │ │ ├── maps-button.deps.yaml │ │ ├── maps-button.styl │ │ └── maps-button.bt.js │ ├── maps-zoom │ │ ├── maps-zoom.deps.yaml │ │ ├── maps-zoom.bt.js │ │ └── maps-zoom.styl │ ├── maps-listbox │ │ ├── maps-listbox.deps.yaml │ │ ├── images.jpg │ │ ├── images │ │ │ ├── images_01.jpg │ │ │ ├── images_02.jpg │ │ │ ├── images_03.jpg │ │ │ └── images_04.jpg │ │ ├── maps-listbox.bt.js │ │ └── maps-listbox.styl │ ├── x-variables │ │ └── x-variables.styl │ ├── maps-button-icon │ │ ├── images │ │ │ ├── minus.svg │ │ │ ├── loupe.svg │ │ │ ├── geolocation.svg │ │ │ ├── plus.svg │ │ │ ├── pano.svg │ │ │ ├── cross.svg │ │ │ ├── ruler.svg │ │ │ ├── layers.svg │ │ │ ├── traffic_yellow.svg │ │ │ ├── h-collapse.svg │ │ │ ├── traffic_gray.svg │ │ │ ├── traffic_green.svg │ │ │ ├── h-expand.svg │ │ │ ├── traffic_red.svg │ │ │ ├── expand.svg │ │ │ ├── collapse.svg │ │ │ └── routes.svg │ │ ├── maps-button-icon.bt.js │ │ └── maps-button-icon.styl │ ├── maps-popup │ │ ├── maps-popup.bt.js │ │ └── maps-popup.styl │ └── x-button │ │ └── x-button.styl │ ├── .borschik │ ├── .analyze.js │ ├── .jscs.json │ ├── .gitignore │ ├── .editorconfig │ ├── copyfiles.js │ ├── server │ ├── config.js │ ├── logger.js │ ├── boot.js │ ├── build-page.js │ └── app.js │ ├── .jshint-groups.js │ ├── package.json │ ├── .enb │ ├── lib │ │ ├── priv.js │ │ ├── ymaps-image-preprocessor.js │ │ └── ymaps-css-preprocessor.js │ ├── techs │ │ ├── priv-js.js │ │ ├── ymaps-layout-module.js │ │ ├── ymaps-module-deps.js │ │ ├── ymaps-module-from-html.js │ │ ├── cross-node-copy.js │ │ └── ymaps--fragments.js │ └── make.js │ └── Makefile ├── .jshintignore ├── screenshot.jpg ├── docs ├── icons │ ├── icon_pano.jpg │ ├── icon_plus.jpg │ ├── icon_cross.jpg │ ├── icon_expand.jpg │ ├── icon_layers.jpg │ ├── icon_loupe.jpg │ ├── icon_minus.jpg │ ├── icon_routes.jpg │ ├── icon_ruler.jpg │ ├── icon_collapse.jpg │ ├── icon_h-expand.jpg │ ├── icon_traffic.jpg │ ├── icon_geolocation.jpg │ └── icon_h-collapse.jpg └── icons.md ├── src ├── markup │ └── bevis │ │ ├── zoom │ │ └── round.zoom.layout.html │ │ │ └── round.zoom.layout.html.btjson.js │ │ ├── button │ │ └── round.button.layout.html │ │ │ └── round.button.layout.html.btjson.js │ │ └── listbox │ │ ├── round.listbox.layout.item.html │ │ └── round.listbox.layout.item.html.btjson.js │ │ └── round.listbox.layout.html │ │ └── round.listbox.layout.html.btjson.js └── theme │ └── maps │ ├── listbox │ └── layout │ │ ├── item │ │ ├── listbox.item.layout.js │ │ └── selectable │ │ │ └── listbox.item.selectable.layout.js │ │ └── listbox.layout.js │ ├── ruler │ └── layout │ │ └── ruler.layout.js │ ├── zoom │ └── layout │ │ └── zoom.layout.js │ └── button │ └── layout │ └── button.layout.js ├── .gitignore ├── make └── variables.mk ├── package.json ├── .githooks └── pre-commit │ └── lint ├── .jshintrc ├── examples └── index.html ├── README.md └── LICENSE.md /ui/build/css/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/layouts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/build/api/common/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/build/api/fragments/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/build/api/layouts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/configs/current: -------------------------------------------------------------------------------- 1 | development/ -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | ui/** 2 | src/markup/** 3 | build/release/** 4 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button/maps-button.deps.yaml: -------------------------------------------------------------------------------- 1 | - block: maps-button-icon 2 | -------------------------------------------------------------------------------- /screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/screenshot.jpg -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-zoom/maps-zoom.deps.yaml: -------------------------------------------------------------------------------- 1 | - block: maps-button-icon 2 | require: true -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/maps-listbox.deps.yaml: -------------------------------------------------------------------------------- 1 | - block: 'maps-popup' 2 | required: true 3 | -------------------------------------------------------------------------------- /docs/icons/icon_pano.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_pano.jpg -------------------------------------------------------------------------------- /docs/icons/icon_plus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_plus.jpg -------------------------------------------------------------------------------- /docs/icons/icon_cross.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_cross.jpg -------------------------------------------------------------------------------- /docs/icons/icon_expand.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_expand.jpg -------------------------------------------------------------------------------- /docs/icons/icon_layers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_layers.jpg -------------------------------------------------------------------------------- /docs/icons/icon_loupe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_loupe.jpg -------------------------------------------------------------------------------- /docs/icons/icon_minus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_minus.jpg -------------------------------------------------------------------------------- /docs/icons/icon_routes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_routes.jpg -------------------------------------------------------------------------------- /docs/icons/icon_ruler.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_ruler.jpg -------------------------------------------------------------------------------- /docs/icons/icon_collapse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_collapse.jpg -------------------------------------------------------------------------------- /docs/icons/icon_h-expand.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_h-expand.jpg -------------------------------------------------------------------------------- /docs/icons/icon_traffic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_traffic.jpg -------------------------------------------------------------------------------- /docs/icons/icon_geolocation.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_geolocation.jpg -------------------------------------------------------------------------------- /docs/icons/icon_h-collapse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/docs/icons/icon_h-collapse.jpg -------------------------------------------------------------------------------- /ui/build/css/maps-popup/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "maps-popup", 3 | "src": [ 4 | "maps-popup.css" 5 | ] 6 | } -------------------------------------------------------------------------------- /ui/build/css/maps-zoom/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "maps-zoom", 3 | "src": [ 4 | "maps-zoom.css" 5 | ] 6 | } -------------------------------------------------------------------------------- /ui/build/css/maps-button/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "maps-button", 3 | "src": [ 4 | "maps-button.css" 5 | ] 6 | } -------------------------------------------------------------------------------- /src/markup/bevis/zoom/round.zoom.layout.html/round.zoom.layout.html.btjson.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | block: 'maps-zoom' 3 | }; 4 | -------------------------------------------------------------------------------- /ui/build/css/maps-listbox/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "maps-listbox", 3 | "src": [ 4 | "maps-listbox.css" 5 | ] 6 | } -------------------------------------------------------------------------------- /ui/build/css/maps-button-icon/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "maps-button-icon", 3 | "src": [ 4 | "maps-button-icon.css" 5 | ] 6 | } -------------------------------------------------------------------------------- /ui/src/bevis/.borschik: -------------------------------------------------------------------------------- 1 | { 2 | "paths": { 3 | "./": "/" 4 | }, 5 | "freeze_paths": { 6 | "client/": "../_" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/ui/src/bevis/blocks/maps-listbox/images.jpg -------------------------------------------------------------------------------- /ui/src/bevis/configs/development/logger.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | console: { 3 | level: 'verbose', 4 | colorize: true 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /ui/src/bevis/configs/production/logger.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | console: { 3 | level: 'error', 4 | colorize: false 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /ui/src/bevis/.analyze.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | config.addSourceRoot('client/common'); 3 | config.addSourceRoot('client/pages'); 4 | }; 5 | -------------------------------------------------------------------------------- /ui/src/bevis/configs/development/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | urls: { 3 | jquery: 'http://yandex.st/jquery/1.10.1/jquery.min.js' 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /ui/src/bevis/configs/production/config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | urls: { 3 | jquery: 'http://yandex.st/jquery/1.10.1/jquery.min.js' 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /ui/build/images/3e13d027c9578c4190aa6fddaaa49022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/ui/build/images/3e13d027c9578c4190aa6fddaaa49022.jpg -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/images/images_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/ui/src/bevis/blocks/maps-listbox/images/images_01.jpg -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/images/images_02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/ui/src/bevis/blocks/maps-listbox/images/images_02.jpg -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/images/images_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/ui/src/bevis/blocks/maps-listbox/images/images_03.jpg -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/images/images_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/mapsapi-round-controls/HEAD/ui/src/bevis/blocks/maps-listbox/images/images_04.jpg -------------------------------------------------------------------------------- /ui/src/bevis/blocks/x-variables/x-variables.styl: -------------------------------------------------------------------------------- 1 | $BUTTON_HEIGHT = 36px; 2 | $FONT_FAMILY =Arial, Helvetica, sans-serif; 3 | $TRANSITION = 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .DS_Store? 4 | ._* 5 | .js___jb_old___ 6 | .idea/ 7 | Thumbs.db 8 | tmp 9 | modulesList.txt 10 | !.keep 11 | .*.pid 12 | *.log 13 | debian/* 14 | -------------------------------------------------------------------------------- /make/variables.mk: -------------------------------------------------------------------------------- 1 | # Переменные для настройки environment 2 | NODE ?= /opt/nodejs/0.10/bin/node 3 | NPM ?= /opt/nodejs/0.10/bin/npm 4 | NODE_MODULES_BIN := node_modules/.bin 5 | YMB = $(NODE_MODULES_BIN)/ymb 6 | YMS = $(NODE_MODULES_BIN)/yms 7 | -------------------------------------------------------------------------------- /ui/build/layouts/round.listbox.layout.item.html/round.listbox.layout.item.html: -------------------------------------------------------------------------------- 1 | {{ data.content|raw }} -------------------------------------------------------------------------------- /ui/build/layouts/round.zoom.layout.html/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "round.zoom.layout.html", 3 | "depends": [ 4 | "maps-zoom", 5 | "maps-button-icon" 6 | ], 7 | "src": [ 8 | "round.zoom.layout.html" 9 | ] 10 | } -------------------------------------------------------------------------------- /ui/build/layouts/round.button.layout.html/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "round.button.layout.html", 3 | "depends": [ 4 | "maps-button", 5 | "maps-button-icon" 6 | ], 7 | "src": [ 8 | "round.button.layout.html" 9 | ] 10 | } -------------------------------------------------------------------------------- /ui/src/bevis/configs/production/env.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | socket: '/tmp/' + path.basename(process.cwd()) + '-' + process.argv[2] + '.socket', 5 | workersCount: 2, 6 | debug: false, 7 | hotReload: false 8 | }; 9 | -------------------------------------------------------------------------------- /ui/build/layouts/round.listbox.layout.item.html/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "round.listbox.layout.item.html", 3 | "depends": [ 4 | "maps-popup", 5 | "maps-listbox" 6 | ], 7 | "src": [ 8 | "round.listbox.layout.item.html" 9 | ] 10 | } -------------------------------------------------------------------------------- /ui/src/bevis/.jscs.json: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "yandex", 3 | 4 | "excludeFiles": [ 5 | ".git/**", 6 | ".enb/**", 7 | "build", 8 | "node_modules/**", 9 | "client/common/i18n/**", 10 | "test/client/**" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /ui/build/layouts/round.zoom.layout.html/round.zoom.layout.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/72a5b596b1ef5da75d408fb6203fea79.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/markup/bevis/button/round.button.layout.html/round.button.layout.html.btjson.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | block: 'maps-button', 3 | style: 'max-width: {{ state.maxWidth|raw }}px', 4 | title: '{{ data.title|raw }}', 5 | icon: {block: 'maps-button-icon'}, 6 | text: '{{ data.content|default:""|raw }}' 7 | }; 8 | -------------------------------------------------------------------------------- /ui/build/layouts/round.listbox.layout.html/module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "round.listbox.layout.html", 3 | "depends": [ 4 | "maps-popup", 5 | "maps-button", 6 | "maps-button-icon", 7 | "maps-listbox" 8 | ], 9 | "src": [ 10 | "round.listbox.layout.html" 11 | ] 12 | } -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/minus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/f6745dfd61fd0cd8512d60d4ab5cb3c1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/layouts/round.button.layout.html/round.button.layout.html: -------------------------------------------------------------------------------- 1 | {{ data.content|default:""|raw }} -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/loupe.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/configs/development/env.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | socket: '/tmp/' + path.basename(process.cwd()) + '-' + process.argv[2] + '.socket', 5 | port: process.env.PORT ? parseInt(process.env.PORT, 10) : undefined, 6 | workersCount: 2, 7 | debug: true, 8 | hotReload: true 9 | }; 10 | -------------------------------------------------------------------------------- /ui/src/bevis/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | npm-debug.log 4 | /.enb/tmp 5 | /node_modules 6 | /static/*/* 7 | !/static/*/*.btjson.js 8 | /layouts/*/* 9 | !/layouts/*/*.btjson.js 10 | 11 | /build/api/common/* 12 | /build/api/fragments/* 13 | /build/api/layouts/* 14 | 15 | !/build/api/common/.gitkeep 16 | !/build/api/fragments/.gitkeep 17 | !/build/api/layouts/.gitkeep 18 | -------------------------------------------------------------------------------- /ui/build/images/772ca48fc800fe30916e8ede02694586.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/geolocation.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | indent_style = space 13 | indent_size = 4 14 | 15 | [rules] 16 | indent_style = tab 17 | 18 | [Makefile] 19 | indent_style = tab 20 | -------------------------------------------------------------------------------- /ui/build/images/30f0cf500cf7d5455a8f9eb6ac42c24f.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/layouts/round.listbox.layout.html/round.listbox.layout.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/plus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/60398ca40abf8fb542dc405ccaece64d.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/pano.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/a461646892fbbb874e5948b24aca0a78.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/cross.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/57c38c6a54e7b5cf02a3c53596c08c16.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/ruler.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/copyfiles.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var exec = require('child_process').exec; 4 | var vowFs = require('vow-fs'); 5 | var fs = require('fs'); 6 | var path = require('path'); 7 | 8 | var TARGET_PATH = fs.realpathSync('build/api/layouts/'); 9 | 10 | vowFs.glob('../../../src/markup/bevis/**/*.btjson.js').done(function (files) { 11 | files.forEach(function (file) { 12 | var dir = path.dirname(file), 13 | dirPath = fs.realpathSync(dir); 14 | 15 | exec('cp -R ' + dirPath + ' ' + TARGET_PATH); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/maps-button-icon.bt.js: -------------------------------------------------------------------------------- 1 | module.exports = function (bt) { 2 | /** 3 | * @param {String} image путь к пользовательской иконке, который выливается в атрибут style 4 | * @param {String} state состояние 5 | */ 6 | 7 | bt.match('maps-button-icon*', function (ctx) { 8 | ctx.disableDataAttrGeneration(); 9 | 10 | ctx.setTag('span'); 11 | 12 | var image = ctx.getParam('image'); 13 | if (image) { 14 | ctx.setAttr('style', 'background-image: url(' + image + ')'); 15 | } 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /src/markup/bevis/listbox/round.listbox.layout.item.html/round.listbox.layout.item.html.btjson.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | block: 'maps-listbox', 3 | returnContent: true, 4 | content: { 5 | elem: 'list-item', 6 | text: '{{ data.content|raw }}', 7 | //image: '{{ data.mapType|raw }}', 8 | mapType: '{{ data.mapType|raw }}' 9 | //text: 'TEXT' 10 | } 11 | }; 12 | 13 | /* 14 | [ 15 | { 16 | block: 'listbox', 17 | elem: 'list-item', 18 | mods: {selected: 'no'}, 19 | content: '{{ data.content|raw }}' 20 | } 21 | ] 22 | */ -------------------------------------------------------------------------------- /src/markup/bevis/listbox/round.listbox.layout.html/round.listbox.layout.html.btjson.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | block: 'maps-listbox', 3 | content: [ 4 | { 5 | block: 'maps-button', 6 | icon: {block: 'maps-button-icon', view: 'layers'} 7 | }, 8 | { 9 | block: 'maps-popup', 10 | // block: 'y-popup', 11 | // view: 'islet-air', 12 | // animate: true, 13 | content: { 14 | block: 'maps-listbox', 15 | elem: 'list' 16 | } 17 | } 18 | ] 19 | }; 20 | -------------------------------------------------------------------------------- /ui/src/bevis/server/config.js: -------------------------------------------------------------------------------- 1 | var extend = require('node.extend'); 2 | 3 | module.exports = { 4 | /** 5 | * Returns config by name. 6 | * 7 | * @param {String} name 8 | * @returns {Object} 9 | */ 10 | get: function (name) { 11 | return require('../configs/current/' + name); 12 | }, 13 | 14 | /** 15 | * Returns config for the client. 16 | * 17 | * @param {Object} [data] Additional data to be added to the client config. 18 | * @returns {Object} 19 | */ 20 | getClientConfig: function (data) { 21 | return extend(true, data || {}, this.get('config')); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /ui/src/bevis/configs/production/assets.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = { 4 | /** 5 | * Host for static files. 6 | */ 7 | host: '/', 8 | 9 | /** 10 | * Disable middleware for static files. 11 | */ 12 | middleware: function () { 13 | return function (req, res, next) { 14 | return next(); 15 | }; 16 | }, 17 | 18 | /** 19 | * @param {String} assetPath 20 | * @returns {Module} module 21 | */ 22 | require: function (assetPath) { 23 | var modulePath = path.join('..', '..', assetPath); 24 | return require(modulePath); 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /ui/build/images/9daecb3c9362cb8c987028971d9857a5.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/layers.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "0.0.1", 4 | "name": "maps-theme", 5 | "description": "Yandex.Maps API Maps Theme", 6 | "dependencies": { 7 | "md5": "^2.0.0", 8 | "cli-color": "^1.0.0", 9 | "gulp-concat": "^2.6.0", 10 | "gulp-rename": "^1.2.2", 11 | "gulp-util": "^3.0.6", 12 | "lodash": "^3.6.0", 13 | "through2": "^0.6.3", 14 | "vow": "^0.4.10", 15 | "vow-fs": "^0.3.4", 16 | "ymb": "^0.3.43" 17 | }, 18 | "devDependencies": { 19 | "git-hooks": "~1.0.0-rc.4", 20 | "jshint": "^2.8.0" 21 | }, 22 | "scripts": { 23 | "debug": "ymb build builder/", 24 | "release": "ymb build builder/ -m release" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-zoom/maps-zoom.bt.js: -------------------------------------------------------------------------------- 1 | module.exports = function (bt) { 2 | 3 | bt.match('maps-zoom', function (ctx) { 4 | ctx.disableDataAttrGeneration(); 5 | 6 | ctx.setContent([ 7 | { 8 | elem: 'plus', 9 | icon: {block: 'maps-button-icon', view: 'plus'} 10 | }, 11 | { 12 | elem: 'minus', 13 | icon: {block: 'maps-button-icon', view: 'minus'} 14 | } 15 | ]); 16 | }); 17 | 18 | bt.match(['maps-zoom__plus', 'maps-zoom__minus'], function (ctx) { 19 | ctx.setTag('span'); 20 | 21 | ctx.setContent(ctx.getParam('icon')); 22 | }); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/traffic_yellow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/36a8b646292617a0950c451a1dde0684.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/h-collapse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/7e124202af7510c53851d21888632893.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/traffic_gray.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/traffic_green.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/96af1f9df9b29c2092ee464736b2a070.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/h-expand.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/traffic_red.svg: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /.githooks/pre-commit/lint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Checks changed javascript files in stage area by running npm test for each commit. 4 | # 5 | 6 | PATCH_FILE="working-tree.patch" 7 | NPM_BIN="./node_modules/.bin" 8 | NODE=${NODE-'/opt/nodejs/0.10/bin/node'} 9 | 10 | function cleanup { 11 | exit_code=$? 12 | if [ -f "$PATCH_FILE" ]; then 13 | git apply "$PATCH_FILE" 2> /dev/null 14 | rm "$PATCH_FILE" 15 | fi 16 | exit $exit_code 17 | } 18 | 19 | trap cleanup EXIT SIGINT SIGHUP 20 | 21 | # Cancel any changes to the working tree that are not going to be committed 22 | git diff > "$PATCH_FILE" 23 | git checkout -- . 24 | 25 | git_cached_files=$(git diff --cached --name-only --diff-filter=ACMR | grep "\.js$") 26 | if [ "$git_cached_files" ]; then 27 | $NODE $NPM_BIN/jshint $git_cached_files || exit 1 28 | fi 29 | -------------------------------------------------------------------------------- /ui/build/images/81de10e069a79157ce9656a7a7ea4b44.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/expand.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/build/images/ee1fe2e811d247c1f8cc55772909d92e.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/collapse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/.jshint-groups.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | options: { 3 | curly: true, 4 | eqeqeq: true, 5 | immed: true, 6 | latedef: 'nofunc', 7 | newcap: true, 8 | noarg: true, 9 | noempty: true, 10 | nonew: true, 11 | undef: true, 12 | unused: true, 13 | trailing: true, 14 | maxlen: 120, 15 | quotmark: 'single' 16 | }, 17 | groups: { 18 | 'bt templates': { 19 | options: { 20 | predef: ['module'] 21 | }, 22 | includes: [ 23 | 'client/**/*.bt.js' 24 | ] 25 | }, 26 | 27 | server: { 28 | options: { 29 | node: true 30 | }, 31 | includes: [ 32 | 'server/**' 33 | ] 34 | } 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-popup/maps-popup.bt.js: -------------------------------------------------------------------------------- 1 | module.exports = function (bt) { 2 | /** 3 | * @param {Btjson} content Содержимое попапа. 4 | * @param {Boolean} [showArrow=true] Показывать стрелку попапа. 5 | */ 6 | 7 | bt.match('maps-popup', function (ctx) { 8 | ctx.disableDataAttrGeneration(); 9 | 10 | var btjson = []; 11 | if (ctx.getParam('showArrow') === undefined || 12 | ctx.getParam('showArrow') 13 | ) { 14 | btjson.push({ 15 | elem: 'arrow' 16 | }); 17 | } 18 | btjson.push({ 19 | elem: 'content', 20 | content: ctx.getParam('content') 21 | }); 22 | ctx.setContent(btjson); 23 | }); 24 | 25 | bt.match('maps-popup__content', function (ctx) { 26 | ctx.setContent(ctx.getParam('content')); 27 | }); 28 | }; 29 | -------------------------------------------------------------------------------- /src/theme/maps/listbox/layout/item/listbox.item.layout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverfiew Макет кнопки. 3 | */ 4 | 5 | ym.modules.define({ 6 | name: "theme.round.control.layout.ListBoxItem", 7 | key: 'round#listBoxItemLayout', 8 | storage: 'layout', 9 | depends: [ 10 | "templateLayoutFactory", 11 | "theme.round.control.layout.ListBoxSelectableItem" 12 | ], 13 | dynamicDepends: { 14 | contentLayout: function (data) { 15 | var key = data.options.get('contentLayout'); 16 | return (typeof key == 'string') ? { 17 | key: key, 18 | storage: 'layout' 19 | } : key; 20 | } 21 | }, 22 | declaration: function (provide, templateLayoutFactory, ListBoxSelectableItem) { 23 | var ListBoxItemLayout = templateLayoutFactory.createClass( 24 | '{% include "round#listBoxItemSelectableLayout" %}' 25 | ); 26 | provide(ListBoxItemLayout); 27 | } 28 | }); 29 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/maps-listbox.bt.js: -------------------------------------------------------------------------------- 1 | module.exports = function (bt) { 2 | 3 | bt.match('maps-listbox', function (ctx) { 4 | ctx.disableDataAttrGeneration(); 5 | 6 | if (ctx.getParam('returnContent')) { 7 | return ctx.getParam('content'); 8 | } else { 9 | ctx.setContent(ctx.getParam('content')); 10 | } 11 | }); 12 | 13 | bt.match(['maps-listbox__panel', 'maps-listbox__list'], function (ctx) { 14 | ctx.setContent(ctx.getParam('content')); 15 | }); 16 | 17 | bt.match('maps-listbox__list-item', function (ctx) { 18 | var image = ctx.getParam('image'); 19 | var mapType = ctx.getParam('mapType'); 20 | 21 | //if (image) 22 | ctx.setState('image', image); 23 | ctx.setAttr('data-type', mapType); 24 | 25 | ctx.setContent([ 26 | (mapType) ? {elem: 'list-item-image'} : '', 27 | ctx.getParam('text') 28 | ]); 29 | }); 30 | }; -------------------------------------------------------------------------------- /ui/src/bevis/server/logger.js: -------------------------------------------------------------------------------- 1 | var winston = require('winston'); 2 | var util = require('util'); 3 | var extend = require('node.extend'); 4 | var config = require('./config').get('logger'); 5 | 6 | function capitalize(str) { 7 | return str.charAt(0).toUpperCase() + str.slice(1); 8 | } 9 | 10 | var DEFAULT_CONFIG = { 11 | timestamp: function () { 12 | return new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, '$1'); 13 | } 14 | }; 15 | 16 | var logger = new winston.Logger({ 17 | transports: Object.keys(config).map(function (key) { 18 | return new winston.transports[capitalize(key)](extend(true, {}, DEFAULT_CONFIG, config[key])); 19 | }) 20 | }); 21 | 22 | [ 23 | 'silly', 24 | 'input', 25 | 'verbose', 26 | 'prompt', 27 | 'info', 28 | 'data', 29 | 'help', 30 | 'warn', 31 | 'debug', 32 | 'error' 33 | ].forEach(function (level) { 34 | exports[level] = function () { 35 | logger.log(level, util.format.apply(util, arguments)); 36 | }; 37 | }); 38 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/x-button/x-button.styl: -------------------------------------------------------------------------------- 1 | @require '../x-variables/x-variables'; 2 | 3 | x-button() { 4 | $height = $BUTTON_HEIGHT; 5 | $transition = $TRANSITION; 6 | 7 | display: inline-block; 8 | margin: 0; 9 | padding: 0; 10 | min-width: $height; 11 | height: $height; 12 | outline: 0; 13 | border-width: 0; 14 | border-radius: $height; 15 | background-color: #FFF; 16 | box-shadow: 0 2px 3px 1px rgba(0, 0, 0, 0.2); 17 | color: #333; 18 | vertical-align: middle; 19 | text-align: left; 20 | font-family: $FONT_FAMILY; 21 | line-height: $height; 22 | cursor: pointer; 23 | transition: box-shadow $transition, background-color $transition, opacity $transition; 24 | user-select: none; 25 | 26 | &:hover { 27 | box-shadow: 0 3px 4px 1px rgba(0, 0, 0, 0.3); 28 | } 29 | 30 | &._pressed { 31 | box-shadow: 0 2px 3px 1px rgba(0, 0, 0, 0.12); 32 | opacity: .95; 33 | } 34 | 35 | &._disabled { 36 | background-color: #ebebeb; 37 | box-shadow: none; 38 | cursor: default; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /ui/src/bevis/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "baby-loris", 3 | "description": "Project stub based on Yandex Maps project", 4 | "version": "1.0.0", 5 | "author": "Yandex Maps ", 6 | "contributors": [ 7 | "Petr Dodev " 8 | ], 9 | "private": true, 10 | "dependencies": { 11 | "enb": "0.16.0", 12 | "enb-bt": "3.0.0", 13 | "express": "4.5.1", 14 | "express-ping-middleware": "1.0.0", 15 | "inherit": "2.2.2", 16 | "node.extend": "1.0.10", 17 | "vow-fs": "0.3.2", 18 | "vow": "0.4.4", 19 | "winston": "0.7.3", 20 | "js-yaml": "3.1.0" 21 | }, 22 | "devDependencies": { 23 | "analyze": "0.0.14", 24 | "enb-bevis-helper": "git://github.com/enb-make/enb-bevis-helper.git#v3.2.0", 25 | "jscs": "1.5.8", 26 | "jshint": "2.5.2", 27 | "jshint-groups": "0.6.2", 28 | "stylus": "0.47.1", 29 | "supervisor": "0.6.0" 30 | }, 31 | "enb": { 32 | "sources": [ 33 | "blocks" 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ui/src/bevis/server/boot.js: -------------------------------------------------------------------------------- 1 | var cluster = require('cluster'); 2 | var fs = require('fs'); 3 | var env = require('./config').get('env'); 4 | var logger = require('./logger'); 5 | var app = require('./app'); 6 | 7 | if (cluster.isMaster) { 8 | if (env.socket) { 9 | try { 10 | fs.unlinkSync(env.socket); 11 | } catch (e) {} 12 | } 13 | 14 | var workersCount = env.workersCount; 15 | 16 | while (workersCount--) { 17 | cluster.fork(); 18 | } 19 | 20 | cluster.on('exit', function (worker) { 21 | if (!worker.suicide) { 22 | cluster.fork(); 23 | } 24 | }); 25 | 26 | if (env.hotReload) { 27 | ['SIGINT', 'SIGTERM', 'SIGQUIT'].forEach(function (signal) { 28 | process.on(signal, function () { 29 | Object.keys(cluster.workers).forEach(function (id) { 30 | cluster.workers[id].destroy(); 31 | }); 32 | process.exit(); 33 | }); 34 | }); 35 | } 36 | } else { 37 | logger.info('worker %s started', process.pid); 38 | app.start(); 39 | } 40 | -------------------------------------------------------------------------------- /ui/build/images/733f8c03d37dfbccbccecd0dcc1577c8.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/images/routes.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ui/src/bevis/.enb/lib/priv.js: -------------------------------------------------------------------------------- 1 | function Blocks() { 2 | this._methods = {}; 3 | 4 | /** 5 | * Basic i18n implementation. Returns key for each call. 6 | * 7 | * @public 8 | * @param {String} keyset 9 | * @param {String} key 10 | * @returns {String} 11 | */ 12 | this.i18n = function (keyset, key) { 13 | return key; 14 | }; 15 | } 16 | 17 | Blocks.prototype = { 18 | 19 | /** 20 | * Declares bemjson block builder. 21 | * 22 | * @param {String} name 23 | * @param {Function} method 24 | * @returns {Blocks} 25 | */ 26 | declare: function (name, method) { 27 | this._methods[name] = method; 28 | return this; 29 | }, 30 | 31 | exec: function (name, data) { 32 | var method = this._methods[name]; 33 | if (method) { 34 | return this._methods[name](data); 35 | } else { 36 | throw new Error('Priv method ' + name + ' was not found'); 37 | } 38 | }, 39 | 40 | setI18n: function (i18n) { 41 | this.i18n = i18n; 42 | } 43 | 44 | }; 45 | 46 | module.exports = Blocks; 47 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-zoom/maps-zoom.styl: -------------------------------------------------------------------------------- 1 | @require "../x-button/x-button"; 2 | @require '../x-variables/x-variables'; 3 | 4 | .maps-zoom { 5 | $button_size = $BUTTON_HEIGHT; 6 | $plus_icon = 'images/plus.svg'; 7 | $minus_icon = 'images/minus.svg'; 8 | 9 | position: relative; 10 | display: block; 11 | padding: $button_size 0; 12 | width: $button_size; 13 | height: 8px; 14 | line-height: 0; 15 | 16 | &__plus, 17 | &__minus { 18 | x-button(); 19 | 20 | position: absolute; 21 | width: $button_size; 22 | height: $button_size; 23 | background-repeat: no-repeat; 24 | background-position: 50% 50%; 25 | z-index: 1; 26 | 27 | .maps-button-icon_plus, 28 | .maps-button-icon_minus { 29 | transition: opacity $TRANSITION; 30 | } 31 | } 32 | 33 | &__plus { 34 | top: 0; 35 | 36 | &._disabled .maps-button-icon_plus { 37 | opacity: .75; 38 | } 39 | } 40 | 41 | &__minus { 42 | bottom: 0; 43 | 44 | &._disabled .maps-button-icon_minus { 45 | opacity: .75; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ui/src/bevis/configs/development/assets.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var enbServerMiddleware = require('enb/lib/server/server-middleware'); 3 | var dropRequireCache = require('enb/lib/fs/drop-require-cache'); 4 | var enbBuilder = enbServerMiddleware.createBuilder(); 5 | 6 | module.exports = { 7 | /** 8 | * Host for static files. 9 | */ 10 | host: '/', 11 | 12 | /** 13 | * @returns {Object} Express application as middleware. 14 | */ 15 | middleware: function () { 16 | return express.Router() 17 | .use(enbServerMiddleware.createMiddleware()) 18 | .use('/blocks', express.static(__dirname + '/../../blocks')) 19 | .use('/node_modules', express.static(__dirname + '/../../node_modules')) 20 | .use('/test/client', express.static(__dirname + '/../../test/client')); 21 | }, 22 | 23 | /** 24 | * @param {String} assetPath 25 | * @returns {Module} module 26 | */ 27 | require: function (assetPath) { 28 | return enbBuilder(assetPath).then(function (fileName) { 29 | dropRequireCache(require, fileName); 30 | return require(fileName); 31 | }); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": false, 3 | "boss": true, 4 | "browser": true, 5 | "curly": false, 6 | "devel": false, 7 | "eqeqeq": false, 8 | "eqnull": true, 9 | "es3": true, 10 | "evil": true, 11 | "expr": true, 12 | "forin": false, 13 | "iterator": true, 14 | "latedef": "nofunc", 15 | "loopfunc": true, 16 | "multistr": true, 17 | "noarg": true, 18 | "noempty": false, 19 | "onecase": true, 20 | "proto": true, 21 | "shadow": true, 22 | "smarttabs": true, 23 | "strict": false, 24 | "sub": true, 25 | "supernew": true, 26 | "undef": true, 27 | "unused": false, 28 | "-W099": true, 29 | "-W014": true, 30 | "-W041": true, 31 | "-W047": true, 32 | "-W008": true, 33 | "-W017": true, 34 | "-W018": true, 35 | "-W065": true, 36 | "-W024": true, 37 | "globals": { 38 | "provide": true, 39 | "modules": true, 40 | "project": true, 41 | "defineClass": true, 42 | "imports": true, 43 | "module": true, 44 | "ym": true, 45 | "JSON": true 46 | }, 47 | 48 | "overrides": { 49 | "!src/**/**.js": { 50 | "node": true 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ui/src/bevis/.enb/lib/ymaps-image-preprocessor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Обрабатывает картинки. 3 | */ 4 | var inherit = require('inherit'); 5 | var fs = require('fs'); 6 | var path = require('path'); 7 | var crypto = require('crypto'); 8 | 9 | var ymapsImages = {}; 10 | 11 | module.exports = { 12 | /** 13 | * Принимает на вход путь до изображения, получает хэш и сохраняет его 14 | * с именем hash.extension в указанную дирректорию. 15 | * @param {String} imagePath Путь до изображения. 16 | * @param {String} saveTo Куда его нужно сохранить. 17 | * @returns {String} Имя файла в формате hash.extension 18 | */ 19 | process: function (imagePath, saveTo) { 20 | if (!fs.existsSync(imagePath)) { 21 | console.log('Изображение не найдено: ', imagePath); 22 | return null; 23 | } 24 | 25 | var extension = imagePath.split('.').pop(); 26 | var md5sum = crypto.createHash('md5'); 27 | var data = fs.readFileSync(imagePath); 28 | 29 | md5sum.update(data); 30 | 31 | var d = md5sum.digest('hex'); 32 | var fileName = d + '.' + extension; 33 | 34 | if (!ymapsImages[d]) { 35 | var filePath = path.resolve('.', saveTo, fileName); 36 | fs.writeFileSync(filePath, data); 37 | ymapsImages[d] = true; 38 | } 39 | 40 | return fileName; 41 | } 42 | } -------------------------------------------------------------------------------- /ui/src/bevis/.enb/techs/priv-js.js: -------------------------------------------------------------------------------- 1 | var path = require('path'), 2 | vowFs = require('vow-fs'); 3 | 4 | module.exports = require('enb/lib/build-flow').create() 5 | .name('priv-js') 6 | .target('target', '?.priv.js') 7 | .defineOption('privFile', '') 8 | .useFileList(['priv.js']) 9 | .needRebuild(function(cache) { 10 | this._privFile = this._privFile || '.enb/lib/priv.js'; 11 | this._privFile = this.node._root + '/' + this._privFile; 12 | return cache.needRebuildFile('priv-file', this._privFile); 13 | }) 14 | .saveCache(function(cache) { 15 | cache.cacheFileInfo('priv-file', this._privFile); 16 | }) 17 | .builder(function(bhFiles) { 18 | var node = this.node; 19 | function buildRequire(absPath, pre, post) { 20 | var relPath = node.relativePath(absPath); 21 | return [ 22 | 'delete require.cache[require.resolve("' + relPath + '")];', 23 | (pre || '') + 'require("' + relPath + '")' + (post || '') + ';' 24 | ].join('\n'); 25 | } 26 | return [ 27 | buildRequire(this._privFile, 'var Blocks = '), 28 | 'var blocks = new Blocks();', 29 | bhFiles.map(function(file) { 30 | return buildRequire(file.fullname, '', '(blocks)'); 31 | }).join('\n'), 32 | 'module.exports = blocks;' 33 | ].join('\n'); 34 | }) 35 | .createTech(); 36 | 37 | -------------------------------------------------------------------------------- /ui/src/bevis/.enb/techs/ymaps-layout-module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ymaps-layout-module 3 | * =================== 4 | * 5 | * Собирает `module.json` для HTML-шаблона. 6 | * 7 | * **Опции** 8 | * 9 | * * *String* **source** — Исходный `.deps.yaml`-файл. 10 | * * *String* **target** — Результирующий файл. По умолчанию — `module.json`. 11 | * 12 | * **Пример** 13 | * 14 | * ```javascript 15 | * nodeConfig.addTech([require('./techs/ymaps-layout-module')]); 16 | * ``` 17 | */ 18 | var yaml = require('js-yaml'); 19 | 20 | module.exports = require('enb/lib/build-flow').create() 21 | .name('ymaps-layout-module') 22 | .target('target', 'module.json') 23 | .useSourceResult('source', '?.ymaps-deps.js') 24 | .builder(function (deps) { 25 | var targetName = this.node.getTargetName(), 26 | json = { 27 | name: targetName, 28 | depends: deps.filter(skipSkins).map(depKey) 29 | }; 30 | 31 | // Содержимое css-макетов (не имеющих собственной разметки) не требуется. 32 | if (targetName.match(/.html$/)) { 33 | json.src = [targetName]; 34 | } 35 | 36 | return JSON.stringify(json, null, 4); 37 | }) 38 | .createTech(); 39 | 40 | function skipSkins(dep) { 41 | return (dep.modName !== "skin"); 42 | } 43 | 44 | function depKey(dep) { 45 | return dep.blockName + 46 | (dep.elemName ? '__' + dep.elemName : '') + 47 | (dep.modName ? '_' + dep.modName + (dep.modValue ? '_' + dep.modValue : '') : ''); 48 | } 49 | -------------------------------------------------------------------------------- /docs/icons.md: -------------------------------------------------------------------------------- 1 | # Icons 2 | 3 | ### Example 4 | ```js 5 | var button = new ymaps.control.Button({ 6 | data: { 7 | iconType: 'cross' 8 | }, 9 | options: { 10 | layout: 'round#buttonLayout' 11 | } 12 | }); 13 | ``` 14 | ### Icons List 15 | 16 | | Preview | `parameters.data.iconType` Value 17 | | -------------------------------------------------------------- | --------------------------------- 18 | | | `'cross'` 19 | | | `'geolocation'` 20 | | | `'layers'` 21 | | | `'loupe'` 22 | | | `'pano'` 23 | | | `'ruler'` 24 | | | `'routes'` 25 | | | `'traffic'` 26 | | | `'minus'` 27 | | | `'plus'` 28 | | | `'collapse'` 29 | | | `'expand'` 30 | | | `'h-collapse'` 31 | | | `'h-expand'` 32 | -------------------------------------------------------------------------------- /ui/src/bevis/.enb/techs/ymaps-module-deps.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ymaps-module-deps 3 | * ================= 4 | * 5 | * Фильтрует `deps.yaml`-файл и на его основе собирает `ymaps-deps.yaml`-файл, 6 | * в который включает лишь те зависимости, где есть css-файлы. 7 | * 8 | * **Опции** 9 | * 10 | * * *String* **source** — Исходный `deps.yaml`-файл. 11 | * * *String* **target** — Результирующий файл. По умолчанию — `?.ymaps-deps.yaml`. 12 | * * *String[]* **suffixes** — Суффиксы для фильтрации. 13 | * По умолчанию — `[css, ie.css, ie8.css, standards.css]`. 14 | * 15 | * **Пример** 16 | * 17 | * ```javascript 18 | * nodeConfig.addTech([require('./techs/ymaps-module-deps')]); 19 | * ``` 20 | */ 21 | 22 | var yaml = require('js-yaml'); 23 | var bevis = require('enb-bevis/lib/bevis'); 24 | 25 | var suffixes = ['']; 26 | 27 | suffixes = [].concat( 28 | getFiles(suffixes, 'css'), 29 | getFiles(suffixes, 'styl') 30 | ); 31 | 32 | module.exports = require('enb/lib/build-flow').create() 33 | .name('ymaps-module-deps') 34 | .target('target', '?.ymaps-deps.js') 35 | .useFileList(suffixes) 36 | .builder(function (files) { 37 | var deps = files.map(function (file) { 38 | return bevis.parseEntityName(file.name); 39 | }); 40 | this.setResult(deps); 41 | return 'module.exports = ' + JSON.stringify(deps, null, 4); 42 | }) 43 | .createTech(); 44 | 45 | function getFiles(names, extension) { 46 | return names.map(function (name) { 47 | return name != '' ? 48 | name + '.' + extension : 49 | extension; 50 | }); 51 | } 52 | -------------------------------------------------------------------------------- /ui/src/bevis/server/build-page.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var vow = require('vow'); 3 | var extend = require('node.extend'); 4 | var assets = require('./config').get('assets'); 5 | 6 | var DEFAULT_LANG = 'ru'; 7 | 8 | /** 9 | * Builds pages from sources. Responds with HTML. 10 | * 11 | * @param {String} pagePath 12 | * @param {http.ClientRequest} req 13 | * @param {http.ServerResponse} res 14 | * @param {Function} next 15 | * @param {Object} [data] Data to be passed to the `priv` file. 16 | */ 17 | module.exports = function (pagePath, req, res, next, data) { 18 | var lang = DEFAULT_LANG; 19 | vow.all([ 20 | assets.require(buildAssetPath(pagePath, 'priv')), 21 | assets.require(buildAssetPath(pagePath, 'bt')), 22 | assets.require(buildAssetPath(pagePath, 'lang.' + lang)) 23 | ]).spread(function (priv, bt, buildI18n) { 24 | var i18n = buildI18n(); 25 | priv.setI18n(i18n); 26 | bt.lib.i18n = i18n; 27 | 28 | var pageName = path.basename(pagePath); 29 | extend(true, data || {}, { 30 | assetsPath: assets.host + pagePath + '/_' + pageName, 31 | lang: lang 32 | }); 33 | res.end(bt.apply(priv.exec(pageName + '-page', data))); 34 | }).fail(function (error) { 35 | next(error); 36 | }); 37 | }; 38 | 39 | /** 40 | * Generates build path for the specified page. 41 | * 42 | * @param {String} pagePath 43 | * @param {String} assetName 44 | * @returns {String} 45 | */ 46 | function buildAssetPath(pagePath, assetName) { 47 | return '/' + pagePath + '/' + path.basename(pagePath) + '.' + assetName + '.js'; 48 | } 49 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button/maps-button.styl: -------------------------------------------------------------------------------- 1 | @require '../x-variables/x-variables'; 2 | @require "../x-button/x-button"; 3 | 4 | .maps-button { 5 | x-button(); 6 | 7 | $transition = $TRANSITION; 8 | $icon-size = 26px; 9 | $icon-padding = 5px; 10 | 11 | position: relative; 12 | white-space: nowrap; 13 | font-size: 15px; 14 | 15 | &__text, 16 | &__icon { 17 | display: inline-block; 18 | vertical-align: top; 19 | } 20 | 21 | &__text { 22 | position: relative; 23 | display: block; 24 | overflow: hidden; 25 | margin: 0; 26 | padding: 0 20px 0 44px; 27 | border: none; 28 | background: none; 29 | color: #333; 30 | text-decoration: none; 31 | text-overflow: ellipsis; 32 | white-space: nowrap; 33 | transition: color $transition; 34 | } 35 | 36 | &._text_only &__text { 37 | padding-left: 20px; 38 | } 39 | 40 | &__icon { 41 | position: absolute; 42 | top: 0; 43 | left: 0; 44 | margin-left: 6px; 45 | padding: $icon-padding; 46 | width: $icon-size; 47 | height: $icon-size; 48 | transition: opacity $transition; 49 | } 50 | 51 | &._icon_only &__icon { 52 | margin-left: 0; 53 | } 54 | 55 | &._checked { 56 | background-color: #FFEBA0; 57 | } 58 | 59 | &._checked &__text { 60 | color: #746233; 61 | 62 | } 63 | 64 | &._disabled &__icon { 65 | opacity: 0.75; 66 | } 67 | 68 | &._checked._disabled { 69 | background: #FFF8DB; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /ui/src/bevis/Makefile: -------------------------------------------------------------------------------- 1 | # On development servers we have to use versioned node and a unix-socket. 2 | # Otherwise (for local development) we use the /usr/bin/node and a web-socket (localhost:). 3 | # Bellow you can see this detection. 4 | SERVER_NODE := /opt/nodejs/0.10/bin/node 5 | SERVER_NPM := /opt/nodejs/0.10/bin/npm 6 | LOCAL_NODE := node 7 | LOCAL_NPM := npm 8 | 9 | NODE := $(firstword $(shell which $(SERVER_NODE) $(LOCAL_NODE))) 10 | NPM := $(firstword $(shell which $(SERVER_NPM) $(LOCAL_NPM))) 11 | 12 | # if server node isn't found then specify PORT for local development 13 | PORT ?= 8081 14 | 15 | NODE_MODULES_BIN := node_modules/.bin 16 | ENB := $(NODE_MODULES_BIN)/enb 17 | 18 | all: install validate build 19 | 20 | # Dependencies 21 | install: npm 22 | 23 | # Install npm modules 24 | npm: 25 | @$(NPM) install --registry http://npm.yandex-team.ru/ 26 | 27 | # Production npm prune 28 | npm-prune: 29 | @$(NPM) prune --production 30 | 31 | # Build project 32 | build: 33 | $(ENB) $(ENB_FLAGS) make 34 | cp -R build/api/layouts/* ../../build/layouts/ 35 | cp -R build/api/fragments/* ../../build/css/ 36 | 37 | # Clean build results 38 | clean: 39 | $(ENB) $(ENB_FLAGS) make clean 40 | 41 | # Validation 42 | validate: lint test 43 | 44 | # Lint js files 45 | lint: 46 | @$(NODE_MODULES_BIN)/jshint-groups 47 | @$(NODE_MODULES_BIN)/jscs . 48 | @$(NODE_MODULES_BIN)/analyze report -r errors -v return-type=-getBlockName:param-type 49 | 50 | # Run application in development mode 51 | dev: install 52 | @PORT=$(PORT) $(NODE_MODULES_BIN)/supervisor -x $(NODE) -w server,configs -- server/boot.js $(USER) 53 | 54 | .PHONY: all install npm npm-prune build clean validate lint dev 55 | -------------------------------------------------------------------------------- /ui/src/bevis/.enb/techs/ymaps-module-from-html.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ymaps-layout-module 3 | * =================== 4 | * 5 | * Собирает `html.js`-файл из `html`-шаблона. 6 | * 7 | * **Опции** 8 | * 9 | * * *String* **source** — Исходный файл. 10 | * * *String* **target** — Результирующий файл. По умолчанию — `?.js`. 11 | * 12 | * **Пример** 13 | * 14 | * ```javascript 15 | * nodeConfig.addTech([require('./techs/ymaps-module-from-html')]); 16 | * ``` 17 | */ 18 | 19 | module.exports = require('enb/lib/build-flow').create() 20 | .name('ymaps-module-from-html') 21 | .target('target', '?') 22 | .useSourceText('source', '?.tmp') 23 | .builder(function (htmlSource) { 24 | var cssPrefix = 'ymaps_'; 25 | 26 | return htmlSource 27 | // экранируем переносы строки 28 | .replace(/\n|\r/g, '') 29 | // кастомный тег 30 | .replace(/<(\/?)(span|div|label|form|button)/g, '<$1ymaps') 31 | // удаляем класс i-bem 32 | .replace(" i-bem", '') 33 | // удаляем ненужный нам эскейпинг 34 | .replace(/</g, '<') 35 | .replace(/>/g, '>') 36 | .replace(///g, '\/') 37 | .replace(/"/g, '\"') 38 | .replace(/&/g, '&') 39 | // все префиксы заменяем на "ymaps-" 40 | .replace( 41 | /class="([^"]+)"/g, 42 | function (_, className) { 43 | return 'class="' + className.replace(/([\S]+)/g, cssPrefix + '$1') + '"'; 44 | } 45 | ) 46 | // удаляем некоторые атрибуты 47 | .replace(/(id|onclick|action|for)="[^"]*"/g, ''); 48 | }) 49 | .createTech(); 50 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button-icon/maps-button-icon.styl: -------------------------------------------------------------------------------- 1 | @require '../x-variables/x-variables'; 2 | 3 | .maps-button-icon { 4 | maps-button-icon() { 5 | display: block; 6 | height: 100%; 7 | background-position: 50% 50%; 8 | background-repeat: no-repeat; 9 | transition: opacity $TRANSITION; 10 | } 11 | 12 | & { 13 | maps-button-icon(); 14 | } 15 | 16 | &_collapse { maps-button-icon(); background-image: url('images/collapse.svg'); } 17 | &_cross { maps-button-icon(); background-image: url('images/cross.svg'); } 18 | &_expand { maps-button-icon(); background-image: url('images/expand.svg'); } 19 | &_geolocation { maps-button-icon(); background-image: url('images/geolocation.svg'); } 20 | &_h-collapse { maps-button-icon(); background-image: url('images/h-collapse.svg'); } 21 | &_h-expand { maps-button-icon(); background-image: url('images/h-expand.svg'); } 22 | &_layers { maps-button-icon(); background-image: url('images/layers.svg'); } 23 | &_loupe { maps-button-icon(); background-image: url('images/loupe.svg'); } 24 | &_minus { maps-button-icon(); background-image: url('images/minus.svg'); } 25 | &_pano { maps-button-icon(); background-image: url('images/pano.svg'); } 26 | &_plus { maps-button-icon(); background-image: url('images/plus.svg'); } 27 | &_ruler { maps-button-icon(); background-image: url('images/ruler.svg'); } 28 | &_routes { maps-button-icon(); background-image: url('images/routes.svg'); } 29 | &_traffic { maps-button-icon(); background-image: url('images/traffic_gray.svg'); } 30 | } 31 | -------------------------------------------------------------------------------- /ui/src/bevis/server/app.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var pingMiddleware = require('express-ping-middleware'); 3 | var logger = require('./logger'); 4 | var config = require('./config'); 5 | var buildPage = require('./build-page'); 6 | 7 | var app = require('express')(); 8 | var env = config.get('env'); 9 | var assets = config.get('assets'); 10 | 11 | app 12 | .disable('x-powered-by') 13 | .enable('trust proxy') 14 | .use(pingMiddleware) 15 | .use(assets.middleware()) 16 | .get('/', function (req, res, next) { 17 | var data = {clientConfig: config.getClientConfig()}; 18 | buildPage('build/index', req, res, next, data); 19 | }) 20 | .use(function (req, res) { 21 | res.statusCode = 404; 22 | res.end('Not found'); 23 | }) 24 | .use(function (err, req, res, next) { 25 | /* jshint unused: vars */ 26 | logger.error(err.stack); 27 | res.statusCode = 500; 28 | res.end('Internal error'); 29 | }); 30 | 31 | exports.start = function () { 32 | var portOrSocket = env.port || env.socket; 33 | app 34 | .listen(portOrSocket, function () { 35 | logger.info('app started on %s', portOrSocket); 36 | if (env.socket && !env.port) { 37 | fs.chmod(env.socket, '0777'); 38 | } 39 | }) 40 | .once('error', function (err) { 41 | logger.error('worker %s has failed to start application', process.pid); 42 | if (err.code === 'EADDRINUSE') { 43 | logger.error('port (or socket) %s is taken', portOrSocket); 44 | process.kill(); 45 | } else { 46 | console.log(err.stack); 47 | } 48 | }); 49 | }; 50 | 51 | if (!module.parent) { 52 | exports.start(); 53 | } 54 | -------------------------------------------------------------------------------- /ui/build/css/maps-zoom/maps-zoom.css: -------------------------------------------------------------------------------- 1 | .ymaps_maps-zoom { 2 | position: relative; 3 | display: block; 4 | padding: 36px 0; 5 | width: 36px; 6 | height: 8px; 7 | line-height: 0; 8 | } 9 | .ymaps_maps-zoom__plus, 10 | .ymaps_maps-zoom__minus { 11 | display: inline-block; 12 | margin: 0; 13 | padding: 0; 14 | min-width: 36px; 15 | height: 36px; 16 | outline: 0; 17 | border-width: 0; 18 | border-radius: 36px; 19 | background-color: #fff; 20 | box-shadow: 0 2px 3px 1px rgba(0,0,0,0.2); 21 | color: #333; 22 | vertical-align: middle; 23 | text-align: left; 24 | font-family: Arial, Helvetica, sans-serif; 25 | line-height: 36px; 26 | cursor: pointer; 27 | transition: box-shadow 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955), background-color 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955), opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 28 | -webkit-user-select: none; 29 | -moz-user-select: none; 30 | -ms-user-select: none; 31 | user-select: none; 32 | position: absolute; 33 | width: 36px; 34 | height: 36px; 35 | background-repeat: no-repeat; 36 | background-position: 50% 50%; 37 | z-index: 1; 38 | } 39 | .ymaps_maps-zoom__plus:hover, 40 | .ymaps_maps-zoom__minus:hover { 41 | box-shadow: 0 3px 4px 1px rgba(0,0,0,0.3); 42 | } 43 | .ymaps_maps-zoom__plus.ymaps__pressed, 44 | .ymaps_maps-zoom__minus.ymaps__pressed { 45 | box-shadow: 0 2px 3px 1px rgba(0,0,0,0.12); 46 | opacity: 0.95; 47 | } 48 | .ymaps_maps-zoom__plus.ymaps__disabled, 49 | .ymaps_maps-zoom__minus.ymaps__disabled { 50 | background-color: #ebebeb; 51 | box-shadow: none; 52 | cursor: default; 53 | } 54 | .ymaps_maps-zoom__plus .ymaps_maps-button-icon_plus, 55 | .ymaps_maps-zoom__minus .ymaps_maps-button-icon_plus, 56 | .ymaps_maps-zoom__plus .ymaps_maps-button-icon_minus, 57 | .ymaps_maps-zoom__minus .ymaps_maps-button-icon_minus { 58 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 59 | } 60 | .ymaps_maps-zoom__plus { 61 | top: 0; 62 | } 63 | .ymaps_maps-zoom__plus.ymaps__disabled .ymaps_maps-button-icon_plus { 64 | opacity: 0.75; 65 | } 66 | .ymaps_maps-zoom__minus { 67 | bottom: 0; 68 | } 69 | .ymaps_maps-zoom__minus.ymaps__disabled .ymaps_maps-button-icon_minus { 70 | opacity: 0.75; 71 | } -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-button/maps-button.bt.js: -------------------------------------------------------------------------------- 1 | module.exports = function (bt) { 2 | 3 | /** 4 | * @param {Btjson} icon блок или элемент любого блока, формирующий иконку. 5 | * @param {String | Boolean} text текст кнопки, в значении true создаётся элемент без контента. 6 | * @param {Boolean} disabled устанавливает состояние disabled, кнопка задизейблена. 7 | * @param {Boolean} checked устанавливает состояние checked, кнопка зажата. 8 | * @param {String} style задаёт инлайновый стиль, нужно для уставновки max-width. 9 | * @param {String} title задаёт html-атрибут title. 10 | */ 11 | 12 | bt.match('maps-button*', function (ctx) { 13 | ctx.disableDataAttrGeneration(); 14 | 15 | ctx.setTag('button'); 16 | 17 | var icon = ctx.getParam('icon'); 18 | var text = ctx.getParam('text'); 19 | 20 | ctx.setContent([ 21 | icon ? {elem: 'icon', name: icon} : null, 22 | text ? {elem: 'text', content: text} : null 23 | ]); 24 | 25 | var disabled = ctx.getParam('disabled'); 26 | if (disabled) { 27 | ctx.setState('disabled'); 28 | } 29 | 30 | var checked = ctx.getParam('checked'); 31 | if (checked) { 32 | ctx.setState('checked'); 33 | } 34 | 35 | var style = ctx.getParam('style'); 36 | if (style) { 37 | ctx.setAttr('style', style); 38 | } 39 | 40 | var title = ctx.getParam('title'); 41 | if (title) { 42 | ctx.setAttr('title', title); 43 | } 44 | 45 | }); 46 | 47 | bt.match('maps-button*__content', function (ctx) { 48 | var icon = ctx.getParam('icon'); 49 | var text = ctx.getParam('text'); 50 | 51 | ctx.setContent([ 52 | icon ? {elem: 'icon', name: icon} : null, 53 | text ? { 54 | elem: 'text', 55 | content: (text === true) ? null : text 56 | } : null 57 | ]); 58 | }); 59 | 60 | bt.match('maps-button*__icon', function (ctx) { 61 | ctx.setTag('span'); 62 | 63 | ctx.setContent(ctx.getParam('name')); 64 | }); 65 | 66 | bt.match('maps-button*__text', function (ctx) { 67 | ctx.setTag('span'); 68 | 69 | ctx.setContent(ctx.getParam('content')); 70 | }); 71 | }; 72 | -------------------------------------------------------------------------------- /ui/build/css/maps-button/maps-button.css: -------------------------------------------------------------------------------- 1 | .ymaps_maps-button { 2 | display: inline-block; 3 | margin: 0; 4 | padding: 0; 5 | min-width: 36px; 6 | height: 36px; 7 | outline: 0; 8 | border-width: 0; 9 | border-radius: 36px; 10 | background-color: #fff; 11 | box-shadow: 0 2px 3px 1px rgba(0,0,0,0.2); 12 | color: #333; 13 | vertical-align: middle; 14 | text-align: left; 15 | font-family: Arial, Helvetica, sans-serif; 16 | line-height: 36px; 17 | cursor: pointer; 18 | transition: box-shadow 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955), background-color 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955), opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 19 | -webkit-user-select: none; 20 | -moz-user-select: none; 21 | -ms-user-select: none; 22 | user-select: none; 23 | position: relative; 24 | white-space: nowrap; 25 | font-size: 15px; 26 | } 27 | .ymaps_maps-button:hover { 28 | box-shadow: 0 3px 4px 1px rgba(0,0,0,0.3); 29 | } 30 | .ymaps_maps-button.ymaps__pressed { 31 | box-shadow: 0 2px 3px 1px rgba(0,0,0,0.12); 32 | opacity: 0.95; 33 | } 34 | .ymaps_maps-button.ymaps__disabled { 35 | background-color: #ebebeb; 36 | box-shadow: none; 37 | cursor: default; 38 | } 39 | .ymaps_maps-button__text, 40 | .ymaps_maps-button__icon { 41 | display: inline-block; 42 | vertical-align: top; 43 | } 44 | .ymaps_maps-button__text { 45 | position: relative; 46 | display: block; 47 | overflow: hidden; 48 | margin: 0; 49 | padding: 0 20px 0 44px; 50 | border: none; 51 | background: none; 52 | color: #333; 53 | text-decoration: none; 54 | text-overflow: ellipsis; 55 | white-space: nowrap; 56 | transition: color 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 57 | } 58 | .ymaps_maps-button.ymaps__text_only .ymaps_maps-button__text { 59 | padding-left: 20px; 60 | } 61 | .ymaps_maps-button__icon { 62 | position: absolute; 63 | top: 0; 64 | left: 0; 65 | margin-left: 6px; 66 | padding: 5px; 67 | width: 26px; 68 | height: 26px; 69 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 70 | } 71 | .ymaps_maps-button.ymaps__icon_only .ymaps_maps-button__icon { 72 | margin-left: 0; 73 | } 74 | .ymaps_maps-button.ymaps__checked { 75 | background-color: #ffeba0; 76 | } 77 | .ymaps_maps-button.ymaps__checked .ymaps_maps-button__text { 78 | color: #746233; 79 | } 80 | .ymaps_maps-button.ymaps__disabled .ymaps_maps-button__icon { 81 | opacity: 0.75; 82 | } 83 | .ymaps_maps-button.ymaps__checked.ymaps__disabled { 84 | background: #fff8db; 85 | } -------------------------------------------------------------------------------- /ui/src/bevis/.enb/techs/cross-node-copy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * cross-node-copy 3 | * =============== 4 | * 5 | * Копирует *файл* в текущую ноду под нужным именем из другой ноды. 6 | * 7 | * **Опции** 8 | * 9 | * * *String* **sourceNodePath** — Путь исходной ноды с нужным файлом. Обязательная опция. 10 | * * *String* **sourceTarget** — Исходный таргет, который будет копироваться. 11 | * * *String* **destTarget** — Результирующий таргет. 12 | * 13 | * **Пример** 14 | * 15 | * ```javascript 16 | * nodeConfig.addTech([require('./techs/cross-node-copy'), { 17 | * sourceNodePath: 'build/api/common', 18 | * sourceTarget: 'common.bemhtml.js', 19 | * destTarget: '?.bemhtml.js' 20 | * }]); 21 | * ``` 22 | */ 23 | var vowFs = require('enb/lib/fs/async-fs'); 24 | var inherit = require('inherit'); 25 | 26 | module.exports = inherit(require('enb/lib/tech/base-tech'), { 27 | getName: function () { 28 | return 'cross-node-copy'; 29 | }, 30 | 31 | configure: function () { 32 | this._sourceNodePath = this.getRequiredOption('sourceNodePath'); 33 | this._sourceTarget = this.getRequiredOption('sourceTarget'); 34 | this._target = this.node.unmaskTargetName(this.getRequiredOption('destTarget')); 35 | }, 36 | 37 | getTargets: function () { 38 | return [this._target]; 39 | }, 40 | 41 | build: function () { 42 | var _this = this; 43 | var destTarget = this._target; 44 | var destTargetPath = this.node.resolvePath(destTarget); 45 | var fromNode = this._sourceNodePath; 46 | var cache = this.node.getNodeCache(destTarget); 47 | var requirements = {}; 48 | var sourceTargetName = this.node.unmaskNodeTargetName(fromNode, this._sourceTarget); 49 | var sourceTargetPath = this.node.resolveNodePath(fromNode, sourceTargetName); 50 | requirements[fromNode] = [sourceTargetName]; 51 | return this.node.requireNodeSources(requirements).then(function () { 52 | if (cache.needRebuildFile('target-file', destTargetPath) || 53 | cache.needRebuildFile('source-file', sourceTargetPath) 54 | ) { 55 | return vowFs.read(sourceTargetPath, 'utf8').then(function (data) { 56 | vowFs.write(destTargetPath, data).then(function () { 57 | cache.cacheFileInfo('target-file', destTargetPath); 58 | cache.cacheFileInfo('source-file', sourceTargetPath); 59 | _this.node.resolveTarget(destTarget); 60 | }); 61 | }); 62 | } else { 63 | _this.node.isValidTarget(destTarget); 64 | _this.node.resolveTarget(destTarget); 65 | return null; 66 | } 67 | }); 68 | } 69 | }); 70 | -------------------------------------------------------------------------------- /src/theme/maps/listbox/layout/item/selectable/listbox.item.selectable.layout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverview Макет пункта выпадающего списка. 3 | */ 4 | 5 | 6 | ym.modules.define({ 7 | name: "theme.round.control.layout.ListBoxSelectableItem", 8 | key: 'round#listBoxItemSelectableLayout', 9 | storage: 'layout', 10 | depends: [ 11 | "templateLayoutFactory", 12 | "round.listbox.layout.item.html", 13 | "util.dom.element", 14 | "util.dom.className", 15 | "util.dom.style", 16 | "Monitor" 17 | ], 18 | dynamicDepends: { 19 | contentLayout: function (data) { 20 | var key = data.options.get('contentLayout'); 21 | return (typeof key == 'string') ? { 22 | key: key, 23 | storage: 'layout' 24 | } : key; 25 | } 26 | }, 27 | declaration: function (provide, templateLayoutFactory, itemHtml, 28 | domElement, domClassName, domStyle, Monitor) { 29 | var CSS_CLASS_PREFIX = 'ymaps_'; 30 | 31 | var ListBoxSelectableItem = templateLayoutFactory.createClass(itemHtml, { 32 | build: function () { 33 | ListBoxSelectableItem.superclass.build.call(this); 34 | domStyle.patch(this.getElement(), { selectable: false }); 35 | this._itemElement = domElement.findByClassName(this.getParentElement(), CSS_CLASS_PREFIX + 'maps-listbox__list-item'); 36 | this._applySelected(this.getData().state.get('selected')); 37 | this._applyEnabled(this.getData().state.get('enabled', true)); 38 | this._stateMonitor = new Monitor(this.getData().state) 39 | .add('selected', this._applySelected, this) 40 | .add('enabled', this._applyEnabled, this); 41 | }, 42 | 43 | clear: function () { 44 | this._stateMonitor.removeAll(); 45 | ListBoxSelectableItem.superclass.clear.call(this); 46 | }, 47 | 48 | _applySelected: function (selected) { 49 | if (selected) { 50 | domClassName.add(this._itemElement, CSS_CLASS_PREFIX + '_selected'); 51 | } else { 52 | domClassName.remove(this._itemElement, CSS_CLASS_PREFIX + '_selected'); 53 | } 54 | }, 55 | 56 | _applyEnabled: function (enabled) { 57 | if (enabled) { 58 | domClassName.remove(this._itemElement, CSS_CLASS_PREFIX + '_disabled'); 59 | } else { 60 | domClassName.add(this._itemElement, CSS_CLASS_PREFIX + '_disabled'); 61 | } 62 | } 63 | }); 64 | 65 | provide(ListBoxSelectableItem); 66 | } 67 | }); 68 | -------------------------------------------------------------------------------- /src/theme/maps/ruler/layout/ruler.layout.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileOverfiew Макет кнопки линейки и масштабного отрезка. 3 | */ 4 | 5 | ym.modules.define({ 6 | name: "theme.round.control.layout.Ruler", 7 | key: 'round#rulerLayout', 8 | storage: 'layout', 9 | depends: [ 10 | "templateLayoutFactory", 11 | "layout.component.clientBounds", 12 | "theme.round.control.layout.Button", 13 | "shape.Rectangle", 14 | "geometry.pixel.Rectangle", 15 | "domEvent.manager", 16 | "control.component.setupMarginManager", 17 | "util.dom.style", 18 | "util.dom.element", 19 | "system.browser" 20 | ], 21 | dynamicDepends: { 22 | contentLayout: function (data) { 23 | var key = data.options.get('contentLayout'); 24 | return (typeof key == 'string') ? { 25 | key: key, 26 | storage: 'layout' 27 | } : key; 28 | } 29 | }, 30 | declaration: function (provide, templateLayoutFactory, clientBounds, ButtonLayout, RectangleShape, 31 | RectanglePixelGeometry, domEventManager, setupMarginManager, utilDomStyle, utilDomElement, browser) { 32 | var RulerLayout = templateLayoutFactory.createClass( 33 | '{% include round#buttonLayout %}', { 34 | _cssClassPrefix: 'ymaps_', 35 | 36 | build: function () { 37 | RulerLayout.superclass.build.call(this); 38 | setupMarginManager.add(this, function () { 39 | return [125, 28]; 40 | }, this); 41 | 42 | var buttonElement = utilDomElement.findByClassName(this.getElement(), this._cssClassPrefix + 'maps-button'); 43 | 44 | utilDomStyle.css(buttonElement, {maxWidth: 38 + 'px'}); 45 | 46 | this._layoutElementListeners = domEventManager.group(buttonElement) 47 | .add('click', this._onButtonClick, this); 48 | 49 | if (browser.isIE && parseInt(browser.version, 10) < 11) { 50 | utilDomStyle.css(buttonElement, {top: 3 + 'px'}); 51 | } 52 | }, 53 | 54 | clear: function () { 55 | setupMarginManager.remove(this); 56 | this._layoutElementListeners.removeAll(); 57 | RulerLayout.superclass.clear.call(this); 58 | }, 59 | 60 | getShape: function () { 61 | var element = this.getElement(); 62 | return element && element.firstChild ? 63 | new RectangleShape( 64 | new RectanglePixelGeometry( 65 | clientBounds(element.firstChild) 66 | ) 67 | ) : 68 | null; 69 | }, 70 | 71 | _onButtonClick: function () { 72 | this.events.fire('rulerbuttonclick'); 73 | } 74 | }); 75 | 76 | provide(RulerLayout); 77 | } 78 | }); 79 | -------------------------------------------------------------------------------- /ui/build/css/maps-listbox/maps-listbox.css: -------------------------------------------------------------------------------- 1 | .ymaps_maps-listbox { 2 | display: block; 3 | position: relative; 4 | } 5 | .ymaps_maps-listbox .ymaps_maps-button__icon { 6 | margin-left: 0; 7 | } 8 | .ymaps_maps-listbox__list { 9 | display: block; 10 | position: relative; 11 | padding: 5px 0; 12 | background-color: #fff; 13 | font-family: Arial, Helvetica, sans-serif; 14 | } 15 | .ymaps_maps-listbox__list.ymaps__scrollable { 16 | overflow-y: scroll; 17 | -webkit-overflow-scrolling: touch; 18 | } 19 | .ymaps_maps-listbox__list-item { 20 | display: block; 21 | font: 13px Arial, sans-serif; 22 | padding: 5px 20px 5px 10px; 23 | cursor: pointer; 24 | white-space: nowrap; 25 | } 26 | .ymaps_maps-listbox__list-item:hover { 27 | background-color: #fbe6a8; 28 | } 29 | .ymaps_maps-listbox__list-item.ymaps__selected { 30 | background-color: rgba(251,230,168,0.6); 31 | cursor: default; 32 | } 33 | .ymaps_maps-listbox__list-item-title, 34 | .ymaps_maps-listbox__list-item-image { 35 | display: inline-block; 36 | } 37 | .ymaps_maps-listbox__list-item-image { 38 | border-radius: 50%; 39 | border: 1px solid rgba(0,0,0,0.2); 40 | width: 58px; 41 | height: 58px; 42 | margin-right: 10px; 43 | background-size: cover; 44 | background-clip: content-box; 45 | background-repeat: no-repeat; 46 | vertical-align: middle; 47 | background-image: url("3e13d027c9578c4190aa6fddaaa49022.jpg"); 48 | } 49 | .ymaps_maps-listbox__list-item[data-type="yandex#satellite"] .ymaps_maps-listbox__list-item-image { 50 | background-position: 0 -58px; 51 | } 52 | .ymaps_maps-listbox__list-item[data-type="yandex#hybrid"] .ymaps_maps-listbox__list-item-image { 53 | background-position: 0 -116px; 54 | } 55 | .ymaps_maps-listbox__list-item[data-type="yandex#publicMap"] .ymaps_maps-listbox__list-item-image { 56 | background-position: 0 100%; 57 | } 58 | .ymaps_maps-listbox .ymaps_maps-popup { 59 | bottom: 0; 60 | } 61 | .ymaps_maps-listbox .ymaps_maps-popup ::-webkit-scrollbar { 62 | width: 13px; 63 | height: 13px; 64 | } 65 | .ymaps_maps-listbox .ymaps_maps-popup ::-webkit-scrollbar-track { 66 | background: transparent; 67 | } 68 | .ymaps_maps-listbox .ymaps_maps-popup ::-webkit-scrollbar-thumb { 69 | min-height: 30px; 70 | box-shadow: inset 0 0 0 4px rgba(0,0,0,0.2); 71 | } 72 | .ymaps_maps-listbox .ymaps_maps-popup ::-webkit-scrollbar-thumb:hover { 73 | box-shadow: inset 0 0 0 4px rgba(0,0,0,0.3); 74 | } 75 | .ymaps_maps-listbox .ymaps_maps-popup ::-webkit-scrollbar-thumb:horizontal { 76 | border-top: 3px solid transparent; 77 | border-bottom: 3px solid transparent; 78 | } 79 | .ymaps_maps-listbox .ymaps_maps-popup ::-webkit-scrollbar-thumb:vertical { 80 | border-right: 3px solid transparent; 81 | border-left: 3px solid transparent; 82 | } 83 | .ymaps_maps-listbox .ymaps_maps-popup .ymaps_maps-popup__arrow { 84 | bottom: 11px; 85 | } 86 | .ymaps_maps-listbox .ymaps_maps-popup.ymaps__position_left { 87 | right: 47px; 88 | } 89 | .ymaps_maps-listbox .ymaps_maps-popup.ymaps__position_left .ymaps_maps-popup__arrow { 90 | right: -6.5px; 91 | } 92 | .ymaps_maps-listbox .ymaps_maps-popup.ymaps__position_right { 93 | left: 47px; 94 | } 95 | .ymaps_maps-listbox .ymaps_maps-popup.ymaps__position_right .ymaps_maps-popup__arrow { 96 | left: -6.5px; 97 | } 98 | .ymaps_maps-listbox .ymaps_maps-popup__content { 99 | padding: 0; 100 | } -------------------------------------------------------------------------------- /examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Mapsapi Round Controls Demo 6 | 14 | 15 | 16 | 17 | 18 | 19 | 99 | 100 | 101 |
102 | 103 | 104 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-listbox/maps-listbox.styl: -------------------------------------------------------------------------------- 1 | /* Стили применятся на ДОЧЕРНИЕ элементы, поэтому миксин следует назначать родителю */ 2 | custom-scroll() { 3 | if (ie != 8) { 4 | ::-webkit-scrollbar { 5 | width: 13px; 6 | height: 13px; 7 | } 8 | ::-webkit-scrollbar-track { 9 | background: transparent; 10 | } 11 | ::-webkit-scrollbar-thumb { 12 | min-height: 30px; 13 | box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .2); 14 | } 15 | ::-webkit-scrollbar-thumb:hover { 16 | box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .3); 17 | } 18 | ::-webkit-scrollbar-thumb:horizontal { 19 | border-top: 3px solid transparent; 20 | border-bottom: 3px solid transparent; 21 | } 22 | ::-webkit-scrollbar-thumb:vertical { 23 | border-right: 3px solid transparent; 24 | border-left: 3px solid transparent; 25 | } 26 | } 27 | } 28 | 29 | .maps-listbox { 30 | display: block; 31 | position: relative; 32 | 33 | // В кнопке только иконки, без текста, правим стиль без "модификатора" 34 | .maps-button__icon { 35 | margin-left: 0; 36 | } 37 | 38 | &__list { 39 | display: block; 40 | position: relative; 41 | padding: 5px 0; 42 | background-color: #fff; 43 | font-family: Arial, Helvetica, sans-serif; 44 | 45 | &._scrollable { 46 | overflow-y: scroll; 47 | -webkit-overflow-scrolling: touch; 48 | } 49 | } 50 | 51 | &__list-item { 52 | display: block; 53 | font: 13px Arial, sans-serif; 54 | padding: 5px 20px 5px 10px; 55 | cursor: pointer; 56 | white-space: nowrap; 57 | 58 | &:hover { 59 | background-color: #fbe6a8; 60 | } 61 | 62 | &._selected { 63 | background-color: rgba(251, 230, 168, .6); 64 | cursor: default; 65 | } 66 | 67 | &-title, 68 | &-image { 69 | display: inline-block; 70 | } 71 | 72 | &-image { 73 | border-radius: 50%; 74 | border: 1px solid rgba(0,0,0,.2); 75 | width: 58px; 76 | height: 58px; 77 | margin-right: 10px; 78 | background-size: cover; 79 | background-clip: content-box; 80 | background-repeat: no-repeat; 81 | vertical-align: middle; 82 | background-image: url('images.jpg'); 83 | } 84 | 85 | &[data-type="yandex#satellite"] &-image { 86 | background-position: 0 -58px; 87 | } 88 | 89 | &[data-type="yandex#hybrid"] &-image { 90 | background-position: 0 -116px; 91 | } 92 | 93 | &[data-type="yandex#publicMap"] &-image { 94 | background-position: 0 100%; 95 | } 96 | } 97 | } 98 | 99 | .maps-listbox { 100 | $__a = '.maps-popup__arrow'; 101 | 102 | .maps-popup { 103 | bottom: 0; 104 | custom-scroll() 105 | 106 | {$__a} { 107 | bottom: 11px; 108 | } 109 | 110 | &._position_left { 111 | right: 47px; 112 | 113 | {$__a} { 114 | right: -6.5px; 115 | } 116 | } 117 | &._position_right { 118 | left: 47px; 119 | 120 | {$__a} { 121 | left: -6.5px; 122 | } 123 | } 124 | 125 | &__content { 126 | padding: 0; 127 | } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /ui/src/bevis/blocks/maps-popup/maps-popup.styl: -------------------------------------------------------------------------------- 1 | @keyframes y-popup-fade-out-down { 2 | 0% { 3 | visibility: visible; 4 | transform: translateY(0); 5 | opacity: 1; 6 | } 7 | 8 | 100% { 9 | visibility: hidden; 10 | transform: translateY(10px); 11 | opacity: 0; 12 | } 13 | } 14 | 15 | @keyframes y-popup-fade-in-up { 16 | 0% { 17 | opacity: 0; 18 | transform: translateY(10px); 19 | } 20 | 21 | 100% { 22 | opacity: 1; 23 | transform: translateY(0); 24 | } 25 | } 26 | 27 | @keyframes y-popup-fade-out-up { 28 | 0% { 29 | visibility: visible; 30 | transform: translateY(0); 31 | opacity: 1; 32 | } 33 | 34 | 100% { 35 | visibility: hidden; 36 | transform: translateY(-10px); 37 | opacity: 0; 38 | } 39 | } 40 | 41 | @keyframes y-popup-fade-in-down { 42 | 0% { 43 | opacity: 0; 44 | transform: translateY(-10px); 45 | } 46 | 47 | 100% { 48 | opacity: 1; 49 | transform: translateY(0); 50 | } 51 | } 52 | 53 | @keyframes y-popup-fade-out-left { 54 | 0% { 55 | visibility: visible; 56 | transform: translateX(0); 57 | opacity: 1; 58 | } 59 | 60 | 100% { 61 | visibility: hidden; 62 | transform: translateX(10px); 63 | opacity: 0; 64 | } 65 | } 66 | 67 | @keyframes y-popup-fade-in-right { 68 | 0% { 69 | opacity: 0; 70 | transform: translateX(10px); 71 | } 72 | 73 | 100% { 74 | opacity: 1; 75 | transform: translateX(0); 76 | } 77 | } 78 | 79 | @keyframes y-popup-fade-out-right { 80 | 0% { 81 | visibility: visible; 82 | transform: translateX(0); 83 | opacity: 1; 84 | } 85 | 86 | 100% { 87 | visibility: hidden; 88 | transform: translateX(-10px); 89 | opacity: 0; 90 | } 91 | } 92 | 93 | @keyframes y-popup-fade-in-left { 94 | 0% { 95 | opacity: 0; 96 | transform: translateX(-10px); 97 | } 98 | 99 | 100% { 100 | opacity: 1; 101 | transform: translateX(0); 102 | } 103 | } 104 | 105 | y-popup_skin_common($arrow-size) { 106 | position: absolute; 107 | z-index: 1000; 108 | 109 | // Если задать display: none, то размеры содержимого будут равны 0. 110 | visibility: hidden; 111 | 112 | &__content { 113 | position: relative; 114 | padding: 10px; 115 | background-color: inherit; 116 | } 117 | 118 | &__arrow { 119 | position: absolute; 120 | width: $arrow-size; 121 | height: $arrow-size; 122 | transform: rotate(45deg); 123 | background-color: inherit; 124 | background-clip: padding-box; 125 | } 126 | 127 | &._shown { 128 | visibility: visible; 129 | } 130 | 131 | &._animate { 132 | animation-duration: 100ms; 133 | animation-timing-function: ease-out; 134 | animation-fill-mode: forwards; 135 | 136 | &._position_top { 137 | animation-name: y-popup-fade-out-up; 138 | } 139 | &._position_top._shown { 140 | animation-name: y-popup-fade-in-down; 141 | } 142 | 143 | &._position_bottom { 144 | animation-name: y-popup-fade-out-down; 145 | } 146 | &._position_bottom._shown { 147 | animation-name: y-popup-fade-in-up; 148 | } 149 | 150 | &._position_left { 151 | animation-name: y-popup-fade-out-right; 152 | } 153 | &._position_left._shown { 154 | animation-name: y-popup-fade-in-left; 155 | } 156 | 157 | &._position_right { 158 | animation-name: y-popup-fade-out-left; 159 | } 160 | &._position_right._shown { 161 | animation-name: y-popup-fade-in-right; 162 | } 163 | } 164 | } 165 | 166 | .maps-popup { 167 | y-popup_skin_common(11px); 168 | 169 | border: 1px solid rgba(0, 0, 0, 0.08); 170 | background-color: #fff; 171 | background-clip: padding-box; 172 | box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.2); 173 | 174 | &__arrow { 175 | border: 1px solid rgba(0, 0, 0, 0.08); 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /ui/src/bevis/.enb/make.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = function(config) { 4 | config.includeConfig('enb-bevis-helper'); 5 | 6 | var browserSupport = [ 7 | 'IE >= 9', 8 | 'Safari >= 7', 9 | 'Chrome >= 33', 10 | 'Opera >= 12.16', 11 | 'Firefox >= 28' 12 | ]; 13 | 14 | var bevisHelper = config.module('enb-bevis-helper') 15 | .browserSupport(browserSupport) 16 | .useAutopolyfiller(); 17 | 18 | config.setLanguages(['ru']); 19 | 20 | // Эти директории — для сборки HTML-шаблонов. 21 | // В них получается куча файлов, но нам нужны только `?.js` и `module.js`-файлы. 22 | config.nodes('build/api/layouts/*', function (nodeConfig) { 23 | nodeConfig.addTechs([ 24 | [require('enb-bevis/techs/deps')], 25 | require('enb-bevis/techs/files'), 26 | require('enb-bevis/techs/sources'), 27 | 28 | [require('enb-y-i18n/techs/y-i18n-lang-js'), {lang: '{lang}'}], 29 | 30 | require('enb-bt/techs/bt-server'), 31 | [require('enb-bt/techs/bt-client-module'), {useSourceMap: true}], 32 | 33 | // HTML 34 | [require('enb/techs/file-provider'), {target: '?.btjson.js'}], 35 | require('enb-bevis/techs/source-deps-from-btjson'), 36 | [require('enb-bt/techs/html-from-btjson'), {lang: '{lang}', target: '?.tmp'}] 37 | ]); 38 | 39 | // YMAPS TECHS 40 | nodeConfig.addTechs([ 41 | require('./techs/ymaps-module-deps'), 42 | require('./techs/ymaps-module-from-html'), 43 | require('./techs/ymaps-layout-module') 44 | ]); 45 | 46 | nodeConfig.addTargets([ 47 | '?', 48 | '?.tmp', 49 | 'module.json' 50 | ]); 51 | }); 52 | 53 | // Эта директория нужна для того, чтобы собрать вместе зависимости всех HTML-шаблонов. 54 | config.node('build/api/common', function (nodeConfig) { 55 | var layoutNodes = Object.keys(config.getNodeConfigs()).filter(function (nodePath) { 56 | return nodePath.indexOf('build/api/layouts/') === 0; 57 | }); 58 | 59 | var fileNames = []; 60 | 61 | // Сборка YAML файлов из всех собранных лейаутов. 62 | nodeConfig.addTechs(layoutNodes.map(function (nodePath) { 63 | var fileName = path.basename(nodePath) + '.deps.yaml'; 64 | fileNames.push(fileName); 65 | 66 | return [require('./techs/cross-node-copy'), { 67 | sourceNodePath: nodePath, 68 | sourceTarget: fileName, 69 | destTarget: fileName 70 | }]; 71 | })); 72 | nodeConfig.addTargets(fileNames); 73 | 74 | // Объединение и раскрытие зависимостей. 75 | nodeConfig.addTechs([ 76 | [require('enb/techs/file-merge'), {target: '?.ymaps-deps.yaml', sources: fileNames}], 77 | require('enb-bevis/techs/sources') 78 | ]); 79 | 80 | nodeConfig.addTargets([ 81 | "?.ymaps-deps.yaml" 82 | ]); 83 | }); 84 | 85 | config.node('build/api/fragments', function (nodeConfig) { 86 | nodeConfig.addTechs([ 87 | [require('./techs/cross-node-copy'), { 88 | sourceNodePath: 'build/api/common', 89 | sourceTarget: 'common.ymaps-deps.yaml', 90 | destTarget: 'common.ymaps-deps.yaml' 91 | }], 92 | 93 | require('enb-bevis/techs/sources'), 94 | require('enb-bevis/techs/files'), 95 | [require('enb-bevis/techs/deps'), { 96 | sourceDepsFile: 'common.ymaps-deps.yaml', 97 | target: '?.dest-deps.js' 98 | }], 99 | 100 | require('./techs/ymaps-module-deps'), 101 | [require('./techs/ymaps--fragments'), { 102 | sourceTarget: '?.ymaps-deps.js' 103 | }], 104 | [require('enb-stylus/techs/css-stylus-with-autoprefixer'), { 105 | browsers: browserSupport, 106 | target: '?.css', 107 | variables: {ie: false} 108 | }] 109 | ]); 110 | 111 | nodeConfig.addTargets([ 112 | "?.fragments" 113 | ]); 114 | }); 115 | }; 116 | -------------------------------------------------------------------------------- /ui/build/css/maps-button-icon/maps-button-icon.css: -------------------------------------------------------------------------------- 1 | .ymaps_maps-button-icon { 2 | display: block; 3 | height: 100%; 4 | background-position: 50% 50%; 5 | background-repeat: no-repeat; 6 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 7 | } 8 | .ymaps_maps-button-icon_collapse { 9 | display: block; 10 | height: 100%; 11 | background-position: 50% 50%; 12 | background-repeat: no-repeat; 13 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 14 | background-image: url("ee1fe2e811d247c1f8cc55772909d92e.svg"); 15 | } 16 | .ymaps_maps-button-icon_cross { 17 | display: block; 18 | height: 100%; 19 | background-position: 50% 50%; 20 | background-repeat: no-repeat; 21 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 22 | background-image: url("a461646892fbbb874e5948b24aca0a78.svg"); 23 | } 24 | .ymaps_maps-button-icon_expand { 25 | display: block; 26 | height: 100%; 27 | background-position: 50% 50%; 28 | background-repeat: no-repeat; 29 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 30 | background-image: url("81de10e069a79157ce9656a7a7ea4b44.svg"); 31 | } 32 | .ymaps_maps-button-icon_geolocation { 33 | display: block; 34 | height: 100%; 35 | background-position: 50% 50%; 36 | background-repeat: no-repeat; 37 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 38 | background-image: url("772ca48fc800fe30916e8ede02694586.svg"); 39 | } 40 | .ymaps_maps-button-icon_h-collapse { 41 | display: block; 42 | height: 100%; 43 | background-position: 50% 50%; 44 | background-repeat: no-repeat; 45 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 46 | background-image: url("36a8b646292617a0950c451a1dde0684.svg"); 47 | } 48 | .ymaps_maps-button-icon_h-expand { 49 | display: block; 50 | height: 100%; 51 | background-position: 50% 50%; 52 | background-repeat: no-repeat; 53 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 54 | background-image: url("96af1f9df9b29c2092ee464736b2a070.svg"); 55 | } 56 | .ymaps_maps-button-icon_layers { 57 | display: block; 58 | height: 100%; 59 | background-position: 50% 50%; 60 | background-repeat: no-repeat; 61 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 62 | background-image: url("9daecb3c9362cb8c987028971d9857a5.svg"); 63 | } 64 | .ymaps_maps-button-icon_loupe { 65 | display: block; 66 | height: 100%; 67 | background-position: 50% 50%; 68 | background-repeat: no-repeat; 69 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 70 | background-image: url("f6745dfd61fd0cd8512d60d4ab5cb3c1.svg"); 71 | } 72 | .ymaps_maps-button-icon_minus { 73 | display: block; 74 | height: 100%; 75 | background-position: 50% 50%; 76 | background-repeat: no-repeat; 77 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 78 | background-image: url("72a5b596b1ef5da75d408fb6203fea79.svg"); 79 | } 80 | .ymaps_maps-button-icon_pano { 81 | display: block; 82 | height: 100%; 83 | background-position: 50% 50%; 84 | background-repeat: no-repeat; 85 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 86 | background-image: url("60398ca40abf8fb542dc405ccaece64d.svg"); 87 | } 88 | .ymaps_maps-button-icon_plus { 89 | display: block; 90 | height: 100%; 91 | background-position: 50% 50%; 92 | background-repeat: no-repeat; 93 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 94 | background-image: url("30f0cf500cf7d5455a8f9eb6ac42c24f.svg"); 95 | } 96 | .ymaps_maps-button-icon_ruler { 97 | display: block; 98 | height: 100%; 99 | background-position: 50% 50%; 100 | background-repeat: no-repeat; 101 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 102 | background-image: url("57c38c6a54e7b5cf02a3c53596c08c16.svg"); 103 | } 104 | .ymaps_maps-button-icon_routes { 105 | display: block; 106 | height: 100%; 107 | background-position: 50% 50%; 108 | background-repeat: no-repeat; 109 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 110 | background-image: url("733f8c03d37dfbccbccecd0dcc1577c8.svg"); 111 | } 112 | .ymaps_maps-button-icon_traffic { 113 | display: block; 114 | height: 100%; 115 | background-position: 50% 50%; 116 | background-repeat: no-repeat; 117 | transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955); 118 | background-image: url("7e124202af7510c53851d21888632893.svg"); 119 | } -------------------------------------------------------------------------------- /ui/src/bevis/.enb/lib/ymaps-css-preprocessor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * CssPreprocessor 3 | * =============== 4 | */ 5 | var inherit = require('inherit'); 6 | var path = require('path'); 7 | var Vow = require('vow'); 8 | var vowFs = require('enb/lib/fs/async-fs'); 9 | 10 | /** 11 | * CssPreprocessor — класс для препроцессинга CSS. 12 | * Заменяет import'ы на содержимое CSS-файлов, изменяет url'ы картинок. 13 | * Сохраняет картинки. 14 | * @name CssPreprocessor 15 | */ 16 | module.exports = inherit({ 17 | 18 | /** 19 | * Конструктор. 20 | * @param {String} imgPath Путь для сохранения картинок. 21 | */ 22 | __constructor: function () { 23 | var builder = function (url) { 24 | return url; 25 | }; 26 | 27 | this._imgPathBuilder = builder; 28 | this._cssPathBuilder = builder; 29 | }, 30 | 31 | /** 32 | * Устанавливает функцию для построения относительных путей. 33 | * @var {Function} builder 34 | */ 35 | setCssPathBuilder: function (builder) { 36 | this._cssPathBuilder = builder; 37 | }, 38 | 39 | setImgPathBuilder: function (builder) { 40 | this._imgPathBuilder = builder; 41 | }, 42 | 43 | setPathBuilder: function (builder) { 44 | this._cssPathBuilder = this._imgPathBuilder = builder; 45 | }, 46 | 47 | /** 48 | * Запускает препроцессинг. 49 | * @param {String} data CSS для препроцессинга. 50 | * @param {String} filename Имя результирующего файла. 51 | * @returns {Promise} 52 | */ 53 | preprocess: function (data, filename) { 54 | return this._preprocessCss(data, filename) 55 | .spread(this._preprocessImgs, this) 56 | }, 57 | 58 | _preprocessCss: function (data, filename) { 59 | var regExp = /@import\s*(?:url\()?["']?([^"'\)]+)["']?(?:\))?\s*;/g; 60 | var loadPromises = []; 61 | var filesToLoad = []; 62 | var _this = this; 63 | 64 | function addLoadPromise (url) { 65 | var includedFilename = path.resolve(path.dirname(filename), url); 66 | loadPromises.push(vowFs.read(includedFilename, 'utf8').then(function (data) { 67 | return _this._preprocessCss(data, includedFilename).then(function (preprocessedData) { 68 | filesToLoad[url] = preprocessedData; 69 | }); 70 | })); 71 | } 72 | 73 | while (!!(match = regExp.exec(data))) { 74 | var file = this._cssPathBuilder(match[1]); 75 | addLoadPromise(file); 76 | } 77 | 78 | return Vow.all(loadPromises).then(function () { 79 | data = data.replace(/@import\s*(?:url\()?["']?([^"'\)]+)["']?(?:\))?\s*;/g, function (s, url) { 80 | var pre = '/* ' + url + ': begin */ /**/\n'; 81 | var post = '\n/* ' + url + ': end */ /**/\n'; 82 | return pre + ' ' + filesToLoad[url].toString().replace(/\n/g, '\n ') + post; 83 | }); 84 | 85 | return [data, filename]; 86 | }); 87 | }, 88 | 89 | _preprocessImgs: function (data, filename) { 90 | var _this = this; 91 | 92 | data = data 93 | .replace(/url\(('[^']+'|"[^"]+"|[^'")]+)\)/g, function (s, url) { 94 | if (s.indexOf('@import') === 0) { 95 | return s; 96 | } 97 | // Тип кавычки 98 | var q = ''; 99 | var firstChar = url.charAt(0); 100 | if (firstChar === '\'' || firstChar === '"') { 101 | url = url.substr(1, url.length - 2); 102 | q = firstChar; 103 | } 104 | 105 | return 'url(' + q + _this._resolveImgsUrl(url, filename) + q + ')'; 106 | }) 107 | .replace(/src=[']?([^',\)]+)[']?/g, function (s, url) { 108 | return 'src=\'' + _this._resolveImgsUrl(url, filename) + '\''; 109 | }); 110 | 111 | return data; 112 | }, 113 | 114 | _resolveImgsUrl: function (url, filename) { 115 | if (url.substr(0, 5) === 'data:' || 116 | url.substr(0, 2) === '//' || 117 | url.substr(0, 1) === '#' || 118 | ~url.indexOf('http://') || 119 | ~url.indexOf('https://') 120 | ) { 121 | return url; 122 | } else { 123 | return this._imgPathBuilder(url, filename); 124 | } 125 | } 126 | }); 127 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Round map controls theme 2 | ## Plugin for Yandex.Maps JS API 3 | 4 | 5 | 6 | ## Demo 7 | http://yandex.github.io/mapsapi-round-controls/ 8 | 9 | ## How to use? 10 | 11 | 1. Download the source code: [`build/release/all.js`](build/release/all.js). 12 | 2. Add it to your page below Yandex.Maps JS API `