diff --git a/assets/js/jquery.ddYMap-1.3.1.min.js b/assets/js/jquery.ddYMap-1.3.1.min.js deleted file mode 100644 index 09541ae..0000000 --- a/assets/js/jquery.ddYMap-1.3.1.min.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * jQuery ddYMap Plugin - * @version 1.3.1 (2014-07-24) - * - * @desc A jQuery library that allows Yandex.Maps to be rendered on a page in a simple way. - * - * @uses jQuery 1.10.2. - * @uses Yandex.Maps 2.1. - * - * Parameters of the “$.fn.ddYMap” method (transferred as plain object). - * @param placemarks {array} - Array of placemarks to be put on the map. If there is more than one placemark, the map will be scaled to make all the placemarks visible. Also, a pair of coordinates still can be passed (like it was in 1.2 and earlier). @required - * @param placemarks[i] {plain object} - Placemark data. @required - * @param placemarks[i].latLng {array} - Placemark coordinates (latitude and longitude). @required - * @param placemarks[i].content {string: html} - Balloon content. Default: ''. - * @param defaultZoom {integer} - Default map zoom. Default: 15. - * @param defaultType {'map'; 'satellite'; 'hybrid'; 'publicMap'; 'publicMapHybrid'} - Default map type: 'map' — schematic map, 'satellite' — satellite map, 'hybrid' — hybrid map, 'publicMap' — public map, 'publicMapHybrid' - hybrid public map. Default: 'map'; - * @param scrollZoom {boolean} - Allow zoom while scrolling. Default: false. - * @param mapCenterOffset {array} - Center offset of the map with respect to the center of the map container in pixels. Default: [0, 0]. - * @param placemarkOptions {plain object} - Placemark options. Default: {}. - * - * @link http://code.divandesign.biz/jquery/ddymap/1.3.1 - * - * @copyright 2014, DivanDesign - * http://www.DivanDesign.biz - */ - -(function(b){b.extend(!0,{ddYMap:{defaults:{placemarks:[],element:"map",defaultZoom:15,defaultType:"map",scrollZoom:!1,mapCenterOffset:!1,placemarkOptions:{}},verifyRenamedParams:function(a,e){var c={},f=[];b.each(e,function(d,e){"undefined"!=b.type(a[e])&&"undefined"==b.type(a[d])&&(c[d]=a[e],f.push("\u201c"+e+"\u201d must be renamed as \u201c"+d+"\u201d;"))});if(0regClientStartupScript('http://api-maps.yandex.ru/2.1/?lang='.$lang, array('name' => 'api-maps.yandex.ru', 'version' => '2.1')); - //Подключаем $.ddYMap - $modx->regClientStartupScript($modx->getConfig('site_url').'assets/js/jquery.ddYMap-1.3.1.min.js', array('name' => '$.ddYMap', 'version' => '1.3.1')); - //Инлайн-скрипт инициализации $inlineScript = '(function($){$(function(){$("'.$mapElement.'").ddYMap({placemarks: new Array('.$geoPos.')'; @@ -99,7 +97,20 @@ $inlineScript .= '});});})(jQuery);'; - //Подключаем инлайн-скрипт с инициализацией - $modx->regClientStartupScript('', array('plaintext' => true)); + if ($scriptsLocation == 'head') { + //Подключаем библиотеку карт + $modx->regClientStartupScript('//api-maps.yandex.ru/2.1/?lang=' . $lang, array('name' => 'api-maps.yandex.ru', 'version' => '2.1')); + //Подключаем $.ddYMap + $modx->regClientStartupScript($modx->getConfig('site_url') . 'assets/js/jquery.ddYMap-1.4.min.js', array('name' => '$.ddYMap', 'version' => '1.4')); + //Подключаем инлайн-скрипт с инициализацией + $modx->regClientStartupScript('', array('plaintext' => true)); + }else{ + //Подключаем библиотеку карт + $modx->regClientScript("", array('name' => 'api-maps.yandex.ru', 'version' => '2.1')); + //Подключаем $.ddYMap + $modx->regClientScript("", array('name' => '$.ddYMap', 'version' => '1.4')); + //Подключаем инлайн-скрипт с инициализацией + $modx->regClientScript("", array('plaintext' => true)); + } } ?>