shoppe 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/shoppe/chosen-sprite.png +0 -0
- data/app/assets/images/shoppe/chosen-sprite@2x.png +0 -0
- data/app/assets/images/shoppe/icons/bag.svg +1 -0
- data/app/assets/images/shoppe/icons/balance.svg +1 -0
- data/app/assets/images/shoppe/icons/box.svg +1 -0
- data/app/assets/images/shoppe/icons/building.svg +1 -0
- data/app/assets/images/shoppe/icons/chart.svg +1 -0
- data/app/assets/images/shoppe/icons/chat.svg +1 -0
- data/app/assets/images/shoppe/icons/checkbox.svg +1 -0
- data/app/assets/images/shoppe/icons/checkbox2.svg +1 -0
- data/app/assets/images/shoppe/icons/cloud.svg +1 -0
- data/app/assets/images/shoppe/icons/cone.svg +1 -0
- data/app/assets/images/shoppe/icons/credit_card.svg +1 -0
- data/app/assets/images/shoppe/icons/currency.svg +1 -0
- data/app/assets/images/shoppe/icons/flowchart.svg +1 -0
- data/app/assets/images/shoppe/icons/gift.svg +1 -0
- data/app/assets/images/shoppe/icons/globe.svg +1 -0
- data/app/assets/images/shoppe/icons/id.svg +1 -0
- data/app/assets/images/shoppe/icons/id2.svg +1 -0
- data/app/assets/images/shoppe/icons/locked.svg +1 -0
- data/app/assets/images/shoppe/icons/report.svg +1 -0
- data/app/assets/images/shoppe/icons/search.svg +1 -0
- data/app/assets/images/shoppe/icons/support.svg +1 -0
- data/app/assets/images/shoppe/icons/tags.svg +1 -0
- data/app/assets/images/shoppe/icons/toolbox.svg +1 -0
- data/app/assets/images/shoppe/icons/unlocked.svg +1 -0
- data/app/assets/images/shoppe/icons/wallet.svg +1 -0
- data/app/assets/images/shoppe/move.svg +1 -0
- data/app/assets/javascripts/shoppe/application.coffee +32 -1
- data/app/assets/javascripts/shoppe/chosen.jquery.js +1166 -0
- data/app/assets/javascripts/shoppe/jquery_ui.js +6 -0
- data/app/assets/stylesheets/shoppe/application.scss +95 -20
- data/app/assets/stylesheets/shoppe/chosen.css +430 -0
- data/app/assets/stylesheets/shoppe/elements.scss +6 -7
- data/app/controllers/shoppe/delivery_service_prices_controller.rb +1 -1
- data/app/controllers/shoppe/products_controller.rb +1 -1
- data/app/helpers/shoppe/shoppe_helper.rb +2 -0
- data/app/models/shoppe/delivery_service_price.rb +1 -0
- data/app/models/shoppe/order.rb +18 -1
- data/app/models/shoppe/order_item.rb +11 -5
- data/app/models/shoppe/product.rb +19 -4
- data/app/models/shoppe/product/product_attributes.rb +15 -0
- data/app/models/shoppe/product_attribute.rb +51 -0
- data/app/views/shoppe/delivery_service_prices/_form.html.haml +23 -19
- data/app/views/shoppe/delivery_service_prices/edit.html.haml +1 -1
- data/app/views/shoppe/delivery_service_prices/index.html.haml +1 -1
- data/app/views/shoppe/delivery_service_prices/new.html.haml +1 -1
- data/app/views/shoppe/delivery_services/_form.html.haml +27 -25
- data/app/views/shoppe/delivery_services/edit.html.haml +1 -1
- data/app/views/shoppe/delivery_services/index.html.haml +12 -8
- data/app/views/shoppe/delivery_services/new.html.haml +1 -1
- data/app/views/shoppe/orders/index.html.haml +16 -12
- data/app/views/shoppe/orders/show.html.haml +28 -25
- data/app/views/shoppe/product_categories/_form.html.haml +7 -6
- data/app/views/shoppe/product_categories/edit.html.haml +1 -1
- data/app/views/shoppe/product_categories/index.html.haml +8 -4
- data/app/views/shoppe/product_categories/new.html.haml +1 -1
- data/app/views/shoppe/products/_form.html.haml +88 -45
- data/app/views/shoppe/products/edit.html.haml +1 -1
- data/app/views/shoppe/products/index.html.haml +14 -13
- data/app/views/shoppe/products/new.html.haml +1 -1
- data/app/views/shoppe/users/_form.html.haml +17 -15
- data/app/views/shoppe/users/edit.html.haml +1 -1
- data/app/views/shoppe/users/index.html.haml +1 -1
- data/app/views/shoppe/users/new.html.haml +1 -1
- data/db/migrate/20131012123829_create_shoppe_product_attributes.rb +11 -0
- data/db/migrate/20131012163301_add_public_boolean_to_product_attributes.rb +5 -0
- data/db/migrate/20131013123937_add_cost_prices_to_various_objects.rb +8 -0
- data/db/migrate/20131013131658_add_stock_control_boolean_to_products.rb +5 -0
- data/db/seeds.rb +78 -30
- data/lib/shoppe/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +22 -6
- data/test/dummy/log/development.log +29 -0
- metadata +42 -5
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 6,32l 20,0 c 1.104,0, 2-0.896, 2-2L 28,8 c0-1.104-0.896-2-2-2l-4.010,0 C 21.942,2.678, 19.282,0, 16,0S 10.058,2.678, 10.010,6 L 6,6 C 4.896,6, 4,6.896, 4,8l0,22 C 4,31.104, 4.896,32, 6,32z M 26,8l0,22 L 6,30 L 6,8 L 26,8 z M 16,2c 2.174,0, 3.942,1.786, 3.99,4L 12.010,6 C 12.058,3.786, 13.826,2, 16,2zM 13,12l 6,0 C 19.552,12, 20,11.552, 20,11C 20,10.448, 19.552,10, 19,10l-6,0 C 12.448,10, 12,10.448, 12,11C 12,11.552, 12.448,12, 13,12z "></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 31.698,14.286l-4.822-8.77c-0.012-0.022-0.038-0.030-0.052-0.050c-0.242-0.374-0.698-0.564-1.142-0.416 L 18,7.608L 18,5 C 18,4.448, 17.552,4, 17,4S 16,4.448, 16,5l0,3.272 L 7.65,11.050c-0.068,0.022-0.12,0.068-0.18,0.104c0,0,0,0-0.002,0 C 7.332,11.236, 7.218,11.34, 7.136,11.47c-0.010,0.014-0.028,0.020-0.038,0.036l-4.966,8.75c-0.112,0.196-0.132,0.412-0.106,0.62 C 2.020,20.918, 2,20.956, 2,21C 2,23.060, 5.11,26, 8,26s 6-2.94, 6-5c0-0.128-0.028-0.25-0.074-0.362 c0-0.004-0.002-0.008-0.002-0.012c-0.002-0.006-0.004-0.014-0.006-0.020c-0.018-0.12-0.052-0.238-0.114-0.35L 9.438,12.566L 16,10.382 L 16,27 C 16,27.552, 16.448,28, 17,28S 18,27.552, 18,27L 18,9.716 l 5.892-1.96l-3.59,6.532C 20.116,14.468, 20,14.72, 20,15 c0,2.060, 3.11,5, 6,5s 6-2.94, 6-5C 32,14.72, 31.884,14.468, 31.698,14.286z M 4.576,20l 3.392-5.974L 11.358,20L 4.576,20 z M 22.744,14 L 26,8.076L 29.256,14L 22.744,14 z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 30,4L 2,4 C 0.896,4,0,4.896,0,6l0,4 l 32,0 L 32,6 C 32,4.896, 31.104,4, 30,4z M 30,8L 2,8 L 2,6 l 28,0 L 30,8 zM 2,30c0,1.104, 0.896,2, 2,2l 24,0 c 1.104,0, 2-0.896, 2-2L 30,12 L 2,12 L 2,30 z M 4,14l 24,0 l0,16 L 4,30 L 4,14 zM 21,16l-10,0 C 10.448,16, 10,16.448, 10,17C 10,17.552, 10.448,18, 11,18l 10,0 C 21.552,18, 22,17.552, 22,17 C 22,16.448, 21.552,16, 21,16z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 20,4L 22,4L 22,6L 20,6zM 24,4L 26,4L 26,6L 24,6zM 20,8L 22,8L 22,10L 20,10zM 24,8L 26,8L 26,10L 24,10zM 20,12L 22,12L 22,14L 20,14zM 24,12L 26,12L 26,14L 24,14zM 20,16L 22,16L 22,18L 20,18zM 24,16L 26,16L 26,18L 24,18zM 20,20L 22,20L 22,22L 20,22zM 24,20L 26,20L 26,22L 24,22zM 28,0L 18,0 C 16.896,0, 16,0.896, 16,2l0,6 L 6,8 C 4.896,8, 4,8.896, 4,10l0,20 c0,1.104, 0.896,2, 2,2l 22,0 c 1.104,0, 2-0.896, 2-2L 30,2 C 30,0.896, 29.104,0, 28,0z M 12,30L 10,30 l0-4 l 2,0 L 12,30 z M 14,30l0-4 l0-2 L 12,24 L 10,24 L 8,24 l0,2 l0,4 L 6,30 L 6,10 l 10,0 l0,20 L 14,30 z M 24,30l-2,0 l0-4 l 2,0 L 24,30 z M 28,30l-2,0 l0-4 l0-2 l-2,0 l-2,0 l-2,0 l0,6 L 18,30 L 18,10 L 18,2 l 10,0 L 28,30 zM 8,12L 10,12L 10,14L 8,14zM 12,12L 14,12L 14,14L 12,14zM 8,16L 10,16L 10,18L 8,18zM 12,16L 14,16L 14,18L 12,18zM 8,20L 10,20L 10,22L 8,22zM 12,20L 14,20L 14,22L 12,22z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 16,32c 5.158,0, 9.734-2.452, 12.66-6.242L 16,16L 16,0 C 7.164,0,0,7.164,0,16S 7.164,32, 16,32z M 14,2.142L 14,16 c0,0.62, 0.288,1.206, 0.778,1.584l 10.964,8.452C 23.144,28.576, 19.686,30, 16,30c-7.72,0-14-6.28-14-14C 2,8.96, 7.224,3.116, 14,2.142zM 18.75,0.268l0,14.31 l 11.424,8.806C 31.334,21.174, 32,18.668, 32,16C 32,8.104, 26.272,1.574, 18.75,0.268z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 27.91,11.79c 0.176,0.792, 0.278,1.606, 0.278,2.442c0,6.456-5.48,11.838-12.696,12.994 c 1.526,0.616, 3.236,0.976, 5.058,0.976c 1.718,0, 3.34-0.316, 4.804-0.866c 1.854,0.632, 3.878,0.796, 5.552,0.796 c-0.87-1.044-1.474-2.068-1.906-2.968C 30.856,23.508, 32,21.314, 32,18.898C 32,16.042, 30.406,13.496, 27.91,11.79zM 1.472,25.418c 0.174,0.33, 0.516,0.536, 0.886,0.536c 0.016,0, 0.034,0, 0.048-0.002 c 1.058-0.050, 3.162-0.752, 5.39-2.166c 1.192,0.21, 3.862,0.606, 4.794,0.606c 7.034,0, 12.542-4.898, 12.542-11.152 c0-6.15-5.624-11.152-12.542-11.152S 0.052,7.088, 0.052,13.238c0,2.862, 1.26,5.628, 3.478,7.698c-0.498,1.212-1.158,2.358-1.964,3.408 C 1.328,24.652, 1.292,25.072, 1.472,25.418z M 2.052,13.238c0-5.046, 4.728-9.152, 10.542-9.152s 10.542,4.106, 10.542,9.152 c0,5.216-4.532,9.152-10.542,9.152c-0.79,0-3.934-0.458-4.798-0.64c-0.264-0.052-0.538-0.004-0.758,0.146 c-0.858,0.568-1.666,0.998-2.37,1.314c 0.382-0.718, 0.712-1.462, 0.988-2.23c 0.142-0.398, 0.020-0.842-0.304-1.11 C 3.224,18.12, 2.052,15.764, 2.052,13.238z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 26,26L 6,26 L 6,6 l 14.752,0 L 22,4L 6,4 C 4.896,4, 4,4.896, 4,6l0,20 c0,1.104, 0.896,2, 2,2l 20,0 c 1.104,0, 2-0.896, 2-2L 28,12.794 L 26,16L 26,26 zM 29.366,2.228C 29.13,2.074, 28.864,2, 28.602,2c-0.456,0-0.904,0.224-1.172,0.634L 16.558,18.318l-4.206-4.8 C 11.782,12.992, 10.898,13.026, 10.372,13.594S 9.882,15.048, 10.45,15.572l 5.056,5.77c 0.032,0.052, 0.082,0.092, 0.122,0.14l 0.128,0.146 c 0.016,0.014, 0.036,0.018, 0.052,0.032c 0.040,0.032, 0.064,0.076, 0.106,0.106c 0.086,0.056, 0.18,0.092, 0.274,0.126 c 0.022,0.008, 0.040,0.022, 0.062,0.028c 0.14,0.046, 0.286,0.074, 0.43,0.074c 0.006,0, 0.012-0.004, 0.018-0.004 c 0.38,0.002, 0.758-0.138, 1.036-0.438c 0.052-0.056, 0.072-0.124, 0.114-0.186c 0.002-0.002, 0.004-0.004, 0.006-0.006l 11.918-17.194 C 30.194,3.52, 30.014,2.652, 29.366,2.228z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 16.084,0c-8.836,0-16,7.164-16,16s 7.164,16, 16,16s 16-7.164, 16-16S 24.92,0, 16.084,0z M 16.084,30c-7.72,0-14-6.28-14-14 s 6.28-14, 14-14s 14,6.28, 14,14S 23.802,30, 16.084,30zM 23.092,9.636c-0.646-0.424-1.514-0.242-1.938,0.406L 14.402,20.36L 11.174,17.372 C 10.606,16.848, 9.72,16.882, 9.194,17.45S 8.704,18.902, 9.272,19.428l 4.462,4.128c 0.016,0.014, 0.036,0.018, 0.052,0.032 c 0.040,0.032, 0.064,0.076, 0.106,0.106c 0.060,0.040, 0.128,0.048, 0.192,0.076c 0.076,0.036, 0.15,0.070, 0.23,0.092 c 0.078,0.020, 0.154,0.030, 0.234,0.036c 0.114,0.012, 0.224,0.012, 0.336-0.004c 0.046-0.008, 0.090-0.020, 0.136-0.032 c 0.138-0.034, 0.266-0.088, 0.392-0.164c 0.022-0.014, 0.040-0.030, 0.062-0.044c 0.082-0.056, 0.17-0.098, 0.24-0.174 c 0.050-0.054, 0.072-0.124, 0.112-0.184c 0.002-0.002, 0.006-0.004, 0.006-0.006l 7.664-11.714C 23.92,10.928, 23.738,10.060, 23.092,9.636z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 26,16c-0.070,0-0.136,0.018-0.204,0.020C 25.93,15.368, 26,14.692, 26,14c0-5.522-4.478-10-10-10S 6,8.478, 6,14 c0,0.034, 0.010,0.066, 0.010,0.1C 2.618,14.584,0,17.474,0,21c0,3.524, 2.612,6.41, 6,6.9L 6,28 l 20,0 c 3.314,0, 6-2.686, 6-6S 29.314,16, 26,16z M 26,26L 6.628,26 c-0.11-0.036-0.224-0.064-0.342-0.080C 3.842,25.568, 2,23.452, 2,21c0-2.456, 1.846-4.57, 4.292-4.92 c 0.994-0.142, 1.728-0.998, 1.718-2c0-0.060-0.004-0.12-0.010-0.178C 8.054,9.534, 11.622,6, 16,6c 4.412,0, 8,3.588, 8,8 c0,0.544-0.056,1.088-0.164,1.618c-0.124,0.6, 0.036,1.224, 0.432,1.692c 0.38,0.45, 0.94,0.708, 1.528,0.708 c 0.024,0, 0.046,0, 0.070-0.002C 25.91,18.018, 26.004,18.010, 26.082,18C 28.25,18.044, 30,19.822, 30,22C 30,24.206, 28.206,26, 26,26z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 24.966,20l-0.758-2l-2.14,0 L 9.932,18 l-2.14,0 l-0.758,2L 4,28l 24,0 L 24.966,20z M 9.174,20l 13.654,0 l 2.276,6L 6.898,26 L 9.174,20zM 20.552,14l 2.14,0 l-0.758-2L 17.866,1.278C 17.568,0.508, 16.826,0, 16,0S 14.432,0.508, 14.134,1.278L 10.068,12L 9.31,14 l 2.14,0 L 20.552,14 z M 16,2l 3.792,10L 12.208,12 L 16,2zM 30.984,30L 1.016,30 C 0.454,30,0,30.424,0,30.984S 0.454,32, 1.016,32l 29.968,0 C 31.546,32, 32,31.546, 32,30.984 S 31.546,30, 30.984,30z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 30,4L 2,4 C 0.896,4,0,4.896,0,6l0,4.084 L0,14 l0,12 c0,1.104, 0.896,2, 2,2l 28,0 c 1.104,0, 2-0.896, 2-2L 32,14 L 32,10.084 L 32,6 C 32,4.896, 31.104,4, 30,4z M 30,26L 2,26 L 2,14 l 28,0 L 30,26 z M 2,10.084L 2,6 l 28,0 l0,4.084 L 2,10.084 zM 5,24l 10,0 C 15.552,24, 16,23.552, 16,23C 16,22.448, 15.552,22, 15,22l-10,0 C 4.448,22, 4,22.448, 4,23 C 4,23.552, 4.448,24, 5,24zM 18,23A1,1 1080 1 0 20,23A1,1 1080 1 0 18,23zM 22,23A1,1 1080 1 0 24,23A1,1 1080 1 0 22,23zM 26,23A1,1 1080 1 0 28,23A1,1 1080 1 0 26,23z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 17,2C 8.716,2, 2,8.716, 2,17S 8.716,32, 17,32S 32,25.284, 32,17S 25.284,2, 17,2z M 17,30 C 9.832,30, 4,24.168, 4,17S 9.832,4, 17,4S 30,9.832, 30,17S 24.168,30, 17,30zM 18.714,10C 20.526,10, 22,11.346, 22,13C 22,13.552, 22.448,14, 23,14S 24,13.552, 24,13C 24,10.242, 21.628,8, 18.714,8L 18,8 L 18,7 C 18,6.448, 17.552,6, 17,6S 16,6.448, 16,7L 16,8 L 15.286,8 C 12.372,8, 10,10.242, 10,13S 12.372,18, 15.286,18L 16,18 l0,6 L 15.286,24 C 13.474,24, 12,22.654, 12,21 C 12,20.448, 11.552,20, 11,20S 10,20.448, 10,21C 10,23.758, 12.372,26, 15.286,26L 16,26 l0,1 C 16,27.552, 16.448,28, 17,28S 18,27.552, 18,27L 18,26 l 0.714,0 C 21.628,26, 24,23.758, 24,21S 21.628,16, 18.714,16L 18,16 L 18,10 L 18.714,10 z M 18.714,18C 20.526,18, 22,19.346, 22,21S 20.526,24, 18.714,24L 18,24 L 18,18 L 18.714,18 z M 16,16 L 15.286,16 C 13.474,16, 12,14.654, 12,13S 13.474,10, 15.286,10L 16,10 L 16,16 z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 30,20L 30,16 c0-1.104-0.896-2-2-2L 18,14 L 18,10 l 6,0 c 1.104,0, 2-0.896, 2-2L 26,6 c0-1.104-0.896-2-2-2L 10,4 C 8.896,4, 8,4.896, 8,6l0,2 c0,1.104, 0.896,2, 2,2l 6,0 l0,4 L 6,14 C 4.896,14, 4,14.896, 4,16l0,4 c-1.104,0-2,0.896-2,2l0,4 c0,1.104, 0.896,2, 2,2l 2,0 c 1.104,0, 2-0.896, 2-2l0-2 l0-2 c0-1.104-0.896-2-2-2L 6,16 l 10,0 l0,4 c-1.104,0-2,0.896-2,2l0,2 l0,2 c0,1.104, 0.896,2, 2,2l 2,0 c 1.104,0, 2-0.896, 2-2l0-2 l0-2 c0-1.104-0.896-2-2-2L 18,16 l 10,0 l0,4 c-1.104,0-2,0.896-2,2l0,2 l0,2 c0,1.104, 0.896,2, 2,2l 2,0 c 1.104,0, 2-0.896, 2-2l0-4 C 32,20.896, 31.104,20, 30,20z M 10,6l 14,0 l0,2 L 10,8 L 10,6 z M 6,24l0,2 L 4,26 l0-4 l 2,0 L 6,24 z M 18,26L 16,26 l0-4 l 2,0 L 18,26 z M 28,24l0-2 l 2,0 l0,4 l-2,0 L 28,24 z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 30,8L 18.042,8 L 14,8 L 2,8 C 0.896,8,0,8.896,0,10l0,6 l 2,0 l0,14 c0,1.104, 0.896,2, 2,2l 10,0 l 4.042,0 L 28,32 c 1.104,0, 2-0.896, 2-2L 30,16 l 2,0 L 32,10 C 32,8.896, 31.104,8, 30,8z M 2,10l 12,0 l0,4 L 2,14 L 2,10 z M 4,30L 4,16 l 10,0 l0,14 L 4,30 z M 28,30L 18.042,30 L 18.042,16 L 28,16 L 28,30 z M 30,14L 18.042,14 L 18.042,10 L 30,10 L 30,14 zM 16,6c0-0.004-0.002-0.012-0.002-0.016l 0.006,0 C 16.002,5.988, 16,5.996, 16,6c0,0, 5.238,0, 8,0 c 2.762,0, 4-1.344, 4-3S 26.762,0, 24,0c-2.586,0-4.622,1.164-6,2.514C 17.396,2.156, 16.698,1.938, 15.942,1.938 c-0.724,0-1.394,0.204-1.982,0.536C 12.584,1.14, 10.56,0, 8,0C 5.238,0, 4,1.344, 4,3S 5.238,6, 8,6C 10.762,6, 16,6, 16,6z M 26,3 C 26,3.826, 24.912,4, 24,4L 19.458,4 C 19.442,3.972, 19.428,3.942, 19.412,3.916C 20.428,2.928, 21.968,2, 24,2C 24.912,2, 26,2.174, 26,3z M 6,3 C 6,2.174, 7.088,2, 8,2c 1.988,0, 3.496,0.89, 4.512,1.844C 12.48,3.894, 12.456,3.948, 12.426,4L 8,4 C 7.088,4, 6,3.826, 6,3z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 30.118,21.638c-5.446,5.444-14.308,5.448-19.754,0C 7.728,19.004, 6.278,15.496, 6.278,11.76 s 1.452-7.244, 4.084-9.876c 0.39-0.39, 0.39-1.024,0-1.414s-1.024-0.39-1.414,0C 5.936,3.48, 4.278,7.49, 4.278,11.76 s 1.66,8.282, 4.67,11.292C 11.49,25.596, 14.686,27.082, 18,27.548L 18,30 L 15,30 C 14.448,30, 14,30.448, 14,31C 14,31.552, 14.448,32, 15,32l 8,0 c 0.552,0, 1-0.448, 1-1c0-0.552-0.448-1-1-1L 20,30 l0-2.288 c 0.080,0.002, 0.16,0.012, 0.24,0.012 c 4.088,0, 8.178-1.556, 11.292-4.67c 0.39-0.39, 0.39-1.024,0-1.414S 30.508,21.248, 30.118,21.638zM 20.24,0C 13.744,0, 8.48,5.266, 8.48,11.76s 5.266,11.76, 11.76,11.76S 32,18.256, 32,11.76S 26.734,0, 20.24,0z M 20.24,21.52c-5.382,0-9.76-4.378-9.76-9.76C 10.48,6.378, 14.858,2, 20.24,2C 25.622,2, 30,6.378, 30,11.76 C 30,17.142, 25.622,21.52, 20.24,21.52z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 30,6L 2,6 C 0.896,6,0,6.896,0,8l0,18 c0,1.104, 0.896,2, 2,2l 28,0 c 1.104,0, 2-0.896, 2-2L 32,8 C 32,6.896, 31.104,6, 30,6z M 2,8 l 28,0 l0,18 L 2,26 L 2,8 zM 27.166,16L 15,16 C 14.448,16, 14,16.448, 14,17C 14,17.552, 14.448,18, 15,18l 12.166,0 c 0.552,0, 1-0.448, 1-1 C 28.166,16.448, 27.718,16, 27.166,16zM 27.166,20L 15,20 C 14.448,20, 14,20.448, 14,21C 14,21.552, 14.448,22, 15,22l 12.166,0 c 0.552,0, 1-0.448, 1-1 C 28.166,20.448, 27.718,20, 27.166,20zM 27.166,12L 15,12 C 14.448,12, 14,12.448, 14,13C 14,13.552, 14.448,14, 15,14l 12.166,0 c 0.552,0, 1-0.448, 1-1 C 28.166,12.448, 27.718,12, 27.166,12zM 5.58,12.416A2.416,2.416 0 1 0 10.412,12.416A2.416,2.416 0 1 0 5.58,12.416zM 8.048,15.798c-2.184,0-3.952,2.372-3.952,5.3S 12,24.024, 12,21.098S 10.23,15.798, 8.048,15.798z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 30,6l-10,0 l0,4 c0,1.104-0.896,2-2,2l 1,0 C 20.656,12, 22,10.656, 22,9c0-0.38-0.006-0.71-0.018-1L 30,8 l0,22 L 2,30 L 2,8 l 8.018,0 C 10.006,8.29, 10,8.62, 10,9C 10,10.656, 11.344,12, 13,12L 14,12 C 12.896,12, 12,11.104, 12,10L 12,6 L 2,6 C 0.896,6,0,6.896,0,8l0,22 c0,1.104, 0.896,2, 2,2l 28,0 c 1.104,0, 2-0.896, 2-2L 32,8 C 32,6.896, 31.104,6, 30,6zM 27.166,20L 15,20 C 14.448,20, 14,20.448, 14,21C 14,21.552, 14.448,22, 15,22l 12.166,0 c 0.552,0, 1-0.448, 1-1 C 28.166,20.448, 27.718,20, 27.166,20zM 27.166,24L 15,24 C 14.448,24, 14,24.448, 14,25C 14,25.552, 14.448,26, 15,26l 12.166,0 c 0.552,0, 1-0.448, 1-1 C 28.166,24.448, 27.718,24, 27.166,24zM 15,18l 12.166,0 c 0.552,0, 1-0.448, 1-1c0-0.552-0.448-1-1-1L 15,16 C 14.448,16, 14,16.448, 14,17 C 14,17.552, 14.448,18, 15,18zM 5.58,16.416A2.416,2.416 0 1 0 10.412,16.416A2.416,2.416 0 1 0 5.58,16.416zM 8.048,19.798c-2.184,0-3.952,2.372-3.952,5.3S 12,28.024, 12,25.098S 10.23,19.798, 8.048,19.798zM 12,10c0,1.104, 0.896,2, 2,2l 4,0 c 1.104,0, 2-0.896, 2-2L 20,6 L 20,2 c0-1.104-0.896-2-2-2L 14,0 C 12.896,0, 12,0.896, 12,2l0,4 L 12,10 z M 18,10 L 14,10 L 14,2 l 4,0 L 18,10 z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 16,0C 10.478,0, 6,4.546, 6,10.154L 6,12 L 4,12 C 2.896,12, 2,12.896, 2,14l0,16 c0,1.104, 0.896,2, 2,2l 24,0 c 1.104,0, 2-0.896, 2-2L 30,14 c0-1.104-0.896-2-2-2l-2,0 L 26,10.154 C 26,4.546, 21.522,0, 16,0z M 8,10.154C 8,5.658, 11.588,2, 16,2s 8,3.658, 8,8.154L 24,12 L 8,12 L 8,10.154 z M 28,30L 4,30 L 4,14 l 24,0 L 28,30 z M 20,22c0-2.21-1.79-4-4-4s-4,1.79-4,4s 1.79,4, 4,4S 20,24.21, 20,22z M 16,24c-1.102,0-2-0.898-2-2 s 0.898-2, 2-2s 2,0.898, 2,2S 17.102,24, 16,24z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 2,30c0,1.104, 0.896,2, 2,2l 24,0 c 1.104,0, 2-0.896, 2-2L 30,2 c0-1.104-0.896-2-2-2L 4,0 C 2.896,0, 2,0.896, 2,2L 2,30 z M 4,2 l 24,0 l0,28 L 4,30 L 4,2 zM 8,18L 12,18L 12,26L 8,26zM 14,8L 18,8L 18,26L 14,26zM 20,12L 24,12L 24,26L 20,26z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32.24800109863281" height="32.24800109863281" viewBox="0 0 32.24800109863281 32.24800109863281" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 19,0C 11.82,0, 6,5.82, 6,13c0,3.090, 1.084,5.926, 2.884,8.158l-8.592,8.592c-0.54,0.54-0.54,1.418,0,1.958 c 0.54,0.54, 1.418,0.54, 1.958,0l 8.592-8.592C 13.074,24.916, 15.91,26, 19,26c 7.18,0, 13-5.82, 13-13S 26.18,0, 19,0z M 19,24 C 12.934,24, 8,19.066, 8,13S 12.934,2, 19,2S 30,6.934, 30,13S 25.066,24, 19,24z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="35.124000549316406" height="32" viewBox="0 0 35.124000549316406 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 16,0C 11.906,0, 7.81,1.562, 4.686,4.686c-6.248,6.248-6.248,16.38,0,22.628C 7.81,30.438, 11.906,32, 16,32 s 8.19-1.562, 11.314-4.686c 6.248-6.248, 6.248-16.38,0-22.628C 24.19,1.562, 20.094,0, 16,0z M 10.344,21.656C 8.832,20.146, 8,18.136, 8,16 c0-2.136, 0.832-4.146, 2.344-5.656C 11.854,8.832, 13.864,8, 16,8s 4.146,0.832, 5.656,2.344C 23.168,11.854, 24,13.864, 24,16 c0,2.136-0.832,4.146-2.344,5.656C 20.146,23.168, 18.136,24, 16,24S 11.854,23.168, 10.344,21.656z M 22.186,3.45L 19.1,6.536 C 18.092,6.206, 17.050,6, 16,6C 15.044,6, 14.098,6.182, 13.172,6.454l-3.12-3.12C 11.892,2.472, 13.908,2, 16,2C 18.184,2, 20.284,2.51, 22.186,3.45z M 3.336,10.054l 3.12,3.12c-0.572,1.94-0.548,4, 0.080,5.928l-3.086,3.086C 2.51,20.284, 2,18.184, 2,16C 2,13.908, 2.472,11.892, 3.336,10.054z M 6.1,25.898L 6.1,25.898C 6.1,25.9, 6.1,25.9, 6.1,25.898L 6.1,25.898z M 10.294,28.778l 3.152-3.152C 14.284,25.848, 15.138,26, 16,26 c 0.956,0, 1.902-0.182, 2.828-0.456l 3.12,3.12C 20.108,29.528, 18.092,30, 16,30C 13.998,30, 12.068,29.57, 10.294,28.778z M 28.66,21.942 l-3.114-3.114c 0.518-1.758, 0.548-3.612, 0.080-5.382l 3.146-3.146C 30.418,14.002, 30.38,18.266, 28.66,21.942z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32.012001037597656" viewBox="0 0 32 32.012001037597656" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 29.080,0c-0.012,0-0.024,0-0.036,0c-0.006,0-0.012,0-0.018,0c-0.002,0-0.004,0-0.006,0 c-0.010,0-0.018,0-0.026,0c-0.004,0-0.008,0-0.012,0L 18.406,0 C 18.1,0.016, 17.404,0.494, 17.314,0.584L 4.584,13.312 c-0.78,0.78-0.78,2.044,0,2.824l 1.588,1.588L 4.584,19.312c-0.78,0.78-0.78,2.044,0,2.824l 9.292,9.292 c 0.39,0.39, 0.9,0.584, 1.412,0.584c 0.51,0, 1.022-0.194, 1.412-0.584l 12.728-12.73C 29.52,18.608, 30,17.992, 30,17.608L 30,0.994 C 30.028,0.436, 29.628,0, 29.080,0z M 28.022,17.27c-0.006,0.010-0.010,0.016-0.008,0.016c0,0,0,0,0,0l-12.724,12.73l-9.292-9.288 l 1.588-1.588l 6.29,6.29c 0.39,0.39, 0.9,0.584, 1.412,0.584c 0.51,0, 1.022-0.194, 1.412-0.584l 11.322-11.322L 28.022,17.27 z M 28.022,8l0,3.27 c-0.006,0.010-0.010,0.016-0.008,0.016l0,0c0,0,0,0,0,0l-12.724,12.73L 5.998,14.728l 12.644-12.642C 18.68,2.058, 18.726,2.028, 18.772,2 l 9.25,0 L 28.022,8 zM 24.022,4.992A1,1 1080 1 0 26.022,4.992A1,1 1080 1 0 24.022,4.992z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 30,10l-8,0 c0,1.104-0.896,2-2,2l 10,0 l0,4 l-10,0 c 1.104,0, 2,0.896, 2,2l 8,0 l0,12 L 2,30 L 2,18 l 8,0 c0-1.104, 0.896-2, 2-2L 2,16 L 2,12 l 10,0 C 10.896,12, 10,11.104, 10,10L 2,10 C 0.896,10,0,10.896,0,12l0,4 l0,2 l0,12 c0,1.104, 0.896,2, 2,2l 28,0 c 1.104,0, 2-0.896, 2-2L 32,18 L 32,16 L 32,12 C 32,10.896, 31.104,10, 30,10zM 12,12l 8,0 c 1.104,0, 2-0.896, 2-2L 22,8 c0-1.104-0.896-2-2-2L 12,6 C 10.896,6, 10,6.896, 10,8l0,2 C 10,11.104, 10.896,12, 12,12z M 12,8l 8,0 l0,2 L 12,10 L 12,8 zM 10,18l0,2 c0,1.104, 0.896,2, 2,2l 8,0 c 1.104,0, 2-0.896, 2-2L 22,18 c0-1.104-0.896-2-2-2L 12,16 C 10.896,16, 10,16.896, 10,18z M 20,20L 12,20 L 12,18 l 8,0 L 20,20 z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 30,30L 30,14 c0-1.104-0.896-2-2-2L 7.99,12 L 8,11.152C 8,5.764, 11.328,2, 16.096,2c 3.49,0, 6.6,2.006, 8.118,5.236 c 0.234,0.5, 0.828,0.714, 1.33,0.478c 0.5-0.234, 0.714-0.83, 0.478-1.33C 24.172,2.448, 20.37,0, 16.096,0C 10.246,0, 6,4.69, 6,11.14 L 5.99,12L 4,12 C 2.896,12, 2,12.896, 2,14l0,16 c0,1.104, 0.896,2, 2,2l 24,0 C 29.104,32, 30,31.104, 30,30z M 4,14l 24,0 l0,16 L 4,30 L 4,14 zM 16,18c-2.21,0-4,1.79-4,4s 1.79,4, 4,4s 4-1.79, 4-4S 18.21,18, 16,18z M 16,24c-1.102,0-2-0.898-2-2s 0.898-2, 2-2 s 2,0.898, 2,2S 17.102,24, 16,24z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32" height="32" viewBox="0 0 32 32" enable-background="new 0 0 16 16" xml:space="preserve" fill="#000000"> <g><path d="M 30,14L 30,8 c0-1.104-0.896-2-2-2l-0.596,0 l-0.674-4.16c-0.042-0.262-0.186-0.496-0.402-0.65 c-0.212-0.156-0.48-0.222-0.744-0.176L 3.84,4.542C 3.294,4.63, 2.924,5.144, 3.014,5.69L 3.064,6L 2,6 C 0.896,6,0,6.896,0,8l0,22 c0,1.104, 0.896,2, 2,2l 26,0 c 1.104,0, 2-0.896, 2-2l0-6 c 1.104,0, 2-0.896, 2-2L 32,16 C 32,14.896, 31.104,14, 30,14z M 2,8l 26,0 l0,6 l-8,0 C 18.896,14, 18,14.896, 18,16 l0,6 c0,1.104, 0.896,2, 2,2l 8,0 l0,6 L 2,30 L 2,8 z M 7.336,6l 17.58-2.854L 25.378,6L 7.336,6 z M 20,22L 20,16 l 10,0 l0,6 L 20,22 zM 22,19A1,1 0 1 0 24,19A1,1 0 1 0 22,19z"></path></g></svg>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="16" height="16.001001358032227" viewBox="0 0 16 16.001001358032227" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="#000000"><g><path d="M 9.14,15.859c 0.098,0.098, 0.227,0.147, 0.355,0.146c 0.129,0, 0.257-0.048, 0.355-0.146l 1.926-1.926 c 0.195-0.195, 0.195-0.512,0-0.707s-0.512-0.195-0.707,0L 10,14.295l0-8.79 c0-0.276-0.224-0.5-0.5-0.5S 9,5.229, 9,5.505l0,8.8 l-1.152-1.152c-0.195-0.195-0.512-0.195-0.707,0c-0.195,0.195-0.195,0.512,0,0.707L 9.14,15.859zM 6.5,11.005c 0.276,0, 0.5-0.224, 0.5-0.5l0-8.8 l 1.152,1.152c 0.195,0.195, 0.512,0.195, 0.707,0 c 0.195-0.195, 0.195-0.512,0-0.707L 6.86,0.151C 6.762,0.053, 6.634,0.005, 6.505,0.005c-0.129,0-0.257,0.048-0.355,0.146L 4.224,2.077 c-0.195,0.195-0.195,0.512,0,0.707c 0.195,0.195, 0.512,0.195, 0.707,0L 6,1.715l0,8.79 C 6,10.781, 6.224,11.005, 6.5,11.005z"></path></g></svg>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
#= require jquery
|
2
2
|
#= require jquery_ujs
|
3
|
+
#= require shoppe/jquery_ui
|
4
|
+
#= require shoppe/chosen.jquery
|
3
5
|
#= require_tree .
|
4
6
|
|
5
7
|
$ ->
|
@@ -8,4 +10,33 @@ $ ->
|
|
8
10
|
|
9
11
|
# When clicking the order search button, toggle the form
|
10
12
|
$('a[rel=searchOrders]').on 'click', ->
|
11
|
-
$('div.orderSearch').toggle()
|
13
|
+
$('div.orderSearch').toggle()
|
14
|
+
|
15
|
+
# Add a new attribute to a table
|
16
|
+
$('a[data-behavior=addAttributeToAttributesTable]').on 'click', ->
|
17
|
+
table = $('table.productAttributes')
|
18
|
+
if $('tbody tr', table).length == 1 || $('tbody tr:last td:first input', table).val().length > 0
|
19
|
+
template = $('tr.template', table).html()
|
20
|
+
table.append("<tr>#{template}</tr>")
|
21
|
+
false
|
22
|
+
|
23
|
+
# Remove an attribute from a table
|
24
|
+
$('table.productAttributes tbody').on 'click', 'tr td.remove a', ->
|
25
|
+
$(this).parents('tr').remove()
|
26
|
+
false
|
27
|
+
|
28
|
+
# Sorting on the product attribtues table
|
29
|
+
$('table.productAttributes tbody').sortable
|
30
|
+
axis: 'y'
|
31
|
+
handle: '.handle'
|
32
|
+
cursor: 'move',
|
33
|
+
helper: (e,tr)->
|
34
|
+
originals = tr.children()
|
35
|
+
helper = tr.clone()
|
36
|
+
helper.children().each (index)->
|
37
|
+
$(this).width(originals.eq(index).width())
|
38
|
+
helper
|
39
|
+
|
40
|
+
# Chosen
|
41
|
+
$('select.chosen').chosen()
|
42
|
+
|
@@ -0,0 +1,1166 @@
|
|
1
|
+
// Chosen, a Select Box Enhancer for jQuery and Prototype
|
2
|
+
// by Patrick Filler for Harvest, http://getharvest.com
|
3
|
+
//
|
4
|
+
// Version 1.0.0
|
5
|
+
// Full source at https://github.com/harvesthq/chosen
|
6
|
+
// Copyright (c) 2011 Harvest http://getharvest.com
|
7
|
+
|
8
|
+
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
9
|
+
// This file is generated by `grunt build`, do not edit it by hand.
|
10
|
+
(function() {
|
11
|
+
var $, AbstractChosen, Chosen, SelectParser, _ref,
|
12
|
+
__hasProp = {}.hasOwnProperty,
|
13
|
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
14
|
+
|
15
|
+
SelectParser = (function() {
|
16
|
+
function SelectParser() {
|
17
|
+
this.options_index = 0;
|
18
|
+
this.parsed = [];
|
19
|
+
}
|
20
|
+
|
21
|
+
SelectParser.prototype.add_node = function(child) {
|
22
|
+
if (child.nodeName.toUpperCase() === "OPTGROUP") {
|
23
|
+
return this.add_group(child);
|
24
|
+
} else {
|
25
|
+
return this.add_option(child);
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
SelectParser.prototype.add_group = function(group) {
|
30
|
+
var group_position, option, _i, _len, _ref, _results;
|
31
|
+
|
32
|
+
group_position = this.parsed.length;
|
33
|
+
this.parsed.push({
|
34
|
+
array_index: group_position,
|
35
|
+
group: true,
|
36
|
+
label: this.escapeExpression(group.label),
|
37
|
+
children: 0,
|
38
|
+
disabled: group.disabled
|
39
|
+
});
|
40
|
+
_ref = group.childNodes;
|
41
|
+
_results = [];
|
42
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
43
|
+
option = _ref[_i];
|
44
|
+
_results.push(this.add_option(option, group_position, group.disabled));
|
45
|
+
}
|
46
|
+
return _results;
|
47
|
+
};
|
48
|
+
|
49
|
+
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
50
|
+
if (option.nodeName.toUpperCase() === "OPTION") {
|
51
|
+
if (option.text !== "") {
|
52
|
+
if (group_position != null) {
|
53
|
+
this.parsed[group_position].children += 1;
|
54
|
+
}
|
55
|
+
this.parsed.push({
|
56
|
+
array_index: this.parsed.length,
|
57
|
+
options_index: this.options_index,
|
58
|
+
value: option.value,
|
59
|
+
text: option.text,
|
60
|
+
html: option.innerHTML,
|
61
|
+
selected: option.selected,
|
62
|
+
disabled: group_disabled === true ? group_disabled : option.disabled,
|
63
|
+
group_array_index: group_position,
|
64
|
+
classes: option.className,
|
65
|
+
style: option.style.cssText
|
66
|
+
});
|
67
|
+
} else {
|
68
|
+
this.parsed.push({
|
69
|
+
array_index: this.parsed.length,
|
70
|
+
options_index: this.options_index,
|
71
|
+
empty: true
|
72
|
+
});
|
73
|
+
}
|
74
|
+
return this.options_index += 1;
|
75
|
+
}
|
76
|
+
};
|
77
|
+
|
78
|
+
SelectParser.prototype.escapeExpression = function(text) {
|
79
|
+
var map, unsafe_chars;
|
80
|
+
|
81
|
+
if ((text == null) || text === false) {
|
82
|
+
return "";
|
83
|
+
}
|
84
|
+
if (!/[\&\<\>\"\'\`]/.test(text)) {
|
85
|
+
return text;
|
86
|
+
}
|
87
|
+
map = {
|
88
|
+
"<": "<",
|
89
|
+
">": ">",
|
90
|
+
'"': """,
|
91
|
+
"'": "'",
|
92
|
+
"`": "`"
|
93
|
+
};
|
94
|
+
unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
|
95
|
+
return text.replace(unsafe_chars, function(chr) {
|
96
|
+
return map[chr] || "&";
|
97
|
+
});
|
98
|
+
};
|
99
|
+
|
100
|
+
return SelectParser;
|
101
|
+
|
102
|
+
})();
|
103
|
+
|
104
|
+
SelectParser.select_to_array = function(select) {
|
105
|
+
var child, parser, _i, _len, _ref;
|
106
|
+
|
107
|
+
parser = new SelectParser();
|
108
|
+
_ref = select.childNodes;
|
109
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
110
|
+
child = _ref[_i];
|
111
|
+
parser.add_node(child);
|
112
|
+
}
|
113
|
+
return parser.parsed;
|
114
|
+
};
|
115
|
+
|
116
|
+
AbstractChosen = (function() {
|
117
|
+
function AbstractChosen(form_field, options) {
|
118
|
+
this.form_field = form_field;
|
119
|
+
this.options = options != null ? options : {};
|
120
|
+
if (!AbstractChosen.browser_is_supported()) {
|
121
|
+
return;
|
122
|
+
}
|
123
|
+
this.is_multiple = this.form_field.multiple;
|
124
|
+
this.set_default_text();
|
125
|
+
this.set_default_values();
|
126
|
+
this.setup();
|
127
|
+
this.set_up_html();
|
128
|
+
this.register_observers();
|
129
|
+
}
|
130
|
+
|
131
|
+
AbstractChosen.prototype.set_default_values = function() {
|
132
|
+
var _this = this;
|
133
|
+
|
134
|
+
this.click_test_action = function(evt) {
|
135
|
+
return _this.test_active_click(evt);
|
136
|
+
};
|
137
|
+
this.activate_action = function(evt) {
|
138
|
+
return _this.activate_field(evt);
|
139
|
+
};
|
140
|
+
this.active_field = false;
|
141
|
+
this.mouse_on_container = false;
|
142
|
+
this.results_showing = false;
|
143
|
+
this.result_highlighted = null;
|
144
|
+
this.result_single_selected = null;
|
145
|
+
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
146
|
+
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
147
|
+
this.disable_search = this.options.disable_search || false;
|
148
|
+
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
|
149
|
+
this.group_search = this.options.group_search != null ? this.options.group_search : true;
|
150
|
+
this.search_contains = this.options.search_contains || false;
|
151
|
+
this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
|
152
|
+
this.max_selected_options = this.options.max_selected_options || Infinity;
|
153
|
+
this.inherit_select_classes = this.options.inherit_select_classes || false;
|
154
|
+
this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
|
155
|
+
return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
|
156
|
+
};
|
157
|
+
|
158
|
+
AbstractChosen.prototype.set_default_text = function() {
|
159
|
+
if (this.form_field.getAttribute("data-placeholder")) {
|
160
|
+
this.default_text = this.form_field.getAttribute("data-placeholder");
|
161
|
+
} else if (this.is_multiple) {
|
162
|
+
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
|
163
|
+
} else {
|
164
|
+
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
|
165
|
+
}
|
166
|
+
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
|
167
|
+
};
|
168
|
+
|
169
|
+
AbstractChosen.prototype.mouse_enter = function() {
|
170
|
+
return this.mouse_on_container = true;
|
171
|
+
};
|
172
|
+
|
173
|
+
AbstractChosen.prototype.mouse_leave = function() {
|
174
|
+
return this.mouse_on_container = false;
|
175
|
+
};
|
176
|
+
|
177
|
+
AbstractChosen.prototype.input_focus = function(evt) {
|
178
|
+
var _this = this;
|
179
|
+
|
180
|
+
if (this.is_multiple) {
|
181
|
+
if (!this.active_field) {
|
182
|
+
return setTimeout((function() {
|
183
|
+
return _this.container_mousedown();
|
184
|
+
}), 50);
|
185
|
+
}
|
186
|
+
} else {
|
187
|
+
if (!this.active_field) {
|
188
|
+
return this.activate_field();
|
189
|
+
}
|
190
|
+
}
|
191
|
+
};
|
192
|
+
|
193
|
+
AbstractChosen.prototype.input_blur = function(evt) {
|
194
|
+
var _this = this;
|
195
|
+
|
196
|
+
if (!this.mouse_on_container) {
|
197
|
+
this.active_field = false;
|
198
|
+
return setTimeout((function() {
|
199
|
+
return _this.blur_test();
|
200
|
+
}), 100);
|
201
|
+
}
|
202
|
+
};
|
203
|
+
|
204
|
+
AbstractChosen.prototype.results_option_build = function(options) {
|
205
|
+
var content, data, _i, _len, _ref;
|
206
|
+
|
207
|
+
content = '';
|
208
|
+
_ref = this.results_data;
|
209
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
210
|
+
data = _ref[_i];
|
211
|
+
if (data.group) {
|
212
|
+
content += this.result_add_group(data);
|
213
|
+
} else {
|
214
|
+
content += this.result_add_option(data);
|
215
|
+
}
|
216
|
+
if (options != null ? options.first : void 0) {
|
217
|
+
if (data.selected && this.is_multiple) {
|
218
|
+
this.choice_build(data);
|
219
|
+
} else if (data.selected && !this.is_multiple) {
|
220
|
+
this.single_set_selected_text(data.text);
|
221
|
+
}
|
222
|
+
}
|
223
|
+
}
|
224
|
+
return content;
|
225
|
+
};
|
226
|
+
|
227
|
+
AbstractChosen.prototype.result_add_option = function(option) {
|
228
|
+
var classes, style;
|
229
|
+
|
230
|
+
if (!option.search_match) {
|
231
|
+
return '';
|
232
|
+
}
|
233
|
+
if (!this.include_option_in_results(option)) {
|
234
|
+
return '';
|
235
|
+
}
|
236
|
+
classes = [];
|
237
|
+
if (!option.disabled && !(option.selected && this.is_multiple)) {
|
238
|
+
classes.push("active-result");
|
239
|
+
}
|
240
|
+
if (option.disabled && !(option.selected && this.is_multiple)) {
|
241
|
+
classes.push("disabled-result");
|
242
|
+
}
|
243
|
+
if (option.selected) {
|
244
|
+
classes.push("result-selected");
|
245
|
+
}
|
246
|
+
if (option.group_array_index != null) {
|
247
|
+
classes.push("group-option");
|
248
|
+
}
|
249
|
+
if (option.classes !== "") {
|
250
|
+
classes.push(option.classes);
|
251
|
+
}
|
252
|
+
style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
|
253
|
+
return "<li class=\"" + (classes.join(' ')) + "\"" + style + " data-option-array-index=\"" + option.array_index + "\">" + option.search_text + "</li>";
|
254
|
+
};
|
255
|
+
|
256
|
+
AbstractChosen.prototype.result_add_group = function(group) {
|
257
|
+
if (!(group.search_match || group.group_match)) {
|
258
|
+
return '';
|
259
|
+
}
|
260
|
+
if (!(group.active_options > 0)) {
|
261
|
+
return '';
|
262
|
+
}
|
263
|
+
return "<li class=\"group-result\">" + group.search_text + "</li>";
|
264
|
+
};
|
265
|
+
|
266
|
+
AbstractChosen.prototype.results_update_field = function() {
|
267
|
+
this.set_default_text();
|
268
|
+
if (!this.is_multiple) {
|
269
|
+
this.results_reset_cleanup();
|
270
|
+
}
|
271
|
+
this.result_clear_highlight();
|
272
|
+
this.result_single_selected = null;
|
273
|
+
this.results_build();
|
274
|
+
if (this.results_showing) {
|
275
|
+
return this.winnow_results();
|
276
|
+
}
|
277
|
+
};
|
278
|
+
|
279
|
+
AbstractChosen.prototype.results_toggle = function() {
|
280
|
+
if (this.results_showing) {
|
281
|
+
return this.results_hide();
|
282
|
+
} else {
|
283
|
+
return this.results_show();
|
284
|
+
}
|
285
|
+
};
|
286
|
+
|
287
|
+
AbstractChosen.prototype.results_search = function(evt) {
|
288
|
+
if (this.results_showing) {
|
289
|
+
return this.winnow_results();
|
290
|
+
} else {
|
291
|
+
return this.results_show();
|
292
|
+
}
|
293
|
+
};
|
294
|
+
|
295
|
+
AbstractChosen.prototype.winnow_results = function() {
|
296
|
+
var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
|
297
|
+
|
298
|
+
this.no_results_clear();
|
299
|
+
results = 0;
|
300
|
+
searchText = this.get_search_text();
|
301
|
+
escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
302
|
+
regexAnchor = this.search_contains ? "" : "^";
|
303
|
+
regex = new RegExp(regexAnchor + escapedSearchText, 'i');
|
304
|
+
zregex = new RegExp(escapedSearchText, 'i');
|
305
|
+
_ref = this.results_data;
|
306
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
307
|
+
option = _ref[_i];
|
308
|
+
option.search_match = false;
|
309
|
+
results_group = null;
|
310
|
+
if (this.include_option_in_results(option)) {
|
311
|
+
if (option.group) {
|
312
|
+
option.group_match = false;
|
313
|
+
option.active_options = 0;
|
314
|
+
}
|
315
|
+
if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
|
316
|
+
results_group = this.results_data[option.group_array_index];
|
317
|
+
if (results_group.active_options === 0 && results_group.search_match) {
|
318
|
+
results += 1;
|
319
|
+
}
|
320
|
+
results_group.active_options += 1;
|
321
|
+
}
|
322
|
+
if (!(option.group && !this.group_search)) {
|
323
|
+
option.search_text = option.group ? option.label : option.html;
|
324
|
+
option.search_match = this.search_string_match(option.search_text, regex);
|
325
|
+
if (option.search_match && !option.group) {
|
326
|
+
results += 1;
|
327
|
+
}
|
328
|
+
if (option.search_match) {
|
329
|
+
if (searchText.length) {
|
330
|
+
startpos = option.search_text.search(zregex);
|
331
|
+
text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
|
332
|
+
option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
|
333
|
+
}
|
334
|
+
if (results_group != null) {
|
335
|
+
results_group.group_match = true;
|
336
|
+
}
|
337
|
+
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
|
338
|
+
option.search_match = true;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
}
|
342
|
+
}
|
343
|
+
this.result_clear_highlight();
|
344
|
+
if (results < 1 && searchText.length) {
|
345
|
+
this.update_results_content("");
|
346
|
+
return this.no_results(searchText);
|
347
|
+
} else {
|
348
|
+
this.update_results_content(this.results_option_build());
|
349
|
+
return this.winnow_results_set_highlight();
|
350
|
+
}
|
351
|
+
};
|
352
|
+
|
353
|
+
AbstractChosen.prototype.search_string_match = function(search_string, regex) {
|
354
|
+
var part, parts, _i, _len;
|
355
|
+
|
356
|
+
if (regex.test(search_string)) {
|
357
|
+
return true;
|
358
|
+
} else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
|
359
|
+
parts = search_string.replace(/\[|\]/g, "").split(" ");
|
360
|
+
if (parts.length) {
|
361
|
+
for (_i = 0, _len = parts.length; _i < _len; _i++) {
|
362
|
+
part = parts[_i];
|
363
|
+
if (regex.test(part)) {
|
364
|
+
return true;
|
365
|
+
}
|
366
|
+
}
|
367
|
+
}
|
368
|
+
}
|
369
|
+
};
|
370
|
+
|
371
|
+
AbstractChosen.prototype.choices_count = function() {
|
372
|
+
var option, _i, _len, _ref;
|
373
|
+
|
374
|
+
if (this.selected_option_count != null) {
|
375
|
+
return this.selected_option_count;
|
376
|
+
}
|
377
|
+
this.selected_option_count = 0;
|
378
|
+
_ref = this.form_field.options;
|
379
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
380
|
+
option = _ref[_i];
|
381
|
+
if (option.selected) {
|
382
|
+
this.selected_option_count += 1;
|
383
|
+
}
|
384
|
+
}
|
385
|
+
return this.selected_option_count;
|
386
|
+
};
|
387
|
+
|
388
|
+
AbstractChosen.prototype.choices_click = function(evt) {
|
389
|
+
evt.preventDefault();
|
390
|
+
if (!(this.results_showing || this.is_disabled)) {
|
391
|
+
return this.results_show();
|
392
|
+
}
|
393
|
+
};
|
394
|
+
|
395
|
+
AbstractChosen.prototype.keyup_checker = function(evt) {
|
396
|
+
var stroke, _ref;
|
397
|
+
|
398
|
+
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
|
399
|
+
this.search_field_scale();
|
400
|
+
switch (stroke) {
|
401
|
+
case 8:
|
402
|
+
if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
|
403
|
+
return this.keydown_backstroke();
|
404
|
+
} else if (!this.pending_backstroke) {
|
405
|
+
this.result_clear_highlight();
|
406
|
+
return this.results_search();
|
407
|
+
}
|
408
|
+
break;
|
409
|
+
case 13:
|
410
|
+
evt.preventDefault();
|
411
|
+
if (this.results_showing) {
|
412
|
+
return this.result_select(evt);
|
413
|
+
}
|
414
|
+
break;
|
415
|
+
case 27:
|
416
|
+
if (this.results_showing) {
|
417
|
+
this.results_hide();
|
418
|
+
}
|
419
|
+
return true;
|
420
|
+
case 9:
|
421
|
+
case 38:
|
422
|
+
case 40:
|
423
|
+
case 16:
|
424
|
+
case 91:
|
425
|
+
case 17:
|
426
|
+
break;
|
427
|
+
default:
|
428
|
+
return this.results_search();
|
429
|
+
}
|
430
|
+
};
|
431
|
+
|
432
|
+
AbstractChosen.prototype.container_width = function() {
|
433
|
+
if (this.options.width != null) {
|
434
|
+
return this.options.width;
|
435
|
+
} else {
|
436
|
+
return "" + this.form_field.offsetWidth + "px";
|
437
|
+
}
|
438
|
+
};
|
439
|
+
|
440
|
+
AbstractChosen.prototype.include_option_in_results = function(option) {
|
441
|
+
if (this.is_multiple && (!this.display_selected_options && option.selected)) {
|
442
|
+
return false;
|
443
|
+
}
|
444
|
+
if (!this.display_disabled_options && option.disabled) {
|
445
|
+
return false;
|
446
|
+
}
|
447
|
+
if (option.empty) {
|
448
|
+
return false;
|
449
|
+
}
|
450
|
+
return true;
|
451
|
+
};
|
452
|
+
|
453
|
+
AbstractChosen.browser_is_supported = function() {
|
454
|
+
if (window.navigator.appName === "Microsoft Internet Explorer") {
|
455
|
+
return document.documentMode >= 8;
|
456
|
+
}
|
457
|
+
if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
|
458
|
+
return false;
|
459
|
+
}
|
460
|
+
if (/Android/i.test(window.navigator.userAgent)) {
|
461
|
+
if (/Mobile/i.test(window.navigator.userAgent)) {
|
462
|
+
return false;
|
463
|
+
}
|
464
|
+
}
|
465
|
+
return true;
|
466
|
+
};
|
467
|
+
|
468
|
+
AbstractChosen.default_multiple_text = "Select Some Options";
|
469
|
+
|
470
|
+
AbstractChosen.default_single_text = "Select an Option";
|
471
|
+
|
472
|
+
AbstractChosen.default_no_result_text = "No results match";
|
473
|
+
|
474
|
+
return AbstractChosen;
|
475
|
+
|
476
|
+
})();
|
477
|
+
|
478
|
+
$ = jQuery;
|
479
|
+
|
480
|
+
$.fn.extend({
|
481
|
+
chosen: function(options) {
|
482
|
+
if (!AbstractChosen.browser_is_supported()) {
|
483
|
+
return this;
|
484
|
+
}
|
485
|
+
return this.each(function(input_field) {
|
486
|
+
var $this, chosen;
|
487
|
+
|
488
|
+
$this = $(this);
|
489
|
+
chosen = $this.data('chosen');
|
490
|
+
if (options === 'destroy' && chosen) {
|
491
|
+
chosen.destroy();
|
492
|
+
} else if (!chosen) {
|
493
|
+
$this.data('chosen', new Chosen(this, options));
|
494
|
+
}
|
495
|
+
});
|
496
|
+
}
|
497
|
+
});
|
498
|
+
|
499
|
+
Chosen = (function(_super) {
|
500
|
+
__extends(Chosen, _super);
|
501
|
+
|
502
|
+
function Chosen() {
|
503
|
+
_ref = Chosen.__super__.constructor.apply(this, arguments);
|
504
|
+
return _ref;
|
505
|
+
}
|
506
|
+
|
507
|
+
Chosen.prototype.setup = function() {
|
508
|
+
this.form_field_jq = $(this.form_field);
|
509
|
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
510
|
+
return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
|
511
|
+
};
|
512
|
+
|
513
|
+
Chosen.prototype.set_up_html = function() {
|
514
|
+
var container_classes, container_props;
|
515
|
+
|
516
|
+
container_classes = ["chosen-container"];
|
517
|
+
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
|
518
|
+
if (this.inherit_select_classes && this.form_field.className) {
|
519
|
+
container_classes.push(this.form_field.className);
|
520
|
+
}
|
521
|
+
if (this.is_rtl) {
|
522
|
+
container_classes.push("chosen-rtl");
|
523
|
+
}
|
524
|
+
container_props = {
|
525
|
+
'class': container_classes.join(' '),
|
526
|
+
'style': "width: " + (this.container_width()) + ";",
|
527
|
+
'title': this.form_field.title
|
528
|
+
};
|
529
|
+
if (this.form_field.id.length) {
|
530
|
+
container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
|
531
|
+
}
|
532
|
+
this.container = $("<div />", container_props);
|
533
|
+
if (this.is_multiple) {
|
534
|
+
this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
|
535
|
+
} else {
|
536
|
+
this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
|
537
|
+
}
|
538
|
+
this.form_field_jq.hide().after(this.container);
|
539
|
+
this.dropdown = this.container.find('div.chosen-drop').first();
|
540
|
+
this.search_field = this.container.find('input').first();
|
541
|
+
this.search_results = this.container.find('ul.chosen-results').first();
|
542
|
+
this.search_field_scale();
|
543
|
+
this.search_no_results = this.container.find('li.no-results').first();
|
544
|
+
if (this.is_multiple) {
|
545
|
+
this.search_choices = this.container.find('ul.chosen-choices').first();
|
546
|
+
this.search_container = this.container.find('li.search-field').first();
|
547
|
+
} else {
|
548
|
+
this.search_container = this.container.find('div.chosen-search').first();
|
549
|
+
this.selected_item = this.container.find('.chosen-single').first();
|
550
|
+
}
|
551
|
+
this.results_build();
|
552
|
+
this.set_tab_index();
|
553
|
+
this.set_label_behavior();
|
554
|
+
return this.form_field_jq.trigger("chosen:ready", {
|
555
|
+
chosen: this
|
556
|
+
});
|
557
|
+
};
|
558
|
+
|
559
|
+
Chosen.prototype.register_observers = function() {
|
560
|
+
var _this = this;
|
561
|
+
|
562
|
+
this.container.bind('mousedown.chosen', function(evt) {
|
563
|
+
_this.container_mousedown(evt);
|
564
|
+
});
|
565
|
+
this.container.bind('mouseup.chosen', function(evt) {
|
566
|
+
_this.container_mouseup(evt);
|
567
|
+
});
|
568
|
+
this.container.bind('mouseenter.chosen', function(evt) {
|
569
|
+
_this.mouse_enter(evt);
|
570
|
+
});
|
571
|
+
this.container.bind('mouseleave.chosen', function(evt) {
|
572
|
+
_this.mouse_leave(evt);
|
573
|
+
});
|
574
|
+
this.search_results.bind('mouseup.chosen', function(evt) {
|
575
|
+
_this.search_results_mouseup(evt);
|
576
|
+
});
|
577
|
+
this.search_results.bind('mouseover.chosen', function(evt) {
|
578
|
+
_this.search_results_mouseover(evt);
|
579
|
+
});
|
580
|
+
this.search_results.bind('mouseout.chosen', function(evt) {
|
581
|
+
_this.search_results_mouseout(evt);
|
582
|
+
});
|
583
|
+
this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
|
584
|
+
_this.search_results_mousewheel(evt);
|
585
|
+
});
|
586
|
+
this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
|
587
|
+
_this.results_update_field(evt);
|
588
|
+
});
|
589
|
+
this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
|
590
|
+
_this.activate_field(evt);
|
591
|
+
});
|
592
|
+
this.form_field_jq.bind("chosen:open.chosen", function(evt) {
|
593
|
+
_this.container_mousedown(evt);
|
594
|
+
});
|
595
|
+
this.search_field.bind('blur.chosen', function(evt) {
|
596
|
+
_this.input_blur(evt);
|
597
|
+
});
|
598
|
+
this.search_field.bind('keyup.chosen', function(evt) {
|
599
|
+
_this.keyup_checker(evt);
|
600
|
+
});
|
601
|
+
this.search_field.bind('keydown.chosen', function(evt) {
|
602
|
+
_this.keydown_checker(evt);
|
603
|
+
});
|
604
|
+
this.search_field.bind('focus.chosen', function(evt) {
|
605
|
+
_this.input_focus(evt);
|
606
|
+
});
|
607
|
+
if (this.is_multiple) {
|
608
|
+
return this.search_choices.bind('click.chosen', function(evt) {
|
609
|
+
_this.choices_click(evt);
|
610
|
+
});
|
611
|
+
} else {
|
612
|
+
return this.container.bind('click.chosen', function(evt) {
|
613
|
+
evt.preventDefault();
|
614
|
+
});
|
615
|
+
}
|
616
|
+
};
|
617
|
+
|
618
|
+
Chosen.prototype.destroy = function() {
|
619
|
+
$(document).unbind("click.chosen", this.click_test_action);
|
620
|
+
if (this.search_field[0].tabIndex) {
|
621
|
+
this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
|
622
|
+
}
|
623
|
+
this.container.remove();
|
624
|
+
this.form_field_jq.removeData('chosen');
|
625
|
+
return this.form_field_jq.show();
|
626
|
+
};
|
627
|
+
|
628
|
+
Chosen.prototype.search_field_disabled = function() {
|
629
|
+
this.is_disabled = this.form_field_jq[0].disabled;
|
630
|
+
if (this.is_disabled) {
|
631
|
+
this.container.addClass('chosen-disabled');
|
632
|
+
this.search_field[0].disabled = true;
|
633
|
+
if (!this.is_multiple) {
|
634
|
+
this.selected_item.unbind("focus.chosen", this.activate_action);
|
635
|
+
}
|
636
|
+
return this.close_field();
|
637
|
+
} else {
|
638
|
+
this.container.removeClass('chosen-disabled');
|
639
|
+
this.search_field[0].disabled = false;
|
640
|
+
if (!this.is_multiple) {
|
641
|
+
return this.selected_item.bind("focus.chosen", this.activate_action);
|
642
|
+
}
|
643
|
+
}
|
644
|
+
};
|
645
|
+
|
646
|
+
Chosen.prototype.container_mousedown = function(evt) {
|
647
|
+
if (!this.is_disabled) {
|
648
|
+
if (evt && evt.type === "mousedown" && !this.results_showing) {
|
649
|
+
evt.preventDefault();
|
650
|
+
}
|
651
|
+
if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
|
652
|
+
if (!this.active_field) {
|
653
|
+
if (this.is_multiple) {
|
654
|
+
this.search_field.val("");
|
655
|
+
}
|
656
|
+
$(document).bind('click.chosen', this.click_test_action);
|
657
|
+
this.results_show();
|
658
|
+
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
|
659
|
+
evt.preventDefault();
|
660
|
+
this.results_toggle();
|
661
|
+
}
|
662
|
+
return this.activate_field();
|
663
|
+
}
|
664
|
+
}
|
665
|
+
};
|
666
|
+
|
667
|
+
Chosen.prototype.container_mouseup = function(evt) {
|
668
|
+
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
|
669
|
+
return this.results_reset(evt);
|
670
|
+
}
|
671
|
+
};
|
672
|
+
|
673
|
+
Chosen.prototype.search_results_mousewheel = function(evt) {
|
674
|
+
var delta, _ref1, _ref2;
|
675
|
+
|
676
|
+
delta = -((_ref1 = evt.originalEvent) != null ? _ref1.wheelDelta : void 0) || ((_ref2 = evt.originialEvent) != null ? _ref2.detail : void 0);
|
677
|
+
if (delta != null) {
|
678
|
+
evt.preventDefault();
|
679
|
+
if (evt.type === 'DOMMouseScroll') {
|
680
|
+
delta = delta * 40;
|
681
|
+
}
|
682
|
+
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
|
683
|
+
}
|
684
|
+
};
|
685
|
+
|
686
|
+
Chosen.prototype.blur_test = function(evt) {
|
687
|
+
if (!this.active_field && this.container.hasClass("chosen-container-active")) {
|
688
|
+
return this.close_field();
|
689
|
+
}
|
690
|
+
};
|
691
|
+
|
692
|
+
Chosen.prototype.close_field = function() {
|
693
|
+
$(document).unbind("click.chosen", this.click_test_action);
|
694
|
+
this.active_field = false;
|
695
|
+
this.results_hide();
|
696
|
+
this.container.removeClass("chosen-container-active");
|
697
|
+
this.clear_backstroke();
|
698
|
+
this.show_search_field_default();
|
699
|
+
return this.search_field_scale();
|
700
|
+
};
|
701
|
+
|
702
|
+
Chosen.prototype.activate_field = function() {
|
703
|
+
this.container.addClass("chosen-container-active");
|
704
|
+
this.active_field = true;
|
705
|
+
this.search_field.val(this.search_field.val());
|
706
|
+
return this.search_field.focus();
|
707
|
+
};
|
708
|
+
|
709
|
+
Chosen.prototype.test_active_click = function(evt) {
|
710
|
+
if (this.container.is($(evt.target).closest('.chosen-container'))) {
|
711
|
+
return this.active_field = true;
|
712
|
+
} else {
|
713
|
+
return this.close_field();
|
714
|
+
}
|
715
|
+
};
|
716
|
+
|
717
|
+
Chosen.prototype.results_build = function() {
|
718
|
+
this.parsing = true;
|
719
|
+
this.selected_option_count = null;
|
720
|
+
this.results_data = SelectParser.select_to_array(this.form_field);
|
721
|
+
if (this.is_multiple) {
|
722
|
+
this.search_choices.find("li.search-choice").remove();
|
723
|
+
} else if (!this.is_multiple) {
|
724
|
+
this.single_set_selected_text();
|
725
|
+
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
|
726
|
+
this.search_field[0].readOnly = true;
|
727
|
+
this.container.addClass("chosen-container-single-nosearch");
|
728
|
+
} else {
|
729
|
+
this.search_field[0].readOnly = false;
|
730
|
+
this.container.removeClass("chosen-container-single-nosearch");
|
731
|
+
}
|
732
|
+
}
|
733
|
+
this.update_results_content(this.results_option_build({
|
734
|
+
first: true
|
735
|
+
}));
|
736
|
+
this.search_field_disabled();
|
737
|
+
this.show_search_field_default();
|
738
|
+
this.search_field_scale();
|
739
|
+
return this.parsing = false;
|
740
|
+
};
|
741
|
+
|
742
|
+
Chosen.prototype.result_do_highlight = function(el) {
|
743
|
+
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
744
|
+
|
745
|
+
if (el.length) {
|
746
|
+
this.result_clear_highlight();
|
747
|
+
this.result_highlight = el;
|
748
|
+
this.result_highlight.addClass("highlighted");
|
749
|
+
maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
|
750
|
+
visible_top = this.search_results.scrollTop();
|
751
|
+
visible_bottom = maxHeight + visible_top;
|
752
|
+
high_top = this.result_highlight.position().top + this.search_results.scrollTop();
|
753
|
+
high_bottom = high_top + this.result_highlight.outerHeight();
|
754
|
+
if (high_bottom >= visible_bottom) {
|
755
|
+
return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
|
756
|
+
} else if (high_top < visible_top) {
|
757
|
+
return this.search_results.scrollTop(high_top);
|
758
|
+
}
|
759
|
+
}
|
760
|
+
};
|
761
|
+
|
762
|
+
Chosen.prototype.result_clear_highlight = function() {
|
763
|
+
if (this.result_highlight) {
|
764
|
+
this.result_highlight.removeClass("highlighted");
|
765
|
+
}
|
766
|
+
return this.result_highlight = null;
|
767
|
+
};
|
768
|
+
|
769
|
+
Chosen.prototype.results_show = function() {
|
770
|
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
771
|
+
this.form_field_jq.trigger("chosen:maxselected", {
|
772
|
+
chosen: this
|
773
|
+
});
|
774
|
+
return false;
|
775
|
+
}
|
776
|
+
this.container.addClass("chosen-with-drop");
|
777
|
+
this.form_field_jq.trigger("chosen:showing_dropdown", {
|
778
|
+
chosen: this
|
779
|
+
});
|
780
|
+
this.results_showing = true;
|
781
|
+
this.search_field.focus();
|
782
|
+
this.search_field.val(this.search_field.val());
|
783
|
+
return this.winnow_results();
|
784
|
+
};
|
785
|
+
|
786
|
+
Chosen.prototype.update_results_content = function(content) {
|
787
|
+
return this.search_results.html(content);
|
788
|
+
};
|
789
|
+
|
790
|
+
Chosen.prototype.results_hide = function() {
|
791
|
+
if (this.results_showing) {
|
792
|
+
this.result_clear_highlight();
|
793
|
+
this.container.removeClass("chosen-with-drop");
|
794
|
+
this.form_field_jq.trigger("chosen:hiding_dropdown", {
|
795
|
+
chosen: this
|
796
|
+
});
|
797
|
+
}
|
798
|
+
return this.results_showing = false;
|
799
|
+
};
|
800
|
+
|
801
|
+
Chosen.prototype.set_tab_index = function(el) {
|
802
|
+
var ti;
|
803
|
+
|
804
|
+
if (this.form_field.tabIndex) {
|
805
|
+
ti = this.form_field.tabIndex;
|
806
|
+
this.form_field.tabIndex = -1;
|
807
|
+
return this.search_field[0].tabIndex = ti;
|
808
|
+
}
|
809
|
+
};
|
810
|
+
|
811
|
+
Chosen.prototype.set_label_behavior = function() {
|
812
|
+
var _this = this;
|
813
|
+
|
814
|
+
this.form_field_label = this.form_field_jq.parents("label");
|
815
|
+
if (!this.form_field_label.length && this.form_field.id.length) {
|
816
|
+
this.form_field_label = $("label[for='" + this.form_field.id + "']");
|
817
|
+
}
|
818
|
+
if (this.form_field_label.length > 0) {
|
819
|
+
return this.form_field_label.bind('click.chosen', function(evt) {
|
820
|
+
if (_this.is_multiple) {
|
821
|
+
return _this.container_mousedown(evt);
|
822
|
+
} else {
|
823
|
+
return _this.activate_field();
|
824
|
+
}
|
825
|
+
});
|
826
|
+
}
|
827
|
+
};
|
828
|
+
|
829
|
+
Chosen.prototype.show_search_field_default = function() {
|
830
|
+
if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
|
831
|
+
this.search_field.val(this.default_text);
|
832
|
+
return this.search_field.addClass("default");
|
833
|
+
} else {
|
834
|
+
this.search_field.val("");
|
835
|
+
return this.search_field.removeClass("default");
|
836
|
+
}
|
837
|
+
};
|
838
|
+
|
839
|
+
Chosen.prototype.search_results_mouseup = function(evt) {
|
840
|
+
var target;
|
841
|
+
|
842
|
+
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
843
|
+
if (target.length) {
|
844
|
+
this.result_highlight = target;
|
845
|
+
this.result_select(evt);
|
846
|
+
return this.search_field.focus();
|
847
|
+
}
|
848
|
+
};
|
849
|
+
|
850
|
+
Chosen.prototype.search_results_mouseover = function(evt) {
|
851
|
+
var target;
|
852
|
+
|
853
|
+
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
854
|
+
if (target) {
|
855
|
+
return this.result_do_highlight(target);
|
856
|
+
}
|
857
|
+
};
|
858
|
+
|
859
|
+
Chosen.prototype.search_results_mouseout = function(evt) {
|
860
|
+
if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
|
861
|
+
return this.result_clear_highlight();
|
862
|
+
}
|
863
|
+
};
|
864
|
+
|
865
|
+
Chosen.prototype.choice_build = function(item) {
|
866
|
+
var choice, close_link,
|
867
|
+
_this = this;
|
868
|
+
|
869
|
+
choice = $('<li />', {
|
870
|
+
"class": "search-choice"
|
871
|
+
}).html("<span>" + item.html + "</span>");
|
872
|
+
if (item.disabled) {
|
873
|
+
choice.addClass('search-choice-disabled');
|
874
|
+
} else {
|
875
|
+
close_link = $('<a />', {
|
876
|
+
"class": 'search-choice-close',
|
877
|
+
'data-option-array-index': item.array_index
|
878
|
+
});
|
879
|
+
close_link.bind('click.chosen', function(evt) {
|
880
|
+
return _this.choice_destroy_link_click(evt);
|
881
|
+
});
|
882
|
+
choice.append(close_link);
|
883
|
+
}
|
884
|
+
return this.search_container.before(choice);
|
885
|
+
};
|
886
|
+
|
887
|
+
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
888
|
+
evt.preventDefault();
|
889
|
+
evt.stopPropagation();
|
890
|
+
if (!this.is_disabled) {
|
891
|
+
return this.choice_destroy($(evt.target));
|
892
|
+
}
|
893
|
+
};
|
894
|
+
|
895
|
+
Chosen.prototype.choice_destroy = function(link) {
|
896
|
+
if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
|
897
|
+
this.show_search_field_default();
|
898
|
+
if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
|
899
|
+
this.results_hide();
|
900
|
+
}
|
901
|
+
link.parents('li').first().remove();
|
902
|
+
return this.search_field_scale();
|
903
|
+
}
|
904
|
+
};
|
905
|
+
|
906
|
+
Chosen.prototype.results_reset = function() {
|
907
|
+
this.form_field.options[0].selected = true;
|
908
|
+
this.selected_option_count = null;
|
909
|
+
this.single_set_selected_text();
|
910
|
+
this.show_search_field_default();
|
911
|
+
this.results_reset_cleanup();
|
912
|
+
this.form_field_jq.trigger("change");
|
913
|
+
if (this.active_field) {
|
914
|
+
return this.results_hide();
|
915
|
+
}
|
916
|
+
};
|
917
|
+
|
918
|
+
Chosen.prototype.results_reset_cleanup = function() {
|
919
|
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
920
|
+
return this.selected_item.find("abbr").remove();
|
921
|
+
};
|
922
|
+
|
923
|
+
Chosen.prototype.result_select = function(evt) {
|
924
|
+
var high, item, selected_index;
|
925
|
+
|
926
|
+
if (this.result_highlight) {
|
927
|
+
high = this.result_highlight;
|
928
|
+
this.result_clear_highlight();
|
929
|
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
930
|
+
this.form_field_jq.trigger("chosen:maxselected", {
|
931
|
+
chosen: this
|
932
|
+
});
|
933
|
+
return false;
|
934
|
+
}
|
935
|
+
if (this.is_multiple) {
|
936
|
+
high.removeClass("active-result");
|
937
|
+
} else {
|
938
|
+
if (this.result_single_selected) {
|
939
|
+
this.result_single_selected.removeClass("result-selected");
|
940
|
+
selected_index = this.result_single_selected[0].getAttribute('data-option-array-index');
|
941
|
+
this.results_data[selected_index].selected = false;
|
942
|
+
}
|
943
|
+
this.result_single_selected = high;
|
944
|
+
}
|
945
|
+
high.addClass("result-selected");
|
946
|
+
item = this.results_data[high[0].getAttribute("data-option-array-index")];
|
947
|
+
item.selected = true;
|
948
|
+
this.form_field.options[item.options_index].selected = true;
|
949
|
+
this.selected_option_count = null;
|
950
|
+
if (this.is_multiple) {
|
951
|
+
this.choice_build(item);
|
952
|
+
} else {
|
953
|
+
this.single_set_selected_text(item.text);
|
954
|
+
}
|
955
|
+
if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
|
956
|
+
this.results_hide();
|
957
|
+
}
|
958
|
+
this.search_field.val("");
|
959
|
+
if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
|
960
|
+
this.form_field_jq.trigger("change", {
|
961
|
+
'selected': this.form_field.options[item.options_index].value
|
962
|
+
});
|
963
|
+
}
|
964
|
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
965
|
+
return this.search_field_scale();
|
966
|
+
}
|
967
|
+
};
|
968
|
+
|
969
|
+
Chosen.prototype.single_set_selected_text = function(text) {
|
970
|
+
if (text == null) {
|
971
|
+
text = this.default_text;
|
972
|
+
}
|
973
|
+
if (text === this.default_text) {
|
974
|
+
this.selected_item.addClass("chosen-default");
|
975
|
+
} else {
|
976
|
+
this.single_deselect_control_build();
|
977
|
+
this.selected_item.removeClass("chosen-default");
|
978
|
+
}
|
979
|
+
return this.selected_item.find("span").text(text);
|
980
|
+
};
|
981
|
+
|
982
|
+
Chosen.prototype.result_deselect = function(pos) {
|
983
|
+
var result_data;
|
984
|
+
|
985
|
+
result_data = this.results_data[pos];
|
986
|
+
if (!this.form_field.options[result_data.options_index].disabled) {
|
987
|
+
result_data.selected = false;
|
988
|
+
this.form_field.options[result_data.options_index].selected = false;
|
989
|
+
this.selected_option_count = null;
|
990
|
+
this.result_clear_highlight();
|
991
|
+
if (this.results_showing) {
|
992
|
+
this.winnow_results();
|
993
|
+
}
|
994
|
+
this.form_field_jq.trigger("change", {
|
995
|
+
deselected: this.form_field.options[result_data.options_index].value
|
996
|
+
});
|
997
|
+
this.search_field_scale();
|
998
|
+
return true;
|
999
|
+
} else {
|
1000
|
+
return false;
|
1001
|
+
}
|
1002
|
+
};
|
1003
|
+
|
1004
|
+
Chosen.prototype.single_deselect_control_build = function() {
|
1005
|
+
if (!this.allow_single_deselect) {
|
1006
|
+
return;
|
1007
|
+
}
|
1008
|
+
if (!this.selected_item.find("abbr").length) {
|
1009
|
+
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
|
1010
|
+
}
|
1011
|
+
return this.selected_item.addClass("chosen-single-with-deselect");
|
1012
|
+
};
|
1013
|
+
|
1014
|
+
Chosen.prototype.get_search_text = function() {
|
1015
|
+
if (this.search_field.val() === this.default_text) {
|
1016
|
+
return "";
|
1017
|
+
} else {
|
1018
|
+
return $('<div/>').text($.trim(this.search_field.val())).html();
|
1019
|
+
}
|
1020
|
+
};
|
1021
|
+
|
1022
|
+
Chosen.prototype.winnow_results_set_highlight = function() {
|
1023
|
+
var do_high, selected_results;
|
1024
|
+
|
1025
|
+
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
|
1026
|
+
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
1027
|
+
if (do_high != null) {
|
1028
|
+
return this.result_do_highlight(do_high);
|
1029
|
+
}
|
1030
|
+
};
|
1031
|
+
|
1032
|
+
Chosen.prototype.no_results = function(terms) {
|
1033
|
+
var no_results_html;
|
1034
|
+
|
1035
|
+
no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
|
1036
|
+
no_results_html.find("span").first().html(terms);
|
1037
|
+
return this.search_results.append(no_results_html);
|
1038
|
+
};
|
1039
|
+
|
1040
|
+
Chosen.prototype.no_results_clear = function() {
|
1041
|
+
return this.search_results.find(".no-results").remove();
|
1042
|
+
};
|
1043
|
+
|
1044
|
+
Chosen.prototype.keydown_arrow = function() {
|
1045
|
+
var next_sib;
|
1046
|
+
|
1047
|
+
if (this.results_showing && this.result_highlight) {
|
1048
|
+
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
1049
|
+
if (next_sib) {
|
1050
|
+
return this.result_do_highlight(next_sib);
|
1051
|
+
}
|
1052
|
+
} else {
|
1053
|
+
return this.results_show();
|
1054
|
+
}
|
1055
|
+
};
|
1056
|
+
|
1057
|
+
Chosen.prototype.keyup_arrow = function() {
|
1058
|
+
var prev_sibs;
|
1059
|
+
|
1060
|
+
if (!this.results_showing && !this.is_multiple) {
|
1061
|
+
return this.results_show();
|
1062
|
+
} else if (this.result_highlight) {
|
1063
|
+
prev_sibs = this.result_highlight.prevAll("li.active-result");
|
1064
|
+
if (prev_sibs.length) {
|
1065
|
+
return this.result_do_highlight(prev_sibs.first());
|
1066
|
+
} else {
|
1067
|
+
if (this.choices_count() > 0) {
|
1068
|
+
this.results_hide();
|
1069
|
+
}
|
1070
|
+
return this.result_clear_highlight();
|
1071
|
+
}
|
1072
|
+
}
|
1073
|
+
};
|
1074
|
+
|
1075
|
+
Chosen.prototype.keydown_backstroke = function() {
|
1076
|
+
var next_available_destroy;
|
1077
|
+
|
1078
|
+
if (this.pending_backstroke) {
|
1079
|
+
this.choice_destroy(this.pending_backstroke.find("a").first());
|
1080
|
+
return this.clear_backstroke();
|
1081
|
+
} else {
|
1082
|
+
next_available_destroy = this.search_container.siblings("li.search-choice").last();
|
1083
|
+
if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
|
1084
|
+
this.pending_backstroke = next_available_destroy;
|
1085
|
+
if (this.single_backstroke_delete) {
|
1086
|
+
return this.keydown_backstroke();
|
1087
|
+
} else {
|
1088
|
+
return this.pending_backstroke.addClass("search-choice-focus");
|
1089
|
+
}
|
1090
|
+
}
|
1091
|
+
}
|
1092
|
+
};
|
1093
|
+
|
1094
|
+
Chosen.prototype.clear_backstroke = function() {
|
1095
|
+
if (this.pending_backstroke) {
|
1096
|
+
this.pending_backstroke.removeClass("search-choice-focus");
|
1097
|
+
}
|
1098
|
+
return this.pending_backstroke = null;
|
1099
|
+
};
|
1100
|
+
|
1101
|
+
Chosen.prototype.keydown_checker = function(evt) {
|
1102
|
+
var stroke, _ref1;
|
1103
|
+
|
1104
|
+
stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
|
1105
|
+
this.search_field_scale();
|
1106
|
+
if (stroke !== 8 && this.pending_backstroke) {
|
1107
|
+
this.clear_backstroke();
|
1108
|
+
}
|
1109
|
+
switch (stroke) {
|
1110
|
+
case 8:
|
1111
|
+
this.backstroke_length = this.search_field.val().length;
|
1112
|
+
break;
|
1113
|
+
case 9:
|
1114
|
+
if (this.results_showing && !this.is_multiple) {
|
1115
|
+
this.result_select(evt);
|
1116
|
+
}
|
1117
|
+
this.mouse_on_container = false;
|
1118
|
+
break;
|
1119
|
+
case 13:
|
1120
|
+
evt.preventDefault();
|
1121
|
+
break;
|
1122
|
+
case 38:
|
1123
|
+
evt.preventDefault();
|
1124
|
+
this.keyup_arrow();
|
1125
|
+
break;
|
1126
|
+
case 40:
|
1127
|
+
evt.preventDefault();
|
1128
|
+
this.keydown_arrow();
|
1129
|
+
break;
|
1130
|
+
}
|
1131
|
+
};
|
1132
|
+
|
1133
|
+
Chosen.prototype.search_field_scale = function() {
|
1134
|
+
var div, f_width, h, style, style_block, styles, w, _i, _len;
|
1135
|
+
|
1136
|
+
if (this.is_multiple) {
|
1137
|
+
h = 0;
|
1138
|
+
w = 0;
|
1139
|
+
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
|
1140
|
+
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
|
1141
|
+
for (_i = 0, _len = styles.length; _i < _len; _i++) {
|
1142
|
+
style = styles[_i];
|
1143
|
+
style_block += style + ":" + this.search_field.css(style) + ";";
|
1144
|
+
}
|
1145
|
+
div = $('<div />', {
|
1146
|
+
'style': style_block
|
1147
|
+
});
|
1148
|
+
div.text(this.search_field.val());
|
1149
|
+
$('body').append(div);
|
1150
|
+
w = div.width() + 25;
|
1151
|
+
div.remove();
|
1152
|
+
f_width = this.container.outerWidth();
|
1153
|
+
if (w > f_width - 10) {
|
1154
|
+
w = f_width - 10;
|
1155
|
+
}
|
1156
|
+
return this.search_field.css({
|
1157
|
+
'width': w + 'px'
|
1158
|
+
});
|
1159
|
+
}
|
1160
|
+
};
|
1161
|
+
|
1162
|
+
return Chosen;
|
1163
|
+
|
1164
|
+
})(AbstractChosen);
|
1165
|
+
|
1166
|
+
}).call(this);
|