├── .gitignore ├── README.md ├── assets ├── css │ ├── bootstrap.css │ ├── custom.css │ ├── foundation-datepicker.min.css │ ├── foundation.min.css │ ├── i-con.css │ └── style.css ├── fonts │ ├── georgia.woff │ ├── georgiab.woff │ ├── georgiai.woff │ ├── georgiaz.woff │ └── style.css ├── images │ ├── Givaudan-Globe-Logo.png │ ├── Givaudan-textile-Logo.png │ └── nav.png └── js │ ├── bootstrap-timepicker.js │ ├── bootstrap.min.js │ ├── custom.js │ ├── foundation-datepicker.js │ ├── google-spreadsheet.coffee │ ├── google-spreadsheet.js │ ├── infobox.js │ ├── jquery.min.js │ ├── markercluster.js │ └── popper.min.js ├── favicon.ico ├── index.html ├── index2.html └── places.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | node_modules/ 3 | npm-debug.log 4 | yarn-error.log 5 | 6 | # Laravel 4 specific 7 | bootstrap/compiled.php 8 | app/storage/ 9 | 10 | # Laravel 5 & Lumen specific 11 | public/storage 12 | public/hot 13 | 14 | # Laravel 5 & Lumen specific with changed public path 15 | public_html/storage 16 | public_html/hot 17 | 18 | storage/*.key 19 | .env 20 | Homestead.yaml 21 | Homestead.json 22 | /.vagrant 23 | .phpunit.result.cache 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Map-View 2 | Show map with levels 3 | -------------------------------------------------------------------------------- /assets/css/custom.css: -------------------------------------------------------------------------------- 1 | .sidenav { 2 | height: 95%; 3 | width: 20%; 4 | position: fixed; 5 | z-index: 1; 6 | top: 60px; 7 | left: 500px; 8 | background-color: white; 9 | overflow-x: hidden; 10 | transition: 0.5s; 11 | } 12 | .nav-title { 13 | font-size: 30px; 14 | font-weight: bold; 15 | } 16 | 17 | .chk-filter { 18 | font-size: 20px; 19 | font-weight: bold; 20 | } 21 | 22 | #propertymap .gm-style-iw{ 23 | box-shadow:none; 24 | background: rgb(39, 48, 49)!important; 25 | color:#515151; 26 | font-family: "Georgia", "Open Sans", Sans-serif; 27 | text-align: center; 28 | width: 100% !important; 29 | border-radius: 0; 30 | left: 0 !important; 31 | top: 20px !important; 32 | } 33 | .gm-style .gm-style-iw-t::after { 34 | background: rgb(39,48,49); 35 | box-shadow: -2px 2px 2px 0 rgb(178 178 178 / 40%); 36 | content: ""; 37 | height: 30px; 38 | left: 0; 39 | position: absolute; 40 | top: -20px; 41 | transform: translate(-50%,-50%) rotate(-45deg); 42 | width: 30px; 43 | box-shadow: -9px 8px 7px 0px rgb(196 242 247 / 60%) 44 | } 45 | .gm-style-iw-d { 46 | overflow: hidden !important; 47 | } 48 | .gm-style .gm-style-iw-c { 49 | position: absolute; 50 | box-sizing: border-box; 51 | overflow: hidden; 52 | top: -20px; 53 | left: 0; 54 | /* transform: translate(-50%,-100%); */ 55 | background-color: rgb(39,48,49); 56 | box-shadow: 0px 0px 9px 9px rgb(196 242 247 / 60%); 57 | border-radius: 0px; 58 | padding: 0px; 59 | max-width: 300px !important; 60 | min-width: 300px !important; 61 | max-height: fit-content !important; 62 | margin-left: 50px; 63 | } 64 | 65 | .property_title { 66 | padding-top: 2rem; 67 | padding-left: 1rem; 68 | font-size: 23px; 69 | font-family: auto; 70 | color: rgb(103 222 235); 71 | } 72 | 73 | .property_content { 74 | font-family: auto; 75 | color: white; 76 | font-size: 15px; 77 | padding-top: 1rem; 78 | flex-wrap: wrap; 79 | padding-left: 1rem; 80 | padding-right: 1rem; 81 | } 82 | 83 | .property_activity { 84 | padding-top: 2rem; 85 | padding-left: 1rem; 86 | font-size: 20px; 87 | font-family: auto; 88 | color: rgb(103 222 235); 89 | } 90 | 91 | .property_detail { 92 | font-family: auto; 93 | color: white; 94 | font-size: 15px; 95 | padding-top: 1rem; 96 | flex-wrap: wrap; 97 | padding-left: 1rem; 98 | padding-right: 1rem; 99 | padding-bottom: 2rem; 100 | } 101 | 102 | @media (max-width : 700px) { 103 | .responsive-title { 104 | font-size: 20px; 105 | } 106 | } 107 | @media (min-width : 700px) { 108 | .responsive-title { 109 | font-size: 28px; 110 | } 111 | } 112 | 113 | #logo-image:hover { 114 | cursor: pointer; 115 | } 116 | 117 | .gmnoprint { 118 | display: none; 119 | } 120 | 121 | .gm-ui-hover-effect { 122 | display: none !important; 123 | } -------------------------------------------------------------------------------- /assets/css/foundation-datepicker.min.css: -------------------------------------------------------------------------------- 1 | .datepicker{display:none;position:absolute;padding:4px;margin-top:1px;direction:ltr}.datepicker.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;list-style:none;background-color:#fff;border:1px solid rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;color:#333;font-size:13px;line-height:18px}.datepicker.dropdown-menu td,.datepicker.dropdown-menu th{padding:4px 5px}.datepicker table{border:0;margin:0;width:auto}.datepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer}.datepicker td,.datepicker th{text-align:center;width:20px;height:20px;border:0;font-size:12px;padding:4px 8px;cursor:pointer}.datepicker td{background:#fff}.datepicker td span.active,.datepicker td.active.day,.datepicker td.active.year{background:#2ba6cb}.datepicker td.new,.datepicker td.old{color:#999}.datepicker td span.month.disabled,.datepicker td span.year.disabled,.datepicker td.day.disabled{color:#eee}.datepicker th{background:#fff}.datepicker th span.active,.datepicker th.active.day,.datepicker th.active.year{background:#2ba6cb}.datepicker th.date-switch{width:145px}.datepicker .cw{font-size:10px;width:12px;padding:0 2px 0 5px;vertical-align:middle}.datepicker.days div.datepicker-days,.datepicker.months div.datepicker-months,.datepicker.years div.datepicker-years{display:block}.datepicker-dropdown:after,.datepicker-dropdown:before{content:'';display:inline-block;position:absolute}.datepicker thead tr:first-child th{cursor:pointer}.datepicker thead tr:first-child th.cw{cursor:default;background-color:transparent}.datepicker tfoot tr:first-child th{cursor:pointer}.datepicker-inline{width:220px}.datepicker-rtl{direction:rtl}.datepicker-rtl table tr td span{float:right}.datepicker-dropdown{top:0;left:0}.datepicker-dropdown:before{border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:1px solid rgba(0,0,0,.2);top:-7px;left:6px}.datepicker-dropdown:after{border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;top:-6px;left:7px}.datepicker-dropdown::after,.datepicker-dropdown::before,.datepicker>div{display:none}.datepicker-close{position:absolute;top:-30px;right:0;width:15px;height:30px;padding:0;display:none}.table-striped .datepicker table tr td,.table-striped .datepicker table tr th{background-color:transparent} -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Custom css 3 | */ 4 | 5 | .setting-menu .list-item { 6 | cursor: pointer; 7 | padding: 0.5rem 0.625rem; 8 | } 9 | 10 | .setting-menu .list-item:hover span, 11 | .setting-menu .list-item:hover i { 12 | color: #137eff; 13 | } 14 | 15 | .setting-menu .item a, 16 | .setting-menu .item span { 17 | color: inherit; 18 | } 19 | 20 | .setting-menu .list-item:active { 21 | background: rgba(135, 150, 165, 0.075); 22 | } 23 | 24 | .setting-menu .list-item.active { 25 | background: rgba(135, 150, 165, 0.075); 26 | } 27 | 28 | .setting-menu .list-item:active * { 29 | color: gray; 30 | } 31 | 32 | .setting-menu .list-item * { 33 | color: grey; 34 | } 35 | 36 | .setting-menu .active span { 37 | color: #137eff !important; 38 | } 39 | 40 | tbody { 41 | cursor: pointer; 42 | } 43 | 44 | tbody tr:hover { 45 | background: #ffffff !important; 46 | } 47 | 48 | .bg-success-lt:hover { 49 | background: #e5f5e1 !important; 50 | color: #479f35 !important; 51 | } 52 | 53 | .bg-warning-lt:hover { 54 | background: #fff8e3 !important; 55 | color: #ffc41a !important; 56 | } 57 | 58 | .bg-primary-lt:hover { 59 | color: #0065df !important; 60 | background-color: #d9eaff !important; 61 | } 62 | 63 | .bg-danger-lt:hover { 64 | color: #fe1a35 !important; 65 | background-color: #ffe3e6 !important; 66 | } 67 | 68 | .bg-secondary-lt:hover { 69 | color: #657380 !important; 70 | background-color: #eaedef !important; 71 | } 72 | 73 | .modal .process-bar { 74 | transition: 1s; 75 | } 76 | 77 | #accordion .row:hover { 78 | background: rgba(135, 150, 165, 0.075); 79 | cursor: pointer; 80 | } 81 | 82 | .animation-icon img { 83 | width: 16px; 84 | height: 16px; 85 | } 86 | 87 | .animation-icon img.icon-lg { 88 | width: 30px; 89 | height: 30px; 90 | } 91 | 92 | .animation-icon img.stop { 93 | display: block; 94 | } 95 | 96 | .animation-icon img.play { 97 | display: none; 98 | } 99 | 100 | .animation-icon:hover img.play { 101 | display: block; 102 | } 103 | 104 | .animation-icon:hover img.stop { 105 | display: none; 106 | } 107 | 108 | footer { 109 | width: 100%; 110 | z-index: 1010; 111 | height: 100px; 112 | position: fixed; 113 | bottom: 0; 114 | background: white; 115 | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 -1px 0px rgba(0, 0, 0, 0.015); 116 | padding: 20px 50px 20px 50px; 117 | } 118 | 119 | .alert-container { 120 | display: flex; 121 | justify-content: flex-end; 122 | align-items: center; 123 | } 124 | 125 | .alert { 126 | cursor: pointer; 127 | margin-bottom: 0px; 128 | } 129 | 130 | #accordion .row { 131 | border-bottom: 1px solid rgba(135, 150, 165, 0.075); 132 | } 133 | 134 | #accordion .collapse .row { 135 | background: #fbfbfd; 136 | } 137 | 138 | #accordion .collapse .row:hover { 139 | background: rgba(135, 150, 165, 0.075); 140 | } 141 | 142 | img.icon { 143 | width: 16px; 144 | height: 16px; 145 | margin-right: 5px; 146 | } 147 | 148 | .badge { 149 | font-weight: normal; 150 | } 151 | 152 | #content-aside { 153 | z-index: 1005; 154 | } 155 | 156 | table td { 157 | vertical-align: middle!important; 158 | } 159 | 160 | .scroll-container { 161 | overflow-x: hidden; 162 | overflow-y: scroll; 163 | } 164 | 165 | 166 | /* .scroll-container:hover { 167 | overflow-y: overlay; 168 | } */ 169 | 170 | body.modal-open .setting-menu { 171 | border-radius: 0px!important; 172 | } 173 | 174 | .margin-bottom-80 { 175 | margin-bottom: 80px; 176 | } 177 | 178 | input::-webkit-outer-spin-button, 179 | input::-webkit-inner-spin-button { 180 | -webkit-appearance: none; 181 | margin: 0; 182 | } 183 | 184 | .period-table-td { 185 | border-top: 0.5px solid rgba(135, 150, 165, 0.1) !important; 186 | } 187 | .supplier-dropdwon:hover{ 188 | color:#4D7CFE !important; 189 | } 190 | .import-icon-check{ 191 | width: 16px; 192 | height: 16px; 193 | } 194 | -------------------------------------------------------------------------------- /assets/fonts/georgia.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-free89/Map-View/b80f5b3ec0d7e4dd355704cf4f8a28e5d836cbef/assets/fonts/georgia.woff -------------------------------------------------------------------------------- /assets/fonts/georgiab.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-free89/Map-View/b80f5b3ec0d7e4dd355704cf4f8a28e5d836cbef/assets/fonts/georgiab.woff -------------------------------------------------------------------------------- /assets/fonts/georgiai.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-free89/Map-View/b80f5b3ec0d7e4dd355704cf4f8a28e5d836cbef/assets/fonts/georgiai.woff -------------------------------------------------------------------------------- /assets/fonts/georgiaz.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-free89/Map-View/b80f5b3ec0d7e4dd355704cf4f8a28e5d836cbef/assets/fonts/georgiaz.woff -------------------------------------------------------------------------------- /assets/fonts/style.css: -------------------------------------------------------------------------------- 1 | /* #### Generated By: http://www.cufonfonts.com #### */ 2 | 3 | @font-face { 4 | font-family: 'Georgia Regular'; 5 | font-style: normal; 6 | font-weight: normal; 7 | src: local('Georgia Regular'), url('georgia.woff') format('woff'); 8 | } 9 | 10 | 11 | @font-face { 12 | font-family: 'Georgia Italic'; 13 | font-style: normal; 14 | font-weight: normal; 15 | src: local('Georgia Italic'), url('georgiai.woff') format('woff'); 16 | } 17 | 18 | 19 | @font-face { 20 | font-family: 'Georgia Bold'; 21 | font-style: normal; 22 | font-weight: normal; 23 | src: local('Georgia Bold'), url('georgiab.woff') format('woff'); 24 | } 25 | 26 | 27 | @font-face { 28 | font-family: 'Georgia Bold Italic'; 29 | font-style: normal; 30 | font-weight: normal; 31 | src: local('Georgia Bold Italic'), url('georgiaz.woff') format('woff'); 32 | } -------------------------------------------------------------------------------- /assets/images/Givaudan-Globe-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-free89/Map-View/b80f5b3ec0d7e4dd355704cf4f8a28e5d836cbef/assets/images/Givaudan-Globe-Logo.png -------------------------------------------------------------------------------- /assets/images/Givaudan-textile-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-free89/Map-View/b80f5b3ec0d7e4dd355704cf4f8a28e5d836cbef/assets/images/Givaudan-textile-Logo.png -------------------------------------------------------------------------------- /assets/images/nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-free89/Map-View/b80f5b3ec0d7e4dd355704cf4f8a28e5d836cbef/assets/images/nav.png -------------------------------------------------------------------------------- /assets/js/bootstrap-timepicker.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Timepicker Component for Twitter Bootstrap 3 | * 4 | * Copyright 2013 Joris de Wit and bootstrap-timepicker contributors 5 | * 6 | * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | (function($, window, document) { 12 | 'use strict'; 13 | 14 | // TIMEPICKER PUBLIC CLASS DEFINITION 15 | var Timepicker = function(element, options) { 16 | this.widget = ''; 17 | this.$element = $(element); 18 | this.defaultTime = options.defaultTime; 19 | this.disableFocus = options.disableFocus; 20 | this.disableMousewheel = options.disableMousewheel; 21 | this.isOpen = options.isOpen; 22 | this.minuteStep = options.minuteStep; 23 | this.modalBackdrop = options.modalBackdrop; 24 | this.orientation = options.orientation; 25 | this.secondStep = options.secondStep; 26 | this.snapToStep = options.snapToStep; 27 | this.showInputs = options.showInputs; 28 | this.showMeridian = options.showMeridian; 29 | this.showSeconds = options.showSeconds; 30 | this.template = options.template; 31 | this.appendWidgetTo = options.appendWidgetTo; 32 | this.showWidgetOnAddonClick = options.showWidgetOnAddonClick; 33 | this.icons = options.icons; 34 | this.maxHours = options.maxHours; 35 | this.explicitMode = options.explicitMode; // If true 123 = 1:23, 12345 = 1:23:45, else invalid. 36 | 37 | this.handleDocumentClick = function (e) { 38 | var self = e.data.scope; 39 | // This condition was inspired by bootstrap-datepicker. 40 | // The element the timepicker is invoked on is the input but it has a sibling for addon/button. 41 | if (!(self.$element.parent().find(e.target).length || 42 | self.$widget.is(e.target) || 43 | self.$widget.find(e.target).length)) { 44 | self.hideWidget(); 45 | } 46 | }; 47 | 48 | this._init(); 49 | }; 50 | 51 | Timepicker.prototype = { 52 | 53 | constructor: Timepicker, 54 | _init: function() { 55 | var self = this; 56 | 57 | if (this.showWidgetOnAddonClick && (this.$element.parent().hasClass('input-group') && this.$element.parent().hasClass('bootstrap-timepicker'))) { 58 | this.$element.parent('.input-group.bootstrap-timepicker').find('.input-group-addon').on({ 59 | 'click.timepicker': $.proxy(this.showWidget, this) 60 | }); 61 | this.$element.on({ 62 | 'focus.timepicker': $.proxy(this.highlightUnit, this), 63 | 'click.timepicker': $.proxy(this.highlightUnit, this), 64 | 'keydown.timepicker': $.proxy(this.elementKeydown, this), 65 | 'blur.timepicker': $.proxy(this.blurElement, this), 66 | 'mousewheel.timepicker DOMMouseScroll.timepicker': $.proxy(this.mousewheel, this) 67 | }); 68 | } else { 69 | if (this.template) { 70 | this.$element.on({ 71 | 'focus.timepicker': $.proxy(this.showWidget, this), 72 | 'click.timepicker': $.proxy(this.showWidget, this), 73 | 'blur.timepicker': $.proxy(this.blurElement, this), 74 | 'mousewheel.timepicker DOMMouseScroll.timepicker': $.proxy(this.mousewheel, this) 75 | }); 76 | } else { 77 | this.$element.on({ 78 | 'focus.timepicker': $.proxy(this.highlightUnit, this), 79 | 'click.timepicker': $.proxy(this.highlightUnit, this), 80 | 'keydown.timepicker': $.proxy(this.elementKeydown, this), 81 | 'blur.timepicker': $.proxy(this.blurElement, this), 82 | 'mousewheel.timepicker DOMMouseScroll.timepicker': $.proxy(this.mousewheel, this) 83 | }); 84 | } 85 | } 86 | 87 | if (this.template !== false) { 88 | this.$widget = $(this.getTemplate()).on('click', $.proxy(this.widgetClick, this)); 89 | } else { 90 | this.$widget = false; 91 | } 92 | 93 | if (this.showInputs && this.$widget !== false) { 94 | this.$widget.find('input').each(function() { 95 | $(this).on({ 96 | 'click.timepicker': function() { $(this).select(); }, 97 | 'keydown.timepicker': $.proxy(self.widgetKeydown, self), 98 | 'keyup.timepicker': $.proxy(self.widgetKeyup, self) 99 | }); 100 | }); 101 | } 102 | 103 | this.setDefaultTime(this.defaultTime); 104 | }, 105 | 106 | blurElement: function() { 107 | this.highlightedUnit = null; 108 | this.updateFromElementVal(); 109 | }, 110 | 111 | clear: function() { 112 | this.hour = ''; 113 | this.minute = ''; 114 | this.second = ''; 115 | this.meridian = ''; 116 | 117 | this.$element.val(''); 118 | }, 119 | 120 | decrementHour: function() { 121 | if (this.showMeridian) { 122 | if (this.hour === 1) { 123 | this.hour = 12; 124 | } else if (this.hour === 12) { 125 | this.hour--; 126 | 127 | return this.toggleMeridian(); 128 | } else if (this.hour === 0) { 129 | this.hour = 11; 130 | 131 | return this.toggleMeridian(); 132 | } else { 133 | this.hour--; 134 | } 135 | } else { 136 | if (this.hour <= 0) { 137 | this.hour = this.maxHours - 1; 138 | } else { 139 | this.hour--; 140 | } 141 | } 142 | }, 143 | 144 | decrementMinute: function(step) { 145 | var newVal; 146 | 147 | if (step) { 148 | newVal = this.minute - step; 149 | } else { 150 | newVal = this.minute - this.minuteStep; 151 | } 152 | 153 | if (newVal < 0) { 154 | this.decrementHour(); 155 | this.minute = newVal + 60; 156 | } else { 157 | this.minute = newVal; 158 | } 159 | }, 160 | 161 | decrementSecond: function() { 162 | var newVal = this.second - this.secondStep; 163 | 164 | if (newVal < 0) { 165 | this.decrementMinute(true); 166 | this.second = newVal + 60; 167 | } else { 168 | this.second = newVal; 169 | } 170 | }, 171 | 172 | elementKeydown: function(e) { 173 | switch (e.which) { 174 | case 9: //tab 175 | if (e.shiftKey) { 176 | if (this.highlightedUnit === 'hour') { 177 | this.hideWidget(); 178 | break; 179 | } 180 | this.highlightPrevUnit(); 181 | } else if ((this.showMeridian && this.highlightedUnit === 'meridian') || (this.showSeconds && this.highlightedUnit === 'second') || (!this.showMeridian && !this.showSeconds && this.highlightedUnit ==='minute')) { 182 | this.hideWidget(); 183 | break; 184 | } else { 185 | this.highlightNextUnit(); 186 | } 187 | e.preventDefault(); 188 | this.updateFromElementVal(); 189 | break; 190 | case 27: // escape 191 | this.updateFromElementVal(); 192 | break; 193 | case 37: // left arrow 194 | e.preventDefault(); 195 | this.highlightPrevUnit(); 196 | this.updateFromElementVal(); 197 | break; 198 | case 38: // up arrow 199 | e.preventDefault(); 200 | switch (this.highlightedUnit) { 201 | case 'hour': 202 | this.incrementHour(); 203 | this.highlightHour(); 204 | break; 205 | case 'minute': 206 | this.incrementMinute(); 207 | this.highlightMinute(); 208 | break; 209 | case 'second': 210 | this.incrementSecond(); 211 | this.highlightSecond(); 212 | break; 213 | case 'meridian': 214 | this.toggleMeridian(); 215 | this.highlightMeridian(); 216 | break; 217 | } 218 | this.update(); 219 | break; 220 | case 39: // right arrow 221 | e.preventDefault(); 222 | this.highlightNextUnit(); 223 | this.updateFromElementVal(); 224 | break; 225 | case 40: // down arrow 226 | e.preventDefault(); 227 | switch (this.highlightedUnit) { 228 | case 'hour': 229 | this.decrementHour(); 230 | this.highlightHour(); 231 | break; 232 | case 'minute': 233 | this.decrementMinute(); 234 | this.highlightMinute(); 235 | break; 236 | case 'second': 237 | this.decrementSecond(); 238 | this.highlightSecond(); 239 | break; 240 | case 'meridian': 241 | this.toggleMeridian(); 242 | this.highlightMeridian(); 243 | break; 244 | } 245 | 246 | this.update(); 247 | break; 248 | } 249 | }, 250 | 251 | getCursorPosition: function() { 252 | var input = this.$element.get(0); 253 | 254 | if ('selectionStart' in input) {// Standard-compliant browsers 255 | 256 | return input.selectionStart; 257 | } else if (document.selection) {// IE fix 258 | input.focus(); 259 | var sel = document.selection.createRange(), 260 | selLen = document.selection.createRange().text.length; 261 | 262 | sel.moveStart('character', - input.value.length); 263 | 264 | return sel.text.length - selLen; 265 | } 266 | }, 267 | 268 | getTemplate: function() { 269 | var template, 270 | hourTemplate, 271 | minuteTemplate, 272 | secondTemplate, 273 | meridianTemplate, 274 | templateContent; 275 | 276 | if (this.showInputs) { 277 | hourTemplate = ''; 278 | minuteTemplate = ''; 279 | secondTemplate = ''; 280 | meridianTemplate = ''; 281 | } else { 282 | hourTemplate = ''; 283 | minuteTemplate = ''; 284 | secondTemplate = ''; 285 | meridianTemplate = ''; 286 | } 287 | 288 | templateContent = ''+ 289 | ''+ 290 | ''+ 291 | ''+ 292 | ''+ 293 | (this.showSeconds ? 294 | ''+ 295 | '' 296 | : '') + 297 | (this.showMeridian ? 298 | ''+ 299 | '' 300 | : '') + 301 | ''+ 302 | ''+ 303 | ' '+ 304 | ''+ 305 | ' '+ 306 | (this.showSeconds ? 307 | ''+ 308 | '' 309 | : '') + 310 | (this.showMeridian ? 311 | ''+ 312 | '' 313 | : '') + 314 | ''+ 315 | ''+ 316 | ''+ 317 | ''+ 318 | ''+ 319 | (this.showSeconds ? 320 | ''+ 321 | '' 322 | : '') + 323 | (this.showMeridian ? 324 | ''+ 325 | '' 326 | : '') + 327 | ''+ 328 | '
   
'+ hourTemplate +':'+ minuteTemplate +':'+ secondTemplate +' '+ meridianTemplate +'
  
'; 329 | 330 | switch(this.template) { 331 | case 'modal': 332 | template = ''; 344 | break; 345 | case 'dropdown': 346 | template = ''; 347 | break; 348 | } 349 | 350 | return template; 351 | }, 352 | 353 | getTime: function() { 354 | if (this.hour === '') { 355 | return ''; 356 | } 357 | 358 | return this.hour + ':' + (this.minute.toString().length === 1 ? '0' + this.minute : this.minute) + (this.showSeconds ? ':' + (this.second.toString().length === 1 ? '0' + this.second : this.second) : '') + (this.showMeridian ? ' ' + this.meridian : ''); 359 | }, 360 | 361 | hideWidget: function() { 362 | if (this.isOpen === false) { 363 | return; 364 | } 365 | 366 | this.$element.trigger({ 367 | 'type': 'hide.timepicker', 368 | 'time': { 369 | 'value': this.getTime(), 370 | 'hours': this.hour, 371 | 'minutes': this.minute, 372 | 'seconds': this.second, 373 | 'meridian': this.meridian 374 | } 375 | }); 376 | 377 | if (this.template === 'modal' && this.$widget.modal) { 378 | this.$widget.modal('hide'); 379 | } else { 380 | this.$widget.removeClass('open'); 381 | } 382 | 383 | $(document).off('mousedown.timepicker, touchend.timepicker', this.handleDocumentClick); 384 | 385 | this.isOpen = false; 386 | // show/hide approach taken by datepicker 387 | this.$widget.detach(); 388 | }, 389 | 390 | highlightUnit: function() { 391 | this.position = this.getCursorPosition(); 392 | if (this.position >= 0 && this.position <= 2) { 393 | this.highlightHour(); 394 | } else if (this.position >= 3 && this.position <= 5) { 395 | this.highlightMinute(); 396 | } else if (this.position >= 6 && this.position <= 8) { 397 | if (this.showSeconds) { 398 | this.highlightSecond(); 399 | } else { 400 | this.highlightMeridian(); 401 | } 402 | } else if (this.position >= 9 && this.position <= 11) { 403 | this.highlightMeridian(); 404 | } 405 | }, 406 | 407 | highlightNextUnit: function() { 408 | switch (this.highlightedUnit) { 409 | case 'hour': 410 | this.highlightMinute(); 411 | break; 412 | case 'minute': 413 | if (this.showSeconds) { 414 | this.highlightSecond(); 415 | } else if (this.showMeridian){ 416 | this.highlightMeridian(); 417 | } else { 418 | this.highlightHour(); 419 | } 420 | break; 421 | case 'second': 422 | if (this.showMeridian) { 423 | this.highlightMeridian(); 424 | } else { 425 | this.highlightHour(); 426 | } 427 | break; 428 | case 'meridian': 429 | this.highlightHour(); 430 | break; 431 | } 432 | }, 433 | 434 | highlightPrevUnit: function() { 435 | switch (this.highlightedUnit) { 436 | case 'hour': 437 | if(this.showMeridian){ 438 | this.highlightMeridian(); 439 | } else if (this.showSeconds) { 440 | this.highlightSecond(); 441 | } else { 442 | this.highlightMinute(); 443 | } 444 | break; 445 | case 'minute': 446 | this.highlightHour(); 447 | break; 448 | case 'second': 449 | this.highlightMinute(); 450 | break; 451 | case 'meridian': 452 | if (this.showSeconds) { 453 | this.highlightSecond(); 454 | } else { 455 | this.highlightMinute(); 456 | } 457 | break; 458 | } 459 | }, 460 | 461 | highlightHour: function() { 462 | var $element = this.$element.get(0), 463 | self = this; 464 | 465 | this.highlightedUnit = 'hour'; 466 | 467 | if ($element.setSelectionRange) { 468 | setTimeout(function() { 469 | if (self.hour < 10) { 470 | $element.setSelectionRange(0,1); 471 | } else { 472 | $element.setSelectionRange(0,2); 473 | } 474 | }, 0); 475 | } 476 | }, 477 | 478 | highlightMinute: function() { 479 | var $element = this.$element.get(0), 480 | self = this; 481 | 482 | this.highlightedUnit = 'minute'; 483 | 484 | if ($element.setSelectionRange) { 485 | setTimeout(function() { 486 | if (self.hour < 10) { 487 | $element.setSelectionRange(2,4); 488 | } else { 489 | $element.setSelectionRange(3,5); 490 | } 491 | }, 0); 492 | } 493 | }, 494 | 495 | highlightSecond: function() { 496 | var $element = this.$element.get(0), 497 | self = this; 498 | 499 | this.highlightedUnit = 'second'; 500 | 501 | if ($element.setSelectionRange) { 502 | setTimeout(function() { 503 | if (self.hour < 10) { 504 | $element.setSelectionRange(5,7); 505 | } else { 506 | $element.setSelectionRange(6,8); 507 | } 508 | }, 0); 509 | } 510 | }, 511 | 512 | highlightMeridian: function() { 513 | var $element = this.$element.get(0), 514 | self = this; 515 | 516 | this.highlightedUnit = 'meridian'; 517 | 518 | if ($element.setSelectionRange) { 519 | if (this.showSeconds) { 520 | setTimeout(function() { 521 | if (self.hour < 10) { 522 | $element.setSelectionRange(8,10); 523 | } else { 524 | $element.setSelectionRange(9,11); 525 | } 526 | }, 0); 527 | } else { 528 | setTimeout(function() { 529 | if (self.hour < 10) { 530 | $element.setSelectionRange(5,7); 531 | } else { 532 | $element.setSelectionRange(6,8); 533 | } 534 | }, 0); 535 | } 536 | } 537 | }, 538 | 539 | incrementHour: function() { 540 | if (this.showMeridian) { 541 | if (this.hour === 11) { 542 | this.hour++; 543 | return this.toggleMeridian(); 544 | } else if (this.hour === 12) { 545 | this.hour = 0; 546 | } 547 | } 548 | if (this.hour === this.maxHours - 1) { 549 | this.hour = 0; 550 | 551 | return; 552 | } 553 | this.hour++; 554 | }, 555 | 556 | incrementMinute: function(step) { 557 | var newVal; 558 | 559 | if (step) { 560 | newVal = this.minute + step; 561 | } else { 562 | newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep); 563 | } 564 | 565 | if (newVal > 59) { 566 | this.incrementHour(); 567 | this.minute = newVal - 60; 568 | } else { 569 | this.minute = newVal; 570 | } 571 | }, 572 | 573 | incrementSecond: function() { 574 | var newVal = this.second + this.secondStep - (this.second % this.secondStep); 575 | 576 | if (newVal > 59) { 577 | this.incrementMinute(true); 578 | this.second = newVal - 60; 579 | } else { 580 | this.second = newVal; 581 | } 582 | }, 583 | 584 | mousewheel: function(e) { 585 | if (this.disableMousewheel) { 586 | return; 587 | } 588 | 589 | e.preventDefault(); 590 | e.stopPropagation(); 591 | 592 | var delta = e.originalEvent.wheelDelta || -e.originalEvent.detail, 593 | scrollTo = null; 594 | 595 | if (e.type === 'mousewheel') { 596 | scrollTo = (e.originalEvent.wheelDelta * -1); 597 | } 598 | else if (e.type === 'DOMMouseScroll') { 599 | scrollTo = 40 * e.originalEvent.detail; 600 | } 601 | 602 | if (scrollTo) { 603 | e.preventDefault(); 604 | $(this).scrollTop(scrollTo + $(this).scrollTop()); 605 | } 606 | 607 | switch (this.highlightedUnit) { 608 | case 'minute': 609 | if (delta > 0) { 610 | this.incrementMinute(); 611 | } else { 612 | this.decrementMinute(); 613 | } 614 | this.highlightMinute(); 615 | break; 616 | case 'second': 617 | if (delta > 0) { 618 | this.incrementSecond(); 619 | } else { 620 | this.decrementSecond(); 621 | } 622 | this.highlightSecond(); 623 | break; 624 | case 'meridian': 625 | this.toggleMeridian(); 626 | this.highlightMeridian(); 627 | break; 628 | default: 629 | if (delta > 0) { 630 | this.incrementHour(); 631 | } else { 632 | this.decrementHour(); 633 | } 634 | this.highlightHour(); 635 | break; 636 | } 637 | 638 | return false; 639 | }, 640 | 641 | /** 642 | * Given a segment value like 43, will round and snap the segment 643 | * to the nearest "step", like 45 if step is 15. Segment will 644 | * "overflow" to 0 if it's larger than 59 or would otherwise 645 | * round up to 60. 646 | */ 647 | changeToNearestStep: function (segment, step) { 648 | if (segment % step === 0) { 649 | return segment; 650 | } 651 | if (Math.round((segment % step) / step)) { 652 | return (segment + (step - segment % step)) % 60; 653 | } else { 654 | return segment - segment % step; 655 | } 656 | }, 657 | 658 | // This method was adapted from bootstrap-datepicker. 659 | place : function() { 660 | if (this.isInline) { 661 | return; 662 | } 663 | var widgetWidth = this.$widget.outerWidth(), widgetHeight = this.$widget.outerHeight(), visualPadding = 10, windowWidth = 664 | $(window).width(), windowHeight = $(window).height(), scrollTop = $(window).scrollTop(); 665 | 666 | var zIndex = parseInt(this.$element.parents().filter(function() { return $(this).css('z-index') !== 'auto'; }).first().css('z-index'), 10) + 10; 667 | var offset = this.component ? this.component.parent().offset() : this.$element.offset(); 668 | var height = this.component ? this.component.outerHeight(true) : this.$element.outerHeight(false); 669 | var width = this.component ? this.component.outerWidth(true) : this.$element.outerWidth(false); 670 | var left = offset.left, top = offset.top; 671 | 672 | this.$widget.removeClass('timepicker-orient-top timepicker-orient-bottom timepicker-orient-right timepicker-orient-left'); 673 | 674 | if (this.orientation.x !== 'auto') { 675 | this.$widget.addClass('timepicker-orient-' + this.orientation.x); 676 | if (this.orientation.x === 'right') { 677 | left -= widgetWidth - width; 678 | } 679 | } else{ 680 | // auto x orientation is best-placement: if it crosses a window edge, fudge it sideways 681 | // Default to left 682 | this.$widget.addClass('timepicker-orient-left'); 683 | if (offset.left < 0) { 684 | left -= offset.left - visualPadding; 685 | } else if (offset.left + widgetWidth > windowWidth) { 686 | left = windowWidth - widgetWidth - visualPadding; 687 | } 688 | } 689 | // auto y orientation is best-situation: top or bottom, no fudging, decision based on which shows more of the widget 690 | var yorient = this.orientation.y, topOverflow, bottomOverflow; 691 | if (yorient === 'auto') { 692 | topOverflow = -scrollTop + offset.top - widgetHeight; 693 | bottomOverflow = scrollTop + windowHeight - (offset.top + height + widgetHeight); 694 | if (Math.max(topOverflow, bottomOverflow) === bottomOverflow) { 695 | yorient = 'top'; 696 | } else { 697 | yorient = 'bottom'; 698 | } 699 | } 700 | this.$widget.addClass('timepicker-orient-' + yorient); 701 | if (yorient === 'top'){ 702 | top += height; 703 | } else{ 704 | top -= widgetHeight + parseInt(this.$widget.css('padding-top'), 10); 705 | } 706 | 707 | this.$widget.css({ 708 | top : top, 709 | left : left, 710 | zIndex : zIndex 711 | }); 712 | }, 713 | 714 | remove: function() { 715 | $('document').off('.timepicker'); 716 | if (this.$widget) { 717 | this.$widget.remove(); 718 | } 719 | delete this.$element.data().timepicker; 720 | }, 721 | 722 | setDefaultTime: function(defaultTime) { 723 | if (!this.$element.val()) { 724 | if (defaultTime === 'current') { 725 | var dTime = new Date(), 726 | hours = dTime.getHours(), 727 | minutes = dTime.getMinutes(), 728 | seconds = dTime.getSeconds(), 729 | meridian = 'AM'; 730 | 731 | if (seconds !== 0) { 732 | seconds = Math.ceil(dTime.getSeconds() / this.secondStep) * this.secondStep; 733 | if (seconds === 60) { 734 | minutes += 1; 735 | seconds = 0; 736 | } 737 | } 738 | 739 | if (minutes !== 0) { 740 | minutes = Math.ceil(dTime.getMinutes() / this.minuteStep) * this.minuteStep; 741 | if (minutes === 60) { 742 | hours += 1; 743 | minutes = 0; 744 | } 745 | } 746 | 747 | if (this.showMeridian) { 748 | if (hours === 0) { 749 | hours = 12; 750 | } else if (hours >= 12) { 751 | if (hours > 12) { 752 | hours = hours - 12; 753 | } 754 | meridian = 'PM'; 755 | } else { 756 | meridian = 'AM'; 757 | } 758 | } 759 | 760 | this.hour = hours; 761 | this.minute = minutes; 762 | this.second = seconds; 763 | this.meridian = meridian; 764 | 765 | this.update(); 766 | 767 | } else if (defaultTime === false) { 768 | this.hour = 0; 769 | this.minute = 0; 770 | this.second = 0; 771 | this.meridian = 'AM'; 772 | } else { 773 | this.setTime(defaultTime); 774 | } 775 | } else { 776 | this.updateFromElementVal(); 777 | } 778 | }, 779 | 780 | setTime: function(time, ignoreWidget) { 781 | if (!time) { 782 | this.clear(); 783 | return; 784 | } 785 | 786 | var timeMode, 787 | timeArray, 788 | hour, 789 | minute, 790 | second, 791 | meridian; 792 | 793 | if (typeof time === 'object' && time.getMonth){ 794 | // this is a date object 795 | hour = time.getHours(); 796 | minute = time.getMinutes(); 797 | second = time.getSeconds(); 798 | 799 | if (this.showMeridian){ 800 | meridian = 'AM'; 801 | if (hour > 12){ 802 | meridian = 'PM'; 803 | hour = hour % 12; 804 | } 805 | 806 | if (hour === 12){ 807 | meridian = 'PM'; 808 | } 809 | } 810 | } else { 811 | timeMode = ((/a/i).test(time) ? 1 : 0) + ((/p/i).test(time) ? 2 : 0); // 0 = none, 1 = AM, 2 = PM, 3 = BOTH. 812 | if (timeMode > 2) { // If both are present, fail. 813 | this.clear(); 814 | return; 815 | } 816 | 817 | timeArray = time.replace(/[^0-9\:]/g, '').split(':'); 818 | 819 | hour = timeArray[0] ? timeArray[0].toString() : timeArray.toString(); 820 | 821 | if(this.explicitMode && hour.length > 2 && (hour.length % 2) !== 0 ) { 822 | this.clear(); 823 | return; 824 | } 825 | 826 | minute = timeArray[1] ? timeArray[1].toString() : ''; 827 | second = timeArray[2] ? timeArray[2].toString() : ''; 828 | 829 | // adaptive time parsing 830 | if (hour.length > 4) { 831 | second = hour.slice(-2); 832 | hour = hour.slice(0, -2); 833 | } 834 | 835 | if (hour.length > 2) { 836 | minute = hour.slice(-2); 837 | hour = hour.slice(0, -2); 838 | } 839 | 840 | if (minute.length > 2) { 841 | second = minute.slice(-2); 842 | minute = minute.slice(0, -2); 843 | } 844 | 845 | hour = parseInt(hour, 10); 846 | minute = parseInt(minute, 10); 847 | second = parseInt(second, 10); 848 | 849 | if (isNaN(hour)) { 850 | hour = 0; 851 | } 852 | if (isNaN(minute)) { 853 | minute = 0; 854 | } 855 | if (isNaN(second)) { 856 | second = 0; 857 | } 858 | 859 | // Adjust the time based upon unit boundary. 860 | // NOTE: Negatives will never occur due to time.replace() above. 861 | if (second > 59) { 862 | second = 59; 863 | } 864 | 865 | if (minute > 59) { 866 | minute = 59; 867 | } 868 | 869 | if (hour >= this.maxHours) { 870 | // No day/date handling. 871 | hour = this.maxHours - 1; 872 | } 873 | 874 | if (this.showMeridian) { 875 | if (hour > 12) { 876 | // Force PM. 877 | timeMode = 2; 878 | hour -= 12; 879 | } 880 | if (!timeMode) { 881 | timeMode = 1; 882 | } 883 | if (hour === 0) { 884 | hour = 12; // AM or PM, reset to 12. 0 AM = 12 AM. 0 PM = 12 PM, etc. 885 | } 886 | meridian = timeMode === 1 ? 'AM' : 'PM'; 887 | } else if (hour < 12 && timeMode === 2) { 888 | hour += 12; 889 | } else { 890 | if (hour >= this.maxHours) { 891 | hour = this.maxHours - 1; 892 | } else if ((hour < 0) || (hour === 12 && timeMode === 1)){ 893 | hour = 0; 894 | } 895 | } 896 | } 897 | 898 | this.hour = hour; 899 | if (this.snapToStep) { 900 | this.minute = this.changeToNearestStep(minute, this.minuteStep); 901 | this.second = this.changeToNearestStep(second, this.secondStep); 902 | } else { 903 | this.minute = minute; 904 | this.second = second; 905 | } 906 | this.meridian = meridian; 907 | 908 | this.update(ignoreWidget); 909 | }, 910 | 911 | showWidget: function() { 912 | if (this.isOpen) { 913 | return; 914 | } 915 | 916 | if (this.$element.is(':disabled')) { 917 | return; 918 | } 919 | 920 | // show/hide approach taken by datepicker 921 | this.$widget.appendTo(this.appendWidgetTo); 922 | $(document).on('mousedown.timepicker, touchend.timepicker', {scope: this}, this.handleDocumentClick); 923 | 924 | this.$element.trigger({ 925 | 'type': 'show.timepicker', 926 | 'time': { 927 | 'value': this.getTime(), 928 | 'hours': this.hour, 929 | 'minutes': this.minute, 930 | 'seconds': this.second, 931 | 'meridian': this.meridian 932 | } 933 | }); 934 | 935 | this.place(); 936 | if (this.disableFocus) { 937 | this.$element.blur(); 938 | } 939 | 940 | // widget shouldn't be empty on open 941 | if (this.hour === '') { 942 | if (this.defaultTime) { 943 | this.setDefaultTime(this.defaultTime); 944 | } else { 945 | this.setTime('0:0:0'); 946 | } 947 | } 948 | 949 | if (this.template === 'modal' && this.$widget.modal) { 950 | this.$widget.modal('show').on('hidden', $.proxy(this.hideWidget, this)); 951 | } else { 952 | if (this.isOpen === false) { 953 | this.$widget.addClass('open'); 954 | } 955 | } 956 | 957 | this.isOpen = true; 958 | }, 959 | 960 | toggleMeridian: function() { 961 | this.meridian = this.meridian === 'AM' ? 'PM' : 'AM'; 962 | }, 963 | 964 | update: function(ignoreWidget) { 965 | this.updateElement(); 966 | if (!ignoreWidget) { 967 | this.updateWidget(); 968 | } 969 | 970 | this.$element.trigger({ 971 | 'type': 'changeTime.timepicker', 972 | 'time': { 973 | 'value': this.getTime(), 974 | 'hours': this.hour, 975 | 'minutes': this.minute, 976 | 'seconds': this.second, 977 | 'meridian': this.meridian 978 | } 979 | }); 980 | }, 981 | 982 | updateElement: function() { 983 | this.$element.val(this.getTime()).change(); 984 | }, 985 | 986 | updateFromElementVal: function() { 987 | this.setTime(this.$element.val()); 988 | }, 989 | 990 | updateWidget: function() { 991 | if (this.$widget === false) { 992 | return; 993 | } 994 | 995 | var hour = this.hour, 996 | minute = this.minute.toString().length === 1 ? '0' + this.minute : this.minute, 997 | second = this.second.toString().length === 1 ? '0' + this.second : this.second; 998 | 999 | if (this.showInputs) { 1000 | this.$widget.find('input.bootstrap-timepicker-hour').val(hour); 1001 | this.$widget.find('input.bootstrap-timepicker-minute').val(minute); 1002 | 1003 | if (this.showSeconds) { 1004 | this.$widget.find('input.bootstrap-timepicker-second').val(second); 1005 | } 1006 | if (this.showMeridian) { 1007 | this.$widget.find('input.bootstrap-timepicker-meridian').val(this.meridian); 1008 | } 1009 | } else { 1010 | this.$widget.find('span.bootstrap-timepicker-hour').text(hour); 1011 | this.$widget.find('span.bootstrap-timepicker-minute').text(minute); 1012 | 1013 | if (this.showSeconds) { 1014 | this.$widget.find('span.bootstrap-timepicker-second').text(second); 1015 | } 1016 | if (this.showMeridian) { 1017 | this.$widget.find('span.bootstrap-timepicker-meridian').text(this.meridian); 1018 | } 1019 | } 1020 | }, 1021 | 1022 | updateFromWidgetInputs: function() { 1023 | if (this.$widget === false) { 1024 | return; 1025 | } 1026 | 1027 | var t = this.$widget.find('input.bootstrap-timepicker-hour').val() + ':' + 1028 | this.$widget.find('input.bootstrap-timepicker-minute').val() + 1029 | (this.showSeconds ? ':' + this.$widget.find('input.bootstrap-timepicker-second').val() : '') + 1030 | (this.showMeridian ? this.$widget.find('input.bootstrap-timepicker-meridian').val() : '') 1031 | ; 1032 | 1033 | this.setTime(t, true); 1034 | }, 1035 | 1036 | widgetClick: function(e) { 1037 | e.stopPropagation(); 1038 | e.preventDefault(); 1039 | 1040 | var $input = $(e.target), 1041 | action = $input.closest('a').data('action'); 1042 | 1043 | if (action) { 1044 | this[action](); 1045 | } 1046 | this.update(); 1047 | 1048 | if ($input.is('input')) { 1049 | $input.get(0).setSelectionRange(0,2); 1050 | } 1051 | }, 1052 | 1053 | widgetKeydown: function(e) { 1054 | var $input = $(e.target), 1055 | name = $input.attr('class').replace('bootstrap-timepicker-', ''); 1056 | 1057 | switch (e.which) { 1058 | case 9: //tab 1059 | if (e.shiftKey) { 1060 | if (name === 'hour') { 1061 | return this.hideWidget(); 1062 | } 1063 | } else if ((this.showMeridian && name === 'meridian') || (this.showSeconds && name === 'second') || (!this.showMeridian && !this.showSeconds && name === 'minute')) { 1064 | return this.hideWidget(); 1065 | } 1066 | break; 1067 | case 27: // escape 1068 | this.hideWidget(); 1069 | break; 1070 | case 38: // up arrow 1071 | e.preventDefault(); 1072 | switch (name) { 1073 | case 'hour': 1074 | this.incrementHour(); 1075 | break; 1076 | case 'minute': 1077 | this.incrementMinute(); 1078 | break; 1079 | case 'second': 1080 | this.incrementSecond(); 1081 | break; 1082 | case 'meridian': 1083 | this.toggleMeridian(); 1084 | break; 1085 | } 1086 | this.setTime(this.getTime()); 1087 | $input.get(0).setSelectionRange(0,2); 1088 | break; 1089 | case 40: // down arrow 1090 | e.preventDefault(); 1091 | switch (name) { 1092 | case 'hour': 1093 | this.decrementHour(); 1094 | break; 1095 | case 'minute': 1096 | this.decrementMinute(); 1097 | break; 1098 | case 'second': 1099 | this.decrementSecond(); 1100 | break; 1101 | case 'meridian': 1102 | this.toggleMeridian(); 1103 | break; 1104 | } 1105 | this.setTime(this.getTime()); 1106 | $input.get(0).setSelectionRange(0,2); 1107 | break; 1108 | } 1109 | }, 1110 | 1111 | widgetKeyup: function(e) { 1112 | if ((e.which === 65) || (e.which === 77) || (e.which === 80) || (e.which === 46) || (e.which === 8) || (e.which >= 48 && e.which <= 57) || (e.which >= 96 && e.which <= 105)) { 1113 | this.updateFromWidgetInputs(); 1114 | } 1115 | } 1116 | }; 1117 | 1118 | //TIMEPICKER PLUGIN DEFINITION 1119 | $.fn.timepicker = function(option) { 1120 | var args = Array.apply(null, arguments); 1121 | args.shift(); 1122 | return this.each(function() { 1123 | var $this = $(this), 1124 | data = $this.data('timepicker'), 1125 | options = typeof option === 'object' && option; 1126 | 1127 | if (!data) { 1128 | $this.data('timepicker', (data = new Timepicker(this, $.extend({}, $.fn.timepicker.defaults, options, $(this).data())))); 1129 | } 1130 | 1131 | if (typeof option === 'string') { 1132 | data[option].apply(data, args); 1133 | } 1134 | }); 1135 | }; 1136 | 1137 | $.fn.timepicker.defaults = { 1138 | defaultTime: 'current', 1139 | disableFocus: false, 1140 | disableMousewheel: false, 1141 | isOpen: false, 1142 | minuteStep: 15, 1143 | modalBackdrop: false, 1144 | orientation: { x: 'auto', y: 'auto'}, 1145 | secondStep: 15, 1146 | snapToStep: false, 1147 | showSeconds: false, 1148 | showInputs: true, 1149 | showMeridian: true, 1150 | template: 'dropdown', 1151 | appendWidgetTo: 'body', 1152 | showWidgetOnAddonClick: true, 1153 | icons: { 1154 | up: 'glyphicon glyphicon-chevron-up', 1155 | down: 'glyphicon glyphicon-chevron-down' 1156 | }, 1157 | maxHours: 24, 1158 | explicitMode: false 1159 | }; 1160 | 1161 | $.fn.timepicker.Constructor = Timepicker; 1162 | 1163 | $(document).on( 1164 | 'focus.timepicker.data-api click.timepicker.data-api', 1165 | '[data-provide="timepicker"]', 1166 | function(e){ 1167 | var $this = $(this); 1168 | if ($this.data('timepicker')) { 1169 | return; 1170 | } 1171 | e.preventDefault(); 1172 | // component click requires us to explicitly show it 1173 | $this.timepicker(); 1174 | } 1175 | ); 1176 | 1177 | })(jQuery, window, document); 1178 | -------------------------------------------------------------------------------- /assets/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.3.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)g(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Ee},je="show",He="out",Re={HIDE:"hide"+De,HIDDEN:"hidden"+De,SHOW:"show"+De,SHOWN:"shown"+De,INSERTED:"inserted"+De,CLICK:"click"+De,FOCUSIN:"focusin"+De,FOCUSOUT:"focusout"+De,MOUSEENTER:"mouseenter"+De,MOUSELEAVE:"mouseleave"+De},xe="fade",Fe="show",Ue=".tooltip-inner",We=".arrow",qe="hover",Me="focus",Ke="click",Qe="manual",Be=function(){function i(t,e){if("undefined"==typeof u)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=g(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(g(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),g.removeData(this.element,this.constructor.DATA_KEY),g(this.element).off(this.constructor.EVENT_KEY),g(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&g(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===g(this.element).css("display"))throw new Error("Please use show on visible elements");var t=g.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){g(this.element).trigger(t);var n=_.findShadowRoot(this.element),i=g.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=_.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&g(o).addClass(xe);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();g(o).data(this.constructor.DATA_KEY,this),g.contains(this.element.ownerDocument.documentElement,this.tip)||g(o).appendTo(l),g(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new u(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:We},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),g(o).addClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().on("mouseover",null,g.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,g(e.element).trigger(e.constructor.Event.SHOWN),t===He&&e._leave(null,e)};if(g(this.tip).hasClass(xe)){var h=_.getTransitionDurationFromElement(this.tip);g(this.tip).one(_.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=g.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==je&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),g(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(g(this.element).trigger(i),!i.isDefaultPrevented()){if(g(n).removeClass(Fe),"ontouchstart"in document.documentElement&&g(document.body).children().off("mouseover",null,g.noop),this._activeTrigger[Ke]=!1,this._activeTrigger[Me]=!1,this._activeTrigger[qe]=!1,g(this.tip).hasClass(xe)){var r=_.getTransitionDurationFromElement(n);g(n).one(_.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){g(this.getTipElement()).addClass(Ae+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(g(t.querySelectorAll(Ue)),this.getTitle()),g(t).removeClass(xe+" "+Fe)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=Se(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?g(e).parent().is(t)||t.empty().append(e):t.text(g(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:_.isElement(this.config.container)?g(this.config.container):g(document).find(this.config.container)},t._getAttachment=function(t){return Pe[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)g(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Qe){var e=t===qe?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===qe?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;g(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),g(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Me:qe]=!0),g(e.getTipElement()).hasClass(Fe)||e._hoverState===je?e._hoverState=je:(clearTimeout(e._timeout),e._hoverState=je,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===je&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||g(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),g(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Me:qe]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===He&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=g(this.element).data();return Object.keys(e).forEach(function(t){-1!==Oe.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_.typeCheckConfig(be,t,this.constructor.DefaultType),t.sanitize&&(t.template=Se(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ne);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(g(t).removeClass(xe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=g(this).data(Ie),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),g(this).data(Ie,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return Le}},{key:"NAME",get:function(){return be}},{key:"DATA_KEY",get:function(){return Ie}},{key:"Event",get:function(){return Re}},{key:"EVENT_KEY",get:function(){return De}},{key:"DefaultType",get:function(){return ke}}]),i}();g.fn[be]=Be._jQueryInterface,g.fn[be].Constructor=Be,g.fn[be].noConflict=function(){return g.fn[be]=we,Be._jQueryInterface};var Ve="popover",Ye="bs.popover",ze="."+Ye,Xe=g.fn[Ve],$e="bs-popover",Ge=new RegExp("(^|\\s)"+$e+"\\S+","g"),Je=l({},Be.Default,{placement:"right",trigger:"click",content:"",template:''}),Ze=l({},Be.DefaultType,{content:"(string|element|function)"}),tn="fade",en="show",nn=".popover-header",on=".popover-body",rn={HIDE:"hide"+ze,HIDDEN:"hidden"+ze,SHOW:"show"+ze,SHOWN:"shown"+ze,INSERTED:"inserted"+ze,CLICK:"click"+ze,FOCUSIN:"focusin"+ze,FOCUSOUT:"focusout"+ze,MOUSEENTER:"mouseenter"+ze,MOUSELEAVE:"mouseleave"+ze},sn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){g(this.getTipElement()).addClass($e+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||g(this.config.template)[0],this.tip},o.setContent=function(){var t=g(this.getTipElement());this.setElementContent(t.find(nn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(on),e),t.removeClass(tn+" "+en)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=g(this.getTipElement()),e=t.attr("class").match(Ge);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t { 27 | initLocations(); 28 | initMap(); 29 | $('#mySidenav').css("left", $(window).width()); 30 | $('#mySidenav').removeClass('d-none'); 31 | open_flag = 0; 32 | }, 2000); 33 | 34 | $('input[type="checkbox"]').change(function() { 35 | set_Filter(); 36 | }); 37 | 38 | $('#logo-image').click(function() { 39 | initMap(); 40 | }); 41 | $('#logo-title').click(function() { 42 | initMap(); 43 | }); 44 | }); 45 | 46 | function initLocations() { 47 | for (let i = 0; i < $('tbody tr').length; i ++) 48 | { 49 | locations.push({ lat: parseFloat($('tbody tr').eq(i).children().eq(4).text()), lng: parseFloat($('tbody tr').eq(i).children().eq(5).text()) }); 50 | } 51 | } 52 | function initMap() { 53 | map = new google.maps.Map(document.getElementById("map"), { 54 | zoom: zoom_level, 55 | center: { lat: 20, lng: -25 }, 56 | styles: [ 57 | { 58 | "elementType": "geometry", 59 | "stylers": [ 60 | { 61 | "color": "#114a43" 62 | } 63 | ] 64 | }, 65 | { 66 | "elementType": "labels.icon", 67 | "stylers": [ 68 | { 69 | "visibility": "off" 70 | } 71 | ] 72 | }, 73 | { 74 | "elementType": "labels.text.fill", 75 | "stylers": [ 76 | { 77 | "color": "#757575" 78 | } 79 | ] 80 | }, 81 | { 82 | "elementType": "labels.text.stroke", 83 | "stylers": [ 84 | { 85 | "color": "#212121" 86 | } 87 | ] 88 | }, 89 | { 90 | "featureType": "administrative", 91 | "elementType": "geometry", 92 | "stylers": [ 93 | { 94 | "color": "#757575" 95 | } 96 | ] 97 | }, 98 | { 99 | "featureType": "administrative", 100 | "elementType": "geometry.fill", 101 | "stylers": [ 102 | { 103 | "color": "#262626" 104 | } 105 | ] 106 | }, 107 | { 108 | "featureType": "administrative", 109 | "elementType": "geometry.stroke", 110 | "stylers": [ 111 | { 112 | "color": "#707070" 113 | } 114 | ] 115 | }, 116 | { 117 | "featureType": "administrative.country", 118 | "elementType": "labels.text.fill", 119 | "stylers": [ 120 | { 121 | "color": "#9e9e9e" 122 | } 123 | ] 124 | }, 125 | { 126 | "featureType": "administrative.land_parcel", 127 | "stylers": [ 128 | { 129 | "visibility": "off" 130 | } 131 | ] 132 | }, 133 | { 134 | "featureType": "administrative.locality", 135 | "elementType": "labels.text.fill", 136 | "stylers": [ 137 | { 138 | "color": "#bdbdbd" 139 | } 140 | ] 141 | }, 142 | { 143 | "featureType": "poi", 144 | "elementType": "labels.text.fill", 145 | "stylers": [ 146 | { 147 | "color": "#757575" 148 | } 149 | ] 150 | }, 151 | { 152 | "featureType": "poi.park", 153 | "elementType": "geometry", 154 | "stylers": [ 155 | { 156 | "color": "#181818" 157 | } 158 | ] 159 | }, 160 | { 161 | "featureType": "poi.park", 162 | "elementType": "labels.text.fill", 163 | "stylers": [ 164 | { 165 | "color": "#616161" 166 | } 167 | ] 168 | }, 169 | { 170 | "featureType": "poi.park", 171 | "elementType": "labels.text.stroke", 172 | "stylers": [ 173 | { 174 | "color": "#1b1b1b" 175 | } 176 | ] 177 | }, 178 | { 179 | "featureType": "road", 180 | "elementType": "geometry.fill", 181 | "stylers": [ 182 | { 183 | "color": "#2c2c2c" 184 | } 185 | ] 186 | }, 187 | { 188 | "featureType": "road", 189 | "elementType": "labels.text.fill", 190 | "stylers": [ 191 | { 192 | "color": "#8a8a8a" 193 | } 194 | ] 195 | }, 196 | { 197 | "featureType": "road.arterial", 198 | "elementType": "geometry", 199 | "stylers": [ 200 | { 201 | "color": "#373737" 202 | } 203 | ] 204 | }, 205 | { 206 | "featureType": "road.highway", 207 | "elementType": "geometry", 208 | "stylers": [ 209 | { 210 | "color": "#3c3c3c" 211 | } 212 | ] 213 | }, 214 | { 215 | "featureType": "road.highway.controlled_access", 216 | "elementType": "geometry", 217 | "stylers": [ 218 | { 219 | "color": "#4e4e4e" 220 | } 221 | ] 222 | }, 223 | { 224 | "featureType": "road.local", 225 | "elementType": "labels.text.fill", 226 | "stylers": [ 227 | { 228 | "color": "#616161" 229 | } 230 | ] 231 | }, 232 | { 233 | "featureType": "transit", 234 | "elementType": "labels.text.fill", 235 | "stylers": [ 236 | { 237 | "color": "#757575" 238 | } 239 | ] 240 | }, 241 | { 242 | "featureType": "water", 243 | "elementType": "geometry", 244 | "stylers": [ 245 | { 246 | "color": "#000000" 247 | } 248 | ] 249 | }, 250 | { 251 | "featureType": "water", 252 | "elementType": "labels.text.fill", 253 | "stylers": [ 254 | { 255 | "color": "#3d3d3d" 256 | } 257 | ] 258 | } 259 | ], 260 | }); 261 | const markers = locations.map((location, i) => { 262 | var marker = new google.maps.Marker({ 263 | position: location, 264 | icon: { 265 | url: "assets/images/Givaudan-textile-Logo.png", // url 266 | scaledSize: new google.maps.Size(20, 20), // scaled size 267 | }, 268 | }); 269 | google.maps.event.addListener(marker, 'click', function() { 270 | infowindow.close(); 271 | map.setCenter(this.getPosition()); 272 | if(zoom_level != 18) { 273 | console.log($('tbody tr').eq(i).children().eq(7).text()); 274 | window.location.href = "https://" + $('tbody tr').eq(i).children().eq(7).text(); 275 | } 276 | }); 277 | google.maps.event.addListener(marker, 'mouseover', function() { 278 | var contents = ` 279 |
280 |
281 |
282 | ` + $('tbody tr').eq(i).children().eq(0).text() + ` 283 |
284 | 285 |
286 | ` + $('tbody tr').eq(i).children().eq(1).text() + ` 287 |
288 |
289 | ` + $('tbody tr').eq(i).children().eq(2).text() + ` 290 |
291 |
292 | ` + $('tbody tr').eq(i).children().eq(3).text() + ` 293 |
294 | 295 |
296 | Activities 297 |
298 | 299 |
300 | Sales: T&W
301 | Creation and application: T&W
302 | Production: T&W, F&B 303 |
304 |
305 |
`; 306 | infowindow = new google.maps.InfoWindow({ 307 | content: contents, 308 | }); 309 | infowindow.open(map, this); 310 | }); 311 | google.maps.event.addListener(marker, 'mouseout', function() { 312 | infowindow.close(); 313 | }); 314 | return marker; 315 | }); 316 | m_cluster = new MarkerClusterer(map, markers, { 317 | imagePath: 318 | "https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m", 319 | averageCenter: true, 320 | }); 321 | var latlng = new google.maps.LatLng(-23.5344015, -46.7500668); 322 | latlng = new google.maps.LatLng(46.20656289999999, 6.0785769); 323 | var geocoder = new google.maps.Geocoder(); 324 | // var autocomplete_pickup = new google.maps.places.Autocomplete(place_pickup); 325 | // var autocomplete_delivery = new google.maps.places.Autocomplete(place_delivery); 326 | // autocomplete_pickup.bindTo('bounds', map); 327 | infowindow = new google.maps.InfoWindow({ 328 | content: document.getElementById("infobox"), 329 | disableAutoPan: false, 330 | maxWidth: 150, 331 | pixelOffset: new google.maps.Size(-140, 0), 332 | zIndex: null, 333 | boxStyle: { 334 | background: "url('https://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/examples/tipbox.gif') no-repeat", 335 | opacity: 0.90, 336 | width: "300px" 337 | }, 338 | closeBoxMargin: "12px 4px 2px 2px", 339 | closeBoxURL: "https://www.google.com/intl/en_us/mapfiles/close.gif", 340 | infoBoxClearance: new google.maps.Size(1, 1) 341 | }); 342 | } 343 | function smoothZoom (map, max, cnt) { 344 | if (cnt >= max) { 345 | return; 346 | } 347 | else { 348 | z = google.maps.event.addListener(map, 'zoom_changed', function(event){ 349 | google.maps.event.removeListener(z); 350 | smoothZoom(map, max, cnt + 1); 351 | }); 352 | setTimeout(function(){map.setZoom(cnt)}, 80); // 80ms is what I found to work well on my system -- it might not work well on all systems 353 | } 354 | } 355 | 356 | function smoothZoomout(map, min, cnt) { 357 | if (cnt < min) { 358 | return; 359 | } 360 | else { 361 | z = google.maps.event.addListener(map, 'zoom_changed', function(event){ 362 | google.maps.event.removeListener(z); 363 | smoothZoomout(map, min, cnt - 1); 364 | }); 365 | setTimeout(function(){map.setZoom(cnt)}, 80); // 80ms is what I found to work well on my system -- it might not work well on all systems 366 | } 367 | } 368 | 369 | function openNav() { 370 | if(open_flag == 0) { 371 | $('#mySidenav').css("left", $(window).width() - $('#mySidenav').width()); 372 | open_flag = 1; 373 | } else { 374 | $('#mySidenav').css("left", $(window).width()); 375 | open_flag = 0; 376 | } 377 | } 378 | 379 | function set_Filter() { 380 | locations = []; 381 | var filter_str = []; 382 | for(let i = 0; i < $('input[type="checkbox"]').length; i ++) { 383 | if($('input[type="checkbox"]').eq(i).prop("checked") == true) 384 | filter_str.push($('input[type="checkbox"]').eq(i).parent().find('span').text()); 385 | } 386 | for (let i = 0; i < $('tbody tr').length; i ++) 387 | { 388 | for(let j = 0; j < filter_str.length; j ++) { 389 | if($('tbody tr').eq(i).children().eq(6).text() == filter_str[j]) 390 | locations.push({ lat: parseFloat($('tbody tr').eq(i).children().eq(4).text()), lng: parseFloat($('tbody tr').eq(i).children().eq(5).text()) }); 391 | } 392 | } 393 | m_cluster.clearMarkers(); 394 | const markers = locations.map((location, i) => { 395 | var marker = new google.maps.Marker({ 396 | position: location, 397 | icon: { 398 | url: "assets/images/Givaudan-textile-Logo.png", // url 399 | scaledSize: new google.maps.Size(20, 20), // scaled size 400 | }, 401 | }); 402 | google.maps.event.addListener(marker, 'click', function() { 403 | infowindow.close(); 404 | map.setCenter(this.getPosition()); 405 | if(zoom_level != 18) { 406 | window.location.href = "http://www.blanklink.com"; 407 | } 408 | }); 409 | google.maps.event.addListener(marker, 'mouseover', function() { 410 | var contents = ` 411 |
412 |
413 |
414 | ` + $('tbody tr').eq(i).children().eq(0).text() + ` 415 |
416 | 417 |
418 | ` + $('tbody tr').eq(i).children().eq(1).text() + ` 419 |
420 |
421 | ` + $('tbody tr').eq(i).children().eq(2).text() + ` 422 |
423 |
424 | ` + $('tbody tr').eq(i).children().eq(3).text() + ` 425 |
426 | 427 |
428 | Activities 429 |
430 | 431 |
432 | Sales: T&W 433 | Creation and application: T&W 434 | Production: T&W, F&B 435 |
436 |
437 |
`; 438 | infowindow = new google.maps.InfoWindow({ 439 | content: contents, 440 | }); 441 | infowindow.open(map, this); 442 | }); 443 | google.maps.event.addListener(marker, 'mouseout', function() { 444 | infowindow.close(); 445 | }); 446 | return marker; 447 | }); 448 | m_cluster = new MarkerClusterer(map, markers, { 449 | imagePath: 450 | "https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m", 451 | averageCenter: true, 452 | }); 453 | } -------------------------------------------------------------------------------- /assets/js/google-spreadsheet.coffee: -------------------------------------------------------------------------------- 1 | 2 | ### 3 | Updated versions can be found at https://github.com/mikeymckay/google-spreadsheet-javascript 4 | ### 5 | 6 | 7 | 8 | class GoogleUrl 9 | constructor: (@sourceIdentifier) -> 10 | if (@sourceIdentifier.match(/http(s)*:/)) 11 | @url = @sourceIdentifier 12 | try 13 | @key = @url.match(/key=(.*?)&/)[1] 14 | catch error 15 | @key = @url.match(/(cells|list)\/(.*?)\//)[2] 16 | else 17 | @key = @sourceIdentifier 18 | @jsonCellsUrl = "http://spreadsheets.google.com/feeds/cells/" + @key + "/od6/public/basic?alt=json-in-script" 19 | @jsonListUrl = "http://spreadsheets.google.com/feeds/list/" + @key + "/od6/public/basic?alt=json-in-script" 20 | @jsonUrl = @jsonCellsUrl 21 | 22 | class GoogleSpreadsheet 23 | load: (callback) -> 24 | 25 | url = @googleUrl.jsonCellsUrl + "&callback=GoogleSpreadsheet.callbackCells" 26 | $('body').append(" 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 44 | 45 |
46 |
47 | 48 |
49 |
50 | Flavours 51 |
52 | 53 |
54 | Fragrances 55 |
56 | 57 |
58 | Fragrances & Flavours 59 |
60 | 61 |
62 | Sales 63 |
64 | 65 |
66 | Active Beauty 67 |
68 |
69 |
70 |
71 |
72 |
73 | 74 |
75 | 76 |
77 |
78 | 79 |
80 | 81 |
82 |
83 |
84 |
85 |
86 |
87 | 101 |
102 |
103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /index2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Google Sheets API Quickstart 5 | 6 | 7 | 8 |

Google Sheets API Quickstart

9 | 10 | 11 | 12 | 13 | 14 |

 15 | 
 16 |     
128 | 
129 |     
133 |   
134 | 


--------------------------------------------------------------------------------
/places.txt:
--------------------------------------------------------------------------------
1 | Av. Eng. Billings, 2185 - Jaguaré, São Paulo - SP, 05321-010, Brazil
2 | 
3 | Chemin de la Parfumerie 5, 1214 Vernier, Switzerland


--------------------------------------------------------------------------------