Ajouter le dossier "vendor" à GITprodstable
@@ -18,7 +18,6 @@ | |||
"yiisoft/yii2": "*", | |||
"yiisoft/yii2-bootstrap": "*", | |||
"yiisoft/yii2-swiftmailer": "*", | |||
"fxp/composer-asset-plugin": "dev-master", | |||
"2amigos/yii2-chartjs-widget": "~2.0.0", | |||
"2amigos/yii2-leaflet-extension" : "*" | |||
}, |
@@ -4,25 +4,25 @@ | |||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | |||
"This file is @generated automatically" | |||
], | |||
"hash": "9ac6fd89ba06838267dc2a76575ab5fd", | |||
"content-hash": "f851f7ba9d097dd52e2c1711e9627d15", | |||
"hash": "60af2f259c01d843983ec6c8dc54c6d0", | |||
"content-hash": "6c00361804798cb6dd632972211c3e5e", | |||
"packages": [ | |||
{ | |||
"name": "2amigos/yii2-chartjs-widget", | |||
"version": "2.0.0", | |||
"version": "2.0.1", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/2amigos/yii2-chartjs-widget.git", | |||
"reference": "6637e1559cb4b365fcc3966e1776a67f03ba6c2a" | |||
"reference": "9e9c55212f80870820739a3b6e5deea88789876a" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/2amigos/yii2-chartjs-widget/zipball/6637e1559cb4b365fcc3966e1776a67f03ba6c2a", | |||
"reference": "6637e1559cb4b365fcc3966e1776a67f03ba6c2a", | |||
"url": "https://api.github.com/repos/2amigos/yii2-chartjs-widget/zipball/9e9c55212f80870820739a3b6e5deea88789876a", | |||
"reference": "9e9c55212f80870820739a3b6e5deea88789876a", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"bower-asset/chartjs": "1.0.2", | |||
"bower-asset/chartjs": "2.1.6", | |||
"yiisoft/yii2": "*" | |||
}, | |||
"require-dev": { | |||
@@ -65,35 +65,90 @@ | |||
"yii 2", | |||
"yii2" | |||
], | |||
"time": "2015-03-18 13:16:41" | |||
"time": "2016-07-09 19:09:35" | |||
}, | |||
{ | |||
"name": "2amigos/yii2-leaflet-extension", | |||
"version": "1.0.2", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/2amigos/yii2-leaflet-extension.git", | |||
"reference": "05ac1496b0b7a5c7bdeec110a02f0e36d0a91e88" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/2amigos/yii2-leaflet-extension/zipball/05ac1496b0b7a5c7bdeec110a02f0e36d0a91e88", | |||
"reference": "05ac1496b0b7a5c7bdeec110a02f0e36d0a91e88", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"bower-asset/leaflet": "0.7.*@stable", | |||
"yiisoft/yii2": "~2.0.0" | |||
}, | |||
"require-dev": { | |||
"phpunit/phpunit": "4.*" | |||
}, | |||
"type": "yii2-extension", | |||
"extra": { | |||
"branch-alias": { | |||
"dev-master": "1.0-dev" | |||
}, | |||
"asset-installer-paths": { | |||
"bower-asset-library": "vendor/bower" | |||
} | |||
}, | |||
"autoload": { | |||
"psr-4": { | |||
"dosamigos\\leaflet\\": "src" | |||
} | |||
}, | |||
"notification-url": "https://packagist.org/downloads/", | |||
"license": [ | |||
"BSD-3-Clause" | |||
], | |||
"authors": [ | |||
{ | |||
"name": "2amigOS! Consulting Group", | |||
"email": "hola@2amigos.us", | |||
"homepage": "http://2amigos.us", | |||
"role": "Developer" | |||
} | |||
], | |||
"description": "LeafLet Mobile-Friendly Interactive Maps Extension Library for Yii2.", | |||
"homepage": "http://yiiwheels.com/extension/leaflet-extension-library", | |||
"keywords": [ | |||
"2amigos", | |||
"extension", | |||
"leaflet", | |||
"maps", | |||
"widget", | |||
"yii", | |||
"yii2" | |||
], | |||
"time": "2016-02-05 23:47:38" | |||
}, | |||
{ | |||
"name": "bower-asset/bootstrap", | |||
"version": "v3.3.2", | |||
"version": "v3.3.7", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/twbs/bootstrap.git", | |||
"reference": "bcf7dd38b5ab180256e2e4fb5da0369551b3f082" | |||
"reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/bcf7dd38b5ab180256e2e4fb5da0369551b3f082", | |||
"reference": "bcf7dd38b5ab180256e2e4fb5da0369551b3f082", | |||
"url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86", | |||
"reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"bower-asset/jquery": ">=1.9.1" | |||
"bower-asset/jquery": ">=1.9.1,<=3" | |||
}, | |||
"type": "bower-asset-library", | |||
"extra": { | |||
"bower-asset-main": [ | |||
"less/bootstrap.less", | |||
"dist/css/bootstrap.css", | |||
"dist/js/bootstrap.js", | |||
"dist/fonts/glyphicons-halflings-regular.eot", | |||
"dist/fonts/glyphicons-halflings-regular.svg", | |||
"dist/fonts/glyphicons-halflings-regular.ttf", | |||
"dist/fonts/glyphicons-halflings-regular.woff" | |||
"dist/js/bootstrap.js" | |||
], | |||
"bower-asset-ignore": [ | |||
"/.*", | |||
@@ -106,6 +161,9 @@ | |||
"test-infra" | |||
] | |||
}, | |||
"license": [ | |||
"MIT" | |||
], | |||
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", | |||
"keywords": [ | |||
"css", | |||
@@ -120,57 +178,50 @@ | |||
}, | |||
{ | |||
"name": "bower-asset/chartjs", | |||
"version": "v1.0.2", | |||
"version": "v2.1.6", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/nnnick/Chart.js.git", | |||
"reference": "930b16a0af59201dcfcd1594b0e7540db4d04c9f" | |||
"url": "https://github.com/chartjs/Chart.js.git", | |||
"reference": "07662b158d829f395b2c97d732e60599b8b5c4e4" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/nnnick/Chart.js/zipball/930b16a0af59201dcfcd1594b0e7540db4d04c9f", | |||
"reference": "930b16a0af59201dcfcd1594b0e7540db4d04c9f", | |||
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/07662b158d829f395b2c97d732e60599b8b5c4e4", | |||
"reference": "07662b158d829f395b2c97d732e60599b8b5c4e4", | |||
"shasum": "" | |||
}, | |||
"require-dev": { | |||
"bower-asset/jquery": "~2.1.4" | |||
}, | |||
"type": "bower-asset-library", | |||
"extra": { | |||
"bower-asset-main": [ | |||
"Chart.js" | |||
"dist/Chart.js" | |||
] | |||
}, | |||
"license": [ | |||
"MIT" | |||
], | |||
"description": "Simple HTML5 Charts using the canvas element" | |||
}, | |||
{ | |||
"name": "bower-asset/jquery", | |||
"version": "2.1.3", | |||
"version": "2.2.4", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/jquery/jquery.git", | |||
"reference": "8f2a9d9272d6ed7f32d3a484740ab342c02541e0" | |||
"url": "https://github.com/jquery/jquery-dist.git", | |||
"reference": "c0185ab7c75aab88762c5aae780b9d83b80eda72" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/jquery/jquery/zipball/8f2a9d9272d6ed7f32d3a484740ab342c02541e0", | |||
"reference": "8f2a9d9272d6ed7f32d3a484740ab342c02541e0", | |||
"url": "https://api.github.com/repos/jquery/jquery-dist/zipball/c0185ab7c75aab88762c5aae780b9d83b80eda72", | |||
"reference": "c0185ab7c75aab88762c5aae780b9d83b80eda72", | |||
"shasum": "" | |||
}, | |||
"require-dev": { | |||
"bower-asset/qunit": "1.14.0", | |||
"bower-asset/requirejs": "2.1.10", | |||
"bower-asset/sinon": "1.8.1", | |||
"bower-asset/sizzle": "2.1.1-patch2" | |||
}, | |||
"type": "bower-asset-library", | |||
"extra": { | |||
"bower-asset-main": "dist/jquery.js", | |||
"bower-asset-ignore": [ | |||
"**/.*", | |||
"build", | |||
"speed", | |||
"test", | |||
"*.md", | |||
"AUTHORS.txt", | |||
"Gruntfile.js", | |||
"package.json" | |||
] | |||
}, | |||
@@ -178,6 +229,7 @@ | |||
"MIT" | |||
], | |||
"keywords": [ | |||
"browser", | |||
"javascript", | |||
"jquery", | |||
"library" | |||
@@ -185,16 +237,16 @@ | |||
}, | |||
{ | |||
"name": "bower-asset/jquery.inputmask", | |||
"version": "3.1.61", | |||
"version": "3.2.7", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/RobinHerbots/jquery.inputmask.git", | |||
"reference": "f2c086411d2557fc485c47afb3cecfa6c1de9ee2" | |||
"url": "https://github.com/RobinHerbots/Inputmask.git", | |||
"reference": "5a72c563b502b8e05958a524cdfffafe9987be38" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/RobinHerbots/jquery.inputmask/zipball/f2c086411d2557fc485c47afb3cecfa6c1de9ee2", | |||
"reference": "f2c086411d2557fc485c47afb3cecfa6c1de9ee2", | |||
"url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/5a72c563b502b8e05958a524cdfffafe9987be38", | |||
"reference": "5a72c563b502b8e05958a524cdfffafe9987be38", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
@@ -203,23 +255,17 @@ | |||
"type": "bower-asset-library", | |||
"extra": { | |||
"bower-asset-main": [ | |||
"./dist/inputmask/jquery.inputmask.js", | |||
"./dist/inputmask/jquery.inputmask.extensions.js", | |||
"./dist/inputmask/jquery.inputmask.date.extensions.js", | |||
"./dist/inputmask/jquery.inputmask.numeric.extensions.js", | |||
"./dist/inputmask/jquery.inputmask.phone.extensions.js", | |||
"./dist/inputmask/jquery.inputmask.regex.extensions.js" | |||
"./dist/inputmask/inputmask.js" | |||
], | |||
"bower-asset-ignore": [ | |||
"**/.*", | |||
"qunit/", | |||
"nuget/", | |||
"tools/", | |||
"js/", | |||
"*.md", | |||
"build.properties", | |||
"build.xml", | |||
"jquery.inputmask.jquery.json" | |||
"**/*", | |||
"!dist/*", | |||
"!dist/inputmask/*", | |||
"!dist/min/*", | |||
"!dist/min/inputmask/*", | |||
"!extra/bindings/*", | |||
"!extra/dependencyLibs/*", | |||
"!extra/phone-codes/*" | |||
] | |||
}, | |||
"license": [ | |||
@@ -235,6 +281,43 @@ | |||
"plugins" | |||
] | |||
}, | |||
{ | |||
"name": "bower-asset/leaflet", | |||
"version": "v0.7.7", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/Leaflet/Leaflet.git", | |||
"reference": "197f9d43b7bbc73c0492bf62cd666a5a98038098" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/Leaflet/Leaflet/zipball/197f9d43b7bbc73c0492bf62cd666a5a98038098", | |||
"reference": "197f9d43b7bbc73c0492bf62cd666a5a98038098", | |||
"shasum": "" | |||
}, | |||
"type": "bower-asset-library", | |||
"extra": { | |||
"bower-asset-main": [ | |||
"dist/leaflet.css", | |||
"dist/leaflet-src.js", | |||
"dist/images/layers-2x.png", | |||
"dist/images/layers.png", | |||
"dist/images/marker-icon-2x.png", | |||
"dist/images/marker-icon.png", | |||
"dist/images/marker-shadow.png" | |||
], | |||
"bower-asset-ignore": [ | |||
".*", | |||
"CHANGELOG.json", | |||
"FAQ.md", | |||
"debug", | |||
"spec", | |||
"src", | |||
"build" | |||
] | |||
}, | |||
"description": "JavaScript library for mobile-friendly interactive maps" | |||
}, | |||
{ | |||
"name": "bower-asset/punycode", | |||
"version": "v1.3.2", | |||
@@ -265,16 +348,16 @@ | |||
}, | |||
{ | |||
"name": "bower-asset/yii2-pjax", | |||
"version": "v2.0.2", | |||
"version": "v2.0.6", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/jquery-pjax.git", | |||
"reference": "fb92be865c0fd6583714475cb7d629020749d73f" | |||
"reference": "60728da6ade5879e807a49ce59ef9a72039b8978" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/fb92be865c0fd6583714475cb7d629020749d73f", | |||
"reference": "fb92be865c0fd6583714475cb7d629020749d73f", | |||
"url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/60728da6ade5879e807a49ce59ef9a72039b8978", | |||
"reference": "60728da6ade5879e807a49ce59ef9a72039b8978", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
@@ -287,24 +370,28 @@ | |||
".travis.yml", | |||
"Gemfile", | |||
"Gemfile.lock", | |||
"CONTRIBUTING.md", | |||
"vendor/", | |||
"script/", | |||
"test/" | |||
] | |||
} | |||
}, | |||
"license": [ | |||
"MIT" | |||
] | |||
}, | |||
{ | |||
"name": "cebe/markdown", | |||
"version": "1.0.1", | |||
"version": "1.1.1", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/cebe/markdown.git", | |||
"reference": "9d6c36d6623497523ed421a31d940bc1d7435578" | |||
"reference": "c30eb5e01fe021cc5bba2f9ee0eeef96d4931166" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/cebe/markdown/zipball/9d6c36d6623497523ed421a31d940bc1d7435578", | |||
"reference": "9d6c36d6623497523ed421a31d940bc1d7435578", | |||
"url": "https://api.github.com/repos/cebe/markdown/zipball/c30eb5e01fe021cc5bba2f9ee0eeef96d4931166", | |||
"reference": "c30eb5e01fe021cc5bba2f9ee0eeef96d4931166", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
@@ -314,7 +401,7 @@ | |||
"require-dev": { | |||
"cebe/indent": "*", | |||
"facebook/xhprof": "*@dev", | |||
"phpunit/phpunit": "3.7.*" | |||
"phpunit/phpunit": "4.1.*" | |||
}, | |||
"bin": [ | |||
"bin/markdown" | |||
@@ -322,7 +409,7 @@ | |||
"type": "library", | |||
"extra": { | |||
"branch-alias": { | |||
"dev-master": "1.0.x-dev" | |||
"dev-master": "1.1.x-dev" | |||
} | |||
}, | |||
"autoload": { | |||
@@ -351,20 +438,20 @@ | |||
"markdown", | |||
"markdown-extra" | |||
], | |||
"time": "2014-10-25 16:16:49" | |||
"time": "2016-09-14 20:40:20" | |||
}, | |||
{ | |||
"name": "ezyang/htmlpurifier", | |||
"version": "v4.6.0", | |||
"version": "v4.8.0", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/ezyang/htmlpurifier.git", | |||
"reference": "6f389f0f25b90d0b495308efcfa073981177f0fd" | |||
"reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/6f389f0f25b90d0b495308efcfa073981177f0fd", | |||
"reference": "6f389f0f25b90d0b495308efcfa073981177f0fd", | |||
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2", | |||
"reference": "d0c392f77d2f2a3dcf7fcb79e2a1e2b8804e75b2", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
@@ -395,76 +482,20 @@ | |||
"keywords": [ | |||
"html" | |||
], | |||
"time": "2013-11-30 08:25:19" | |||
}, | |||
{ | |||
"name": "fxp/composer-asset-plugin", | |||
"version": "v1.1.1", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/francoispluchino/composer-asset-plugin.git", | |||
"reference": "daca454b94539a4e6d30937dfc6b817eceb03f28" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/francoispluchino/composer-asset-plugin/zipball/daca454b94539a4e6d30937dfc6b817eceb03f28", | |||
"reference": "daca454b94539a4e6d30937dfc6b817eceb03f28", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"composer-plugin-api": "^1.0", | |||
"php": ">=5.3.3" | |||
}, | |||
"require-dev": { | |||
"composer/composer": "~1.0@dev" | |||
}, | |||
"type": "composer-plugin", | |||
"extra": { | |||
"class": "Fxp\\Composer\\AssetPlugin\\FxpAssetPlugin", | |||
"branch-alias": { | |||
"dev-master": "1.1-dev" | |||
} | |||
}, | |||
"autoload": { | |||
"psr-4": { | |||
"Fxp\\Composer\\AssetPlugin\\": "" | |||
} | |||
}, | |||
"notification-url": "https://packagist.org/downloads/", | |||
"license": [ | |||
"MIT" | |||
], | |||
"authors": [ | |||
{ | |||
"name": "François Pluchino", | |||
"email": "francois.pluchino@gmail.com" | |||
} | |||
], | |||
"description": "NPM/Bower Dependency Manager for Composer", | |||
"homepage": "https://github.com/francoispluchino/composer-asset-plugin", | |||
"keywords": [ | |||
"asset", | |||
"bower", | |||
"composer", | |||
"dependency manager", | |||
"nodejs", | |||
"npm", | |||
"package" | |||
], | |||
"time": "2015-11-20 14:58:24" | |||
"time": "2016-07-16 12:58:58" | |||
}, | |||
{ | |||
"name": "swiftmailer/swiftmailer", | |||
"version": "v5.3.1", | |||
"version": "v5.4.3", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/swiftmailer/swiftmailer.git", | |||
"reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a" | |||
"reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/c5f963e7f9d6f6438fda4f22d5cc2db296ec621a", | |||
"reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a", | |||
"url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", | |||
"reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
@@ -476,7 +507,7 @@ | |||
"type": "library", | |||
"extra": { | |||
"branch-alias": { | |||
"dev-master": "5.3-dev" | |||
"dev-master": "5.4-dev" | |||
} | |||
}, | |||
"autoload": { | |||
@@ -500,36 +531,38 @@ | |||
"description": "Swiftmailer, free feature-rich PHP mailer", | |||
"homepage": "http://swiftmailer.org", | |||
"keywords": [ | |||
"email", | |||
"mail", | |||
"mailer" | |||
], | |||
"time": "2014-12-05 14:17:14" | |||
"time": "2016-07-08 11:51:25" | |||
}, | |||
{ | |||
"name": "yiisoft/yii2", | |||
"version": "2.0.3", | |||
"version": "2.0.9", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/yii2-framework.git", | |||
"reference": "85b773a384f3894d558905cb13522bb338c99dba" | |||
"reference": "2b75151ea60e1fd820046416eee2e89c3dda1133" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/85b773a384f3894d558905cb13522bb338c99dba", | |||
"reference": "85b773a384f3894d558905cb13522bb338c99dba", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/2b75151ea60e1fd820046416eee2e89c3dda1133", | |||
"reference": "2b75151ea60e1fd820046416eee2e89c3dda1133", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"bower-asset/jquery": "2.1.*@stable | 1.11.*@stable", | |||
"bower-asset/jquery.inputmask": "3.1.*", | |||
"bower-asset/jquery": "2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", | |||
"bower-asset/jquery.inputmask": "~3.2.2", | |||
"bower-asset/punycode": "1.3.*", | |||
"bower-asset/yii2-pjax": ">=2.0.1", | |||
"cebe/markdown": "~1.0.0", | |||
"bower-asset/yii2-pjax": "~2.0.1", | |||
"cebe/markdown": "~1.0.0 | ~1.1.0", | |||
"ext-ctype": "*", | |||
"ext-mbstring": "*", | |||
"ezyang/htmlpurifier": "4.6.*", | |||
"ezyang/htmlpurifier": "~4.6", | |||
"lib-pcre": "*", | |||
"php": ">=5.4.0", | |||
"yiisoft/yii2-composer": "*" | |||
"yiisoft/yii2-composer": "~2.0.4" | |||
}, | |||
"bin": [ | |||
"yii" | |||
@@ -583,6 +616,11 @@ | |||
"name": "Paul Klimov", | |||
"email": "klimov.paul@gmail.com", | |||
"role": "Core framework development" | |||
}, | |||
{ | |||
"name": "Dmitry Naumenko", | |||
"email": "d.naumenko.a@gmail.com", | |||
"role": "Core framework development" | |||
} | |||
], | |||
"description": "Yii PHP Framework Version 2", | |||
@@ -591,30 +629,34 @@ | |||
"framework", | |||
"yii2" | |||
], | |||
"time": "2015-03-01 06:22:44" | |||
"time": "2016-07-11 13:36:42" | |||
}, | |||
{ | |||
"name": "yiisoft/yii2-bootstrap", | |||
"version": "2.0.3", | |||
"version": "2.0.6", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/yii2-bootstrap.git", | |||
"reference": "d4bd9c5f97ea891ebbfaf276d3083d85e27fbcb6" | |||
"reference": "3fd2b8c950cce79d60e9702d6bcb24eb3c80f6c5" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/d4bd9c5f97ea891ebbfaf276d3083d85e27fbcb6", | |||
"reference": "d4bd9c5f97ea891ebbfaf276d3083d85e27fbcb6", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/3fd2b8c950cce79d60e9702d6bcb24eb3c80f6c5", | |||
"reference": "3fd2b8c950cce79d60e9702d6bcb24eb3c80f6c5", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", | |||
"yiisoft/yii2": "*" | |||
"yiisoft/yii2": ">=2.0.6" | |||
}, | |||
"type": "yii2-extension", | |||
"extra": { | |||
"branch-alias": { | |||
"dev-master": "2.0.x-dev" | |||
}, | |||
"asset-installer-paths": { | |||
"npm-asset-library": "vendor/npm", | |||
"bower-asset-library": "vendor/bower" | |||
} | |||
}, | |||
"autoload": { | |||
@@ -637,24 +679,24 @@ | |||
"bootstrap", | |||
"yii2" | |||
], | |||
"time": "2015-03-01 06:22:44" | |||
"time": "2016-03-17 03:29:28" | |||
}, | |||
{ | |||
"name": "yiisoft/yii2-composer", | |||
"version": "2.0.3", | |||
"version": "2.0.4", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/yii2-composer.git", | |||
"reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be" | |||
"reference": "7452fd908a5023b8bb5ea1b123a174ca080de464" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/ca8d23707ae47d20b0454e4b135c156f6da6d7be", | |||
"reference": "ca8d23707ae47d20b0454e4b135c156f6da6d7be", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/7452fd908a5023b8bb5ea1b123a174ca080de464", | |||
"reference": "7452fd908a5023b8bb5ea1b123a174ca080de464", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"composer-plugin-api": "1.0.0" | |||
"composer-plugin-api": "^1.0" | |||
}, | |||
"type": "composer-plugin", | |||
"extra": { | |||
@@ -684,25 +726,25 @@ | |||
"extension installer", | |||
"yii2" | |||
], | |||
"time": "2015-03-01 06:22:44" | |||
"time": "2016-02-06 00:49:24" | |||
}, | |||
{ | |||
"name": "yiisoft/yii2-swiftmailer", | |||
"version": "2.0.3", | |||
"version": "2.0.6", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/yii2-swiftmailer.git", | |||
"reference": "cb5f0a70d871b409bef7333fc3e0d262fb57eb5c" | |||
"reference": "26b900767f1031ff3a4668dfa36c10595875f0a5" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/cb5f0a70d871b409bef7333fc3e0d262fb57eb5c", | |||
"reference": "cb5f0a70d871b409bef7333fc3e0d262fb57eb5c", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/26b900767f1031ff3a4668dfa36c10595875f0a5", | |||
"reference": "26b900767f1031ff3a4668dfa36c10595875f0a5", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"swiftmailer/swiftmailer": "*", | |||
"yiisoft/yii2": "*" | |||
"swiftmailer/swiftmailer": "~5.0", | |||
"yiisoft/yii2": "~2.0.4" | |||
}, | |||
"type": "yii2-extension", | |||
"extra": { | |||
@@ -734,31 +776,31 @@ | |||
"swiftmailer", | |||
"yii2" | |||
], | |||
"time": "2015-03-01 06:22:44" | |||
"time": "2016-09-09 11:48:11" | |||
} | |||
], | |||
"packages-dev": [ | |||
{ | |||
"name": "bower-asset/typeahead.js", | |||
"version": "v0.10.5", | |||
"version": "v0.11.1", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/twitter/typeahead.js.git", | |||
"reference": "5f198b87d1af845da502ea9df93a5e84801ce742" | |||
"reference": "588440f66559714280628a4f9799f0c4eb880a4a" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/twitter/typeahead.js/zipball/5f198b87d1af845da502ea9df93a5e84801ce742", | |||
"reference": "5f198b87d1af845da502ea9df93a5e84801ce742", | |||
"url": "https://api.github.com/repos/twitter/typeahead.js/zipball/588440f66559714280628a4f9799f0c4eb880a4a", | |||
"reference": "588440f66559714280628a4f9799f0c4eb880a4a", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"bower-asset/jquery": ">=1.7" | |||
}, | |||
"require-dev": { | |||
"bower-asset/jasmine-ajax": ">=1.3.1,<1.4", | |||
"bower-asset/jasmine-jquery": ">=1.5.2,<1.6", | |||
"bower-asset/jquery": ">=1.7,<1.8" | |||
"bower-asset/jasmine-ajax": "~1.3.1", | |||
"bower-asset/jasmine-jquery": "~1.5.2", | |||
"bower-asset/jquery": "~1.7" | |||
}, | |||
"type": "bower-asset-library", | |||
"extra": { | |||
@@ -767,22 +809,23 @@ | |||
}, | |||
{ | |||
"name": "fzaninotto/faker", | |||
"version": "v1.4.0", | |||
"version": "v1.6.0", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/fzaninotto/Faker.git", | |||
"reference": "010c7efedd88bf31141a02719f51fb44c732d5a0" | |||
"reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/fzaninotto/Faker/zipball/010c7efedd88bf31141a02719f51fb44c732d5a0", | |||
"reference": "010c7efedd88bf31141a02719f51fb44c732d5a0", | |||
"url": "https://api.github.com/repos/fzaninotto/Faker/zipball/44f9a286a04b80c76a4e5fb7aad8bb539b920123", | |||
"reference": "44f9a286a04b80c76a4e5fb7aad8bb539b920123", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"php": ">=5.3.3" | |||
"php": "^5.3.3|^7.0" | |||
}, | |||
"require-dev": { | |||
"ext-intl": "*", | |||
"phpunit/phpunit": "~4.0", | |||
"squizlabs/php_codesniffer": "~1.5" | |||
}, | |||
@@ -791,9 +834,8 @@ | |||
"branch-alias": [] | |||
}, | |||
"autoload": { | |||
"psr-0": { | |||
"Faker": "src/", | |||
"Faker\\PHPUnit": "test/" | |||
"psr-4": { | |||
"Faker\\": "src/Faker/" | |||
} | |||
}, | |||
"notification-url": "https://packagist.org/downloads/", | |||
@@ -811,23 +853,28 @@ | |||
"faker", | |||
"fixtures" | |||
], | |||
"time": "2014-06-04 14:43:02" | |||
"time": "2016-04-29 12:21:54" | |||
}, | |||
{ | |||
"name": "phpspec/php-diff", | |||
"version": "v1.0.2", | |||
"version": "v1.1.0", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/phpspec/php-diff.git", | |||
"reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" | |||
"reference": "0464787bfa7cd13576c5a1e318709768798bec6a" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", | |||
"reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", | |||
"url": "https://api.github.com/repos/phpspec/php-diff/zipball/0464787bfa7cd13576c5a1e318709768798bec6a", | |||
"reference": "0464787bfa7cd13576c5a1e318709768798bec6a", | |||
"shasum": "" | |||
}, | |||
"type": "library", | |||
"extra": { | |||
"branch-alias": { | |||
"dev-master": "1.0.x-dev" | |||
} | |||
}, | |||
"autoload": { | |||
"psr-0": { | |||
"Diff": "lib/" | |||
@@ -840,29 +887,28 @@ | |||
"authors": [ | |||
{ | |||
"name": "Chris Boulton", | |||
"homepage": "http://github.com/chrisboulton", | |||
"role": "Original developer" | |||
"homepage": "http://github.com/chrisboulton" | |||
} | |||
], | |||
"description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", | |||
"time": "2013-11-01 13:02:21" | |||
"time": "2016-04-07 12:29:16" | |||
}, | |||
{ | |||
"name": "yiisoft/yii2-codeception", | |||
"version": "2.0.3", | |||
"version": "2.0.5", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/yii2-codeception.git", | |||
"reference": "c2fdee4e7e9846e141ceddeb4386325e921e375a" | |||
"reference": "c916a36d09fc128b05a374e7922bc56854334d56" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/c2fdee4e7e9846e141ceddeb4386325e921e375a", | |||
"reference": "c2fdee4e7e9846e141ceddeb4386325e921e375a", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/c916a36d09fc128b05a374e7922bc56854334d56", | |||
"reference": "c916a36d09fc128b05a374e7922bc56854334d56", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"yiisoft/yii2": "*" | |||
"yiisoft/yii2": ">=2.0.4" | |||
}, | |||
"type": "yii2-extension", | |||
"extra": { | |||
@@ -890,24 +936,24 @@ | |||
"codeception", | |||
"yii2" | |||
], | |||
"time": "2015-03-01 06:22:44" | |||
"time": "2016-03-17 03:41:26" | |||
}, | |||
{ | |||
"name": "yiisoft/yii2-debug", | |||
"version": "2.0.3", | |||
"version": "2.0.6", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/yii2-debug.git", | |||
"reference": "8a0db5130a9ea3941304dd77cef23d69257e8d48" | |||
"reference": "55ed2e853ed8050a34415f63a4da84f88a56f895" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/8a0db5130a9ea3941304dd77cef23d69257e8d48", | |||
"reference": "8a0db5130a9ea3941304dd77cef23d69257e8d48", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/55ed2e853ed8050a34415f63a4da84f88a56f895", | |||
"reference": "55ed2e853ed8050a34415f63a4da84f88a56f895", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"yiisoft/yii2": "*", | |||
"yiisoft/yii2": ">=2.0.4", | |||
"yiisoft/yii2-bootstrap": "*" | |||
}, | |||
"type": "yii2-extension", | |||
@@ -937,7 +983,7 @@ | |||
"debugger", | |||
"yii2" | |||
], | |||
"time": "2015-03-01 06:22:44" | |||
"time": "2016-03-17 03:50:19" | |||
}, | |||
{ | |||
"name": "yiisoft/yii2-faker", | |||
@@ -988,28 +1034,32 @@ | |||
}, | |||
{ | |||
"name": "yiisoft/yii2-gii", | |||
"version": "2.0.3", | |||
"version": "2.0.5", | |||
"source": { | |||
"type": "git", | |||
"url": "https://github.com/yiisoft/yii2-gii.git", | |||
"reference": "bb79aeafa8e3b89dd25e07ac895b269680e537a8" | |||
"reference": "1bd6df6804ca077ec022587905a0d43eb286f507" | |||
}, | |||
"dist": { | |||
"type": "zip", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/bb79aeafa8e3b89dd25e07ac895b269680e537a8", | |||
"reference": "bb79aeafa8e3b89dd25e07ac895b269680e537a8", | |||
"url": "https://api.github.com/repos/yiisoft/yii2-gii/zipball/1bd6df6804ca077ec022587905a0d43eb286f507", | |||
"reference": "1bd6df6804ca077ec022587905a0d43eb286f507", | |||
"shasum": "" | |||
}, | |||
"require": { | |||
"bower-asset/typeahead.js": "0.10.*", | |||
"bower-asset/typeahead.js": "0.10.* | ~0.11.0", | |||
"phpspec/php-diff": ">=1.0.2", | |||
"yiisoft/yii2": "*", | |||
"yiisoft/yii2-bootstrap": "*" | |||
"yiisoft/yii2": ">=2.0.4", | |||
"yiisoft/yii2-bootstrap": "~2.0" | |||
}, | |||
"type": "yii2-extension", | |||
"extra": { | |||
"branch-alias": { | |||
"dev-master": "2.0.x-dev" | |||
}, | |||
"asset-installer-paths": { | |||
"npm-asset-library": "vendor/npm", | |||
"bower-asset-library": "vendor/bower" | |||
} | |||
}, | |||
"autoload": { | |||
@@ -1033,7 +1083,7 @@ | |||
"gii", | |||
"yii2" | |||
], | |||
"time": "2015-03-01 06:22:44" | |||
"time": "2016-03-18 14:09:46" | |||
} | |||
], | |||
"aliases": [], |
@@ -13,6 +13,7 @@ use yii\web\BadRequestHttpException; | |||
use yii\web\Controller; | |||
use yii\filters\VerbFilter; | |||
use yii\filters\AccessControl; | |||
use yii\helpers\Html; | |||
use dosamigos\leaflet\types\LatLng; | |||
use dosamigos\leaflet\layers\Marker; | |||
@@ -91,9 +92,9 @@ class SiteController extends Controller | |||
} | |||
// map | |||
/*$center = new dosamigos\leaflet\types\LatLng(['lat' => $resource->address->lat, 'lng' => $resource->address->lon]); | |||
$center = new LatLng(['lat' => '46,9991224', 'lng' => '6,0582595']); | |||
$tileLayer = new TileLayer([ | |||
'map' => 'test', | |||
'map' => 'test1', | |||
'urlTemplate' => 'http://{s}.tile.osm.org/{z}/{x}/{y}.png', | |||
'clientOptions' => [ | |||
'attribution' => 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> ' . | |||
@@ -103,17 +104,17 @@ class SiteController extends Controller | |||
]); | |||
$map = new LeafLet([ | |||
'tileLayer' => $tileLayer, | |||
'center' => $center, | |||
'center' => $center | |||
]); | |||
$point = new LatLng(['lat' => $resource->address->lat, 'lng' => $resource->address->lon]); | |||
$marker = new Marker(['latLng' => $point, 'popupContent' => Html::encode($resource->name)]); | |||
$map->addLayer($marker);*/ | |||
$point = new LatLng(['lat' => '46,9991224', 'lng' => '6,0582595']); | |||
$marker = new Marker(['latLng' => $point, 'popupContent' => Html::encode('Le Chat des Noisettes')]); | |||
$map->addLayer($marker); | |||
return $this->render('index',[ | |||
'page_principale'=>true, | |||
'produits' => $produits, | |||
'model' => $model, | |||
//('map' => $map | |||
'map' => $map | |||
]); | |||
} | |||
@@ -38,7 +38,7 @@ AppAsset::register($this); | |||
<header id="header"> | |||
<div class="container"> | |||
<a id="link-home" href="<?= Yii::$app->urlManager->createUrl('site/index') ; ?>"> | |||
<img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange.png" alt="" /><br /> | |||
<img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange.png" alt="" /> | |||
La boulange | |||
</a> | |||
<nav class=""> |
@@ -57,10 +57,10 @@ $this->title = 'Système de réservation de pain'; | |||
</div> | |||
<div class="row"> | |||
<!--<h2>Boulangeries partenaires</h2>--> | |||
<h1>Boulangeries partenaires</h1> | |||
<?php | |||
//echo Map::widget(['leafLet' => $map,]); | |||
echo Map::widget(['leafLet' => $map,'height' => 400]); | |||
?> | |||
</div> |
@@ -139,52 +139,58 @@ ul li { | |||
-moz-box-shadow: 0px 0px 3px gray; | |||
-webkit-box-shadow: 0px 0px 3px gray; | |||
box-shadow: 0px 0px 3px gray; | |||
height: 86px; | |||
} | |||
/* line 114, ../sass/screen.scss */ | |||
/* line 115, ../sass/screen.scss */ | |||
#header .container { | |||
position: relative; | |||
} | |||
/* line 119, ../sass/screen.scss */ | |||
/* line 120, ../sass/screen.scss */ | |||
#header #link-home { | |||
position: fixed; | |||
z-index: 1000; | |||
text-align: center; | |||
/*position: fixed ; | |||
z-index: 1000 ; | |||
text-align: center ; | |||
position: absolute ; | |||
top: 0px ; | |||
left: 0px ; | |||
padding: 10px ; | |||
background-color: white ; | |||
@include box-shadow(0px 0px 5px black) ; | |||
@include border-radius(0px 0px 8px 8px) ; | |||
*/ | |||
position: absolute; | |||
top: 0px; | |||
top: 10px; | |||
left: 0px; | |||
padding: 10px; | |||
text-decoration: none; | |||
background-color: white; | |||
-moz-box-shadow: 0px 0px 5px black; | |||
-webkit-box-shadow: 0px 0px 5px black; | |||
box-shadow: 0px 0px 5px black; | |||
-moz-border-radius: 0px 0px 8px 8px; | |||
-webkit-border-radius: 0px; | |||
border-radius: 0px 0px 8px 8px; | |||
font-size: 18px; | |||
font-size: 22px; | |||
} | |||
/* line 133, ../sass/screen.scss */ | |||
/* line 140, ../sass/screen.scss */ | |||
#header #link-home img { | |||
width: 90px; | |||
height: 60px; | |||
margin-bottom: 5px; | |||
} | |||
/* line 139, ../sass/screen.scss */ | |||
/* line 146, ../sass/screen.scss */ | |||
#header #link-espace-boulanger { | |||
border-left: solid 1px #e0e0e0; | |||
} | |||
/* line 144, ../sass/screen.scss */ | |||
/* line 150, ../sass/screen.scss */ | |||
#header nav { | |||
padding-top: 22px; | |||
} | |||
/* line 152, ../sass/screen.scss */ | |||
#header nav ul { | |||
float: right; | |||
} | |||
/* line 147, ../sass/screen.scss */ | |||
/* line 155, ../sass/screen.scss */ | |||
#header nav ul li a { | |||
text-decoration: none; | |||
} | |||
/* line 150, ../sass/screen.scss */ | |||
/* line 159, ../sass/screen.scss */ | |||
#header nav ul li a.active { | |||
background-color: #eee; | |||
} | |||
/* line 159, ../sass/screen.scss */ | |||
/* line 168, ../sass/screen.scss */ | |||
#header #link-logout .nom { | |||
font-size: 10px; | |||
/*position: relative ; | |||
@@ -192,12 +198,12 @@ ul li { | |||
top: -3px ;*/ | |||
} | |||
/* line 168, ../sass/screen.scss */ | |||
/* line 177, ../sass/screen.scss */ | |||
#main { | |||
padding: 0px; | |||
} | |||
/* line 178, ../sass/screen.scss */ | |||
/* line 187, ../sass/screen.scss */ | |||
#content { | |||
position: relative; | |||
padding: 20px 0px; | |||
@@ -205,11 +211,11 @@ ul li { | |||
padding-top: 35px; | |||
min-height: 500px; | |||
} | |||
/* line 186, ../sass/screen.scss */ | |||
/* line 195, ../sass/screen.scss */ | |||
#content #description img { | |||
width: 100%; | |||
} | |||
/* line 191, ../sass/screen.scss */ | |||
/* line 200, ../sass/screen.scss */ | |||
#content #main-img { | |||
max-width: 100%; | |||
border: solid 1px #e0e0e0; | |||
@@ -218,53 +224,53 @@ ul li { | |||
-webkit-border-radius: 5px; | |||
border-radius: 5px; | |||
} | |||
/* line 198, ../sass/screen.scss */ | |||
/* line 207, ../sass/screen.scss */ | |||
#content #row-presentation { | |||
text-align: center; | |||
} | |||
/* line 202, ../sass/screen.scss */ | |||
/* line 211, ../sass/screen.scss */ | |||
#content #row-signup { | |||
text-align: center; | |||
margin-top: 20px; | |||
} | |||
/* line 207, ../sass/screen.scss */ | |||
/* line 216, ../sass/screen.scss */ | |||
#content #row-clients-boulanger { | |||
margin-bottom: 50px; | |||
} | |||
/* line 209, ../sass/screen.scss */ | |||
/* line 218, ../sass/screen.scss */ | |||
#content #row-clients-boulanger h2 { | |||
text-align: center; | |||
margin-bottom: 15px; | |||
padding-bottom: 0px; | |||
} | |||
/* line 213, ../sass/screen.scss */ | |||
/* line 222, ../sass/screen.scss */ | |||
#content #row-clients-boulanger h2 img { | |||
height: 70px; | |||
margin-bottom: 60px; | |||
} | |||
/* line 219, ../sass/screen.scss */ | |||
/* line 228, ../sass/screen.scss */ | |||
#content #row-clients-boulanger ul { | |||
text-align: center; | |||
} | |||
/* line 221, ../sass/screen.scss */ | |||
/* line 230, ../sass/screen.scss */ | |||
#content #row-clients-boulanger ul li { | |||
list-style-type: none; | |||
} | |||
/* line 226, ../sass/screen.scss */ | |||
/* line 235, ../sass/screen.scss */ | |||
#content #row-clients-boulanger #clients { | |||
border-right: dotted 1px gray; | |||
} | |||
/* line 231, ../sass/screen.scss */ | |||
/* line 240, ../sass/screen.scss */ | |||
#content .item { | |||
position: relative; | |||
min-height: 250px; | |||
} | |||
/* line 235, ../sass/screen.scss */ | |||
/* line 244, ../sass/screen.scss */ | |||
#content .item .container { | |||
padding: 20px; | |||
position: relative; | |||
} | |||
/* line 240, ../sass/screen.scss */ | |||
/* line 249, ../sass/screen.scss */ | |||
#content .item .separateur { | |||
width: 600px; | |||
border-top: 1px solid #e0e0e0; | |||
@@ -272,7 +278,7 @@ ul li { | |||
padding-top: 20px; | |||
margin-top: 20px; | |||
} | |||
/* line 248, ../sass/screen.scss */ | |||
/* line 257, ../sass/screen.scss */ | |||
#content .item h2 { | |||
color: black; | |||
padding-bottom: 30px; | |||
@@ -283,53 +289,53 @@ ul li { | |||
position: relative; | |||
margin-top: 30px; | |||
} | |||
/* line 260, ../sass/screen.scss */ | |||
/* line 269, ../sass/screen.scss */ | |||
#content .item h3 { | |||
color: black; | |||
font-family: "comfortaalight"; | |||
font-size: 20px; | |||
padding-bottom: 12px; | |||
} | |||
/* line 267, ../sass/screen.scss */ | |||
/* line 276, ../sass/screen.scss */ | |||
#content .item .icon { | |||
position: absolute; | |||
} | |||
/* line 276, ../sass/screen.scss */ | |||
/* line 285, ../sass/screen.scss */ | |||
#content #contact { | |||
display: none; | |||
} | |||
/* line 280, ../sass/screen.scss */ | |||
/* line 289, ../sass/screen.scss */ | |||
#content #contact .icon { | |||
width: 55px; | |||
top: -15px; | |||
margin-left: -70px; | |||
} | |||
/* line 289, ../sass/screen.scss */ | |||
/* line 298, ../sass/screen.scss */ | |||
#content #contact .form-control:focus { | |||
/*@include box-shadow(0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px $jaune) ; | |||
border-color: $jaune ;*/ | |||
} | |||
/* line 294, ../sass/screen.scss */ | |||
/* line 303, ../sass/screen.scss */ | |||
#content #contact .form-group { | |||
text-align: center; | |||
} | |||
/* line 298, ../sass/screen.scss */ | |||
/* line 307, ../sass/screen.scss */ | |||
#content #contact .img-right { | |||
float: right; | |||
} | |||
/* line 301, ../sass/screen.scss */ | |||
/* line 310, ../sass/screen.scss */ | |||
#content #contact .img-right img { | |||
width: 300px; | |||
} | |||
/* line 308, ../sass/screen.scss */ | |||
/* line 317, ../sass/screen.scss */ | |||
.form-control:focus { | |||
/*@include box-shadow(0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px $jaune) ; | |||
border-color: $jaune ;*/ | |||
} | |||
/* line 313, ../sass/screen.scss */ | |||
/* line 322, ../sass/screen.scss */ | |||
#footer { | |||
height: 50px; | |||
background-color: white; | |||
@@ -339,31 +345,31 @@ ul li { | |||
padding-bottom: 60px; | |||
position: relative; | |||
} | |||
/* line 325, ../sass/screen.scss */ | |||
/* line 334, ../sass/screen.scss */ | |||
#footer a { | |||
color: #7e7e7e; | |||
text-transform: uppercase; | |||
text-decoration: none; | |||
} | |||
/* line 330, ../sass/screen.scss */ | |||
/* line 339, ../sass/screen.scss */ | |||
#footer a:hover { | |||
color: black; | |||
} | |||
/* line 336, ../sass/screen.scss */ | |||
/* line 345, ../sass/screen.scss */ | |||
#content #mentions { | |||
padding-top: 20px; | |||
} | |||
/* line 339, ../sass/screen.scss */ | |||
/* line 348, ../sass/screen.scss */ | |||
#content #mentions div.content { | |||
width: 60%; | |||
font-size: 90%; | |||
} | |||
/* line 344, ../sass/screen.scss */ | |||
/* line 353, ../sass/screen.scss */ | |||
#content #mentions p { | |||
padding-bottom: 15px; | |||
} | |||
/* line 348, ../sass/screen.scss */ | |||
/* line 357, ../sass/screen.scss */ | |||
#content #mentions h2 { | |||
color: black; | |||
padding-bottom: 40px; | |||
@@ -371,7 +377,7 @@ ul li { | |||
line-height: 35px; | |||
font-family: "myriadpro-regular"; | |||
} | |||
/* line 356, ../sass/screen.scss */ | |||
/* line 365, ../sass/screen.scss */ | |||
#content #mentions h3 { | |||
font-family: "comfortaaregular"; | |||
font-size: 18px; | |||
@@ -380,40 +386,40 @@ ul li { | |||
color: black; | |||
} | |||
/* line 367, ../sass/screen.scss */ | |||
/* line 376, ../sass/screen.scss */ | |||
.mentions #main, .mentions body { | |||
background-color: white; | |||
} | |||
/* line 372, ../sass/screen.scss */ | |||
/* line 381, ../sass/screen.scss */ | |||
.vegas-loading { | |||
display: none; | |||
} | |||
/* line 379, ../sass/screen.scss */ | |||
/* line 388, ../sass/screen.scss */ | |||
#profil-user .form-group.field-user-no_mail label { | |||
font-weight: normal; | |||
} | |||
/* line 383, ../sass/screen.scss */ | |||
/* line 392, ../sass/screen.scss */ | |||
#profil-user .form-group label { | |||
cursor: pointer; | |||
} | |||
/* line 388, ../sass/screen.scss */ | |||
/* line 397, ../sass/screen.scss */ | |||
#profil-user #mails-jours-prod .form-group { | |||
float: left; | |||
margin-right: 15px; | |||
} | |||
/* line 391, ../sass/screen.scss */ | |||
/* line 400, ../sass/screen.scss */ | |||
#profil-user #mails-jours-prod .form-group label { | |||
font-weight: normal; | |||
} | |||
/* line 397, ../sass/screen.scss */ | |||
/* line 406, ../sass/screen.scss */ | |||
#profil-user p.strong { | |||
font-weight: bold; | |||
} | |||
/* signup */ | |||
/* line 406, ../sass/screen.scss */ | |||
/* line 415, ../sass/screen.scss */ | |||
#form-signup #champs-boulanger { | |||
display: none; | |||
} |
@@ -40,7 +40,7 @@ | |||
$(document).ready(function() { | |||
chat_scroll() ; | |||
//chat_scroll() ; | |||
chat_tabs_gamme_saison() ; | |||
//chat_slideshow() ; | |||
$('[data-toggle="tooltip"]').tooltip() ; |
@@ -103,6 +103,7 @@ ul { | |||
background-color: white ; | |||
//border-top: 4px solid #2b669a ; | |||
@include box-shadow(0px 0px 3px gray) ; | |||
height: 86px ; | |||
//@include box-shadow(0px 0px 5px #ededed) ; | |||
//@include box-shadow(0px 0px 5px #dcdcdc) ; | |||
@@ -117,21 +118,27 @@ ul { | |||
} | |||
#link-home { | |||
position: fixed ; | |||
/*position: fixed ; | |||
z-index: 1000 ; | |||
text-align: center ; | |||
position: absolute ; | |||
top: 0px ; | |||
left: 0px ; | |||
padding: 10px ; | |||
text-decoration: none ; | |||
background-color: white ; | |||
@include box-shadow(0px 0px 5px black) ; | |||
@include border-radius(0px 0px 8px 8px) ; | |||
font-size: 18px ; | |||
*/ | |||
position: absolute ; | |||
top: 10px ; | |||
left: 0px ; | |||
text-decoration: none ; | |||
font-size: 22px ; | |||
img { | |||
width: 90px ; | |||
height: 60px ; | |||
margin-bottom: 5px ; | |||
} | |||
} | |||
@@ -141,12 +148,14 @@ ul { | |||
} | |||
nav { | |||
padding-top: 22px ; | |||
ul { | |||
float: right ; | |||
li { | |||
a { | |||
text-decoration: none ; | |||
//color: #9d9d9d ; | |||
&.active { | |||
background-color: #eee ; | |||
} |
@@ -20,12 +20,12 @@ set. | |||
Either run | |||
``` | |||
composer require 2amigos/yii2-chartjs-widget:~1.0 | |||
composer require 2amigos/yii2-chartjs-widget:~2.0 | |||
``` | |||
or add | |||
```json | |||
"2amigos/yii2-chartjs-widget" : "~1.0" | |||
"2amigos/yii2-chartjs-widget" : "~2.0" | |||
``` | |||
to the require section of your application's `composer.json` file. | |||
@@ -45,9 +45,9 @@ The following example is using the `Line` type of chart. Please, check [ChartJs | |||
documentation for the different types supported by the plugin. | |||
``` | |||
use dosamigos\chartjs\Chart; | |||
use dosamigos\chartjs\ChartJs; | |||
<?= Chart::widget([ | |||
<?= ChartJs::widget([ | |||
'type' => 'Line', | |||
'options' => [ | |||
'height' => 400, |
@@ -27,7 +27,7 @@ | |||
}, | |||
"require": { | |||
"yiisoft/yii2": "*", | |||
"bower-asset/chartjs": "1.0.2" | |||
"bower-asset/chartjs": "2.1.6" | |||
}, | |||
"require-dev": { | |||
"phpunit/phpunit": "4.*" | |||
@@ -45,4 +45,4 @@ | |||
"bower-asset-library": "vendor/bower" | |||
} | |||
} | |||
} | |||
} |
@@ -1,6 +1,6 @@ | |||
<?php | |||
/** | |||
* @link https://github.com/2amigos/yii2-selectize-widget | |||
* @link https://github.com/2amigos/yii2-chartjs-widget | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @license http://opensource.org/licenses/BSD-3-Clause | |||
*/ | |||
@@ -8,8 +8,10 @@ namespace dosamigos\chartjs; | |||
use yii\base\InvalidConfigException; | |||
use yii\base\Widget; | |||
use yii\helpers\ArrayHelper; | |||
use yii\helpers\Html; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* | |||
@@ -86,14 +88,18 @@ class ChartJs extends Widget | |||
protected function registerClientScript() | |||
{ | |||
$id = $this->options['id']; | |||
$type = $this->type; | |||
$view = $this->getView(); | |||
$data = !empty($this->data) ? Json::encode($this->data) : '{}'; | |||
$options = !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '{}'; | |||
ChartJsAsset::register($view); | |||
$js = ";var chartJS_{$id} = new Chart(document.getElementById('{$id}').getContext('2d')).{$type}({$data}, {$options});"; | |||
$config = Json::encode( | |||
[ | |||
'type' => $this->type, | |||
'data' => $this->data ?: new JsExpression('{}'), | |||
'options' => $this->clientOptions ?: new JsExpression('{}') | |||
] | |||
); | |||
$js = ";var chartJS_{$id} = new Chart($('#{$id}'),{$config});"; | |||
$view->registerJs($js); | |||
} | |||
} | |||
} |
@@ -1,6 +1,6 @@ | |||
<?php | |||
/** | |||
* @link https://github.com/2amigos/yii2-selectize-widget | |||
* @link https://github.com/2amigos/yii2-chartjs-widget | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @license http://opensource.org/licenses/BSD-3-Clause | |||
*/ | |||
@@ -18,10 +18,10 @@ use yii\web\AssetBundle; | |||
*/ | |||
class ChartJsAsset extends AssetBundle | |||
{ | |||
public $sourcePath = '@bower/chartjs'; | |||
public $sourcePath = '@bower/chartjs/dist'; | |||
public function init() | |||
{ | |||
$this->js = YII_DEBUG ? ['Chart.js'] : ['Chart.min.js']; | |||
} | |||
} | |||
public $js = [ | |||
'Chart.js' | |||
]; | |||
} |
@@ -0,0 +1,32 @@ | |||
# Contributing | |||
Contributions are **welcome** and will be fully **credited**. | |||
We accept contributions via Pull Requests on [Github](https://github.com/2amigos/yii2-leaflet-extension). | |||
## Pull Requests | |||
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). | |||
- **Add tests!** - Your patch won't be accepted if it doesn't have tests. | |||
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. | |||
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. | |||
- **Create feature branches** - Don't ask us to pull from your master branch. | |||
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. | |||
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting. | |||
## Running Tests | |||
``` bash | |||
$ phpunit | |||
``` | |||
**Happy coding**! |
@@ -0,0 +1,28 @@ | |||
# The BSD License (BSD) | |||
Copyright (c) 2013-2015, 2amigOS! Consulting Group LLC. | |||
> Redistribution and use in source and binary forms, with or without modification, | |||
> are permitted provided that the following conditions are met: | |||
> | |||
> Redistributions of source code must retain the above copyright notice, this | |||
> list of conditions and the following disclaimer. | |||
> | |||
> Redistributions in binary form must reproduce the above copyright notice, this | |||
> list of conditions and the following disclaimer in the documentation and/or | |||
> other materials provided with the distribution. | |||
> | |||
> Neither the name of 2amigOS! Consulting Group, LLC. nor the names of its | |||
> contributors may be used to endorse or promote products derived from | |||
> this software without specific prior written permission. | |||
> | |||
>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||
>ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||
>WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
>DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | |||
>ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |||
>(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |||
>LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | |||
>ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
>(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |||
>SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
@@ -0,0 +1,115 @@ | |||
LeafLet Extension for Yii2 | |||
========================== | |||
[![Latest Version](https://img.shields.io/github/tag/2amigos/yii2-leaflet-extension.svg?style=flat-square&label=release)](https://github.com/2amigos/yii2-leaflet-extension/tags) | |||
[![Software License](https://img.shields.io/badge/license-BSD-brightgreen.svg?style=flat-square)](LICENSE.md) | |||
[![Build Status](https://img.shields.io/travis/2amigos/yii2-leaflet-extension/master.svg?style=flat-square)](https://travis-ci.org/2amigos/yii2-leaflet-extension) | |||
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/2amigos/yii2-leaflet-extension.svg?style=flat-square)](https://scrutinizer-ci.com/g/2amigos/yii2-leaflet-extension/code-structure) | |||
[![Total Downloads](https://img.shields.io/packagist/dt/2amigos/yii2-leaflet-extension.svg?style=flat-square)](https://packagist.org/packages/2amigos/yii2-leaflet-extension) | |||
Extension library to display interactive maps with [LeafletJs](http://leafletjs.com/) | |||
Installation | |||
------------ | |||
The preferred way to install this extension is through | |||
[composer](http://getcomposer.org/download/). This requires the | |||
[`composer-asset-plugin`](https://github.com/francoispluchino/composer-asset-plugin), | |||
which is also a dependency for yii2 – so if you have yii2 installed, you are | |||
most likely already set. | |||
Either run | |||
``` | |||
composer require 2amigos/yii2-leaflet-extension:~1.0 | |||
``` | |||
or add | |||
```json | |||
"2amigos/yii2-leaflet-extension" : "~1.0" | |||
``` | |||
to the require section of your application's `composer.json` file. | |||
Usage | |||
----- | |||
One of the things to take into account when working with [LeafletJs](http://leafletjs.com/) is that we need a Tile | |||
Provider. Is very important, if we fail to provide a Tile Provider Url, the map will display plain, without any maps at | |||
all. | |||
The following example, is making use of [MapQuest](http://developer.mapquest.com/): | |||
``` | |||
// first lets setup the center of our map | |||
$center = new dosamigos\leaflet\types\LatLng(['lat' => 51.508, 'lng' => -0.11]); | |||
// now lets create a marker that we are going to place on our map | |||
$marker = new \dosamigos\leaflet\layers\Marker(['latLng' => $center, 'popupContent' => 'Hi!']); | |||
// The Tile Layer (very important) | |||
$tileLayer = new \dosamigos\leaflet\layers\TileLayer([ | |||
'urlTemplate' => 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg', | |||
'clientOptions' => [ | |||
'attribution' => 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> ' . | |||
'<img src="http://developer.mapquest.com/content/osm/mq_logo.png">, ' . | |||
'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>', | |||
'subdomains' => '1234' | |||
] | |||
]); | |||
// now our component and we are going to configure it | |||
$leaflet = new \dosamigos\leaflet\LeafLet([ | |||
'center' => $center, // set the center | |||
]); | |||
// Different layers can be added to our map using the `addLayer` function. | |||
$leaflet->addLayer($marker) // add the marker | |||
->addLayer($tileLayer); // add the tile layer | |||
// finally render the widget | |||
echo \dosamigos\leaflet\widgets\Map::widget(['leafLet' => $leaflet]); | |||
// we could also do | |||
// echo $leaflet->widget(); | |||
``` | |||
Testing | |||
------- | |||
To test the extension, is better to clone this repository on your computer. After, go to the extensions folder and do | |||
the following (assuming you have `composer` installed on your computer): | |||
```bash | |||
$ composer install --no-interaction --prefer-source --dev | |||
``` | |||
Once all required libraries are installed then do: | |||
```bash | |||
$ vendor/bin/phpunit | |||
``` | |||
Further Information | |||
------------------- | |||
For further information regarding the multiple settings of LeafLetJS library please visit | |||
[its API reference](http://leafletjs.com/reference.html) | |||
Contributing | |||
------------ | |||
Please see [CONTRIBUTING](CONTRIBUTING.md) for details. | |||
Credits | |||
------- | |||
- [Antonio Ramirez](https://github.com/tonydspaniard) | |||
- [All Contributors](../../contributors) | |||
License | |||
------- | |||
The BSD License (BSD). Please see [License File](LICENSE.md) for more information. | |||
> [![2amigOS!](http://www.gravatar.com/avatar/55363394d72945ff7ed312556ec041e0.png)](http://www.2amigos.us) | |||
<i>Web development has never been so fun!</i> | |||
[www.2amigos.us](http://www.2amigos.us) |
@@ -0,0 +1,48 @@ | |||
{ | |||
"name": "2amigos/yii2-leaflet-extension", | |||
"description": "LeafLet Mobile-Friendly Interactive Maps Extension Library for Yii2.", | |||
"type": "yii2-extension", | |||
"keywords": [ | |||
"2amigos", | |||
"yii", | |||
"yii2", | |||
"extension", | |||
"widget", | |||
"maps", | |||
"leaflet" | |||
], | |||
"homepage": "http://yiiwheels.com/extension/leaflet-extension-library", | |||
"license": "BSD-3-Clause", | |||
"authors": [ | |||
{ | |||
"name": "2amigOS! Consulting Group", | |||
"email": "hola@2amigos.us", | |||
"homepage": "http://2amigos.us", | |||
"role": "Developer" | |||
} | |||
], | |||
"support": { | |||
"issues": "https://github.com/2amigos/yii2-leaflet-extension/issues", | |||
"source": "https://github.com/2amigos/yii2-leaflet-extension" | |||
}, | |||
"require": { | |||
"yiisoft/yii2": "~2.0.0", | |||
"bower-asset/leaflet": "0.7.*@stable" | |||
}, | |||
"require-dev": { | |||
"phpunit/phpunit": "4.*" | |||
}, | |||
"autoload": { | |||
"psr-4": { | |||
"dosamigos\\leaflet\\": "src" | |||
} | |||
}, | |||
"extra": { | |||
"branch-alias": { | |||
"dev-master": "1.0-dev" | |||
}, | |||
"asset-installer-paths": { | |||
"bower-asset-library": "vendor/bower" | |||
} | |||
} | |||
} |
@@ -0,0 +1,393 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet; | |||
use dosamigos\leaflet\controls\Control; | |||
use dosamigos\leaflet\layers\Layer; | |||
use dosamigos\leaflet\layers\LayerGroup; | |||
use dosamigos\leaflet\layers\TileLayer; | |||
use dosamigos\leaflet\layers\Polygon; | |||
use dosamigos\leaflet\types\LatLng; | |||
use dosamigos\leaflet\widgets\Map; | |||
use yii\base\Component; | |||
use yii\base\InvalidConfigException; | |||
use yii\base\InvalidParamException; | |||
use yii\helpers\ArrayHelper; | |||
/** | |||
* Class LeafLet | |||
* @package dosamigos\leaflet | |||
*/ | |||
/** | |||
* @property LatLng $center | |||
* | |||
*/ | |||
class LeafLet extends Component | |||
{ | |||
// JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK | |||
const JSON_OPTIONS = 352; | |||
/** | |||
* @var integer a counter used to generate [[name]] for layers. | |||
* @internal | |||
*/ | |||
public static $counter = 0; | |||
/** | |||
* @var string the prefix to the automatically generated object names. | |||
* @see [[generateName()]] | |||
*/ | |||
public static $autoNamePrefix = 'l'; | |||
/** | |||
* @var string the name to give to the variable. The name of the map specified on the | |||
* [[TileLayer]] component overrides this one. | |||
*/ | |||
public $name = 'map'; | |||
/** | |||
* @var int the zoom level of the map | |||
*/ | |||
public $zoom = 13; | |||
/** | |||
* @var array the options for the underlying LeafLetJs JS component. | |||
* Please refer to the LeafLetJs api reference for possible | |||
* [options](http://leafletjs.com/reference.html). | |||
*/ | |||
public $clientOptions = []; | |||
/** | |||
* @var array the event handlers for the underlying LeafletJs JS plugin. | |||
* Please refer to the LeafLetJs js api object options for possible events. | |||
*/ | |||
public $clientEvents = []; | |||
/** | |||
* @var Layer[] holding ui layers (do not confuse with map layers, these are markers, popups, polygons, etc) | |||
*/ | |||
private $_layers = []; | |||
/** | |||
* @var LayerGroup[] holding layer groups | |||
*/ | |||
private $_layerGroups = []; | |||
/** | |||
* @var LatLng sets the center of the map | |||
*/ | |||
private $_center; | |||
/** | |||
* Returns the center of the map. | |||
* @return LatLng center of the map. | |||
*/ | |||
public function getCenter() | |||
{ | |||
return $this->_center; | |||
} | |||
/** | |||
* Sets the center of the map. | |||
* | |||
* @param LatLng $value center of the map. | |||
*/ | |||
public function setCenter(LatLng $value) | |||
{ | |||
$this->_center = $value; | |||
} | |||
/** | |||
* @var Control[] holding controls to be added to the map. | |||
*/ | |||
private $_controls = []; | |||
/** | |||
* @param \dosamigos\leaflet\controls\Control[] $controls | |||
* | |||
* @throws \yii\base\InvalidParamException | |||
*/ | |||
public function setControls(array $controls) | |||
{ | |||
foreach ($controls as $control) { | |||
if (!($control instanceof Control)) { | |||
throw new InvalidParamException("All controls must be of type Control."); | |||
} | |||
} | |||
$this->_controls = $controls; | |||
} | |||
/** | |||
* @return \dosamigos\leaflet\controls\Control[] | |||
*/ | |||
public function getControls() | |||
{ | |||
return $this->_controls; | |||
} | |||
/** | |||
* @param Control $control | |||
*/ | |||
public function addControl(Control $control) | |||
{ | |||
$this->_controls[] = $control; | |||
} | |||
/** | |||
* @var \dosamigos\leaflet\layers\TileLayer | |||
*/ | |||
private $_tileLayer; | |||
/** | |||
* @param \dosamigos\leaflet\layers\TileLayer $tileLayer | |||
* | |||
* @return static the component itself | |||
*/ | |||
public function setTileLayer(TileLayer $tileLayer) | |||
{ | |||
if (!empty($tileLayer->map) && strcmp($tileLayer->map, $this->name) !== 0) { | |||
$this->name = $tileLayer->map; | |||
} | |||
if (empty($tileLayer->map)) { | |||
$tileLayer->map = $this->name; | |||
} | |||
$this->_tileLayer = $tileLayer; | |||
return $this; | |||
} | |||
/** | |||
* @return \dosamigos\leaflet\layers\TileLayer | |||
*/ | |||
public function getTileLayer() | |||
{ | |||
return $this->_tileLayer; | |||
} | |||
/** | |||
* @var array holds the js script lines to be registered. | |||
*/ | |||
private $_js = []; | |||
/** | |||
* @param string|array $js custom javascript code to be registered. | |||
* *Warning*: This method overrides any previous settings. | |||
* | |||
* @return static the component itself | |||
*/ | |||
public function setJs($js) | |||
{ | |||
$this->_js = is_array($js) ? $js : [$js]; | |||
return $this; | |||
} | |||
/** | |||
* @param string $js appends javascript code to be registered. | |||
* | |||
* @return static the component itself | |||
*/ | |||
public function appendJs($js) | |||
{ | |||
$this->_js[] = $js; | |||
return $this; | |||
} | |||
/** | |||
* @return array the queued javascript code to be registered. | |||
* *Warning*: This method does not include map initialization. | |||
*/ | |||
public function getJs() | |||
{ | |||
$js = []; | |||
foreach ($this->getLayers() as $layer) { | |||
if ($layer instanceof Polygon) { | |||
$layerJs = $layer->encode(); | |||
$insertAtTheBottom = $layer->insertAtTheBottom ? 'true' : 'false'; | |||
$js[] = "$this->name.addLayer($layerJs, $insertAtTheBottom);"; | |||
continue; | |||
} | |||
$layer->map = $this->name; | |||
$js[] = $layer->encode(); | |||
} | |||
$groups = $this->getEncodedLayerGroups($this->getLayerGroups()); | |||
$controls = $this->getEncodedControls($this->getControls()); | |||
$plugins = $this->getEncodedPlugins($this->getPlugins()->getInstalledPlugins()); | |||
$js = ArrayHelper::merge($js, $groups); | |||
$js = ArrayHelper::merge($js, $controls); | |||
$js = ArrayHelper::merge($js, $plugins); | |||
$js = ArrayHelper::merge($js, $this->_js); | |||
return $js; | |||
} | |||
/** | |||
* @var PluginManager | |||
*/ | |||
private $_plugins; | |||
/** | |||
* @return PluginManager | |||
*/ | |||
public function getPlugins() | |||
{ | |||
return $this->_plugins; | |||
} | |||
/** | |||
* Installs a plugin | |||
* | |||
* @param Plugin $plugin | |||
*/ | |||
public function installPlugin(Plugin $plugin) | |||
{ | |||
$plugin->map = $this->name; | |||
$this->getPlugins()->install($plugin); | |||
} | |||
/** | |||
* Removes an installed plugin | |||
* | |||
* @param $plugin | |||
* | |||
* @return mixed|null | |||
*/ | |||
public function removePlugin($plugin) | |||
{ | |||
return $this->getPlugins()->remove($plugin); | |||
} | |||
/** | |||
* Initializes the widget. | |||
*/ | |||
public function init() | |||
{ | |||
parent::init(); | |||
if (empty($this->center) || empty($this->zoom)) { | |||
throw new InvalidConfigException("'center' and/or 'zoom' attributes cannot be empty."); | |||
} | |||
$this->_plugins = new PluginManager(); | |||
$this->clientOptions['center'] = $this->center->toArray(true); | |||
$this->clientOptions['zoom'] = $this->zoom; | |||
} | |||
/** | |||
* Helper method to render the widget. It is also possible to use the widget directly: | |||
* ``` | |||
* echo Map::widget(['leafLet' => $leafLetObject, ...]); | |||
* ``` | |||
* | |||
* @param array $config | |||
* | |||
* @return string | |||
*/ | |||
public function widget($config = []) | |||
{ | |||
ob_start(); | |||
ob_implicit_flush(false); | |||
$config['leafLet'] = $this; | |||
$widget = new Map($config); | |||
$out = $widget->run(); | |||
return ob_get_clean() . $out; | |||
} | |||
/** | |||
* @param Layer $layer the layer script to add to the js script code. It could be any object extending from [[Layer]] | |||
* component (markers, polylines, popup, etc) | |||
* | |||
* @return static the component itself | |||
*/ | |||
public function addLayer(Layer $layer) | |||
{ | |||
$this->_layers[] = $layer; | |||
return $this; | |||
} | |||
/** | |||
* @return Layer[] the stored layers | |||
*/ | |||
public function getLayers() | |||
{ | |||
return $this->_layers; | |||
} | |||
/** | |||
* @param LayerGroup $group sets a layer group | |||
* | |||
* @return static the component itself | |||
*/ | |||
public function addLayerGroup(LayerGroup $group) | |||
{ | |||
$this->_layerGroups[] = $group; | |||
return $this; | |||
} | |||
/** | |||
* @return layers\LayerGroup[] all stored layer groups | |||
*/ | |||
public function getLayerGroups() | |||
{ | |||
return $this->_layerGroups; | |||
} | |||
/** | |||
* Clears all stored layer groups | |||
* @return static the component itself | |||
*/ | |||
public function clearLayerGroups() | |||
{ | |||
$this->_layerGroups = []; | |||
return $this; | |||
} | |||
/** | |||
* @param Control[] $controls | |||
* | |||
* @return array | |||
*/ | |||
public function getEncodedControls($controls) | |||
{ | |||
return $this->getEncodedObjects($controls); | |||
} | |||
/** | |||
* @param LayerGroup[] $groups | |||
* | |||
* @return array | |||
*/ | |||
public function getEncodedLayerGroups($groups) | |||
{ | |||
return $this->getEncodedObjects($groups); | |||
} | |||
/** | |||
* @param Plugin[] $plugins | |||
* | |||
* @return array | |||
*/ | |||
public function getEncodedPlugins($plugins) | |||
{ | |||
return $this->getEncodedObjects($plugins); | |||
} | |||
/** | |||
* @return string | |||
*/ | |||
public static function generateName() | |||
{ | |||
return self::$autoNamePrefix . self::$counter++; | |||
} | |||
/** | |||
* @param $objects | |||
* | |||
* @return array | |||
*/ | |||
protected function getEncodedObjects($objects) | |||
{ | |||
$js = []; | |||
foreach ((array)$objects as $object) { | |||
if (property_exists($object, 'map')) { | |||
$object->map = $this->name; | |||
} | |||
$js[] = method_exists($object, 'encode') ? $object->encode() : null; | |||
} | |||
return array_filter($js); | |||
} | |||
} |
@@ -0,0 +1,46 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet; | |||
use yii\web\AssetBundle; | |||
/** | |||
* LeafLetAsset Registers widget requires files. Please, use the following in order to override bundles for CDN: | |||
* | |||
* ``` | |||
* return [ | |||
* // ... | |||
* 'components' => [ | |||
* 'bundles' => [ | |||
* 'dosamigos\leaftlet\LeafLetAsset' => [ | |||
* 'sourcePath' => null, | |||
* 'js' => [ 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js' ], | |||
* 'css' => [ 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css' ] | |||
* ] | |||
* ] | |||
* ] | |||
* ] | |||
* ``` | |||
* | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet | |||
*/ | |||
class LeafLetAsset extends AssetBundle | |||
{ | |||
public $sourcePath = '@bower/leaflet/dist'; | |||
public $css = [ | |||
'leaflet.css' | |||
]; | |||
public function init() | |||
{ | |||
$this->js = YII_DEBUG ? ['leaflet-src.js'] : ['leaflet.js']; | |||
} | |||
} |
@@ -0,0 +1,118 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet; | |||
use yii\base\Component; | |||
use yii\helpers\Json; | |||
/** | |||
* @property string $name | |||
*/ | |||
/** | |||
* Plugin is the abstract class where all plugins should extend from | |||
* | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet | |||
*/ | |||
abstract class Plugin extends Component | |||
{ | |||
/** | |||
* @var string the map name | |||
*/ | |||
public $map; | |||
/** | |||
* @var array the options for the underlying LeafLetJs JS component. | |||
* Please refer to the LeafLetJs api reference for possible | |||
* [options](http://leafletjs.com/reference.html). | |||
*/ | |||
public $clientOptions = []; | |||
/** | |||
* @var array the event handlers for the underlying LeafletJs JS plugin. | |||
* Please refer to the LeafLetJs js api object options for possible events. | |||
*/ | |||
public $clientEvents = []; | |||
/** | |||
* @var string the variable name. If not null, then the js creation script | |||
* will be returned as a variable. If null, then the js creation script will | |||
* be returned as a constructor that you can use on other object's configuration options. | |||
*/ | |||
private $_name; | |||
/** | |||
* Returns the name of the layer. | |||
* | |||
* @param boolean $autoGenerate whether to generate a name if it is not set previously | |||
* | |||
* @return string name of the layer. | |||
*/ | |||
public function getName($autoGenerate = false) | |||
{ | |||
if ($autoGenerate && $this->_name === null) { | |||
$this->_name = LeafLet::generateName(); | |||
} | |||
return $this->_name; | |||
} | |||
/** | |||
* Sets the name of the layer. | |||
* | |||
* @param string $value name of the layer. | |||
*/ | |||
public function setName($value) | |||
{ | |||
$this->_name = $value; | |||
} | |||
/** | |||
* Returns the processed js options | |||
* @return array | |||
*/ | |||
public function getOptions() | |||
{ | |||
return empty($this->clientOptions) ? '{}' : Json::encode($this->clientOptions, LeafLet::JSON_OPTIONS); | |||
} | |||
/** | |||
* @return string the processed js events | |||
*/ | |||
public function getEvents() | |||
{ | |||
$js = []; | |||
if (!empty($this->name) && !empty($this->clientEvents)) { | |||
$name = $this->name; | |||
foreach ($this->clientEvents as $event => $handler) { | |||
$js[] = "$name.on('$event', $handler);"; | |||
} | |||
} | |||
return !empty($js) ? implode("\n", $js) : ""; | |||
} | |||
/** | |||
* Returns the plugin name | |||
* @return string | |||
*/ | |||
abstract public function getPluginName(); | |||
/** | |||
* Registers plugin asset bundle | |||
* | |||
* @param \yii\web\View $view | |||
* | |||
* @return mixed | |||
*/ | |||
abstract public function registerAssetBundle($view); | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return \yii\web\JsExpression | |||
*/ | |||
abstract public function encode(); | |||
} |
@@ -0,0 +1,85 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet; | |||
use yii\base\Component; | |||
use yii\helpers\ArrayHelper; | |||
class PluginManager extends Component | |||
{ | |||
private $_plugins = []; | |||
/** | |||
* Check whether we have a plugin installed with that name previous firing up the call | |||
* | |||
* @param string $name | |||
* | |||
* @return mixed|void | |||
*/ | |||
public function __get($name) | |||
{ | |||
if (ArrayHelper::keyExists($name, $this->getInstalledPlugins())) { | |||
return $this->getPlugin($name); | |||
} | |||
return parent::__get($name); | |||
} | |||
/** | |||
* Installs a plugin | |||
* | |||
* @param Plugin $plugin | |||
* | |||
* @return void | |||
*/ | |||
public function install(Plugin $plugin) | |||
{ | |||
$this->_plugins[$plugin->name] = $plugin; | |||
} | |||
/** | |||
* Removes a plugin | |||
* | |||
* @param Plugin $plugin | |||
* | |||
* @return mixed|null the value of the element if found, default value otherwise | |||
*/ | |||
public function remove(Plugin $plugin) | |||
{ | |||
return ArrayHelper::remove($this->_plugins, $plugin->name); | |||
} | |||
/** | |||
* @param \yii\web\View $view | |||
* Registers plugin bundles | |||
*/ | |||
public function registerAssetBundles($view) | |||
{ | |||
foreach ($this->_plugins as $plugin) { | |||
$plugin->registerAssetBundle($view); | |||
} | |||
} | |||
/** | |||
* @return array of installed plugins | |||
*/ | |||
public function getInstalledPlugins() | |||
{ | |||
return $this->_plugins; | |||
} | |||
/** | |||
* Returns an installed plugin by name | |||
* | |||
* @param string $name | |||
* | |||
* @return Plugin|null | |||
*/ | |||
public function getPlugin($name) | |||
{ | |||
return isset($this->_plugins[$name]) ? $this->_plugins[$name] : null; | |||
} | |||
} |
@@ -0,0 +1,87 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\controls; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\base\Component; | |||
use yii\helpers\Json; | |||
/** | |||
* Control is the base class for all Controls | |||
* | |||
* @property string $name | |||
* | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\controls | |||
*/ | |||
abstract class Control extends Component | |||
{ | |||
/** | |||
* @var string the name of the javascript variable that will hold the reference | |||
* to the map object. | |||
*/ | |||
public $map; | |||
/** | |||
* @var string the initial position of the control (one of the map corners). | |||
*/ | |||
public $position = 'topright'; | |||
/** | |||
* @var array the options for the underlying LeafLetJs JS component. | |||
* Please refer to the LeafLetJs api reference for possible | |||
* [options](http://leafletjs.com/reference.html). | |||
*/ | |||
public $clientOptions = []; | |||
/** | |||
* @var string the variable name. If not null, then the js creation script | |||
* will be returned as a variable. If null, then the js creation script will | |||
* be returned as a constructor that you can use on other object's configuration options. | |||
*/ | |||
private $_name; | |||
/** | |||
* Returns the name of the layer. | |||
* | |||
* @param boolean $autoGenerate whether to generate a name if it is not set previously | |||
* | |||
* @return string name of the layer. | |||
*/ | |||
public function getName($autoGenerate = false) | |||
{ | |||
if ($autoGenerate && $this->_name === null) { | |||
$this->_name = LeafLet::generateName(); | |||
} | |||
return $this->_name; | |||
} | |||
/** | |||
* Sets the name of the layer. | |||
* | |||
* @param string $value name of the layer. | |||
*/ | |||
public function setName($value) | |||
{ | |||
$this->_name = $value; | |||
} | |||
/** | |||
* Returns the processed js options | |||
* @return array | |||
*/ | |||
public function getOptions() | |||
{ | |||
return empty($this->clientOptions) ? '{}' : Json::encode($this->clientOptions, LeafLet::JSON_OPTIONS); | |||
} | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return \yii\web\JsExpression | |||
*/ | |||
abstract public function encode(); | |||
} |
@@ -0,0 +1,134 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\controls; | |||
use dosamigos\leaflet\layers\LayerGroup; | |||
use dosamigos\leaflet\layers\TileLayer; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\base\InvalidParamException; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* Layers The layers control gives users the ability to switch between different base layers and switch overlays on/off. | |||
* | |||
* @see http://leafletjs.com/reference.html#control-layers | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\controls | |||
*/ | |||
class Layers extends Control | |||
{ | |||
/** | |||
* @var \dosamigos\leaflet\layers\TileLayer[] | |||
*/ | |||
private $_baseLayers = []; | |||
/** | |||
* @param mixed $baseLayers | |||
* | |||
* @throws \yii\base\InvalidParamException | |||
*/ | |||
public function setBaseLayers(array $baseLayers) | |||
{ | |||
foreach ($baseLayers as $key => $layer) { | |||
if (!($layer instanceof TileLayer)) { | |||
throw new InvalidParamException("All baselayers should be of type TileLayer "); | |||
} | |||
$this->_baseLayers[$key] = $layer; | |||
} | |||
} | |||
/** | |||
* @return \dosamigos\leaflet\layers\TileLayer[] | |||
*/ | |||
public function getBaseLayers() | |||
{ | |||
return $this->_baseLayers; | |||
} | |||
/** | |||
* @return array of encoded base layers | |||
*/ | |||
public function getEncodedBaseLayers() | |||
{ | |||
$layers = []; | |||
foreach ($this->getBaseLayers() as $key => $layer) { | |||
$layer->name = null; | |||
$layers[$key] = new JsExpression(str_replace(";", "", $layer->encode())); | |||
} | |||
return $layers; | |||
} | |||
/** | |||
* @var \dosamigos\leaflet\layers\Layer[] | |||
*/ | |||
private $_overlays = []; | |||
/** | |||
* @param \dosamigos\leaflet\layers\LayerGroup[] $overlays | |||
* | |||
* @throws \yii\base\InvalidParamException | |||
*/ | |||
public function setOverlays($overlays) | |||
{ | |||
foreach ($overlays as $key => $overlay) { | |||
if (!($overlay instanceof LayerGroup)) { | |||
throw new InvalidParamException("All overlays should be of type LayerGroup"); | |||
} | |||
$this->_overlays[$key] = $overlay; | |||
} | |||
} | |||
/** | |||
* @return \dosamigos\leaflet\layers\Layer[] | |||
*/ | |||
public function getOverlays() | |||
{ | |||
return $this->_overlays; | |||
} | |||
/** | |||
* @return array of encoded overlays | |||
*/ | |||
public function getEncodedOverlays() | |||
{ | |||
$overlays = []; | |||
/** | |||
* @var \dosamigos\leaflet\layers\LayerGroup $overlay | |||
*/ | |||
foreach ($this->getOverlays() as $key => $overlay) { | |||
$overlays[$key] = $overlay->oneLineEncode(); | |||
} | |||
return $overlays; | |||
} | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return \yii\web\JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$this->clientOptions['position'] = $this->position; | |||
$layers = $this->getEncodedBaseLayers(); | |||
$overlays = $this->getEncodedOverlays(); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$layers = empty($layers) ? '{}' : Json::encode($layers, LeafLet::JSON_OPTIONS); | |||
$overlays = empty($overlays) ? '{}' : Json::encode($overlays, LeafLet::JSON_OPTIONS); | |||
$js = "L.control.layers($layers, $overlays, $options)" . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,41 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\controls; | |||
use yii\web\JsExpression; | |||
/** | |||
* Zoom renders basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you | |||
* set the map's zoomControl option to false | |||
* | |||
* @see http://leafletjs.com/reference.html#control-zoom | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\controls | |||
*/ | |||
class Zoom extends Control | |||
{ | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return \yii\web\JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$this->clientOptions['position'] = $this->position; | |||
$options = $this->getOptions(); | |||
$name = $this->getName(); | |||
$map = $this->map; | |||
$js = "L.control.zoom($options)" . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,54 @@ | |||
<?php | |||
/** | |||
* /** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use yii\web\JsExpression; | |||
/** | |||
* Circle a class for drawing circle overlays on a map. | |||
* | |||
* @see http://leafletjs.com/reference.html#circle | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
*/ | |||
class Circle extends Layer | |||
{ | |||
use LatLngTrait; | |||
use PopupTrait; | |||
/** | |||
* @var float Sets the radius of a circle. Units are in meters. | |||
*/ | |||
public $radius; | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$bounds = $this->getLatLng()->toArray(true); | |||
$radius = $this->radius; | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = $this->bindPopupContent("L.circle($bounds, $radius, $options)") . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,44 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use yii\web\JsExpression; | |||
/** | |||
* CircleMarker is a circle of a fixed size with radius specified in pixels. Setting its radius wont change its size. | |||
* | |||
* @see http://leafletjs.com/reference.html#circlemarker | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
*/ | |||
class CircleMarker extends Circle | |||
{ | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$bounds = $this->getLatLng()->toArray(true); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = $this->bindPopupContent("L.circleMarker($bounds, $options)") . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,91 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* FeatureGroup | |||
* | |||
* @see http://leafletjs.com/reference.html#featuregroup | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
*/ | |||
class FeatureGroup extends LayerGroup | |||
{ | |||
use PopupTrait; | |||
/** | |||
* @var array the event handlers for the underlying LeafletJs featureGroup JS plugin. | |||
* Please refer to the [LeafLetJs::featureGroup](http://leafletjs.com/reference.html#featuregroup) | |||
* js api object options for possible events. | |||
*/ | |||
public $clientEvents = []; | |||
/** | |||
* @return JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$js = []; | |||
$layers = $this->getLayers(); | |||
$name = $this->name; | |||
$names = str_replace(array('"', "'"), "", Json::encode(array_keys($layers))); | |||
$map = $this->map; | |||
foreach ($layers as $layer) { | |||
$js[] = $layer->encode(); | |||
} | |||
$initJs = "L.featureGroup($names)" . $this->getEvents() . ($map !== null ? ".addTo($map);" : ""); | |||
if (empty($name)) { | |||
$js[] = $initJs . ($map !== null ? "" : ";"); | |||
} else { | |||
$js[] = "var $name = $initJs" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression(implode("\n", $js)); | |||
} | |||
/** | |||
* @inheritdoc | |||
*/ | |||
public function oneLineEncode() { | |||
$map = $this->map; | |||
$layers = $this->getLayers(); | |||
$layersJs = []; | |||
/** @var \dosamigos\leaflet\layers\Layer $layer */ | |||
foreach ($layers as $layer) { | |||
$layer->setName(null); | |||
$layersJs[] = $layer->encode(); | |||
} | |||
$js = "L.featureGroup([" . implode(",", $layersJs) . "])" . | |||
$this->getEvents() . | |||
($map !== null ? ".addTo($map);" : ""); | |||
return new JsExpression($js); | |||
} | |||
/** | |||
* @return string the processed js events | |||
*/ | |||
protected function getEvents() | |||
{ | |||
$js = []; | |||
if (!empty($this->clientEvents)) { | |||
foreach ($this->clientEvents as $event => $handler) { | |||
$js[] = ".on('$event', $handler)"; | |||
} | |||
} | |||
return !empty($js) ? implode("\n", $js) : ""; | |||
} | |||
} |
@@ -0,0 +1,54 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* GeoJson allows you to parse GeoJSON data and display it on the map | |||
* | |||
* @see http://leafletjs.com/reference.html#geojson | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
*/ | |||
class GeoJson extends Layer | |||
{ | |||
/** | |||
* @var array geo spatial data interchange json object. For information related to GeoJSON format, please visit | |||
* [http://geojson.org/geojson-spec.html](http://geojson.org/geojson-spec.html). This component does not validate | |||
* this data, it just renders it. This array will be converted into a json object previous encoding. | |||
*/ | |||
public $data = []; | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return string|JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$data = Json::encode($this->data, LeafLet::JSON_OPTIONS); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = "L.geoJson($data, $options)" . ($map !== null ? ".addTo($map)" : "") . ";"; | |||
if (!empty($name)) { | |||
$js = "var $name = $js"; | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,72 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\types\LatLngBounds; | |||
use yii\web\JsExpression; | |||
/** | |||
* ImageOverlay it is used to load and display a single image over specific bounds of the map | |||
* | |||
* @see http://leafletjs.com/reference.html#imageoverlay | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package extensions\leafletjs\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
*/ | |||
class ImageOverlay extends Layer | |||
{ | |||
/** | |||
* @var string the image Url | |||
*/ | |||
public $imageUrl; | |||
/** | |||
* @var LatLngBounds | |||
*/ | |||
private $_bounds; | |||
/** | |||
* @param LatLngBounds $bounds | |||
*/ | |||
public function setImageBounds(LatLngBounds $bounds) | |||
{ | |||
$this->_bounds = $bounds; | |||
} | |||
/** | |||
* @return LatLngBounds | |||
*/ | |||
public function getImageBounds() | |||
{ | |||
return $this->_bounds; | |||
} | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return \yii\web\JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$name = $this->name; | |||
$imageUrl = $this->imageUrl; | |||
$bounds = $this->getImageBounds()->encode(); | |||
$options = $this->getOptions(); | |||
$map = $this->map; | |||
$js = "L.imageOverlay('$imageUrl', $bounds, $options)" . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,33 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\types\LatLng; | |||
trait LatLngTrait | |||
{ | |||
/** | |||
* @var \dosamigos\leaflet\types\LatLng holds the latitude and longitude values. | |||
*/ | |||
private $_latLon; | |||
/** | |||
* @param \dosamigos\leaflet\types\LatLng $latLon the position to render the marker | |||
*/ | |||
public function setLatLng(LatLng $latLon) | |||
{ | |||
$this->_latLon = $latLon; | |||
} | |||
/** | |||
* @return \dosamigos\leaflet\types\LatLng | |||
*/ | |||
public function getLatLng() | |||
{ | |||
return $this->_latLon; | |||
} | |||
} |
@@ -0,0 +1,86 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\base\Component; | |||
use dosamigos\leaflet\types\Type; | |||
use yii\helpers\Json; | |||
/** | |||
* Layer is the base class for UI Layers | |||
* | |||
* @property string $name | |||
* | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
abstract class Layer extends Component | |||
{ | |||
use NameTrait; | |||
/** | |||
* @var string the name of the javascript variable that will hold the reference | |||
* to the map object. | |||
*/ | |||
public $map; | |||
/** | |||
* @var array the options for the underlying LeafLetJs JS component. | |||
* Please refer to the LeafLetJs api reference for possible | |||
* [options](http://leafletjs.com/reference.html). | |||
*/ | |||
public $clientOptions = []; | |||
/** | |||
* @var array the event handlers for the underlying LeafletJs JS plugin. | |||
* Please refer to the LeafLetJs js api object options for possible events. | |||
*/ | |||
public $clientEvents = []; | |||
/** | |||
* Returns the processed js options | |||
* @return array | |||
*/ | |||
public function getOptions() | |||
{ | |||
$options = []; | |||
foreach ($this->clientOptions as $key => $option) { | |||
if ($option instanceof Type) { | |||
$option = $option->encode(); | |||
} | |||
$options[$key] = $option; | |||
} | |||
return empty($options) ? '{}' : Json::encode($options, LeafLet::JSON_OPTIONS); | |||
} | |||
/** | |||
* @return string the processed js events | |||
*/ | |||
public function getEvents() | |||
{ | |||
$js = []; | |||
if (!empty($this->clientEvents)) { | |||
if (!empty($this->name)) { | |||
$name = $this->name; | |||
$js[] = "{$name}"; | |||
foreach ($this->clientEvents as $event => $handler) { | |||
$js[] = ".on('$event', $handler)"; | |||
} | |||
} else { | |||
foreach ($this->clientEvents as $event => $handler) { | |||
$js[] = ".on('$event', $handler)"; | |||
} | |||
} | |||
} | |||
return !empty($js) ? implode("", $js) . ($this->name !== null ? ";" : "") : ""; | |||
} | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return \yii\web\JsExpression | |||
*/ | |||
abstract public function encode(); | |||
} |
@@ -0,0 +1,131 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use yii\base\Component; | |||
use yii\base\InvalidParamException; | |||
use yii\helpers\ArrayHelper; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* LayerGroup Used to group several layers and handle them as one. | |||
* | |||
* @see http://leafletjs.com/reference.html#layergroup | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
class LayerGroup extends Component | |||
{ | |||
use NameTrait; | |||
/** | |||
* @var string the name of the javascript variable that will hold the reference | |||
* to the map object. | |||
*/ | |||
public $map; | |||
/** | |||
* @var Layer[] | |||
*/ | |||
private $_layers = []; | |||
/** | |||
* Adds a layer to the group. If no name given it will be automatically generated. | |||
* | |||
* @param Layer $layer | |||
* | |||
* @return $this | |||
* @throws \yii\base\InvalidParamException | |||
*/ | |||
public function addLayer(Layer $layer) | |||
{ | |||
if (($layer instanceof Popup) || ($layer instanceof TileLayer)) { | |||
throw new InvalidParamException("'\$layer' cannot be of type Popup or TileLayer."); | |||
} | |||
$layer->map = null; | |||
$this->_layers[$layer->getName(true)] = $layer; | |||
return $this; | |||
} | |||
/** | |||
* Returns a specific layer. Please note that if the layer didn't have a name, it will be dynamically created. This | |||
* method works for those that we know the name previously. | |||
* | |||
* @param string $name the name of the layer | |||
* | |||
* @return mixed | |||
*/ | |||
public function getLayer($name) | |||
{ | |||
return ArrayHelper::getValue($this->_layers, $name); | |||
} | |||
/** | |||
* Removes a layer with the given name from the group. | |||
* | |||
* @param $name | |||
* | |||
* @return mixed|null | |||
*/ | |||
public function removeLayer($name) | |||
{ | |||
return ArrayHelper::remove($this->_layers, $name); | |||
} | |||
/** | |||
* @return Layer[] the added layers | |||
*/ | |||
public function getLayers() | |||
{ | |||
return $this->_layers; | |||
} | |||
/** | |||
* @return JsExpression | |||
*/ | |||
public function encode() | |||
{ | |||
$js = []; | |||
$layers = $this->getLayers(); | |||
$name = $this->getName(); | |||
$names = str_replace(array('"', "'"), "", Json::encode(array_keys($layers))); | |||
$map = $this->map; | |||
foreach ($layers as $layer) { | |||
$js[] = $layer->encode(); | |||
} | |||
$initJs = "L.layerGroup($names)" . ($map !== null ? ".addTo($map);\n" : ""); | |||
if (empty($name)) { | |||
$js[] = $initJs . ($map !== null ? "" : ";"); | |||
} else { | |||
$js[] = "var $name = $initJs" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression(implode("\n", $js)); | |||
} | |||
/** | |||
* Returns the initialization | |||
* @return JsExpression | |||
*/ | |||
public function oneLineEncode() | |||
{ | |||
$map = $this->map; | |||
$layers = $this->getLayers(); | |||
$layersJs = []; | |||
/** @var \dosamigos\leaflet\layers\Layer $layer */ | |||
foreach ($layers as $layer) { | |||
$layer->name = null; | |||
$layersJs[] = $layer->encode(); | |||
} | |||
$js = "L.layerGroup([" . implode(",", $layersJs) . "])" . ($map !== null ? ".addTo($map);" : ""); | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,80 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\types\Icon; | |||
use yii\base\InvalidConfigException; | |||
use yii\web\JsExpression; | |||
/** | |||
* Marker is used to put a marker on the map | |||
* | |||
* @see http://leafletjs.com/reference.html#circle | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
* @property \dosamigos\leaflet\types\LatLng $latLng | |||
* @property string $popupContent | |||
* @property bool $openPopup | |||
*/ | |||
class Marker extends Layer | |||
{ | |||
use LatLngTrait; | |||
use PopupTrait; | |||
/** | |||
* Sets the marker's icon | |||
* | |||
* @param Icon $icon | |||
*/ | |||
public function setIcon($icon) //Icon - if you force the icon as type, the makimarker won't work...:( | |||
{ | |||
$this->clientOptions['icon'] = $icon; | |||
} | |||
/** | |||
* @return \dosamigos\leaflet\types\Icon | |||
*/ | |||
public function getIcon() | |||
{ | |||
return isset($this->clientOptions['icon']) ? $this->clientOptions['icon'] : null; | |||
} | |||
/** | |||
* Initializes the marker. | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
parent::init(); | |||
if (empty($this->latLng)) { | |||
throw new InvalidConfigException("'latLng' attribute cannot be empty."); | |||
} | |||
} | |||
/** | |||
* @return \yii\web\JsExpression the marker constructor string | |||
*/ | |||
public function encode() | |||
{ | |||
$latLon = $this->getLatLng()->toArray(true); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = $this->bindPopupContent("L.marker($latLon, $options)") . ($map !== null ? ".addTo($map)" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js;"; | |||
} | |||
$js .= $this->getEvents() . ($map !== null && empty($name)? ";" : ""); | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,45 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\LeafLet; | |||
trait NameTrait | |||
{ | |||
/** | |||
* @var string the variable name. If not null, then the js creation script | |||
* will be returned as a variable. If null, then the js creation script will | |||
* be returned as a constructor that you can use on other object's configuration options. | |||
*/ | |||
private $_name; | |||
/** | |||
* Returns the name of the layer. | |||
* | |||
* @param boolean $autoGenerate whether to generate a name if it is not set previously | |||
* | |||
* @return string name of the layer. | |||
*/ | |||
public function getName($autoGenerate = false) | |||
{ | |||
if ($autoGenerate && $this->_name === null) { | |||
$this->_name = LeafLet::generateName(); | |||
} | |||
return $this->_name; | |||
} | |||
/** | |||
* Sets the name of the layer. | |||
* | |||
* @param string $value name of the layer. | |||
*/ | |||
public function setName($value) | |||
{ | |||
$this->_name = $value; | |||
} | |||
} |
@@ -0,0 +1,113 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\LeafLet; | |||
use dosamigos\leaflet\types\LatLng; | |||
use dosamigos\leaflet\types\LatLngBounds; | |||
use yii\base\InvalidParamException; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* PolyLine is a class for drawing a polygon overlay on the map. | |||
* | |||
* @see http://leafletjs.com/reference.html#polyline | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
* @property string $popupContent | |||
* @property bool $openPopup | |||
*/ | |||
class PolyLine extends Layer | |||
{ | |||
use PopupTrait; | |||
/** | |||
* @var LatLng[] | |||
*/ | |||
private $_latLngs = []; | |||
/** | |||
* @var LatLngBounds | |||
*/ | |||
private $_bounds; | |||
/** | |||
* @param array $latLngs | |||
* | |||
* @throws \yii\base\InvalidParamException | |||
*/ | |||
public function setLatLngs(array $latLngs) | |||
{ | |||
foreach ($latLngs as $latLng) { | |||
if (!($latLng instanceof LatLng)) { | |||
throw new InvalidParamException("Wrong parameter. All items should be of type LatLng."); | |||
} | |||
} | |||
$this->_latLngs = $latLngs; | |||
$this->setBounds(); | |||
} | |||
/** | |||
* @return \dosamigos\leaflet\types\LatLng[] | |||
*/ | |||
public function getLatLngs() | |||
{ | |||
return $this->_latLngs; | |||
} | |||
/** | |||
* Returns the latLngs as array objects | |||
* @return array | |||
*/ | |||
public function getLatLngstoArray() | |||
{ | |||
$latLngs = []; | |||
foreach ($this->getLatLngs() as $latLng) { | |||
$latLngs[] = $latLng->toArray(); | |||
} | |||
return $latLngs; | |||
} | |||
/** | |||
* Returns the LatLngBounds of the polyline. | |||
* @return LatLngBounds | |||
*/ | |||
public function getBounds() | |||
{ | |||
return $this->_bounds; | |||
} | |||
/** | |||
* Sets bounds after initialization of the [[LatLng]] objects that compound the polyline. | |||
*/ | |||
protected function setBounds() | |||
{ | |||
$this->_bounds = LatLngBounds::getBoundsOfLatLngs($this->getLatLngs()); | |||
} | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return string | |||
*/ | |||
public function encode() | |||
{ | |||
$latLngs = Json::encode($this->getLatLngstoArray(), LeafLet::JSON_OPTIONS); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = $this->bindPopupContent("L.polyline($latLngs, $options)") . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,53 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* Polygon is a class for drawing polygon overlays on a map | |||
* | |||
* @see http://leafletjs.com/reference.html#polygon | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
*/ | |||
class Polygon extends PolyLine | |||
{ | |||
/** | |||
* @var bool whether to insert the layer at the bottom most position (z-index) on the map in reference to other | |||
* ui layers. | |||
*/ | |||
public $insertAtTheBottom = false; | |||
/** | |||
* Returns the javascript ready code for the object to render on the map. | |||
* To add a Polygon to the map, you need to use the special method [[LetLeaf::addPolygon]]. | |||
* @return string | |||
*/ | |||
public function encode() | |||
{ | |||
$latLngs = Json::encode($this->getLatLngstoArray(), LeafLet::JSON_OPTIONS); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = $this->bindPopupContent("L.polygon($latLngs, $options)") . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,63 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use yii\base\InvalidConfigException; | |||
use yii\web\JsExpression; | |||
/** | |||
* Popup is used to open popups in certain places of the map. For popups directly attached to an | |||
* object (ie [[Marker]]) better use their `popup` attribute. | |||
* | |||
* @see http://leafletjs.com/reference.html#popup | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property \dosamigos\leaflet\types\LatLng $latLng | |||
*/ | |||
class Popup extends Layer | |||
{ | |||
use LatLngTrait; | |||
/** | |||
* @var string the HTML content of the popup | |||
*/ | |||
public $content; | |||
/** | |||
* Initializes the marker. | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
parent::init(); | |||
if (empty($this->latLng)) { | |||
throw new InvalidConfigException("'latLon' attribute cannot be empty."); | |||
} | |||
} | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return string | |||
*/ | |||
public function encode() | |||
{ | |||
$latLon = $this->getLatLng()->encode(); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = "L.popup($options).setLatLng($latLon).setContent('$this->content')" . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,45 @@ | |||
<?php | |||
/** | |||
* | |||
* PopupTrait.php | |||
* | |||
* Date: 15/02/14 | |||
* Time: 11:03 | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
trait PopupTrait | |||
{ | |||
/** | |||
* @var string the HTML content of the popup to display when clicking on the marker. | |||
*/ | |||
public $popupContent; | |||
/** | |||
* @var bool whether to open the popup dialog on display. | |||
*/ | |||
public $openPopup = false; | |||
/** | |||
* Binds popup content (if any) to the js code to register | |||
* | |||
* @param string $js | |||
* | |||
* @return string | |||
*/ | |||
protected function bindPopupContent($js) | |||
{ | |||
if (!empty($this->popupContent)) { | |||
$content = addslashes($this->popupContent); | |||
$js .= ".bindPopup(\"{$content}\")"; | |||
if ($this->openPopup) { | |||
$js .= ".openPopup()"; | |||
} | |||
} | |||
return $js; | |||
} | |||
} |
@@ -0,0 +1,70 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use dosamigos\leaflet\types\LatLngBounds; | |||
use yii\web\JsExpression; | |||
/** | |||
* Rectangle a class for drawing rectangle overlays on a map. | |||
* | |||
* @see http://leafletjs.com/reference.html#rectangle | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
/** | |||
* @property string $name | |||
* @property string $popupContent | |||
* @property bool $openPopup | |||
*/ | |||
class Rectangle extends Layer | |||
{ | |||
use PopupTrait; | |||
/** | |||
* @var LatLngBounds | |||
*/ | |||
private $_bounds; | |||
/** | |||
* @param LatLngBounds $bounds | |||
*/ | |||
public function setBounds(LatLngBounds $bounds) | |||
{ | |||
$bounds->name = null; | |||
$this->_bounds = $bounds; | |||
} | |||
/** | |||
* @return LatLngBounds | |||
*/ | |||
public function getBounds() | |||
{ | |||
return $this->_bounds; | |||
} | |||
/** | |||
* Returns the javascript ready code for the object to render | |||
* @return string | |||
*/ | |||
public function encode() | |||
{ | |||
$bounds = $this->getBounds()->encode(); | |||
$options = $this->getOptions(); | |||
$name = $this->name; | |||
$map = $this->map; | |||
$js = $this->bindPopupContent("L.rectangle($bounds, $options)") . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,77 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\layers; | |||
use yii\base\InvalidConfigException; | |||
use yii\web\JsExpression; | |||
/** | |||
* TileLayer is used to load and display tile layers on the map | |||
* | |||
* @see http://leafletjs.com/reference.html#tilelayer | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\layers | |||
*/ | |||
class TileLayer extends Layer | |||
{ | |||
/** | |||
* @var string a template has the following form: | |||
* | |||
* ``` | |||
* 'http://{s}.somedomain.com/blabla/{z}/{x}/{y}.png' | |||
* ``` | |||
* | |||
* {s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain | |||
* limitation; subdomain values are specified in options; a, b or c by default, can be omitted), {z} — zoom level, | |||
* {x} and {y} — tile coordinates. | |||
* | |||
* You can use custom keys in the template, which will be evaluated from TileLayer options, like this: | |||
* | |||
* ``` | |||
* $layer = new TileLayer([ | |||
* 'urlTemplate' => 'L.tileLayer('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', | |||
* 'clientOptions' => [ | |||
* 'foo' => 'bar' | |||
* ] | |||
* ]); | |||
* ``` | |||
*/ | |||
public $urlTemplate; | |||
/** | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
parent::init(); | |||
if (empty($this->urlTemplate)) { | |||
throw new InvalidConfigException("'urlTemplate' cannot be empty."); | |||
} | |||
} | |||
/** | |||
* @return \yii\web\JsExpression the marker constructor string | |||
*/ | |||
public function encode() | |||
{ | |||
$options = $this->getOptions(); | |||
$name = $this->getName(); | |||
$map = $this->map; | |||
$js = "L.tileLayer('$this->urlTemplate', $options)" . ($map !== null ? ".addTo($map);" : ""); | |||
if (!empty($name)) { | |||
$js = "var $name = $js" . ($map !== null ? "" : ";"); | |||
$js .= $this->getEvents(); | |||
} | |||
return new JsExpression($js); | |||
} | |||
} |
@@ -0,0 +1,26 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
/** | |||
* Arrayable should be implemented by classes that need to be represented in array format. | |||
* | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
interface ArrayableInterface | |||
{ | |||
/** | |||
* Converts the object into an array. | |||
* | |||
* @param bool $encode whether to return the array json_encoded or raw | |||
* | |||
* @return array the array representation of this object | |||
*/ | |||
public function toArray($encode = false); | |||
} |
@@ -0,0 +1,110 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
use yii\base\InvalidConfigException; | |||
use yii\web\JsExpression; | |||
/** | |||
* Bounds represents a rectangular area in pixel coordinates. | |||
* | |||
* @see http://leafletjs.com/reference.html#bounds | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
/** | |||
* @property Point $min | |||
* @property Point $max | |||
*/ | |||
class Bounds extends Type implements ArrayableInterface | |||
{ | |||
/** | |||
* @var Point the top left corner of the rectangle | |||
*/ | |||
private $_min; | |||
/** | |||
* @var Point the bottom right corner of the rectangle | |||
*/ | |||
private $_max; | |||
/** | |||
* @param Point $max | |||
*/ | |||
public function setMax(Point $max) | |||
{ | |||
$this->_max = $max; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getMax() | |||
{ | |||
return $this->_max; | |||
} | |||
/** | |||
* @param Point $min | |||
*/ | |||
public function setMin(Point $min) | |||
{ | |||
$this->_min = $min; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getMin() | |||
{ | |||
return $this->_min; | |||
} | |||
/** | |||
* Initializes the object | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
if (empty($this->min) || empty($this->max)) { | |||
throw new InvalidConfigException("'min' and 'max' attributes cannot be empty."); | |||
} | |||
} | |||
/** | |||
* @return \yii\web\JsExpression the js initialization code of the object | |||
*/ | |||
public function encode() | |||
{ | |||
$min = $this->getMin()->toArray(true); | |||
$max = $this->getMax()->toArray(true); | |||
return new JsExpression("L.bounds($min, $max)"); | |||
} | |||
/** | |||
* Converts the object into an array. | |||
* | |||
* @param bool $encode whether to return the array json_encoded or raw | |||
* | |||
* @return array the array representation of this object | |||
*/ | |||
public function toArray($encode = false) | |||
{ | |||
$min = $this->getMin()->toArray($encode); | |||
$max = $this->getMax()->toArray($encode); | |||
return $encode ? "[$min, $max]" : [$min, $max]; | |||
} | |||
} |
@@ -0,0 +1,130 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* | |||
* DivIcon represents a lightweight icon for markers that uses a simple div element instead of an image. | |||
* | |||
* @see http://leafletjs.com/reference.html#divicon | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
class DivIcon extends Type | |||
{ | |||
/** | |||
* @var string the variable name. If not null, then the js icon creation script | |||
* will be returned as a variable: | |||
* | |||
* ``` | |||
* var iconName = L.divIcon({...}); | |||
* // after it can be shared among other markers | |||
* L.marker({icon: iconName, ...).addTo(map); | |||
* L.marker({icon: iconName, ...).addTo(map); | |||
* ``` | |||
* If null, the js icon creation script will be returned to be used as constructor so it can be used within another | |||
* constructor options: | |||
* | |||
* ``` | |||
* L.marker({icon: L.icon({...}), ...).addTo(map); | |||
* ``` | |||
*/ | |||
public $name; | |||
/** | |||
* @var string a custom class name to assign to both icon and shadow images. Empty by default. | |||
*/ | |||
public $className; | |||
/** | |||
* @var string a custom HTML code to put inside the div element, empty by default. | |||
*/ | |||
public $html; | |||
/** | |||
* @var Point size of the icon image in pixels. | |||
*/ | |||
private $_iconSize; | |||
/** | |||
* @var Point the coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so | |||
* that this point is at the marker's geographical location. Centered by default if size is specified, also can be | |||
* set in CSS with negative margins. | |||
*/ | |||
private $_iconAnchor; | |||
/** | |||
* @param Point $iconSize | |||
*/ | |||
public function setIconSize(Point $iconSize) | |||
{ | |||
$this->_iconSize = $iconSize; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getIconSize() | |||
{ | |||
return $this->_iconSize; | |||
} | |||
/** | |||
* @param Point $iconAnchor | |||
*/ | |||
public function setIconAnchor(Point $iconAnchor) | |||
{ | |||
$this->_iconAnchor = $iconAnchor; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getIconAnchor() | |||
{ | |||
return $this->_iconAnchor; | |||
} | |||
/** | |||
* @return \yii\web\JsExpression the js initialization code of the object | |||
*/ | |||
public function encode() | |||
{ | |||
$options = Json::encode($this->getOptions(), LeafLet::JSON_OPTIONS); | |||
$js = "L.divIcon($options)"; | |||
if ($this->name) { | |||
$js = "var $this->name = $js;"; | |||
} | |||
return new JsExpression($js); | |||
} | |||
/** | |||
* @return array the configuration options of the array | |||
*/ | |||
public function getOptions() | |||
{ | |||
$options = []; | |||
$class = new \ReflectionClass(__CLASS__); | |||
foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { | |||
if (!$property->isStatic()) { | |||
$name = $property->getName(); | |||
$options[$name] = $this->$name; | |||
} | |||
} | |||
foreach (['iconSize', 'iconAnchor'] as $property) { | |||
$point = $this->$property; | |||
if ($point instanceof Point) { | |||
$options[$property] = $point->toArray(true); | |||
} | |||
} | |||
return array_filter($options); | |||
} | |||
} |
@@ -0,0 +1,217 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\base\InvalidConfigException; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* Icon represents an icon to provide when creating a marker. | |||
* | |||
* @see http://leafletjs.com/reference.html#icon | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
class Icon extends Type | |||
{ | |||
/** | |||
* @var string the variable name. If not null, then the js icon creation script | |||
* will be returned as a variable: | |||
* | |||
* ``` | |||
* var iconName = L.icon({...}); | |||
* // after it can be shared among other markers | |||
* L.marker({icon: iconName, ...).addTo(map); | |||
* L.marker({icon: iconName, ...).addTo(map); | |||
* ``` | |||
* If null, the js icon creation script will be returned to be used as constructor so it can be used within another | |||
* constructor options: | |||
* | |||
* ``` | |||
* L.marker({icon: L.icon({...}), ...).addTo(map); | |||
* ``` | |||
*/ | |||
public $name; | |||
/** | |||
* @var string (required) the URL to the icon image (absolute or relative to your script path). | |||
*/ | |||
public $iconUrl; | |||
/** | |||
* @var string the URL to a retina sized version of the icon image (absolute or relative to your script path). Used | |||
* for Retina screen devices. | |||
*/ | |||
public $iconRetinaUrl; | |||
/** | |||
* @var string the URL to the icon shadow image. If not specified, no shadow image will be created. | |||
*/ | |||
public $shadowUrl; | |||
/** | |||
* @var string the URL to the retina sized version of the icon shadow image. If not specified, no shadow image will | |||
* be created. Used for Retina screen devices. | |||
*/ | |||
public $shadowRetinaUrl; | |||
/** | |||
* @var string a custom class name to assign to both icon and shadow images. Empty by default. | |||
*/ | |||
public $className; | |||
/** | |||
* @var Point size of the icon image in pixels. | |||
*/ | |||
private $_iconSize; | |||
/** | |||
* @var Point the coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so | |||
* that this point is at the marker's geographical location. Centered by default if size is specified, also can be | |||
* set in CSS with negative margins. | |||
*/ | |||
private $_iconAnchor; | |||
/** | |||
* @var Point size of the shadow image in pixels. | |||
*/ | |||
private $_shadowSize; | |||
/** | |||
* @var Point the coordinates of the "tip" of the shadow (relative to its top left corner) (the same as iconAnchor | |||
* if not specified). | |||
*/ | |||
private $_shadowAnchor; | |||
/** | |||
* @var Point the coordinates of the point from which popups will "open", relative to the icon anchor. | |||
*/ | |||
private $_popupAnchor; | |||
/** | |||
* @param Point $iconAnchor | |||
*/ | |||
public function setIconAnchor(Point $iconAnchor) | |||
{ | |||
$this->_iconAnchor = $iconAnchor; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getIconAnchor() | |||
{ | |||
return $this->_iconAnchor; | |||
} | |||
/** | |||
* @param Point $iconSize | |||
*/ | |||
public function setIconSize(Point $iconSize) | |||
{ | |||
$this->_iconSize = $iconSize; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getIconSize() | |||
{ | |||
return $this->_iconSize; | |||
} | |||
/** | |||
* @param Point $popupAnchor | |||
*/ | |||
public function setPopupAnchor(Point $popupAnchor) | |||
{ | |||
$this->_popupAnchor = $popupAnchor; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getPopupAnchor() | |||
{ | |||
return $this->_popupAnchor; | |||
} | |||
/** | |||
* @param Point $shadowAnchor | |||
*/ | |||
public function setShadowAnchor(Point $shadowAnchor) | |||
{ | |||
$this->_shadowAnchor = $shadowAnchor; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getShadowAnchor() | |||
{ | |||
return $this->_shadowAnchor; | |||
} | |||
/** | |||
* @param Point $shadowSize | |||
*/ | |||
public function setShadowSize(Point $shadowSize) | |||
{ | |||
$this->_shadowSize = $shadowSize; | |||
} | |||
/** | |||
* @return Point | |||
*/ | |||
public function getShadowSize() | |||
{ | |||
return $this->_shadowSize; | |||
} | |||
/** | |||
* Initializes the object | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
if (empty($this->iconUrl)) { | |||
throw new InvalidConfigException("'iconUrl' attribute cannot be empty."); | |||
} | |||
} | |||
/** | |||
* @return string the js initialization code of the object | |||
*/ | |||
public function encode() | |||
{ | |||
$options = Json::encode($this->getOptions(), LeafLet::JSON_OPTIONS); | |||
$js = "L.icon($options)"; | |||
if ($this->name) { | |||
$js = "var $this->name = $js;"; | |||
} | |||
return new JsExpression($js); | |||
} | |||
/** | |||
* @return array the configuration options of the array | |||
*/ | |||
public function getOptions() | |||
{ | |||
$options = []; | |||
$class = new \ReflectionClass(__CLASS__); | |||
foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { | |||
if (!$property->isStatic()) { | |||
$name = $property->getName(); | |||
$options[$name] = $this->$name; | |||
} | |||
} | |||
foreach (['iconAnchor', 'iconSize', 'popupAnchor', 'shadowAnchor', 'shadowSize'] as $property) { | |||
$point = $this->$property; | |||
if ($point instanceof Point) { | |||
$options[$property] = $point->toArray(true); | |||
} | |||
} | |||
return array_filter($options); | |||
} | |||
} |
@@ -0,0 +1,81 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\base\InvalidConfigException; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* LatLng | |||
* Represents a geographical point with a certain latitude and longitude. Please, note that | |||
* all Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form | |||
* (unless noted otherwise), so these lines are equivalent: | |||
* | |||
* ``` | |||
* use dosamigos\leafletjs\layers\Marker; | |||
* use dosamigos\leafletjs\types\LatLng; | |||
* | |||
* $marker = new Marker(['latLong'=>[50, 30]]); | |||
* $marker = new Marker(new LatLng(['latLng'=>[50,30]])); | |||
* ``` | |||
* | |||
* @see http://leafletjs.com/reference.html#latlng | |||
* @see http://leafletjs.com/reference.html#bounds | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
class LatLng extends Type implements ArrayableInterface | |||
{ | |||
/** | |||
* @var float the latitude in degrees. | |||
*/ | |||
public $lat; | |||
/** | |||
* @var float the longitude in degrees. | |||
*/ | |||
public $lng; | |||
/** | |||
* Initializes the object | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
if ($this->lat === null || $this->lng === null) { | |||
throw new InvalidConfigException("'lat' and 'lng' attributes cannot be empty."); | |||
} | |||
} | |||
/** | |||
* LatLng is and object to be used | |||
* @return \yii\web\JsExpression the js initialization code of the object | |||
*/ | |||
public function encode() | |||
{ | |||
return new JsExpression("L.latLng($this->lat, $this->lng)"); // no semicolon | |||
} | |||
/** | |||
* Returns the lat and lng as array | |||
* | |||
* @param bool $encode whether to return the array json_encoded or raw | |||
* | |||
* @return array|JsExpression | |||
*/ | |||
public function toArray($encode = false) | |||
{ | |||
$latLng = [$this->lat, $this->lng]; | |||
return $encode | |||
? new JsExpression(Json::encode($latLng, LeafLet::JSON_OPTIONS)) | |||
: $latLng; | |||
} | |||
} |
@@ -0,0 +1,151 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
use yii\base\InvalidConfigException; | |||
use yii\base\InvalidParamException; | |||
use yii\web\JsExpression; | |||
/** | |||
* LatLngBounds represents a rectangular geographical area on a map. | |||
* | |||
* @see http://leafletjs.com/reference.html#latlngbounds | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
/** | |||
* @property LatLng $southWest | |||
* @property LatLng $northEast | |||
*/ | |||
class LatLngBounds extends Type | |||
{ | |||
/** | |||
* @var string the variable name. If not null, then the js icon creation script | |||
* will be returned as a variable: | |||
* | |||
* ``` | |||
* var bounds = L.latLngBounds(...); | |||
* // after it can be included to the map | |||
* map.fitBounds(bounds); | |||
* ``` | |||
* If null, the js icon creation script will be returned to be used as constructor so it can be used within another | |||
* constructor options: | |||
* | |||
* ``` | |||
* L.map({maxBounds: L.latLngBounds(...)); | |||
* ``` | |||
*/ | |||
public $name; | |||
/** | |||
* @var LatLng the southWest boundary | |||
*/ | |||
private $_southWest; | |||
/** | |||
* @var LatLng the northEast boundary | |||
*/ | |||
private $_northEast; | |||
/** | |||
* @return LatLng | |||
*/ | |||
public function getSouthWest() | |||
{ | |||
return $this->_southWest; | |||
} | |||
/** | |||
* @param LatLng $latLng | |||
*/ | |||
public function setSouthWest(LatLng $latLng) | |||
{ | |||
$this->_southWest = $latLng; | |||
} | |||
/** | |||
* @return LatLng | |||
*/ | |||
public function getNorthEast() | |||
{ | |||
return $this->_northEast; | |||
} | |||
/** | |||
* @param LatLng $latLng | |||
*/ | |||
public function setNorthEast(LatLng $latLng) | |||
{ | |||
$this->_northEast = $latLng; | |||
} | |||
/** | |||
* Initializes the class | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
parent::init(); | |||
if (empty($this->southWest) || empty($this->northEast)) { | |||
throw new InvalidConfigException("'southEast' and/or 'northEast' cannot be empty"); | |||
} | |||
} | |||
/** | |||
* @return \yii\web\JsExpression the js initialization code of the object | |||
*/ | |||
public function encode() | |||
{ | |||
$southWest = $this->getSouthWest()->toArray(true); | |||
$northEast = $this->getNorthEast()->toArray(true); | |||
$js = "L.latLngBounds($southWest, $northEast)"; | |||
if (!empty($this->name)) { | |||
$js = "var $this->name = $js;"; | |||
} | |||
return new JsExpression($js); | |||
} | |||
/** | |||
* Finds bounds of an array of LatLng instances | |||
* | |||
* @param LatLng[] $latLngs | |||
* @param int $margin | |||
* | |||
* @return LatLngBounds | |||
*/ | |||
public static function getBoundsOfLatLngs(array $latLngs, $margin = 0) | |||
{ | |||
$min_lat = 1000; | |||
$max_lat = -1000; | |||
$min_lng = 1000; | |||
$max_lng = -1000; | |||
foreach ($latLngs as $latLng) { | |||
if (!($latLng instanceof LatLng)) { | |||
throw new InvalidParamException('"$latLngs" should be an array of LatLng instances.'); | |||
} | |||
/* @var $coord LatLng */ | |||
$min_lat = min($min_lat, $latLng->lat); | |||
$max_lat = max($max_lat, $latLng->lat); | |||
$min_lng = min($min_lng, $latLng->lng); | |||
$max_lng = max($max_lng, $latLng->lng); | |||
} | |||
if ($margin > 0) { | |||
$min_lat = $min_lat - $margin * ($max_lat - $min_lat); | |||
$min_lng = $min_lng - $margin * ($max_lng - $min_lng); | |||
$max_lat = $max_lat + $margin * ($max_lat - $min_lat); | |||
$max_lng = $max_lng + $margin * ($max_lng - $min_lng); | |||
} | |||
$bounds = new LatLngBounds( | |||
[ | |||
'southWest' => new LatLng(['lat' => $min_lat, 'lng' => $min_lng]), | |||
'northEast' => new LatLng(['lat' => $max_lat, 'lng' => $max_lng]) | |||
] | |||
); | |||
return $bounds; | |||
} | |||
} |
@@ -0,0 +1,76 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
use dosamigos\leaflet\LeafLet; | |||
use yii\base\InvalidConfigException; | |||
use yii\helpers\Json; | |||
use yii\web\JsExpression; | |||
/** | |||
* Point represents a point with x and y coordinates in pixels. | |||
* | |||
* ``` | |||
* $map->panBy(new Point(['x' => 200, 'y' => '300'])); | |||
* ``` | |||
* | |||
* @see http://leafletjs.com/reference.html#point | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
class Point extends Type implements ArrayableInterface | |||
{ | |||
/** | |||
* @var float x coordinate | |||
*/ | |||
public $x; | |||
/** | |||
* @var float y coordinate | |||
*/ | |||
public $y; | |||
/** | |||
* @var bool if round is set to true, LetLeaf will round the x and y values. | |||
*/ | |||
public $round = false; | |||
/** | |||
* Initializes the class | |||
* @throws \yii\base\InvalidConfigException | |||
*/ | |||
public function init() | |||
{ | |||
if (empty($this->x) || empty($this->y)) { | |||
throw new InvalidConfigException("'x' or 'y' cannot be empty."); | |||
} | |||
} | |||
/** | |||
* @return \yii\web\JsExpression the js initialization code of the object | |||
*/ | |||
public function encode() | |||
{ | |||
$x = $this->x; | |||
$y = $this->y; | |||
return new JsExpression("L.point($x, $y)"); // no semicolon | |||
} | |||
/** | |||
* Returns the point values as array | |||
* | |||
* @param bool $encode whether to return the array json_encoded or raw | |||
* | |||
* @return array|JsExpression | |||
*/ | |||
public function toArray($encode = false) | |||
{ | |||
$point = [$this->x, $this->y]; | |||
return $encode ? new JsExpression(Json::encode($point, LeafLet::JSON_OPTIONS)) : $point; | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\types; | |||
use yii\base\Component; | |||
/** | |||
* Type is the abstract class for all Types | |||
* | |||
* @author Antonio Ramirez <amigo.cobos@gmail.com> | |||
* @link http://www.ramirezcobos.com/ | |||
* @link http://www.2amigos.us/ | |||
* @package dosamigos\leaflet\types | |||
*/ | |||
abstract class Type extends Component | |||
{ | |||
/** | |||
* @return string|\yii\web\JsExpression the js initialization code of the object | |||
*/ | |||
abstract public function encode(); | |||
} |
@@ -0,0 +1,116 @@ | |||
<?php | |||
/** | |||
* @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC | |||
* @link http://2amigos.us | |||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | |||
*/ | |||
namespace dosamigos\leaflet\widgets; | |||
use dosamigos\leaflet\LeafLet; | |||
use dosamigos\leaflet\LeafLetAsset; | |||
use yii\base\InvalidConfigException; | |||
use yii\base\Widget; | |||
use yii\helpers\ArrayHelper; | |||
use yii\helpers\Html; | |||
use yii\helpers\Json; | |||
/** | |||
* Widget Map renders the map using the LeafLet component configurations for rendering on the view. | |||
* *Important* It is very important to specify the height of the widget, whether with a class name or through an inline | |||
* style. Failing to configure the height may have unexpected rendering results. | |||
* | |||
* @package dosamigos\leaflet\widgets | |||
*/ | |||
class Map extends Widget | |||
{ | |||
/** | |||
* @var \dosamigos\leaflet\LeafLet component holding all configuration | |||
*/ | |||
public $leafLet; | |||
/** | |||
* @var string the height of the map. Failing to configure the height of the map, will result in | |||
* unexpected results. | |||
*/ | |||
public $height = '200px'; | |||
/** | |||
* @var array the HTML attributes for the widget container tag. | |||
*/ | |||
public $options = []; | |||
/** | |||
* Initializes the widget. | |||
* This method will register the bootstrap asset bundle. If you override this method, | |||
* make sure you call the parent implementation first. | |||
*/ | |||
public function init() | |||
{ | |||
parent::init(); | |||
if (!isset($this->options['id'])) { | |||
$this->options['id'] = $this->getId(); | |||
} | |||
if (empty($this->leafLet) || !($this->leafLet instanceof LeafLet)) { | |||
throw new InvalidConfigException( | |||
"'leafLet' attribute cannot be empty and should be of type LeafLet component." | |||
); | |||
} | |||
if(is_numeric($this->height)) { | |||
$this->height .= 'px'; | |||
} | |||
Html::addCssStyle($this->options, ['height' => $this->height], false); | |||
} | |||
/** | |||
* Renders the map | |||
* @return string|void | |||
*/ | |||
public function run() | |||
{ | |||
echo "\n" . Html::tag('div', '', $this->options); | |||
$this->registerScript(); | |||
} | |||
/** | |||
* Register the script for the map to be rendered according to the configurations on the LeafLet | |||
* component. | |||
*/ | |||
public function registerScript() | |||
{ | |||
$view = $this->getView(); | |||
LeafLetAsset::register($view); | |||
$this->leafLet->getPlugins()->registerAssetBundles($view); | |||
$id = $this->options['id']; | |||
$name = $this->leafLet->name; | |||
$js = $this->leafLet->getJs(); | |||
$clientOptions = $this->leafLet->clientOptions; | |||
// for map load event to fire, we have to postpone setting view, until events are bound | |||
// see https://github.com/Leaflet/Leaflet/issues/3560 | |||
$lateInitClientOptions['center'] = Json::encode($clientOptions['center']); | |||
$lateInitClientOptions['zoom'] = $clientOptions['zoom']; | |||
unset($clientOptions['center']); | |||
unset($clientOptions['zoom']); | |||
$options = empty($clientOptions) ? '{}' : Json::encode($clientOptions, LeafLet::JSON_OPTIONS); | |||
array_unshift($js, "var $name = L.map('$id', $options);"); | |||
if ($this->leafLet->getTileLayer() !== null) { | |||
$js[] = $this->leafLet->getTileLayer()->encode(); | |||
} | |||
$clientEvents = $this->leafLet->clientEvents; | |||
if (!empty($clientEvents)) { | |||
foreach ($clientEvents as $event => $handler) { | |||
$js[] = "$name.on('$event', $handler);"; | |||
} | |||
} | |||
$js[] = "$name.setView({$lateInitClientOptions['center']}, {$lateInitClientOptions['zoom']});"; | |||
$view->registerJs("function {$name}_init(){\n" . implode("\n", $js) . "}\n{$name}_init();"); | |||
} | |||
} |
@@ -0,0 +1 @@ | |||
../cebe/markdown/bin/markdown |
@@ -0,0 +1 @@ | |||
../yiisoft/yii2/yii |
@@ -0,0 +1,5 @@ | |||
Bootstrap uses [GitHub's Releases feature](https://github.com/blog/1547-release-your-software) for its changelogs. | |||
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. | |||
Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release. |
@@ -0,0 +1,6 @@ | |||
source 'https://rubygems.org' | |||
group :development, :test do | |||
gem 'jekyll', '~> 3.1.2' | |||
gem 'jekyll-sitemap', '~> 0.11.0' | |||
end |
@@ -0,0 +1,43 @@ | |||
GEM | |||
remote: https://rubygems.org/ | |||
specs: | |||
addressable (2.4.0) | |||
colorator (0.1) | |||
ffi (1.9.14-x64-mingw32) | |||
jekyll (3.1.6) | |||
colorator (~> 0.1) | |||
jekyll-sass-converter (~> 1.0) | |||
jekyll-watch (~> 1.1) | |||
kramdown (~> 1.3) | |||
liquid (~> 3.0) | |||
mercenary (~> 0.3.3) | |||
rouge (~> 1.7) | |||
safe_yaml (~> 1.0) | |||
jekyll-sass-converter (1.4.0) | |||
sass (~> 3.4) | |||
jekyll-sitemap (0.11.0) | |||
addressable (~> 2.4.0) | |||
jekyll-watch (1.4.0) | |||
listen (~> 3.0, < 3.1) | |||
kramdown (1.11.1) | |||
liquid (3.0.6) | |||
listen (3.0.8) | |||
rb-fsevent (~> 0.9, >= 0.9.4) | |||
rb-inotify (~> 0.9, >= 0.9.7) | |||
mercenary (0.3.6) | |||
rb-fsevent (0.9.7) | |||
rb-inotify (0.9.7) | |||
ffi (>= 0.5.0) | |||
rouge (1.11.1) | |||
safe_yaml (1.0.4) | |||
sass (3.4.22) | |||
PLATFORMS | |||
x64-mingw32 | |||
DEPENDENCIES | |||
jekyll (~> 3.1.2) | |||
jekyll-sitemap (~> 0.11.0) | |||
BUNDLED WITH | |||
1.12.5 |
@@ -1,7 +1,7 @@ | |||
/*! | |||
* Bootstrap's Gruntfile | |||
* http://getbootstrap.com | |||
* Copyright 2013-2015 Twitter, Inc. | |||
* Copyright 2013-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
@@ -17,7 +17,6 @@ module.exports = function (grunt) { | |||
var fs = require('fs'); | |||
var path = require('path'); | |||
var npmShrinkwrap = require('npm-shrinkwrap'); | |||
var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js'); | |||
var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js'); | |||
var getLessVarsData = function () { | |||
@@ -44,7 +43,7 @@ module.exports = function (grunt) { | |||
banner: '/*!\n' + | |||
' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' + | |||
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + | |||
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' + | |||
' * Licensed under the <%= pkg.license %> license\n' + | |||
' */\n', | |||
jqueryCheck: configBridge.config.jqueryCheck.join('\n'), | |||
jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'), | |||
@@ -63,7 +62,7 @@ module.exports = function (grunt) { | |||
options: { | |||
jshintrc: 'grunt/.jshintrc' | |||
}, | |||
src: ['Gruntfile.js', 'grunt/*.js'] | |||
src: ['Gruntfile.js', 'package.js', 'grunt/*.js'] | |||
}, | |||
core: { | |||
src: 'js/*.js' | |||
@@ -126,7 +125,11 @@ module.exports = function (grunt) { | |||
uglify: { | |||
options: { | |||
preserveComments: 'some' | |||
compress: { | |||
warnings: false | |||
}, | |||
mangle: true, | |||
preserveComments: /^!|@preserve|@license|@cc_on/i | |||
}, | |||
core: { | |||
src: '<%= concat.bootstrap.dest %>', | |||
@@ -191,7 +194,7 @@ module.exports = function (grunt) { | |||
src: 'dist/css/<%= pkg.name %>-theme.css' | |||
}, | |||
docs: { | |||
src: 'docs/assets/css/src/docs.css' | |||
src: ['docs/assets/css/src/docs.css'] | |||
}, | |||
examples: { | |||
expand: true, | |||
@@ -223,8 +226,12 @@ module.exports = function (grunt) { | |||
cssmin: { | |||
options: { | |||
// TODO: disable `zeroUnits` optimization once clean-css 3.2 is released | |||
// and then simplify the fix for https://github.com/twbs/bootstrap/issues/14837 accordingly | |||
compatibility: 'ie8', | |||
keepSpecialComments: '*', | |||
sourceMap: true, | |||
sourceMapInlineSources: true, | |||
advanced: false | |||
}, | |||
minifyCore: { | |||
@@ -237,23 +244,14 @@ module.exports = function (grunt) { | |||
}, | |||
docs: { | |||
src: [ | |||
'docs/assets/css/src/docs.css', | |||
'docs/assets/css/src/pygments-manni.css' | |||
'docs/assets/css/ie10-viewport-bug-workaround.css', | |||
'docs/assets/css/src/pygments-manni.css', | |||
'docs/assets/css/src/docs.css' | |||
], | |||
dest: 'docs/assets/css/docs.min.css' | |||
} | |||
}, | |||
usebanner: { | |||
options: { | |||
position: 'top', | |||
banner: '<%= banner %>' | |||
}, | |||
files: { | |||
src: 'dist/css/*.css' | |||
} | |||
}, | |||
csscomb: { | |||
options: { | |||
config: 'less/.csscomb.json' | |||
@@ -278,12 +276,17 @@ module.exports = function (grunt) { | |||
copy: { | |||
fonts: { | |||
src: 'fonts/*', | |||
expand: true, | |||
src: 'fonts/**', | |||
dest: 'dist/' | |||
}, | |||
docs: { | |||
src: 'dist/*/*', | |||
dest: 'docs/' | |||
expand: true, | |||
cwd: 'dist/', | |||
src: [ | |||
'**/*' | |||
], | |||
dest: 'docs/dist/' | |||
} | |||
}, | |||
@@ -298,7 +301,9 @@ module.exports = function (grunt) { | |||
jekyll: { | |||
options: { | |||
config: '_config.yml' | |||
bundleExec: true, | |||
config: '_config.yml', | |||
incremental: false | |||
}, | |||
docs: {}, | |||
github: { | |||
@@ -308,43 +313,71 @@ module.exports = function (grunt) { | |||
} | |||
}, | |||
jade: { | |||
htmlmin: { | |||
dist: { | |||
options: { | |||
collapseBooleanAttributes: true, | |||
collapseWhitespace: true, | |||
conservativeCollapse: true, | |||
decodeEntities: false, | |||
minifyCSS: { | |||
compatibility: 'ie8', | |||
keepSpecialComments: 0 | |||
}, | |||
minifyJS: true, | |||
minifyURLs: false, | |||
processConditionalComments: true, | |||
removeAttributeQuotes: true, | |||
removeComments: true, | |||
removeOptionalAttributes: true, | |||
removeOptionalTags: true, | |||
removeRedundantAttributes: true, | |||
removeScriptTypeAttributes: true, | |||
removeStyleLinkTypeAttributes: true, | |||
removeTagWhitespace: false, | |||
sortAttributes: true, | |||
sortClassName: true | |||
}, | |||
expand: true, | |||
cwd: '_gh_pages', | |||
dest: '_gh_pages', | |||
src: [ | |||
'**/*.html', | |||
'!examples/**/*.html' | |||
] | |||
} | |||
}, | |||
pug: { | |||
options: { | |||
pretty: true, | |||
data: getLessVarsData | |||
}, | |||
customizerVars: { | |||
src: 'docs/_jade/customizer-variables.jade', | |||
src: 'docs/_pug/customizer-variables.pug', | |||
dest: 'docs/_includes/customizer-variables.html' | |||
}, | |||
customizerNav: { | |||
src: 'docs/_jade/customizer-nav.jade', | |||
src: 'docs/_pug/customizer-nav.pug', | |||
dest: 'docs/_includes/nav/customize.html' | |||
} | |||
}, | |||
validation: { | |||
htmllint: { | |||
options: { | |||
charset: 'utf-8', | |||
doctype: 'HTML5', | |||
failHard: true, | |||
reset: true, | |||
relaxerror: [ | |||
'Element img is missing required attribute src.', | |||
'Attribute autocomplete not allowed on element input at this point.', | |||
'Attribute autocomplete not allowed on element button at this point.', | |||
'Bad value separator for attribute role on element li.' | |||
ignore: [ | |||
'Attribute "autocomplete" not allowed on element "button" at this point.', | |||
'Attribute "autocomplete" is only allowed when the input type is "color", "date", "datetime", "datetime-local", "email", "hidden", "month", "number", "password", "range", "search", "tel", "text", "time", "url", or "week".', | |||
'Element "img" is missing required attribute "src".' | |||
] | |||
}, | |||
files: { | |||
src: '_gh_pages/**/*.html' | |||
} | |||
src: '_gh_pages/**/*.html' | |||
}, | |||
watch: { | |||
src: { | |||
files: '<%= jshint.core.src %>', | |||
tasks: ['jshint:src', 'qunit', 'concat'] | |||
tasks: ['jshint:core', 'qunit', 'concat'] | |||
}, | |||
test: { | |||
files: '<%= jshint.test.src %>', | |||
@@ -356,17 +389,6 @@ module.exports = function (grunt) { | |||
} | |||
}, | |||
sed: { | |||
versionNumber: { | |||
pattern: (function () { | |||
var old = grunt.option('oldver'); | |||
return old ? RegExp.quote(old) : old; | |||
})(), | |||
replacement: grunt.option('newver'), | |||
recursive: true | |||
} | |||
}, | |||
'saucelabs-qunit': { | |||
all: { | |||
options: { | |||
@@ -374,7 +396,7 @@ module.exports = function (grunt) { | |||
throttled: 10, | |||
maxRetries: 3, | |||
maxPollRetries: 4, | |||
urls: ['http://127.0.0.1:3000/js/tests/index.html'], | |||
urls: ['http://127.0.0.1:3000/js/tests/index.html?hidepassed'], | |||
browsers: grunt.file.readYAML('grunt/sauce_browsers.yml') | |||
} | |||
} | |||
@@ -413,7 +435,7 @@ module.exports = function (grunt) { | |||
require('time-grunt')(grunt); | |||
// Docs HTML validation task | |||
grunt.registerTask('validate-html', ['jekyll:docs', 'validation']); | |||
grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']); | |||
var runSubset = function (subset) { | |||
return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset; | |||
@@ -453,7 +475,7 @@ module.exports = function (grunt) { | |||
// CSS distribution task. | |||
grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']); | |||
grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'usebanner', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']); | |||
grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']); | |||
// Full distribution task. | |||
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'copy:fonts', 'dist-js']); | |||
@@ -461,16 +483,11 @@ module.exports = function (grunt) { | |||
// Default task. | |||
grunt.registerTask('default', ['clean:dist', 'copy:fonts', 'test']); | |||
// Version numbering task. | |||
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z | |||
// This can be overzealous, so its changes should always be manually reviewed! | |||
grunt.registerTask('change-version-number', 'sed'); | |||
grunt.registerTask('build-glyphicons-data', function () { generateGlyphiconsData.call(this, grunt); }); | |||
// task for building customizer | |||
grunt.registerTask('build-customizer', ['build-customizer-html', 'build-raw-files']); | |||
grunt.registerTask('build-customizer-html', 'jade'); | |||
grunt.registerTask('build-customizer-html', 'pug'); | |||
grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', function () { | |||
var banner = grunt.template.process('<%= banner %>'); | |||
generateRawFiles(grunt, banner); | |||
@@ -488,22 +505,7 @@ module.exports = function (grunt) { | |||
grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']); | |||
grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']); | |||
grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-glyphicons-data', 'build-customizer']); | |||
grunt.registerTask('docs-github', ['jekyll:github', 'htmlmin']); | |||
grunt.registerTask('prep-release', ['jekyll:github', 'compress']); | |||
// Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json). | |||
// This task should be run and the updated file should be committed whenever Bootstrap's dependencies change. | |||
grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', '_update-shrinkwrap']); | |||
grunt.registerTask('_update-shrinkwrap', function () { | |||
var done = this.async(); | |||
npmShrinkwrap({ dev: true, dirname: __dirname }, function (err) { | |||
if (err) { | |||
grunt.fail.warn(err); | |||
} | |||
var dest = 'test-infra/npm-shrinkwrap.json'; | |||
fs.renameSync('npm-shrinkwrap.json', dest); | |||
grunt.log.writeln('File ' + dest.cyan + ' updated.'); | |||
done(); | |||
}); | |||
}); | |||
grunt.registerTask('prep-release', ['dist', 'docs', 'docs-github', 'compress']); | |||
}; |
@@ -0,0 +1,22 @@ | |||
Before opening an issue: | |||
- [Search for duplicate or closed issues](https://github.com/twbs/bootstrap/issues?utf8=%E2%9C%93&q=is%3Aissue) | |||
- [Validate](http://validator.w3.org/nu/) and [lint](https://github.com/twbs/bootlint#in-the-browser) any HTML to avoid common problems | |||
- Prepare a [reduced test case](https://css-tricks.com/reduced-test-cases/) for any bugs | |||
- Read the [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md) | |||
When asking general "how to" questions: | |||
- Please do not open an issue here | |||
- Instead, ask for help on [StackOverflow, IRC, or Slack](https://github.com/twbs/bootstrap/blob/master/README.md#community) | |||
When reporting a bug, include: | |||
- Operating system and version (Windows, Mac OS X, Android, iOS, Win10 Mobile) | |||
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser) | |||
- Reduced test cases and potential fixes using [JS Bin](https://jsbin.com) | |||
When suggesting a feature, include: | |||
- As much detail as possible for what we should add and why it's important to Bootstrap | |||
- Relevant links to prior art, screenshots, or live demos whenever possible |
@@ -1,6 +1,6 @@ | |||
The MIT License (MIT) | |||
Copyright (c) 2011-2015 Twitter, Inc | |||
Copyright (c) 2011-2016 Twitter, Inc. | |||
Permission is hereby granted, free of charge, to any person obtaining a copy | |||
of this software and associated documentation files (the "Software"), to deal |
@@ -1,33 +1,40 @@ | |||
# [Bootstrap](http://getbootstrap.com) | |||
![Bower version](https://img.shields.io/bower/v/bootstrap.svg?style=flat) | |||
[![npm version](https://img.shields.io/npm/v/bootstrap.svg?style=flat)](https://www.npmjs.com/package/bootstrap) | |||
[![Build Status](https://img.shields.io/travis/twbs/bootstrap/master.svg?style=flat)](https://travis-ci.org/twbs/bootstrap) | |||
[![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg?style=flat)](https://david-dm.org/twbs/bootstrap#info=devDependencies) | |||
[![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com) | |||
![Bower version](https://img.shields.io/bower/v/bootstrap.svg) | |||
[![npm version](https://img.shields.io/npm/v/bootstrap.svg)](https://www.npmjs.com/package/bootstrap) | |||
[![Build Status](https://img.shields.io/travis/twbs/bootstrap/master.svg)](https://travis-ci.org/twbs/bootstrap) | |||
[![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap#info=devDependencies) | |||
[![NuGet](https://img.shields.io/nuget/v/bootstrap.svg)](https://www.nuget.org/packages/Bootstrap) | |||
[![Selenium Test Status](https://saucelabs.com/browser-matrix/bootstrap.svg)](https://saucelabs.com/u/bootstrap) | |||
Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community. | |||
To get started, check out <http://getbootstrap.com>! | |||
## Table of contents | |||
- [Quick start](#quick-start) | |||
- [Bugs and feature requests](#bugs-and-feature-requests) | |||
- [Documentation](#documentation) | |||
- [Contributing](#contributing) | |||
- [Community](#community) | |||
- [Versioning](#versioning) | |||
- [Creators](#creators) | |||
- [Copyright and license](#copyright-and-license) | |||
* [Quick start](#quick-start) | |||
* [Bugs and feature requests](#bugs-and-feature-requests) | |||
* [Documentation](#documentation) | |||
* [Contributing](#contributing) | |||
* [Community](#community) | |||
* [Versioning](#versioning) | |||
* [Creators](#creators) | |||
* [Copyright and license](#copyright-and-license) | |||
## Quick start | |||
Four quick start options are available: | |||
Several quick start options are available: | |||
- [Download the latest release](https://github.com/twbs/bootstrap/archive/v3.3.2.zip). | |||
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`. | |||
- Install with [Bower](http://bower.io): `bower install bootstrap`. | |||
- Install with [npm](https://www.npmjs.org): `npm install bootstrap`. | |||
* [Download the latest release](https://github.com/twbs/bootstrap/archive/v3.3.7.zip). | |||
* Clone the repo: `git clone https://github.com/twbs/bootstrap.git`. | |||
* Install with [Bower](http://bower.io): `bower install bootstrap`. | |||
* Install with [npm](https://www.npmjs.com): `npm install bootstrap@3`. | |||
* Install with [Meteor](https://www.meteor.com): `meteor add twbs:bootstrap`. | |||
* Install with [Composer](https://getcomposer.org): `composer require twbs/bootstrap`. | |||
Read the [Getting started page](http://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more. | |||
@@ -41,9 +48,11 @@ bootstrap/ | |||
│ ├── bootstrap.css | |||
│ ├── bootstrap.css.map | |||
│ ├── bootstrap.min.css | |||
│ ├── bootstrap.min.css.map | |||
│ ├── bootstrap-theme.css | |||
│ ├── bootstrap-theme.css.map | |||
│ └── bootstrap-theme.min.css | |||
│ ├── bootstrap-theme.min.css | |||
│ └── bootstrap-theme.min.css.map | |||
├── js/ | |||
│ ├── bootstrap.js | |||
│ └── bootstrap.min.js | |||
@@ -55,14 +64,15 @@ bootstrap/ | |||
└── glyphicons-halflings-regular.woff2 | |||
``` | |||
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). CSS [source maps](https://developers.google.com/chrome-developer-tools/docs/css-preprocessors) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Fonts from Glyphicons are included, as is the optional Bootstrap theme. | |||
We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). CSS [source maps](https://developer.chrome.com/devtools/docs/css-preprocessors) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Fonts from Glyphicons are included, as is the optional Bootstrap theme. | |||
## Bugs and feature requests | |||
Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new). | |||
Note that **feature requests must target [Bootstrap v4](https://github.com/twbs/bootstrap/tree/v4-dev),** because Bootstrap v3 is now in maintenance mode and is closed off to new features. This is so that we can focus our efforts on Bootstrap v4. | |||
## Documentation | |||
@@ -70,11 +80,10 @@ Bootstrap's documentation, included in this repo in the root directory, is built | |||
### Running documentation locally | |||
1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) (requires v2.5.x). | |||
- **Windows users:** Read [this unofficial guide](http://jekyll-windows.juthilo.com/) to get Jekyll up and running without problems. | |||
2. Install the Ruby-based syntax highlighter, [Rouge](https://github.com/jneen/rouge), with `gem install rouge`. | |||
3. From the root `/bootstrap` directory, run `jekyll serve` in the command line. | |||
4. Open <http://localhost:9001> in your browser, and voilà. | |||
1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) and other Ruby dependencies with `bundle install`. | |||
**Note for Windows users:** Read [this unofficial guide](http://jekyll-windows.juthilo.com/) to get Jekyll up and running without problems. | |||
2. From the root `/bootstrap` directory, run `bundle exec jekyll serve` in the command line. | |||
4. Open `http://localhost:9001` in your browser, and voilà. | |||
Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com/docs/home/). | |||
@@ -85,48 +94,49 @@ Documentation for v2.3.2 has been made available for the time being at <http://g | |||
[Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download. | |||
## Contributing | |||
Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. | |||
Moreover, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo). | |||
Moreover, if your pull request contains JavaScript patches or features, you must include [relevant unit tests](https://github.com/twbs/bootstrap/tree/master/js/tests). All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo). | |||
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>. | |||
**Bootstrap v3 is now closed off to new features.** It has gone into maintenance mode so that we can focus our efforts on [Bootstrap v4](https://github.com/twbs/bootstrap/tree/v4-dev), the future of the framework. Pull requests which add new features (rather than fix bugs) should target [Bootstrap v4 (the `v4-dev` git branch)](https://github.com/twbs/bootstrap/tree/v4-dev) instead. | |||
Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>. | |||
## Community | |||
Keep track of development and community news. | |||
- Follow [@twbootstrap on Twitter](https://twitter.com/twbootstrap). | |||
- Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com). | |||
- Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel. | |||
- Implementation help may be found at Stack Overflow (tagged [`twitter-bootstrap-3`](http://stackoverflow.com/questions/tagged/twitter-bootstrap-3)). | |||
Get updates on Bootstrap's development and chat with the project maintainers and community members. | |||
* Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap). | |||
* Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com). | |||
* Join [the official Slack room](https://bootstrap-slack.herokuapp.com). | |||
* Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel. | |||
* Implementation help may be found at Stack Overflow (tagged [`twitter-bootstrap-3`](https://stackoverflow.com/questions/tagged/twitter-bootstrap-3)). | |||
* Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability. | |||
## Versioning | |||
For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible. | |||
See [the Releases section of our GitHub project](https://github.com/twbs/bootstrap/releases) for changelogs for each release version of Bootstrap. Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release. | |||
## Creators | |||
**Mark Otto** | |||
- <https://twitter.com/mdo> | |||
- <https://github.com/mdo> | |||
* <https://twitter.com/mdo> | |||
* <https://github.com/mdo> | |||
**Jacob Thornton** | |||
- <https://twitter.com/fat> | |||
- <https://github.com/fat> | |||
* <https://twitter.com/fat> | |||
* <https://github.com/fat> | |||
## Copyright and license | |||
Code and documentation copyright 2011-2015 Twitter, Inc. Code released under [the MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE). | |||
Code and documentation copyright 2011-2016 Twitter, Inc. Code released under [the MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE). |
@@ -1,7 +1,6 @@ | |||
{ | |||
"name": "bootstrap", | |||
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", | |||
"version": "3.3.2", | |||
"keywords": [ | |||
"css", | |||
"js", | |||
@@ -13,14 +12,11 @@ | |||
"web" | |||
], | |||
"homepage": "http://getbootstrap.com", | |||
"license": "MIT", | |||
"moduleType": "globals", | |||
"main": [ | |||
"less/bootstrap.less", | |||
"dist/css/bootstrap.css", | |||
"dist/js/bootstrap.js", | |||
"dist/fonts/glyphicons-halflings-regular.eot", | |||
"dist/fonts/glyphicons-halflings-regular.svg", | |||
"dist/fonts/glyphicons-halflings-regular.ttf", | |||
"dist/fonts/glyphicons-halflings-regular.woff" | |||
"dist/js/bootstrap.js" | |||
], | |||
"ignore": [ | |||
"/.*", | |||
@@ -33,6 +29,6 @@ | |||
"test-infra" | |||
], | |||
"dependencies": { | |||
"jquery": ">= 1.9.1" | |||
"jquery": "1.9.1 - 3" | |||
} | |||
} |
@@ -1,9 +1,8 @@ | |||
/*! | |||
* Bootstrap v3.3.2 (http://getbootstrap.com) | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Bootstrap v3.3.7 (http://getbootstrap.com) | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
.btn-default, | |||
.btn-primary, | |||
.btn-success, | |||
@@ -29,6 +28,27 @@ | |||
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); | |||
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); | |||
} | |||
.btn-default.disabled, | |||
.btn-primary.disabled, | |||
.btn-success.disabled, | |||
.btn-info.disabled, | |||
.btn-warning.disabled, | |||
.btn-danger.disabled, | |||
.btn-default[disabled], | |||
.btn-primary[disabled], | |||
.btn-success[disabled], | |||
.btn-info[disabled], | |||
.btn-warning[disabled], | |||
.btn-danger[disabled], | |||
fieldset[disabled] .btn-default, | |||
fieldset[disabled] .btn-primary, | |||
fieldset[disabled] .btn-success, | |||
fieldset[disabled] .btn-info, | |||
fieldset[disabled] .btn-warning, | |||
fieldset[disabled] .btn-danger { | |||
-webkit-box-shadow: none; | |||
box-shadow: none; | |||
} | |||
.btn-default .badge, | |||
.btn-primary .badge, | |||
.btn-success .badge, | |||
@@ -64,8 +84,23 @@ | |||
border-color: #dbdbdb; | |||
} | |||
.btn-default.disabled, | |||
.btn-default:disabled, | |||
.btn-default[disabled] { | |||
.btn-default[disabled], | |||
fieldset[disabled] .btn-default, | |||
.btn-default.disabled:hover, | |||
.btn-default[disabled]:hover, | |||
fieldset[disabled] .btn-default:hover, | |||
.btn-default.disabled:focus, | |||
.btn-default[disabled]:focus, | |||
fieldset[disabled] .btn-default:focus, | |||
.btn-default.disabled.focus, | |||
.btn-default[disabled].focus, | |||
fieldset[disabled] .btn-default.focus, | |||
.btn-default.disabled:active, | |||
.btn-default[disabled]:active, | |||
fieldset[disabled] .btn-default:active, | |||
.btn-default.disabled.active, | |||
.btn-default[disabled].active, | |||
fieldset[disabled] .btn-default.active { | |||
background-color: #e0e0e0; | |||
background-image: none; | |||
} | |||
@@ -90,8 +125,23 @@ | |||
border-color: #245580; | |||
} | |||
.btn-primary.disabled, | |||
.btn-primary:disabled, | |||
.btn-primary[disabled] { | |||
.btn-primary[disabled], | |||
fieldset[disabled] .btn-primary, | |||
.btn-primary.disabled:hover, | |||
.btn-primary[disabled]:hover, | |||
fieldset[disabled] .btn-primary:hover, | |||
.btn-primary.disabled:focus, | |||
.btn-primary[disabled]:focus, | |||
fieldset[disabled] .btn-primary:focus, | |||
.btn-primary.disabled.focus, | |||
.btn-primary[disabled].focus, | |||
fieldset[disabled] .btn-primary.focus, | |||
.btn-primary.disabled:active, | |||
.btn-primary[disabled]:active, | |||
fieldset[disabled] .btn-primary:active, | |||
.btn-primary.disabled.active, | |||
.btn-primary[disabled].active, | |||
fieldset[disabled] .btn-primary.active { | |||
background-color: #265a88; | |||
background-image: none; | |||
} | |||
@@ -116,8 +166,23 @@ | |||
border-color: #3e8f3e; | |||
} | |||
.btn-success.disabled, | |||
.btn-success:disabled, | |||
.btn-success[disabled] { | |||
.btn-success[disabled], | |||
fieldset[disabled] .btn-success, | |||
.btn-success.disabled:hover, | |||
.btn-success[disabled]:hover, | |||
fieldset[disabled] .btn-success:hover, | |||
.btn-success.disabled:focus, | |||
.btn-success[disabled]:focus, | |||
fieldset[disabled] .btn-success:focus, | |||
.btn-success.disabled.focus, | |||
.btn-success[disabled].focus, | |||
fieldset[disabled] .btn-success.focus, | |||
.btn-success.disabled:active, | |||
.btn-success[disabled]:active, | |||
fieldset[disabled] .btn-success:active, | |||
.btn-success.disabled.active, | |||
.btn-success[disabled].active, | |||
fieldset[disabled] .btn-success.active { | |||
background-color: #419641; | |||
background-image: none; | |||
} | |||
@@ -142,8 +207,23 @@ | |||
border-color: #28a4c9; | |||
} | |||
.btn-info.disabled, | |||
.btn-info:disabled, | |||
.btn-info[disabled] { | |||
.btn-info[disabled], | |||
fieldset[disabled] .btn-info, | |||
.btn-info.disabled:hover, | |||
.btn-info[disabled]:hover, | |||
fieldset[disabled] .btn-info:hover, | |||
.btn-info.disabled:focus, | |||
.btn-info[disabled]:focus, | |||
fieldset[disabled] .btn-info:focus, | |||
.btn-info.disabled.focus, | |||
.btn-info[disabled].focus, | |||
fieldset[disabled] .btn-info.focus, | |||
.btn-info.disabled:active, | |||
.btn-info[disabled]:active, | |||
fieldset[disabled] .btn-info:active, | |||
.btn-info.disabled.active, | |||
.btn-info[disabled].active, | |||
fieldset[disabled] .btn-info.active { | |||
background-color: #2aabd2; | |||
background-image: none; | |||
} | |||
@@ -168,8 +248,23 @@ | |||
border-color: #e38d13; | |||
} | |||
.btn-warning.disabled, | |||
.btn-warning:disabled, | |||
.btn-warning[disabled] { | |||
.btn-warning[disabled], | |||
fieldset[disabled] .btn-warning, | |||
.btn-warning.disabled:hover, | |||
.btn-warning[disabled]:hover, | |||
fieldset[disabled] .btn-warning:hover, | |||
.btn-warning.disabled:focus, | |||
.btn-warning[disabled]:focus, | |||
fieldset[disabled] .btn-warning:focus, | |||
.btn-warning.disabled.focus, | |||
.btn-warning[disabled].focus, | |||
fieldset[disabled] .btn-warning.focus, | |||
.btn-warning.disabled:active, | |||
.btn-warning[disabled]:active, | |||
fieldset[disabled] .btn-warning:active, | |||
.btn-warning.disabled.active, | |||
.btn-warning[disabled].active, | |||
fieldset[disabled] .btn-warning.active { | |||
background-color: #eb9316; | |||
background-image: none; | |||
} | |||
@@ -194,8 +289,23 @@ | |||
border-color: #b92c28; | |||
} | |||
.btn-danger.disabled, | |||
.btn-danger:disabled, | |||
.btn-danger[disabled] { | |||
.btn-danger[disabled], | |||
fieldset[disabled] .btn-danger, | |||
.btn-danger.disabled:hover, | |||
.btn-danger[disabled]:hover, | |||
fieldset[disabled] .btn-danger:hover, | |||
.btn-danger.disabled:focus, | |||
.btn-danger[disabled]:focus, | |||
fieldset[disabled] .btn-danger:focus, | |||
.btn-danger.disabled.focus, | |||
.btn-danger[disabled].focus, | |||
fieldset[disabled] .btn-danger.focus, | |||
.btn-danger.disabled:active, | |||
.btn-danger[disabled]:active, | |||
fieldset[disabled] .btn-danger:active, | |||
.btn-danger.disabled.active, | |||
.btn-danger[disabled].active, | |||
fieldset[disabled] .btn-danger.active { | |||
background-color: #c12e2a; | |||
background-image: none; | |||
} | |||
@@ -260,6 +370,7 @@ | |||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0); | |||
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); | |||
background-repeat: repeat-x; | |||
border-radius: 4px; | |||
} | |||
.navbar-inverse .navbar-nav > .open > a, | |||
.navbar-inverse .navbar-nav > .active > a { |
@@ -1,4 +1,12 @@ | |||
/*! | |||
* Bootstrap Grunt task for the CommonJS module generation | |||
* http://getbootstrap.com | |||
* Copyright 2014-2015 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
'use strict'; | |||
var fs = require('fs'); | |||
var path = require('path'); | |||
@@ -15,8 +23,7 @@ module.exports = function generateCommonJSModule(grunt, srcFiles, destFilepath) | |||
var moduleOutputJs = COMMONJS_BANNER + srcFiles.map(srcPathToDestRequire).join('\n'); | |||
try { | |||
fs.writeFileSync(destFilepath, moduleOutputJs); | |||
} | |||
catch (err) { | |||
} catch (err) { | |||
grunt.fail.warn(err); | |||
} | |||
grunt.log.writeln('File ' + destFilepath.cyan + ' created.'); |
@@ -1,10 +1,12 @@ | |||
/*! | |||
* Bootstrap Grunt task for Glyphicons data generation | |||
* http://getbootstrap.com | |||
* Copyright 2014 Twitter, Inc. | |||
* Copyright 2014-2015 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
'use strict'; | |||
var fs = require('fs'); | |||
module.exports = function generateGlyphiconsData(grunt) { | |||
@@ -33,8 +35,7 @@ module.exports = function generateGlyphiconsData(grunt) { | |||
try { | |||
fs.writeFileSync(glyphiconsYml, glyphiconsData); | |||
} | |||
catch (err) { | |||
} catch (err) { | |||
grunt.fail.warn(err); | |||
} | |||
grunt.log.writeln('File ' + glyphiconsYml.cyan + ' created.'); |
@@ -1,15 +1,16 @@ | |||
/*! | |||
* Bootstrap Grunt task for parsing Less docstrings | |||
* http://getbootstrap.com | |||
* Copyright 2014 Twitter, Inc. | |||
* Copyright 2014-2015 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
'use strict'; | |||
var Remarkable = require('remarkable'); | |||
var Markdown = require('markdown-it'); | |||
function markdown2html(markdownString) { | |||
var md = new Remarkable(); | |||
var md = new Markdown(); | |||
// the slice removes the <p>...</p> wrapper output by Markdown processor | |||
return md.render(markdownString.trim()).slice(3, -5); | |||
@@ -121,7 +122,7 @@ Tokenizer.prototype._shift = function () { | |||
return new VarDocstring(match[1]); | |||
} | |||
var commentStart = line.lastIndexOf('//'); | |||
var varLine = (commentStart === -1) ? line : line.slice(0, commentStart); | |||
var varLine = commentStart === -1 ? line : line.slice(0, commentStart); | |||
match = VAR_ASSIGNMENT.exec(varLine); | |||
if (match !== null) { | |||
return new Variable(match[1], match[2]); | |||
@@ -168,8 +169,7 @@ Parser.prototype.parseSection = function () { | |||
var docstring = this._tokenizer.shift(); | |||
if (docstring instanceof SectionDocstring) { | |||
section.docstring = docstring; | |||
} | |||
else { | |||
} else { | |||
this._tokenizer.unshift(docstring); | |||
} | |||
this.parseSubSections(section); | |||
@@ -185,15 +185,14 @@ Parser.prototype.parseSubSections = function (section) { | |||
// Presume an implicit initial subsection | |||
subsection = new SubSection(''); | |||
this.parseVars(subsection); | |||
} | |||
else { | |||
} else { | |||
break; | |||
} | |||
} | |||
section.addSubSection(subsection); | |||
} | |||
if (section.subsections.length === 1 && !(section.subsections[0].heading) && section.subsections[0].variables.length === 0) { | |||
if (section.subsections.length === 1 && !section.subsections[0].heading && section.subsections[0].variables.length === 0) { | |||
// Ignore lone empty implicit subsection | |||
section.subsections = []; | |||
} |
@@ -1,28 +1,27 @@ | |||
/*! | |||
* Bootstrap Grunt task for generating raw-files.min.js for the Customizer | |||
* http://getbootstrap.com | |||
* Copyright 2014 Twitter, Inc. | |||
* Copyright 2014-2015 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
/* global btoa: true */ | |||
'use strict'; | |||
var fs = require('fs'); | |||
var btoa = require('btoa'); | |||
var glob = require('glob'); | |||
function getFiles(type) { | |||
var files = {}; | |||
var recursive = (type === 'less'); | |||
var globExpr = (recursive ? '/**/*' : '/*'); | |||
var recursive = type === 'less'; | |||
var globExpr = recursive ? '/**/*' : '/*'; | |||
glob.sync(type + globExpr) | |||
.filter(function (path) { | |||
return type === 'fonts' ? true : new RegExp('\\.' + type + '$').test(path); | |||
}) | |||
.forEach(function (fullPath) { | |||
var relativePath = fullPath.replace(/^[^/]+\//, ''); | |||
files[relativePath] = (type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8')); | |||
files[relativePath] = type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8'); | |||
}); | |||
return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'; | |||
} | |||
@@ -38,8 +37,7 @@ module.exports = function generateRawFilesJs(grunt, banner) { | |||
var rawFilesJs = 'docs/assets/js/raw-files.min.js'; | |||
try { | |||
fs.writeFileSync(rawFilesJs, files); | |||
} | |||
catch (err) { | |||
} catch (err) { | |||
grunt.fail.warn(err); | |||
} | |||
grunt.log.writeln('File ' + rawFilesJs.cyan + ' created.'); |
@@ -0,0 +1,109 @@ | |||
#!/usr/bin/env node | |||
'use strict'; | |||
/* globals Set */ | |||
/*! | |||
* Script to update version number references in the project. | |||
* Copyright 2015 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
var fs = require('fs'); | |||
var path = require('path'); | |||
var sh = require('shelljs'); | |||
sh.config.fatal = true; | |||
var sed = sh.sed; | |||
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37 | |||
RegExp.quote = function (string) { | |||
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&'); | |||
}; | |||
RegExp.quoteReplacement = function (string) { | |||
return string.replace(/[$]/g, '$$'); | |||
}; | |||
var DRY_RUN = false; | |||
function walkAsync(directory, excludedDirectories, fileCallback, errback) { | |||
if (excludedDirectories.has(path.parse(directory).base)) { | |||
return; | |||
} | |||
fs.readdir(directory, function (err, names) { | |||
if (err) { | |||
errback(err); | |||
return; | |||
} | |||
names.forEach(function (name) { | |||
var filepath = path.join(directory, name); | |||
fs.lstat(filepath, function (err, stats) { | |||
if (err) { | |||
process.nextTick(errback, err); | |||
return; | |||
} | |||
if (stats.isSymbolicLink()) { | |||
return; | |||
} | |||
else if (stats.isDirectory()) { | |||
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback); | |||
} | |||
else if (stats.isFile()) { | |||
process.nextTick(fileCallback, filepath); | |||
} | |||
}); | |||
}); | |||
}); | |||
} | |||
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) { | |||
original = new RegExp(RegExp.quote(original), 'g'); | |||
replacement = RegExp.quoteReplacement(replacement); | |||
var updateFile = !DRY_RUN ? function (filepath) { | |||
if (allowedExtensions.has(path.parse(filepath).ext)) { | |||
sed('-i', original, replacement, filepath); | |||
} | |||
} : function (filepath) { | |||
if (allowedExtensions.has(path.parse(filepath).ext)) { | |||
console.log('FILE: ' + filepath); | |||
} | |||
else { | |||
console.log('EXCLUDED:' + filepath); | |||
} | |||
}; | |||
walkAsync(directory, excludedDirectories, updateFile, function (err) { | |||
console.error('ERROR while traversing directory!:'); | |||
console.error(err); | |||
process.exit(1); | |||
}); | |||
} | |||
function main(args) { | |||
if (args.length !== 2) { | |||
console.error('USAGE: change-version old_version new_version'); | |||
console.error('Got arguments:', args); | |||
process.exit(1); | |||
} | |||
var oldVersion = args[0]; | |||
var newVersion = args[1]; | |||
var EXCLUDED_DIRS = new Set([ | |||
'.git', | |||
'node_modules', | |||
'vendor' | |||
]); | |||
var INCLUDED_EXTENSIONS = new Set([ | |||
// This extension whitelist is how we avoid modifying binary files | |||
'', | |||
'.css', | |||
'.html', | |||
'.js', | |||
'.json', | |||
'.less', | |||
'.md', | |||
'.nuspec', | |||
'.ps1', | |||
'.scss', | |||
'.txt', | |||
'.yml' | |||
]); | |||
replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion); | |||
} | |||
main(process.argv.slice(2)); |
@@ -11,8 +11,9 @@ | |||
"../assets/js/src/customizer.js" | |||
], | |||
"docsJs": [ | |||
"../assets/js/vendor/holder.js", | |||
"../assets/js/vendor/holder.min.js", | |||
"../assets/js/vendor/ZeroClipboard.min.js", | |||
"../assets/js/vendor/anchor.min.js", | |||
"../assets/js/src/application.js" | |||
] | |||
}, | |||
@@ -36,10 +37,10 @@ | |||
"+function ($) {", | |||
" 'use strict';", | |||
" var version = $.fn.jquery.split(' ')[0].split('.')", | |||
" if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {", | |||
" throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher')", | |||
" if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {", | |||
" throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')", | |||
" }", | |||
"}(jQuery);\n\n" | |||
] | |||
} | |||
} | |||
} |
@@ -56,8 +56,8 @@ | |||
{ | |||
browserName: "iphone", | |||
platform: "OS X 10.9", | |||
version: "8.1" | |||
platform: "OS X 10.10", | |||
version: "9.2" | |||
}, | |||
# iOS Chrome not currently supported by Sauce Labs |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: affix.js v3.3.2 | |||
* Bootstrap: affix.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#affix | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -21,14 +21,14 @@ | |||
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) | |||
this.$element = $(element) | |||
this.affixed = | |||
this.unpin = | |||
this.affixed = null | |||
this.unpin = null | |||
this.pinnedOffset = null | |||
this.checkPosition() | |||
} | |||
Affix.VERSION = '3.3.2' | |||
Affix.VERSION = '3.3.7' | |||
Affix.RESET = 'affix affix-top affix-bottom' | |||
@@ -78,7 +78,7 @@ | |||
var offset = this.options.offset | |||
var offsetTop = offset.top | |||
var offsetBottom = offset.bottom | |||
var scrollHeight = $('body').height() | |||
var scrollHeight = Math.max($(document).height(), $(document.body).height()) | |||
if (typeof offset != 'object') offsetBottom = offsetTop = offset | |||
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: alert.js v3.3.2 | |||
* Bootstrap: alert.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#alerts | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -18,7 +18,7 @@ | |||
$(el).on('click', dismiss, this.close) | |||
} | |||
Alert.VERSION = '3.3.2' | |||
Alert.VERSION = '3.3.7' | |||
Alert.TRANSITION_DURATION = 150 | |||
@@ -31,7 +31,7 @@ | |||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | |||
} | |||
var $parent = $(selector) | |||
var $parent = $(selector === '#' ? [] : selector) | |||
if (e) e.preventDefault() | |||
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: button.js v3.3.2 | |||
* Bootstrap: button.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#buttons | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -19,7 +19,7 @@ | |||
this.isLoading = false | |||
} | |||
Button.VERSION = '3.3.2' | |||
Button.VERSION = '3.3.7' | |||
Button.DEFAULTS = { | |||
loadingText: 'loading...' | |||
@@ -31,7 +31,7 @@ | |||
var val = $el.is('input') ? 'val' : 'html' | |||
var data = $el.data() | |||
state = state + 'Text' | |||
state += 'Text' | |||
if (data.resetText == null) $el.data('resetText', $el[val]()) | |||
@@ -41,10 +41,10 @@ | |||
if (state == 'loadingText') { | |||
this.isLoading = true | |||
$el.addClass(d).attr(d, d) | |||
$el.addClass(d).attr(d, d).prop(d, true) | |||
} else if (this.isLoading) { | |||
this.isLoading = false | |||
$el.removeClass(d).removeAttr(d) | |||
$el.removeClass(d).removeAttr(d).prop(d, false) | |||
} | |||
}, this), 0) | |||
} | |||
@@ -56,15 +56,19 @@ | |||
if ($parent.length) { | |||
var $input = this.$element.find('input') | |||
if ($input.prop('type') == 'radio') { | |||
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false | |||
else $parent.find('.active').removeClass('active') | |||
if ($input.prop('checked')) changed = false | |||
$parent.find('.active').removeClass('active') | |||
this.$element.addClass('active') | |||
} else if ($input.prop('type') == 'checkbox') { | |||
if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false | |||
this.$element.toggleClass('active') | |||
} | |||
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') | |||
$input.prop('checked', this.$element.hasClass('active')) | |||
if (changed) $input.trigger('change') | |||
} else { | |||
this.$element.attr('aria-pressed', !this.$element.hasClass('active')) | |||
this.$element.toggleClass('active') | |||
} | |||
if (changed) this.$element.toggleClass('active') | |||
} | |||
@@ -104,10 +108,15 @@ | |||
$(document) | |||
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { | |||
var $btn = $(e.target) | |||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') | |||
var $btn = $(e.target).closest('.btn') | |||
Plugin.call($btn, 'toggle') | |||
e.preventDefault() | |||
if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { | |||
// Prevent double click on radios, and the double selections (so cancellation) on checkboxes | |||
e.preventDefault() | |||
// The target component still receive the focus | |||
if ($btn.is('input,button')) $btn.trigger('focus') | |||
else $btn.find('input:visible,button:visible').first().trigger('focus') | |||
} | |||
}) | |||
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { | |||
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: carousel.js v3.3.2 | |||
* Bootstrap: carousel.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#carousel | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -17,10 +17,10 @@ | |||
this.$element = $(element) | |||
this.$indicators = this.$element.find('.carousel-indicators') | |||
this.options = options | |||
this.paused = | |||
this.sliding = | |||
this.interval = | |||
this.$active = | |||
this.paused = null | |||
this.sliding = null | |||
this.interval = null | |||
this.$active = null | |||
this.$items = null | |||
this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) | |||
@@ -30,7 +30,7 @@ | |||
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) | |||
} | |||
Carousel.VERSION = '3.3.2' | |||
Carousel.VERSION = '3.3.7' | |||
Carousel.TRANSITION_DURATION = 600 | |||
@@ -1,11 +1,12 @@ | |||
/* ======================================================================== | |||
* Bootstrap: collapse.js v3.3.2 | |||
* Bootstrap: collapse.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#collapse | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
/* jshint latedef: false */ | |||
+function ($) { | |||
'use strict'; | |||
@@ -16,7 +17,8 @@ | |||
var Collapse = function (element, options) { | |||
this.$element = $(element) | |||
this.options = $.extend({}, Collapse.DEFAULTS, options) | |||
this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]') | |||
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + | |||
'[data-toggle="collapse"][data-target="#' + element.id + '"]') | |||
this.transitioning = null | |||
if (this.options.parent) { | |||
@@ -28,13 +30,12 @@ | |||
if (this.options.toggle) this.toggle() | |||
} | |||
Collapse.VERSION = '3.3.2' | |||
Collapse.VERSION = '3.3.7' | |||
Collapse.TRANSITION_DURATION = 350 | |||
Collapse.DEFAULTS = { | |||
toggle: true, | |||
trigger: '[data-toggle="collapse"]' | |||
toggle: true | |||
} | |||
Collapse.prototype.dimension = function () { | |||
@@ -172,7 +173,7 @@ | |||
var data = $this.data('bs.collapse') | |||
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) | |||
if (!data && options.toggle && option == 'show') options.toggle = false | |||
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false | |||
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) | |||
if (typeof option == 'string') data[option]() | |||
}) | |||
@@ -203,7 +204,7 @@ | |||
var $target = getTargetFromTrigger($this) | |||
var data = $target.data('bs.collapse') | |||
var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this }) | |||
var option = data ? 'toggle' : $this.data() | |||
Plugin.call($target, option) | |||
}) |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: dropdown.js v3.3.2 | |||
* Bootstrap: dropdown.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#dropdowns | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -19,7 +19,41 @@ | |||
$(element).on('click.bs.dropdown', this.toggle) | |||
} | |||
Dropdown.VERSION = '3.3.2' | |||
Dropdown.VERSION = '3.3.7' | |||
function getParent($this) { | |||
var selector = $this.attr('data-target') | |||
if (!selector) { | |||
selector = $this.attr('href') | |||
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | |||
} | |||
var $parent = selector && $(selector) | |||
return $parent && $parent.length ? $parent : $this.parent() | |||
} | |||
function clearMenus(e) { | |||
if (e && e.which === 3) return | |||
$(backdrop).remove() | |||
$(toggle).each(function () { | |||
var $this = $(this) | |||
var $parent = getParent($this) | |||
var relatedTarget = { relatedTarget: this } | |||
if (!$parent.hasClass('open')) return | |||
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return | |||
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) | |||
if (e.isDefaultPrevented()) return | |||
$this.attr('aria-expanded', 'false') | |||
$parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) | |||
}) | |||
} | |||
Dropdown.prototype.toggle = function (e) { | |||
var $this = $(this) | |||
@@ -34,7 +68,10 @@ | |||
if (!isActive) { | |||
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { | |||
// if mobile we use a backdrop because click events don't delegate | |||
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) | |||
$(document.createElement('div')) | |||
.addClass('dropdown-backdrop') | |||
.insertAfter($(this)) | |||
.on('click', clearMenus) | |||
} | |||
var relatedTarget = { relatedTarget: this } | |||
@@ -48,7 +85,7 @@ | |||
$parent | |||
.toggleClass('open') | |||
.trigger('shown.bs.dropdown', relatedTarget) | |||
.trigger($.Event('shown.bs.dropdown', relatedTarget)) | |||
} | |||
return false | |||
@@ -67,57 +104,25 @@ | |||
var $parent = getParent($this) | |||
var isActive = $parent.hasClass('open') | |||
if ((!isActive && e.which != 27) || (isActive && e.which == 27)) { | |||
if (!isActive && e.which != 27 || isActive && e.which == 27) { | |||
if (e.which == 27) $parent.find(toggle).trigger('focus') | |||
return $this.trigger('click') | |||
} | |||
var desc = ' li:not(.divider):visible a' | |||
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) | |||
var desc = ' li:not(.disabled):visible a' | |||
var $items = $parent.find('.dropdown-menu' + desc) | |||
if (!$items.length) return | |||
var index = $items.index(e.target) | |||
if (e.which == 38 && index > 0) index-- // up | |||
if (e.which == 40 && index < $items.length - 1) index++ // down | |||
if (!~index) index = 0 | |||
if (e.which == 38 && index > 0) index-- // up | |||
if (e.which == 40 && index < $items.length - 1) index++ // down | |||
if (!~index) index = 0 | |||
$items.eq(index).trigger('focus') | |||
} | |||
function clearMenus(e) { | |||
if (e && e.which === 3) return | |||
$(backdrop).remove() | |||
$(toggle).each(function () { | |||
var $this = $(this) | |||
var $parent = getParent($this) | |||
var relatedTarget = { relatedTarget: this } | |||
if (!$parent.hasClass('open')) return | |||
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) | |||
if (e.isDefaultPrevented()) return | |||
$this.attr('aria-expanded', 'false') | |||
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) | |||
}) | |||
} | |||
function getParent($this) { | |||
var selector = $this.attr('data-target') | |||
if (!selector) { | |||
selector = $this.attr('href') | |||
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | |||
} | |||
var $parent = selector && $(selector) | |||
return $parent && $parent.length ? $parent : $this.parent() | |||
} | |||
// DROPDOWN PLUGIN DEFINITION | |||
// ========================== | |||
@@ -155,7 +160,6 @@ | |||
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | |||
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) | |||
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) | |||
.on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown) | |||
.on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown) | |||
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) | |||
}(jQuery); |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: modal.js v3.3.2 | |||
* Bootstrap: modal.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#modals | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -14,12 +14,15 @@ | |||
// ====================== | |||
var Modal = function (element, options) { | |||
this.options = options | |||
this.$body = $(document.body) | |||
this.$element = $(element) | |||
this.$backdrop = | |||
this.isShown = null | |||
this.scrollbarWidth = 0 | |||
this.options = options | |||
this.$body = $(document.body) | |||
this.$element = $(element) | |||
this.$dialog = this.$element.find('.modal-dialog') | |||
this.$backdrop = null | |||
this.isShown = null | |||
this.originalBodyPad = null | |||
this.scrollbarWidth = 0 | |||
this.ignoreBackdropClick = false | |||
if (this.options.remote) { | |||
this.$element | |||
@@ -30,7 +33,7 @@ | |||
} | |||
} | |||
Modal.VERSION = '3.3.2' | |||
Modal.VERSION = '3.3.7' | |||
Modal.TRANSITION_DURATION = 300 | |||
Modal.BACKDROP_TRANSITION_DURATION = 150 | |||
@@ -64,6 +67,12 @@ | |||
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) | |||
this.$dialog.on('mousedown.dismiss.bs.modal', function () { | |||
that.$element.one('mouseup.dismiss.bs.modal', function (e) { | |||
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true | |||
}) | |||
}) | |||
this.backdrop(function () { | |||
var transition = $.support.transition && that.$element.hasClass('fade') | |||
@@ -75,23 +84,20 @@ | |||
.show() | |||
.scrollTop(0) | |||
if (that.options.backdrop) that.adjustBackdrop() | |||
that.adjustDialog() | |||
if (transition) { | |||
that.$element[0].offsetWidth // force reflow | |||
} | |||
that.$element | |||
.addClass('in') | |||
.attr('aria-hidden', false) | |||
that.$element.addClass('in') | |||
that.enforceFocus() | |||
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) | |||
transition ? | |||
that.$element.find('.modal-dialog') // wait for modal to slide in | |||
that.$dialog // wait for modal to slide in | |||
.one('bsTransitionEnd', function () { | |||
that.$element.trigger('focus').trigger(e) | |||
}) | |||
@@ -118,8 +124,10 @@ | |||
this.$element | |||
.removeClass('in') | |||
.attr('aria-hidden', true) | |||
.off('click.dismiss.bs.modal') | |||
.off('mouseup.dismiss.bs.modal') | |||
this.$dialog.off('mousedown.dismiss.bs.modal') | |||
$.support.transition && this.$element.hasClass('fade') ? | |||
this.$element | |||
@@ -132,7 +140,9 @@ | |||
$(document) | |||
.off('focusin.bs.modal') // guard against infinite focus loop | |||
.on('focusin.bs.modal', $.proxy(function (e) { | |||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { | |||
if (document !== e.target && | |||
this.$element[0] !== e.target && | |||
!this.$element.has(e.target).length) { | |||
this.$element.trigger('focus') | |||
} | |||
}, this)) | |||
@@ -179,14 +189,20 @@ | |||
if (this.isShown && this.options.backdrop) { | |||
var doAnimate = $.support.transition && animate | |||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') | |||
.prependTo(this.$element) | |||
.on('click.dismiss.bs.modal', $.proxy(function (e) { | |||
if (e.target !== e.currentTarget) return | |||
this.options.backdrop == 'static' | |||
? this.$element[0].focus.call(this.$element[0]) | |||
: this.hide.call(this) | |||
}, this)) | |||
this.$backdrop = $(document.createElement('div')) | |||
.addClass('modal-backdrop ' + animate) | |||
.appendTo(this.$body) | |||
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { | |||
if (this.ignoreBackdropClick) { | |||
this.ignoreBackdropClick = false | |||
return | |||
} | |||
if (e.target !== e.currentTarget) return | |||
this.options.backdrop == 'static' | |||
? this.$element[0].focus() | |||
: this.hide() | |||
}, this)) | |||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow | |||
@@ -221,16 +237,9 @@ | |||
// these following methods are used to handle overflowing modals | |||
Modal.prototype.handleUpdate = function () { | |||
if (this.options.backdrop) this.adjustBackdrop() | |||
this.adjustDialog() | |||
} | |||
Modal.prototype.adjustBackdrop = function () { | |||
this.$backdrop | |||
.css('height', 0) | |||
.css('height', this.$element[0].scrollHeight) | |||
} | |||
Modal.prototype.adjustDialog = function () { | |||
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight | |||
@@ -248,17 +257,23 @@ | |||
} | |||
Modal.prototype.checkScrollbar = function () { | |||
this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight | |||
var fullWindowWidth = window.innerWidth | |||
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 | |||
var documentElementRect = document.documentElement.getBoundingClientRect() | |||
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) | |||
} | |||
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth | |||
this.scrollbarWidth = this.measureScrollbar() | |||
} | |||
Modal.prototype.setScrollbar = function () { | |||
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) | |||
this.originalBodyPad = document.body.style.paddingRight || '' | |||
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) | |||
} | |||
Modal.prototype.resetScrollbar = function () { | |||
this.$body.css('padding-right', '') | |||
this.$body.css('padding-right', this.originalBodyPad) | |||
} | |||
Modal.prototype.measureScrollbar = function () { // thx walsh |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: popover.js v3.3.2 | |||
* Bootstrap: popover.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#popovers | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -19,7 +19,7 @@ | |||
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') | |||
Popover.VERSION = '3.3.2' | |||
Popover.VERSION = '3.3.7' | |||
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { | |||
placement: 'right', | |||
@@ -75,11 +75,6 @@ | |||
return (this.$arrow = this.$arrow || this.tip().find('.arrow')) | |||
} | |||
Popover.prototype.tip = function () { | |||
if (!this.$tip) this.$tip = $(this.options.template) | |||
return this.$tip | |||
} | |||
// POPOVER PLUGIN DEFINITION | |||
// ========================= | |||
@@ -90,7 +85,7 @@ | |||
var data = $this.data('bs.popover') | |||
var options = typeof option == 'object' && option | |||
if (!data && option == 'destroy') return | |||
if (!data && /destroy|hide/.test(option)) return | |||
if (!data) $this.data('bs.popover', (data = new Popover(this, options))) | |||
if (typeof option == 'string') data[option]() | |||
}) |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: scrollspy.js v3.3.2 | |||
* Bootstrap: scrollspy.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#scrollspy | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -14,10 +14,8 @@ | |||
// ========================== | |||
function ScrollSpy(element, options) { | |||
var process = $.proxy(this.process, this) | |||
this.$body = $('body') | |||
this.$scrollElement = $(element).is('body') ? $(window) : $(element) | |||
this.$body = $(document.body) | |||
this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) | |||
this.options = $.extend({}, ScrollSpy.DEFAULTS, options) | |||
this.selector = (this.options.target || '') + ' .nav li > a' | |||
this.offsets = [] | |||
@@ -25,12 +23,12 @@ | |||
this.activeTarget = null | |||
this.scrollHeight = 0 | |||
this.$scrollElement.on('scroll.bs.scrollspy', process) | |||
this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) | |||
this.refresh() | |||
this.process() | |||
} | |||
ScrollSpy.VERSION = '3.3.2' | |||
ScrollSpy.VERSION = '3.3.7' | |||
ScrollSpy.DEFAULTS = { | |||
offset: 10 | |||
@@ -41,20 +39,19 @@ | |||
} | |||
ScrollSpy.prototype.refresh = function () { | |||
var offsetMethod = 'offset' | |||
var offsetBase = 0 | |||
var that = this | |||
var offsetMethod = 'offset' | |||
var offsetBase = 0 | |||
this.offsets = [] | |||
this.targets = [] | |||
this.scrollHeight = this.getScrollHeight() | |||
if (!$.isWindow(this.$scrollElement[0])) { | |||
offsetMethod = 'position' | |||
offsetBase = this.$scrollElement.scrollTop() | |||
} | |||
this.offsets = [] | |||
this.targets = [] | |||
this.scrollHeight = this.getScrollHeight() | |||
var self = this | |||
this.$body | |||
.find(this.selector) | |||
.map(function () { | |||
@@ -69,8 +66,8 @@ | |||
}) | |||
.sort(function (a, b) { return a[0] - b[0] }) | |||
.each(function () { | |||
self.offsets.push(this[0]) | |||
self.targets.push(this[1]) | |||
that.offsets.push(this[0]) | |||
that.targets.push(this[1]) | |||
}) | |||
} | |||
@@ -99,7 +96,7 @@ | |||
for (i = offsets.length; i--;) { | |||
activeTarget != targets[i] | |||
&& scrollTop >= offsets[i] | |||
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1]) | |||
&& (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) | |||
&& this.activate(targets[i]) | |||
} | |||
} | |||
@@ -110,8 +107,8 @@ | |||
this.clear() | |||
var selector = this.selector + | |||
'[data-target="' + target + '"],' + | |||
this.selector + '[href="' + target + '"]' | |||
'[data-target="' + target + '"],' + | |||
this.selector + '[href="' + target + '"]' | |||
var active = $(selector) | |||
.parents('li') |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: tab.js v3.3.2 | |||
* Bootstrap: tab.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#tabs | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -14,10 +14,12 @@ | |||
// ==================== | |||
var Tab = function (element) { | |||
// jscs:disable requireDollarBeforejQueryAssignment | |||
this.element = $(element) | |||
// jscs:enable requireDollarBeforejQueryAssignment | |||
} | |||
Tab.VERSION = '3.3.2' | |||
Tab.VERSION = '3.3.7' | |||
Tab.TRANSITION_DURATION = 150 | |||
@@ -65,7 +67,7 @@ | |||
var $active = container.find('> .active') | |||
var transition = callback | |||
&& $.support.transition | |||
&& (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length) | |||
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) | |||
function next() { | |||
$active | |||
@@ -88,7 +90,7 @@ | |||
element.removeClass('fade') | |||
} | |||
if (element.parent('.dropdown-menu')) { | |||
if (element.parent('.dropdown-menu').length) { | |||
element | |||
.closest('li.dropdown') | |||
.addClass('active') |
@@ -1,9 +1,9 @@ | |||
/* ======================================================================== | |||
* Bootstrap: tooltip.js v3.3.2 | |||
* Bootstrap: tooltip.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#tooltip | |||
* Inspired by the original jQuery.tipsy by Jason Frame | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -15,17 +15,18 @@ | |||
// =============================== | |||
var Tooltip = function (element, options) { | |||
this.type = | |||
this.options = | |||
this.enabled = | |||
this.timeout = | |||
this.hoverState = | |||
this.type = null | |||
this.options = null | |||
this.enabled = null | |||
this.timeout = null | |||
this.hoverState = null | |||
this.$element = null | |||
this.inState = null | |||
this.init('tooltip', element, options) | |||
} | |||
Tooltip.VERSION = '3.3.2' | |||
Tooltip.VERSION = '3.3.7' | |||
Tooltip.TRANSITION_DURATION = 150 | |||
@@ -50,7 +51,12 @@ | |||
this.type = type | |||
this.$element = $(element) | |||
this.options = this.getOptions(options) | |||
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport) | |||
this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) | |||
this.inState = { click: false, hover: false, focus: false } | |||
if (this.$element[0] instanceof document.constructor && !this.options.selector) { | |||
throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') | |||
} | |||
var triggers = this.options.trigger.split(' ') | |||
@@ -105,16 +111,20 @@ | |||
var self = obj instanceof this.constructor ? | |||
obj : $(obj.currentTarget).data('bs.' + this.type) | |||
if (self && self.$tip && self.$tip.is(':visible')) { | |||
self.hoverState = 'in' | |||
return | |||
} | |||
if (!self) { | |||
self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) | |||
$(obj.currentTarget).data('bs.' + this.type, self) | |||
} | |||
if (obj instanceof $.Event) { | |||
self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true | |||
} | |||
if (self.tip().hasClass('in') || self.hoverState == 'in') { | |||
self.hoverState = 'in' | |||
return | |||
} | |||
clearTimeout(self.timeout) | |||
self.hoverState = 'in' | |||
@@ -126,6 +136,14 @@ | |||
}, self.options.delay.show) | |||
} | |||
Tooltip.prototype.isInStateTrue = function () { | |||
for (var key in this.inState) { | |||
if (this.inState[key]) return true | |||
} | |||
return false | |||
} | |||
Tooltip.prototype.leave = function (obj) { | |||
var self = obj instanceof this.constructor ? | |||
obj : $(obj.currentTarget).data('bs.' + this.type) | |||
@@ -135,6 +153,12 @@ | |||
$(obj.currentTarget).data('bs.' + this.type, self) | |||
} | |||
if (obj instanceof $.Event) { | |||
self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false | |||
} | |||
if (self.isInStateTrue()) return | |||
clearTimeout(self.timeout) | |||
self.hoverState = 'out' | |||
@@ -181,6 +205,7 @@ | |||
.data('bs.' + this.type, this) | |||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) | |||
this.$element.trigger('inserted.bs.' + this.type) | |||
var pos = this.getPosition() | |||
var actualWidth = $tip[0].offsetWidth | |||
@@ -188,13 +213,12 @@ | |||
if (autoPlace) { | |||
var orgPlacement = placement | |||
var $container = this.options.container ? $(this.options.container) : this.$element.parent() | |||
var containerDim = this.getPosition($container) | |||
var viewportDim = this.getPosition(this.$viewport) | |||
placement = placement == 'bottom' && pos.bottom + actualHeight > containerDim.bottom ? 'top' : | |||
placement == 'top' && pos.top - actualHeight < containerDim.top ? 'bottom' : | |||
placement == 'right' && pos.right + actualWidth > containerDim.width ? 'left' : | |||
placement == 'left' && pos.left - actualWidth < containerDim.left ? 'right' : | |||
placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : | |||
placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : | |||
placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : | |||
placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : | |||
placement | |||
$tip | |||
@@ -235,8 +259,8 @@ | |||
if (isNaN(marginTop)) marginTop = 0 | |||
if (isNaN(marginLeft)) marginLeft = 0 | |||
offset.top = offset.top + marginTop | |||
offset.left = offset.left + marginLeft | |||
offset.top += marginTop | |||
offset.left += marginLeft | |||
// $.fn.offset doesn't round pixel values | |||
// so we use setOffset directly with our own function B-0 | |||
@@ -272,10 +296,10 @@ | |||
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) | |||
} | |||
Tooltip.prototype.replaceArrow = function (delta, dimension, isHorizontal) { | |||
Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { | |||
this.arrow() | |||
.css(isHorizontal ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') | |||
.css(isHorizontal ? 'top' : 'left', '') | |||
.css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') | |||
.css(isVertical ? 'top' : 'left', '') | |||
} | |||
Tooltip.prototype.setContent = function () { | |||
@@ -288,14 +312,16 @@ | |||
Tooltip.prototype.hide = function (callback) { | |||
var that = this | |||
var $tip = this.tip() | |||
var $tip = $(this.$tip) | |||
var e = $.Event('hide.bs.' + this.type) | |||
function complete() { | |||
if (that.hoverState != 'in') $tip.detach() | |||
that.$element | |||
.removeAttr('aria-describedby') | |||
.trigger('hidden.bs.' + that.type) | |||
if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. | |||
that.$element | |||
.removeAttr('aria-describedby') | |||
.trigger('hidden.bs.' + that.type) | |||
} | |||
callback && callback() | |||
} | |||
@@ -305,7 +331,7 @@ | |||
$tip.removeClass('in') | |||
$.support.transition && this.$tip.hasClass('fade') ? | |||
$.support.transition && $tip.hasClass('fade') ? | |||
$tip | |||
.one('bsTransitionEnd', complete) | |||
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : | |||
@@ -318,7 +344,7 @@ | |||
Tooltip.prototype.fixTitle = function () { | |||
var $e = this.$element | |||
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') { | |||
if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { | |||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '') | |||
} | |||
} | |||
@@ -338,7 +364,10 @@ | |||
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 | |||
elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) | |||
} | |||
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset() | |||
var isSvg = window.SVGElement && el instanceof window.SVGElement | |||
// Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. | |||
// See https://github.com/twbs/bootstrap/issues/20280 | |||
var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) | |||
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } | |||
var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null | |||
@@ -373,7 +402,7 @@ | |||
var rightEdgeOffset = pos.left + viewportPadding + actualWidth | |||
if (leftEdgeOffset < viewportDimensions.left) { // left overflow | |||
delta.left = viewportDimensions.left - leftEdgeOffset | |||
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow | |||
} else if (rightEdgeOffset > viewportDimensions.right) { // right overflow | |||
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset | |||
} | |||
} | |||
@@ -399,7 +428,13 @@ | |||
} | |||
Tooltip.prototype.tip = function () { | |||
return (this.$tip = this.$tip || $(this.options.template)) | |||
if (!this.$tip) { | |||
this.$tip = $(this.options.template) | |||
if (this.$tip.length != 1) { | |||
throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') | |||
} | |||
} | |||
return this.$tip | |||
} | |||
Tooltip.prototype.arrow = function () { | |||
@@ -428,7 +463,13 @@ | |||
} | |||
} | |||
self.tip().hasClass('in') ? self.leave(self) : self.enter(self) | |||
if (e) { | |||
self.inState.click = !self.inState.click | |||
if (self.isInStateTrue()) self.enter(self) | |||
else self.leave(self) | |||
} else { | |||
self.tip().hasClass('in') ? self.leave(self) : self.enter(self) | |||
} | |||
} | |||
Tooltip.prototype.destroy = function () { | |||
@@ -436,6 +477,13 @@ | |||
clearTimeout(this.timeout) | |||
this.hide(function () { | |||
that.$element.off('.' + that.type).removeData('bs.' + that.type) | |||
if (that.$tip) { | |||
that.$tip.detach() | |||
} | |||
that.$tip = null | |||
that.$arrow = null | |||
that.$viewport = null | |||
that.$element = null | |||
}) | |||
} | |||
@@ -449,7 +497,7 @@ | |||
var data = $this.data('bs.tooltip') | |||
var options = typeof option == 'object' && option | |||
if (!data && option == 'destroy') return | |||
if (!data && /destroy|hide/.test(option)) return | |||
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) | |||
if (typeof option == 'string') data[option]() | |||
}) |
@@ -1,8 +1,8 @@ | |||
/* ======================================================================== | |||
* Bootstrap: transition.js v3.3.2 | |||
* Bootstrap: transition.js v3.3.7 | |||
* http://getbootstrap.com/javascript/#transitions | |||
* ======================================================================== | |||
* Copyright 2011-2015 Twitter, Inc. | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
* ======================================================================== */ | |||
@@ -18,7 +18,7 @@ | |||
// Specified for the h4 to prevent conflicts of changing @headings-color | |||
color: inherit; | |||
} | |||
// Provide class for links that match alerts | |||
.alert-link { | |||
font-weight: @alert-link-font-weight; | |||
@@ -29,7 +29,7 @@ | |||
> ul { | |||
margin-bottom: 0; | |||
} | |||
> p + p { | |||
margin-top: 5px; | |||
} |
@@ -12,7 +12,7 @@ | |||
font-weight: @badge-font-weight; | |||
color: @badge-color; | |||
line-height: @badge-line-height; | |||
vertical-align: baseline; | |||
vertical-align: middle; | |||
white-space: nowrap; | |||
text-align: center; | |||
background-color: @badge-bg; | |||
@@ -28,8 +28,9 @@ | |||
position: relative; | |||
top: -1px; | |||
} | |||
.btn-xs & { | |||
.btn-xs &, | |||
.btn-group-xs > .btn & { | |||
top: 0; | |||
padding: 1px 5px; | |||
} | |||
@@ -50,15 +51,15 @@ | |||
color: @badge-active-color; | |||
background-color: @badge-active-bg; | |||
} | |||
.list-group-item > & { | |||
float: right; | |||
} | |||
.list-group-item > & + & { | |||
margin-right: 5px; | |||
} | |||
.nav-pills > li > a > & { | |||
margin-left: 3px; | |||
} |
@@ -1,3 +1,9 @@ | |||
/*! | |||
* Bootstrap v3.3.7 (http://getbootstrap.com) | |||
* Copyright 2011-2016 Twitter, Inc. | |||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |||
*/ | |||
// Core variables and mixins | |||
@import "variables.less"; | |||
@import "mixins.less"; |
@@ -36,6 +36,7 @@ | |||
margin-left: -5px; // Offset the first child's margin | |||
&:extend(.clearfix all); | |||
.btn, | |||
.btn-group, | |||
.input-group { | |||
float: left; | |||
@@ -58,7 +59,7 @@ | |||
.border-right-radius(0); | |||
} | |||
} | |||
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it | |||
// Need .dropdown-toggle since :last-child doesn't apply, given that a .dropdown-menu is used immediately after it | |||
.btn-group > .btn:last-child:not(:first-child), | |||
.btn-group > .dropdown-toggle:not(:first-child) { | |||
.border-left-radius(0); | |||
@@ -172,12 +173,12 @@ | |||
border-radius: 0; | |||
} | |||
&:first-child:not(:last-child) { | |||
border-top-right-radius: @border-radius-base; | |||
.border-top-radius(@btn-border-radius-base); | |||
.border-bottom-radius(0); | |||
} | |||
&:last-child:not(:first-child) { | |||
border-bottom-left-radius: @border-radius-base; | |||
.border-top-radius(0); | |||
.border-bottom-radius(@btn-border-radius-base); | |||
} | |||
} | |||
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { |
@@ -17,7 +17,7 @@ | |||
background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 | |||
border: 1px solid transparent; | |||
white-space: nowrap; | |||
.button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @border-radius-base); | |||
.button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @btn-border-radius-base); | |||
.user-select(none); | |||
&, | |||
@@ -47,10 +47,16 @@ | |||
&[disabled], | |||
fieldset[disabled] & { | |||
cursor: @cursor-disabled; | |||
pointer-events: none; // Future-proof disabling of clicks | |||
.opacity(.65); | |||
.box-shadow(none); | |||
} | |||
a& { | |||
&.disabled, | |||
fieldset[disabled] & { | |||
pointer-events: none; // Future-proof disabling of clicks on `<a>` elements | |||
} | |||
} | |||
} | |||
@@ -126,14 +132,14 @@ | |||
.btn-lg { | |||
// line-height: ensure even-numbered height of button next to large input | |||
.button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large); | |||
.button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-large); | |||
} | |||
.btn-sm { | |||
// line-height: ensure proper height of button next to small input | |||
.button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small); | |||
.button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small); | |||
} | |||
.btn-xs { | |||
.button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small); | |||
.button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small); | |||
} | |||
@@ -29,7 +29,7 @@ | |||
@media all and (transform-3d), (-webkit-transform-3d) { | |||
.transition-transform(~'0.6s ease-in-out'); | |||
.backface-visibility(~'hidden'); | |||
.perspective(1000); | |||
.perspective(1000px); | |||
&.next, | |||
&.active.right { | |||
@@ -101,6 +101,7 @@ | |||
color: @carousel-control-color; | |||
text-align: center; | |||
text-shadow: @carousel-text-shadow; | |||
background-color: rgba(0, 0, 0, 0); // Fix IE9 click-thru bug | |||
// We can't have this transition here because WebKit cancels the carousel | |||
// animation if you trip this while in the middle of another animation. | |||
@@ -130,6 +131,7 @@ | |||
.glyphicon-chevron-right { | |||
position: absolute; | |||
top: 50%; | |||
margin-top: -10px; | |||
z-index: 5; | |||
display: inline-block; | |||
} | |||
@@ -147,7 +149,6 @@ | |||
.icon-next { | |||
width: 20px; | |||
height: 20px; | |||
margin-top: -10px; | |||
line-height: 1; | |||
font-family: serif; | |||
} | |||
@@ -240,18 +241,18 @@ | |||
.glyphicon-chevron-right, | |||
.icon-prev, | |||
.icon-next { | |||
width: 30px; | |||
height: 30px; | |||
margin-top: -15px; | |||
font-size: 30px; | |||
width: (@carousel-control-font-size * 1.5); | |||
height: (@carousel-control-font-size * 1.5); | |||
margin-top: (@carousel-control-font-size / -2); | |||
font-size: (@carousel-control-font-size * 1.5); | |||
} | |||
.glyphicon-chevron-left, | |||
.icon-prev { | |||
margin-left: -15px; | |||
margin-left: (@carousel-control-font-size / -2); | |||
} | |||
.glyphicon-chevron-right, | |||
.icon-next { | |||
margin-right: -15px; | |||
margin-right: (@carousel-control-font-size / -2); | |||
} | |||
} | |||
@@ -17,9 +17,8 @@ | |||
.collapse { | |||
display: none; | |||
visibility: hidden; | |||
&.in { display: block; visibility: visible; } | |||
&.in { display: block; } | |||
tr&.in { display: table-row; } | |||
tbody&.in { display: table-row-group; } | |||
} |
@@ -10,7 +10,8 @@ | |||
height: 0; | |||
margin-left: 2px; | |||
vertical-align: middle; | |||
border-top: @caret-width-base solid; | |||
border-top: @caret-width-base dashed; | |||
border-top: @caret-width-base solid ~"\9"; // IE8 | |||
border-right: @caret-width-base solid transparent; | |||
border-left: @caret-width-base solid transparent; | |||
} | |||
@@ -184,7 +185,8 @@ | |||
// Reverse the caret | |||
.caret { | |||
border-top: 0; | |||
border-bottom: @caret-width-base solid; | |||
border-bottom: @caret-width-base dashed; | |||
border-bottom: @caret-width-base solid ~"\9"; // IE8 | |||
content: ""; | |||
} | |||
// Different positioning for bottom up menu |
@@ -56,7 +56,6 @@ input[type="checkbox"] { | |||
line-height: normal; | |||
} | |||
// Set the height of file controls to match text inputs | |||
input[type="file"] { | |||
display: block; | |||
} | |||
@@ -133,6 +132,12 @@ output { | |||
// Placeholder | |||
.placeholder(); | |||
// Unstyle the caret on `<select>`s in IE10+. | |||
&::-ms-expand { | |||
border: 0; | |||
background-color: transparent; | |||
} | |||
// Disabled and read-only inputs | |||
// | |||
// HTML5 says that controls under a fieldset > legend:first-child won't be | |||
@@ -141,11 +146,15 @@ output { | |||
&[disabled], | |||
&[readonly], | |||
fieldset[disabled] & { | |||
cursor: @cursor-disabled; | |||
background-color: @input-bg-disabled; | |||
opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655 | |||
} | |||
&[disabled], | |||
fieldset[disabled] & { | |||
cursor: @cursor-disabled; | |||
} | |||
// Reset height for `textarea`s | |||
textarea& { | |||
height: auto; | |||
@@ -171,13 +180,17 @@ input[type="search"] { | |||
// text within the input to become vertically misaligned. As a workaround, we | |||
// set a pixel line-height that matches the given height of the input, but only | |||
// for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848 | |||
// | |||
// Note that as of 9.3, iOS doesn't support `week`. | |||
@media screen and (-webkit-min-device-pixel-ratio: 0) { | |||
input[type="date"], | |||
input[type="time"], | |||
input[type="datetime-local"], | |||
input[type="month"] { | |||
line-height: @input-height-base; | |||
&.form-control { | |||
line-height: @input-height-base; | |||
} | |||
&.input-sm, | |||
.input-group-sm & { | |||
@@ -198,7 +211,7 @@ input[type="search"] { | |||
// horizontal forms, use the predefined grid classes. | |||
.form-group { | |||
margin-bottom: 15px; | |||
margin-bottom: @form-group-margin-bottom; | |||
} | |||
@@ -238,6 +251,7 @@ input[type="search"] { | |||
// Radios and checkboxes on same line | |||
.radio-inline, | |||
.checkbox-inline { | |||
position: relative; | |||
display: inline-block; | |||
padding-left: 20px; | |||
margin-bottom: 0; | |||
@@ -294,6 +308,7 @@ input[type="checkbox"] { | |||
padding-bottom: (@padding-base-vertical + 1); | |||
// Remove default margin from `p` | |||
margin-bottom: 0; | |||
min-height: (@line-height-computed + @font-size-base); | |||
&.input-lg, | |||
&.input-sm { | |||
@@ -316,11 +331,24 @@ input[type="checkbox"] { | |||
} | |||
.form-group-sm { | |||
.form-control { | |||
.input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @input-border-radius-small); | |||
height: @input-height-small; | |||
padding: @padding-small-vertical @padding-small-horizontal; | |||
font-size: @font-size-small; | |||
line-height: @line-height-small; | |||
border-radius: @input-border-radius-small; | |||
} | |||
select.form-control { | |||
height: @input-height-small; | |||
line-height: @input-height-small; | |||
} | |||
textarea.form-control, | |||
select[multiple].form-control { | |||
height: auto; | |||
} | |||
.form-control-static { | |||
height: @input-height-small; | |||
padding: @padding-small-vertical @padding-small-horizontal; | |||
min-height: (@line-height-computed + @font-size-small); | |||
padding: (@padding-small-vertical + 1) @padding-small-horizontal; | |||
font-size: @font-size-small; | |||
line-height: @line-height-small; | |||
} | |||
@@ -331,11 +359,24 @@ input[type="checkbox"] { | |||
} | |||
.form-group-lg { | |||
.form-control { | |||
.input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @input-border-radius-large); | |||
height: @input-height-large; | |||
padding: @padding-large-vertical @padding-large-horizontal; | |||
font-size: @font-size-large; | |||
line-height: @line-height-large; | |||
border-radius: @input-border-radius-large; | |||
} | |||
select.form-control { | |||
height: @input-height-large; | |||
line-height: @input-height-large; | |||
} | |||
textarea.form-control, | |||
select[multiple].form-control { | |||
height: auto; | |||
} | |||
.form-control-static { | |||
height: @input-height-large; | |||
padding: @padding-large-vertical @padding-large-horizontal; | |||
min-height: (@line-height-computed + @font-size-large); | |||
padding: (@padding-large-vertical + 1) @padding-large-horizontal; | |||
font-size: @font-size-large; | |||
line-height: @line-height-large; | |||
} | |||
@@ -368,12 +409,16 @@ input[type="checkbox"] { | |||
text-align: center; | |||
pointer-events: none; | |||
} | |||
.input-lg + .form-control-feedback { | |||
.input-lg + .form-control-feedback, | |||
.input-group-lg + .form-control-feedback, | |||
.form-group-lg .form-control + .form-control-feedback { | |||
width: @input-height-large; | |||
height: @input-height-large; | |||
line-height: @input-height-large; | |||
} | |||
.input-sm + .form-control-feedback { | |||
.input-sm + .form-control-feedback, | |||
.input-group-sm + .form-control-feedback, | |||
.form-group-sm .form-control + .form-control-feedback { | |||
width: @input-height-small; | |||
height: @input-height-small; | |||
line-height: @input-height-small; | |||
@@ -394,10 +439,10 @@ input[type="checkbox"] { | |||
.has-feedback label { | |||
& ~ .form-control-feedback { | |||
top: (@line-height-computed + 5); // Height of the `label` and its margin | |||
top: (@line-height-computed + 5); // Height of the `label` and its margin | |||
} | |||
&.sr-only ~ .form-control-feedback { | |||
top: 0; | |||
top: 0; | |||
} | |||
} | |||
@@ -542,7 +587,7 @@ input[type="checkbox"] { | |||
// Reposition the icon because it's now within a grid column and columns have | |||
// `position: relative;` on them. Also accounts for the grid gutter padding. | |||
.has-feedback .form-control-feedback { | |||
right: (@grid-gutter-width / 2); | |||
right: floor((@grid-gutter-width / 2)); | |||
} | |||
// Form group sizes | |||
@@ -552,7 +597,8 @@ input[type="checkbox"] { | |||
.form-group-lg { | |||
@media (min-width: @screen-sm-min) { | |||
.control-label { | |||
padding-top: ((@padding-large-vertical * @line-height-large) + 1); | |||
padding-top: (@padding-large-vertical + 1); | |||
font-size: @font-size-large; | |||
} | |||
} | |||
} | |||
@@ -560,6 +606,7 @@ input[type="checkbox"] { | |||
@media (min-width: @screen-sm-min) { | |||
.control-label { | |||
padding-top: (@padding-small-vertical + 1); | |||
font-size: @font-size-small; | |||
} | |||
} | |||
} |