Skip to content

Commit

Permalink
add all example
Browse files Browse the repository at this point in the history
  • Loading branch information
xescoder committed Sep 30, 2014
1 parent 57d25c5 commit 356c8d7
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
* **simple.html** - Простой пример подключения плагина
* **one_string.html** - Пример ввода адреса одной строкой
* **form.html** - Пример формы для ввода адреса
* **form_with_map.html** - Пример формы с яндекс картой для ввода адреса
* **form_with_map.html** - Пример формы с яндекс картой для ввода адреса
* **all.html** - Все примеры на одной странице
115 changes: 115 additions & 0 deletions examples/all.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Все примеры</title>

<link href="../jquery.kladr.min.css" rel="stylesheet">
<link href="css/all.css" rel="stylesheet">

<script src="js/lib/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../jquery.kladr.min.js" type="text/javascript"></script>
<script src="js/all.js" type="text/javascript"></script>

<script src="http://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
</head>
<body>
<div id="simple">
<div class ="address">
<h1>Простой пример</h1>
<div class="field">
<input name="city" type="text" value="" placeholder="Город">
</div>
</div>
</div>

<div id="one_string">
<div class ="address">
<h1>Ввод адреса одной строкой</h1>
<div class="field">
<input name="address" type="text" value="" placeholder="Адрес">
</div>
</div>
</div>

<div id="form">
<div class="address">
<h1>Форма для ввода адреса</h1>
<form class="js-form-address">
<div class="field">
<label>Регион</label>
<input type="text" name="region">
</div>
<div class="field">
<label>Район</label>
<input type="text" name="district">
</div>
<div class="field">
<label>Город</label>
<input type="text" name="city">
</div>
<div class="field">
<label>Улица</label>
<input type="text" name="street">
</div>
<div class="field">
<label>Дом</label>
<input type="text" name="building">
</div>
<div class="tooltip" style="display: none;"><b></b><span></span></div>
</form>
</div>
</div>

<div id="form_with_map">
<div class="address">
<h1>Форма для ввода адреса с картой</h1>
<div class="col-1">
<form class="js-form-address">
<div class="field">
<label>Регион</label>
<input name="region" type="text">
</div>
<div class="field">
<label>Район</label>
<input name="district" type="text">
</div>
<div class="field">
<label>Город</label>
<input name="city" type="text">
</div>
<div class="field">
<label>Улица</label>
<input name="street" type="text">
</div>
<div class="field">
<label>Номер дома</label>
<input name="building" type="text">
</div>
</form>
<div class="addition">
<div class="block">
<p class="title">Текстовое представление адреса</p>
<p id="address" class="value"></p>
</div>
<div class="block">
<p class="title">Выбранный объект</p>
<ul class="js-log">
<li id="id" style="display: none;"><span class="name">Код:</span> <span class="value"></span></li>
<li id="zip" style="display: none;"><span class="name">Почтовый индекс:</span> <span class="value"></span></li>
<li id="name" style="display: none;"><span class="name">Название:</span> <span class="value"></span></li>
<li id="type" style="display: none;"><span class="name">Подпись:</span> <span class="value"></span></li>
<li id="typeShort" style="display: none;"><span class="name">Подпись коротко:</span> <span class="value"></span></li>
<li id="contentType" style="display: none;"><span class="name">Тип объекта:</span> <span class="value"></span>
<li id="okato" style="display: none;"><span class="name">ОКАТО:</span> <span class="value"></span>
</ul>
</div>
</div>
</div>
<div class="col-2">
<div id="map" class="panel-map"></div>
</div>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion examples/css/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ input, button {
}
.field input {
height: 2em;
min-width: 295px;
width: 295px;
border: 1px solid #d8d8d8;
padding: 0 7px;
color: #666;
Expand Down
2 changes: 1 addition & 1 deletion examples/css/form_with_map.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ input, button {
}
.field input {
height: 2em;
min-width: 240px;
width: 240px;
border: 1px solid #d8d8d8;
padding: 0 7px;
color: #666;
Expand Down
2 changes: 1 addition & 1 deletion examples/css/one_string.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ input, button {
}
.field input {
height: 2em;
min-width: 470px;
width: 470px;
border: 1px solid #d8d8d8;
padding: 0 7px;
color: #666;
Expand Down
2 changes: 1 addition & 1 deletion examples/css/simple.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ input, button {
}
.field input {
height: 2em;
min-width: 370px;
width: 370px;
border: 1px solid #d8d8d8;
padding: 0 7px;
color: #666;
Expand Down
3 changes: 3 additions & 0 deletions examples/js/form_with_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ $(function () {
$street.kladr('type', $.kladr.type.street);
$building.kladr('type', $.kladr.type.building);

// Отключаем проверку введённых данных для строений
$building.kladr('verify', false);

ymaps.ready(function () {
if (map_created) return;
map_created = true;
Expand Down

0 comments on commit 356c8d7

Please sign in to comment.