This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Если с английского на русский, то передаём вторым параметром true. | |
cyrtolat = ( | |
function() { | |
var | |
rus = "й ц у к е н г ш щ з ф ы в а п р о л д я ч с м и т ь".split(/ +/g), | |
eng = "q w e r t y u i o p a s d f g h j k l z x c v b n m".split(/ +/g) | |
; | |
return function(text, engToRus) { | |
var x; | |
for(x = 0; x < rus.length; x++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(!empty($_POST)){ | |
// Массив сообщений об ошибках | |
$error = array(); | |
// Удаляем тире и пробелы | |
$number = str_replace(array(" ", "-"), | |
array("", ""), | |
$_POST['number']); | |
$pattern = "|^\d{11}$|"; | |
if(!preg_match($pattern, $number)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jq = document.createElement('script'); | |
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// ... give time for script to load, then type. | |
jQuery.noConflict(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Получаем osm_id по координатам | |
* @param {string} lat lat | |
* @param {string} lon lon | |
* @return {int} osm_id | |
*/ | |
function get_osmid_by_lat_lon(lat, lon){ | |
jQuery.ajax({ | |
url: 'http://overpass-api.de/api/interpreter', | |
type: 'POST', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Меняем местами lat и lon в массиве координат | |
* @param {array} coords массив координат | |
* @return {array} обработанный массив координат | |
*/ | |
function swap_coords(coords) { | |
for (var i = coords.length - 1; i >= 0; i--) { | |
var first = coords[i][1]; | |
coords[i][1] = coords[i][0]; | |
coords[i][0] = first; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPosition(e) { | |
var posx = 0; | |
var posy = 0; | |
if (!e) var e = window.event; | |
if (e.pageX || e.pageY) { | |
posx = e.pageX; | |
posy = e.pageY; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="courses"> | |
<?$courses = get_courses();?> | |
<h1>Доступные курсы</h1> | |
<div class="courses-blocks"> | |
<?foreach ($courses as $key => $course):?> | |
<?if( ! empty($course->idnumber)): | |
if ($course instanceof stdClass) { | |
require_once($CFG->libdir. '/coursecatlib.php'); | |
$course = new course_in_list($course); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> | |
<div id="login-overlay" class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | |
<h4 class="modal-title" id="myModalLabel">Login to site.com</h4> | |
</div> | |
<div class="modal-body"> | |
<div class="row"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.timeline { | |
list-style: none; | |
padding: 20px 0 20px; | |
position: relative; | |
} | |
.timeline:before { | |
top: 0; | |
bottom: 0; | |
position: absolute; | |
content: " "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* uses font awesome for social icons */ | |
@import url(http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css); | |
.page-header{ | |
text-align: center; | |
} | |
/*social buttons*/ | |
.btn-social{ | |
color: white; |
OlderNewer