├── .gitmodules ├── .gitignore ├── .dockerignore ├── logs ├── lucee │ └── .gitignore ├── nginx │ └── .gitignore ├── supervisor │ └── .gitignore └── tomcat │ └── .gitignore ├── project ├── css │ ├── images │ │ └── doc-jumbotron-bg.jpg │ └── project.css ├── index.cfm └── js │ ├── project.js │ └── material.js ├── Dockerfile ├── docker-compose.yml ├── config ├── nginx │ ├── conf.d │ │ └── default.conf │ └── nginx.conf └── lucee │ ├── lucee-web.xml.cfm │ └── lucee-server.xml ├── LICENSE └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .vagrant 3 | */.git 4 | logs -------------------------------------------------------------------------------- /logs/lucee/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /logs/nginx/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /logs/supervisor/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /logs/tomcat/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /project/css/images/doc-jumbotron-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modius/lucee-docker-workbench/HEAD/project/css/images/doc-jumbotron-bg.jpg -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM lucee/lucee52-nginx:latest 2 | 3 | MAINTAINER Daemonites 4 | 5 | # NGINX configs 6 | COPY config/nginx/ /etc/nginx/ 7 | 8 | # Lucee server PRODUCTION configs 9 | COPY config/lucee/lucee-server.xml /opt/lucee/server/lucee-server/context/lucee-server.xml 10 | COPY config/lucee/lucee-web.xml.cfm /opt/lucee/web/lucee-web.xml.cfm 11 | 12 | # Deploy codebase to container 13 | COPY project /var/www -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | lucee: 2 | build: . 3 | environment: 4 | - "VIRTUAL_HOST=lucee.*" 5 | volumes: 6 | - /workbench/lucee-docker-workbench/config/lucee/lucee-server.xml:/opt/lucee/server/lucee-server/context/lucee-server.xml 7 | - /workbench/lucee-docker-workbench/config/lucee/lucee-web.xml.cfm:/opt/lucee/web/lucee-web.xml.cfm 8 | - /workbench/lucee-docker-workbench/project:/var/www 9 | - /workbench/lucee-docker-workbench/logs/lucee:/opt/lucee/web/logs 10 | - /workbench/lucee-docker-workbench/logs/nginx:/var/log/nginx 11 | - /workbench/lucee-docker-workbench/logs/supervisor:/var/log/supervisor 12 | - /workbench/lucee-docker-workbench/logs/tomcat:/usr/local/tomcat/logs -------------------------------------------------------------------------------- /config/nginx/conf.d/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | server_name _; 4 | index index.cfm index.html index.htm; 5 | root /var/www; 6 | server_name_in_redirect off; 7 | 8 | location ~* \.(cfm|cfc|cfr)$ { 9 | proxy_pass http://127.0.0.1:8888; 10 | proxy_redirect off; 11 | proxy_set_header Host $host; 12 | proxy_set_header X-Forwarded-Host $host; 13 | proxy_set_header X-Forwarded-Server $host; 14 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 15 | proxy_set_header X-Real-IP $remote_addr; 16 | proxy_connect_timeout 600; 17 | proxy_send_timeout 600; 18 | proxy_read_timeout 600; 19 | send_timeout 600; 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /project/css/project.css: -------------------------------------------------------------------------------- 1 | .doc-jumbotron { 2 | background-image: url(images/doc-jumbotron-bg.jpg); 3 | background-position: 50% 50%; 4 | background-repeat: no-repeat; 5 | -webkit-background-size: cover; 6 | background-size: cover; 7 | padding-top: 7rem; 8 | } 9 | @media (max-width: 959px) { 10 | .doc-jumbotron h1 { 11 | font-size: 3.5rem; 12 | font-weight: 400; 13 | letter-spacing: -0.02em; 14 | line-height: 3.625rem; 15 | } 16 | } 17 | @media (min-width: 1280px) { 18 | .navdrawer-permanent ~ .doc-jumbotron { 19 | margin-left: 17.5rem; 20 | } 21 | } 22 | 23 | @media (min-width: 1280px) { 24 | .navdrawer-permanent ~ .doc-main { 25 | margin-left: 17.5rem; 26 | } 27 | } 28 | 29 | .doc-toolbar { 30 | position: fixed; 31 | } 32 | @media (min-width: 1280px) { 33 | .navdrawer-permanent ~ .doc-toolbar { 34 | margin-left: 17.5rem; 35 | } 36 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Geoff Bowers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /config/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user www-data; 2 | worker_processes 4; 3 | pid /run/nginx.pid; 4 | 5 | events { 6 | worker_connections 768; 7 | # multi_accept on; 8 | } 9 | 10 | http { 11 | 12 | ## 13 | # Basic Settings 14 | ## 15 | 16 | sendfile off; 17 | tcp_nopush on; 18 | tcp_nodelay on; 19 | keepalive_timeout 65; 20 | types_hash_max_size 2048; 21 | # server_tokens off; 22 | 23 | # server_names_hash_bucket_size 64; 24 | # server_name_in_redirect off; 25 | 26 | include /etc/nginx/mime.types; 27 | default_type application/octet-stream; 28 | 29 | ## 30 | # Logging Settings 31 | ## 32 | 33 | access_log /var/log/nginx/access.log ; 34 | error_log /var/log/nginx/error.log; 35 | 36 | ## 37 | # Gzip Settings 38 | ## 39 | 40 | 41 | gzip on; 42 | 43 | 44 | # gzip_vary on; 45 | # gzip_proxied any; 46 | # gzip_comp_level 6; 47 | # gzip_buffers 16 8k; 48 | # gzip_http_version 1.1; 49 | # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 50 | 51 | ## 52 | # nginx-naxsi config 53 | ## 54 | # Uncomment it if you installed nginx-naxsi 55 | ## 56 | 57 | #include /etc/nginx/naxsi_core.rules; 58 | 59 | ## 60 | # nginx-passenger config 61 | ## 62 | # Uncomment it if you installed nginx-passenger 63 | ## 64 | 65 | #passenger_root /usr; 66 | #passenger_ruby /usr/bin/ruby; 67 | 68 | ## 69 | # Virtual Host Configs 70 | ## 71 | 72 | include /etc/nginx/conf.d/*.conf; 73 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lucee Docker Workbench 2 | 3 | Docker workbench project template for a Lucee development pipeline; export files to use as the base for Lucee development in a containerised world. 4 | 5 | **For more information on this Docker Workbench project format, see the [Daemonite Docker Workbench Project](https://github.com/justincarter/docker-workbench) and [my tutorial on setting up the Workbench](https://labs.daemon.com.au/t/daemon-docker-workbench/295).** 6 | 7 | 8 | ## Installation 9 | 10 | Dependencies: Running `docker-machine`, see https://github.com/justincarter/docker-workbench 11 | 12 | ``` 13 | git clone https://github.com/modius/lucee-docker-workbench 14 | cd lucee-docker-workbench 15 | docker-compose up 16 | ``` 17 | 18 | The location depends on your set up but it will either be the VMs IP address or the workbench URL you are using for Lucee development: 19 | ``` 20 | open http://lucee.192.168.99.100.nip.io/ 21 | ``` 22 | 23 | Lucee admin is open (ie. insecure) and uses the password `docker`: 24 | 25 | ``` 26 | open http://lucee.192.168.99.100.nip.io/lucee/admin/web.cfm 27 | ``` 28 | 29 | 30 | ## Anatomy of the Project 31 | 32 | The project structure provides an environment for local Docker development, and a process for building images for production deployment. 33 | 34 | ``` 35 | lucee-docker-workbench/ 36 | ├── docker-compose.yml 37 | ├── Dockerfile 38 | ├── .dockerignore 39 | ├── project 40 | ├── config 41 | │   ├── lucee 42 | │   │   └── lucee-web.xml.cfm 43 | │   └── nginx 44 | │   ├── conf.d 45 | │   │   └── default.conf 46 | │   └── nginx.conf 47 | └── logs 48 | ``` 49 | 50 | `docker-compose.yml` 51 | Defines how your container should spin up; including environment variables and volumes. 52 | 53 | `./Dockerfile` 54 | A sample Dockerfile for building a Lucee application. Use this to build an image externally for deployment. Make sure that the contents of `code` are replicated here otherwise your container will only work locally. 55 | 56 | `./code` 57 | The `code` directory is set up as a **git submodule** pointing to a simple lucee test app. Change this to reflect the code base you want to develop with. Anything under the `code` directory is sync'd into the container via a volume to allow development. 58 | 59 | _Note, you will need to update your Dockerfile with the same code base in order to build your image for deployment._ 60 | 61 | `./config` 62 | Config files for customising the container. The container needs to be re-built any time you make changes to these configuration files. 63 | 64 | `./logs` 65 | The example container will automatically write logs into this directory tree to make development easier. Logs are transient and should never be committed to the repo. The logs are mapped via the volumes nominated in the `docker-compose.yml`. 66 | 67 | 68 | ## Tips 69 | 70 | Getting Lucee configs from container: 71 | ``` 72 | docker ps 73 | docker cp 74f0485da60d:/opt/lucee/server/lucee-server/context/lucee-server.xml ./lucee-server.xml 74 | docker cp 74f0485da60d:/opt/lucee/web/lucee-web.xml.cfm ./lucee-web.xml.cfm 75 | ``` -------------------------------------------------------------------------------- /config/lucee/lucee-web.xml.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 52 | 53 | 54 | 55 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 83 | 84 | 85 | 89 | 90 | 91 | 92 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 134 | 135 | 136 | 137 | 148 | 149 | 150 | 153 | 154 | 155 | 156 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | -------------------------------------------------------------------------------- /project/index.cfm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Lucee Workbench 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 |
28 |
29 |
30 |
31 |

Workbench

32 |

Docker workbench project template for a Lucee development pipeline; export files to use as the base for Lucee development in a containerised world.

33 |

34 | Download Material 35 | Documentation 36 |

37 |

Currently v4.0.0-alpha.6
(based on Bootstrap v4.0.0-alpha.6)

38 |
39 |
40 |
41 |
42 | 43 | 65 | 66 |
67 |
68 |
69 |
70 |
71 |

Introduction

72 |

The basic idea behind this project is to combine the visual language of Google Material Designopen_in_new with the front-end technology of the popular Bootstrapopen_in_new framework.

73 |
74 | 75 |
76 |

Contents

77 |

Goals

78 |

Principles

79 |

Roadmap

80 |
81 | 82 |
83 |

Goals

84 |
85 |
86 |

Primary

87 |

The primary goal of this project is to give all Bootstrap components and elements a Material Design look, so it allows web developers to continue using the exact same Bootstrap HTML markup they are familiar with, but presents them a final outcome that is in line with the principles and specifics of Google Material Design.

88 |

Therefore, the Bootstrap's documentationopen_in_new can serve as a valid documentation for this project as well. Replacing bootstrap.min.css on the site with material.min.css from this project without any other changes will transform all components and elements into a materialised look.

89 |
90 |
91 |

Secondary

92 |

A secondary goal of this project is to add support of some unique Material Design components such as floating action buttons, pickers and steppers, to name a few, which cannot be achieved by transforming existing Bootstrap components or elements.

93 |

Because these components will require additional markup (some may require additional JavaScript), they will be documented separately in Material's documentation (work-in-progress).

94 |
95 |
96 |
97 | 98 |
99 |

Principles

100 |
101 |
102 |

CSS & HTML

103 |

If a Bootstrap component has an exact match in Google Material Design, this project will style this Bootstrap component based on the specifications laid out in Google Material Design Guidelines. For example, Bootstrap's buttons = Google Material Design's buttons.

104 |

Some of the Bootstrap components seem to lack an exact match in Google Material Design, but this may be simply due to different naming conventions. For example, Bootstrap's navbars is very much the same as Google Material Design's toolbars.

105 |

If a Bootstrap component does not have an exact match in Google Material Design, the specifications of a closest matching component in Google Material Design Guidelines will be used to style this Bootstrap component. For example, Bootstrap's badges = Google Material Design's chips.

106 |

If a Bootstrap component lacks a related counterpart in Google Material Design completely, this project will style this component based on our own iteration of Google Material Design Guidelines. For example, Bootstrap's button groups, jumbotrons and paginations, etc.

107 |
108 |
109 |

JavaScript

110 |

No modification has been made to Bootstrap's JavaScript. It is safe to use Bootstrap's JavaScript as it is.

111 |

However, in order to achieve some Material feel and look, Material includes a handful of additional JavaScript to help bring some of the components to life.

112 |
113 |
114 |
115 | 116 |
117 |

Roadmap

118 |
119 |
120 |

Near-term

121 |

Bug fixes and updates alongside Bootstrap 4's continuous releases.

122 |
123 |
124 |

Mid-term

125 |

Add missing support for some Google Material Design components (e.g. snackbars).

126 |
127 |
128 |

Long-term

129 |

Rewrite all JavaScript plugins in ES6 to take advantage of the newest JavaScript enhancements.

130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /config/lucee/lucee-server.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 46 | 47 | 48 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 72 | 73 | 74 | 88 | 89 | 90 | 97 | 98 | 103 | 104 | 109 | 110 | 115 | 116 | 121 | 122 | 127 | 128 | 129 | 141 | 142 | 143 | 144 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 215 | 216 | 217 | 218 | 219 | 230 | 231 | 232 | 244 | 245 | 246 | 249 | 250 | 251 | 266 | 267 | 268 | 269 | 282 | 283 | 284 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | -------------------------------------------------------------------------------- /project/js/project.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Holder - client side image placeholders 3 | * Version 2.9.4+cabil 4 | * © 2016 Ivan Malopinsky - http://imsky.co 5 | 6 | * Site: http://holderjs.com 7 | * Issues: https://github.com/imsky/holder/issues 8 | * License: MIT 9 | */ 10 | !function(e){if(e.document){var t=e.document;t.querySelectorAll||(t.querySelectorAll=function(n){var r,i=t.createElement("style"),o=[];for(t.documentElement.firstChild.appendChild(i),t._qsa=[],i.styleSheet.cssText=n+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",e.scrollBy(0,0),i.parentNode.removeChild(i);t._qsa.length;)r=t._qsa.shift(),r.style.removeAttribute("x-qsa"),o.push(r);return t._qsa=null,o}),t.querySelector||(t.querySelector=function(e){var n=t.querySelectorAll(e);return n.length?n[0]:null}),t.getElementsByClassName||(t.getElementsByClassName=function(e){return e=String(e).replace(/^|\s+/g,"."),t.querySelectorAll(e)}),Object.keys||(Object.keys=function(e){if(e!==Object(e))throw TypeError("Object.keys called on non-object");var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n}),Array.prototype.forEach||(Array.prototype.forEach=function(e){if(void 0===this||null===this)throw TypeError();var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw TypeError();var r,i=arguments[1];for(r=0;r>16&255)),i.push(String.fromCharCode(o>>8&255)),i.push(String.fromCharCode(255&o)),a=0,o=0),r+=1;return 12===a?(o>>=4,i.push(String.fromCharCode(255&o))):18===a&&(o>>=2,i.push(String.fromCharCode(o>>8&255)),i.push(String.fromCharCode(255&o))),i.join("")},e.btoa=e.btoa||function(e){e=String(e);var n,r,i,o,a,s,l,h=0,u=[];if(/[^\x00-\xFF]/.test(e))throw Error("InvalidCharacterError");for(;h>2,a=(3&n)<<4|r>>4,s=(15&r)<<2|i>>6,l=63&i,h===e.length+2?(s=64,l=64):h===e.length+1&&(l=64),u.push(t.charAt(o),t.charAt(a),t.charAt(s),t.charAt(l));return u.join("")}}(e),Object.prototype.hasOwnProperty||(Object.prototype.hasOwnProperty=function(e){var t=this.__proto__||this.constructor.prototype;return e in this&&(!(e in t)||t[e]!==this[e])}),function(){if("performance"in e==!1&&(e.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in e.performance==!1){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),e.performance.now=function(){return Date.now()-t}}}(),e.requestAnimationFrame||(e.webkitRequestAnimationFrame&&e.webkitCancelAnimationFrame?!function(e){e.requestAnimationFrame=function(t){return webkitRequestAnimationFrame(function(){t(e.performance.now())})},e.cancelAnimationFrame=e.webkitCancelAnimationFrame}(e):e.mozRequestAnimationFrame&&e.mozCancelAnimationFrame?!function(e){e.requestAnimationFrame=function(t){return mozRequestAnimationFrame(function(){t(e.performance.now())})},e.cancelAnimationFrame=e.mozCancelAnimationFrame}(e):!function(e){e.requestAnimationFrame=function(t){return e.setTimeout(t,1e3/60)},e.cancelAnimationFrame=e.clearTimeout}(e))}}(this),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Holder=t():e.Holder=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){(function(t){function r(e,t,n,r){var a=i(n.substr(n.lastIndexOf(e.domain)),e);a&&o({mode:null,el:r,flags:a,engineSettings:t})}function i(e,t){var n={theme:k(O.settings.themes.gray,null),stylesheets:t.stylesheets,instanceOptions:t},r=e.indexOf("?"),i=[e];r!==-1&&(i=[e.slice(0,r),e.slice(r+1)]);var o=i[0].split("/");n.holderURL=e;var a=o[1],s=a.match(/([\d]+p?)x([\d]+p?)/);if(!s)return!1;if(n.fluid=a.indexOf("p")!==-1,n.dimensions={width:s[1].replace("p","%"),height:s[2].replace("p","%")},2===i.length){var l=v.parse(i[1]);if(w.truthy(l.ratio)){n.fluid=!0;var h=parseFloat(n.dimensions.width.replace("%","")),u=parseFloat(n.dimensions.height.replace("%",""));u=Math.floor(100*(u/h)),h=100,n.dimensions.width=h+"%",n.dimensions.height=u+"%"}if(n.auto=w.truthy(l.auto),l.bg&&(n.theme.bg=w.parseColor(l.bg)),l.fg&&(n.theme.fg=w.parseColor(l.fg)),l.bg&&!l.fg&&(n.autoFg=!0),l.theme&&n.instanceOptions.themes.hasOwnProperty(l.theme)&&(n.theme=k(n.instanceOptions.themes[l.theme],null)),l.text&&(n.text=l.text),l.textmode&&(n.textmode=l.textmode),l.size&&(n.size=l.size),l.font&&(n.font=l.font),l.align&&(n.align=l.align),l.lineWrap&&(n.lineWrap=l.lineWrap),n.nowrap=w.truthy(l.nowrap),n.outline=w.truthy(l.outline),w.truthy(l.random)){O.vars.cache.themeKeys=O.vars.cache.themeKeys||Object.keys(n.instanceOptions.themes);var c=O.vars.cache.themeKeys[0|Math.random()*O.vars.cache.themeKeys.length];n.theme=k(n.instanceOptions.themes[c],null)}}return n}function o(e){var t=e.mode,n=e.el,r=e.flags,i=e.engineSettings,o=r.dimensions,s=r.theme,l=o.width+"x"+o.height;t=null==t?r.fluid?"fluid":"image":t;var c=/holder_([a-z]+)/g,d=!1;if(null!=r.text&&(s.text=r.text,"object"===n.nodeName.toLowerCase())){for(var f=s.text.split("\\n"),p=0;p1){var b,x=0,A=0,C=0;w=new s.Group("line"+C),"left"!==e.align&&"right"!==e.align||(o=e.width*(1-2*(1-r)));for(var E=0;E=o||T===!0)&&(t(g,w,x,g.properties.leading),g.add(w),x=0,A+=g.properties.leading,C+=1,w=new s.Group("line"+C),w.y=A),T!==!0&&(v.moveTo(x,0),x+=m.spaceWidth+k.width,w.add(v))}if(t(g,w,x,g.properties.leading),g.add(w),"left"===e.align)g.moveTo(e.width-i,null,null);else if("right"===e.align){for(b in g.children)w=g.children[b],w.moveTo(e.width-w.width,null,null);g.moveTo(0-(e.width-i),null,null)}else{for(b in g.children)w=g.children[b],w.moveTo((g.width-w.width)/2,null,null);g.moveTo((e.width-g.width)/2,null,null)}g.moveTo(null,(e.height-g.height)/2,null),(e.height-g.height)/2<0&&g.moveTo(null,0,null)}else v=new s.Text(e.text),w=new s.Group("line0"),w.add(v),g.add(w),"left"===e.align?g.moveTo(e.width-i,null,null):"right"===e.align?g.moveTo(0-(e.width-i),null,null):g.moveTo((e.width-m.boundingBox.width)/2,null,null),g.moveTo(null,(e.height-m.boundingBox.height)/2,null);return a}function l(e,t,n,r){var i=parseInt(e,10),o=parseInt(t,10),a=Math.max(i,o),s=Math.min(i,o),l=.8*Math.min(s,a*r);return Math.round(Math.max(n,l))}function h(e){var t;t=null==e||null==e.nodeType?O.vars.resizableImages:[e];for(var n=0,r=t.length;n1){n.nodeValue="";for(var v=0;v=0?t:1)}function o(e){x?i(e):S.push(e)}null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function C(){document.removeEventListener("DOMContentLoaded",C,!1),document.readyState="complete"},!1),document.readyState="loading");var a=e.document,s=a.documentElement,l="load",h=!1,u="on"+l,c="complete",d="readyState",f="attachEvent",p="detachEvent",g="addEventListener",m="DOMContentLoaded",v="onreadystatechange",y="removeEventListener",w=g in a,b=h,x=h,S=[];if(a[d]===c)i(t);else if(w)a[g](m,n,h),e[g](l,n,h);else{a[f](v,n),e[f](u,n);try{b=null==e.frameElement&&s}catch(A){}b&&b.doScroll&&!function E(){if(!x){try{b.doScroll("left")}catch(e){return i(E,50)}r(),t()}}()}return o.version="1.4.0",o.isReady=function(){return x},o}e.exports="undefined"!=typeof window&&n(window)},function(e,t,n){var r=encodeURIComponent,i=decodeURIComponent,o=n(4),a=n(5),s=/(\w+)\[(\d+)\]/,l=/\w+\.\w+/;t.parse=function(e){if("string"!=typeof e)return{};if(e=o(e),""===e)return{};"?"===e.charAt(0)&&(e=e.slice(1));for(var t={},n=e.split("&"),r=0;r=0;r--)n=e.charCodeAt(r),n>128?t.unshift(["&#",n,";"].join("")):t.unshift(e[r]);return t.join("")},t.imageExists=function(e,t){var n=new Image;n.onerror=function(){t.call(this,!1)},n.onload=function(){t.call(this,!0)},n.src=e},t.decodeHtmlEntity=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(t)})},t.dimensionCheck=function(e){var t={height:e.clientHeight,width:e.clientWidth};return!(!t.height||!t.width)&&t},t.truthy=function(e){return"string"==typeof e?"true"===e||"yes"===e||"1"===e||"on"===e||"✓"===e:!!e},t.parseColor=function(e){var t,n=/(^(?:#?)[0-9a-f]{6}$)|(^(?:#?)[0-9a-f]{3}$)/i,r=/^rgb\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,i=/^rgba\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0\.\d{1,}|1)\)$/,o=e.match(n);return null!==o?(t=o[1]||o[2],"#"!==t[0]?"#"+t:t):(o=e.match(r),null!==o?t="rgb("+o.slice(1).join(",")+")":(o=e.match(i),null!==o?t="rgba("+o.slice(1).join(",")+")":null))},t.canvasRatio=function(){var t=1,n=1;if(e.document){var r=e.document.createElement("canvas");if(r.getContext){var i=r.getContext("2d");t=e.devicePixelRatio||1,n=i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1}}return t/n}}).call(t,function(){return this}())},function(e,t,n){(function(e){var r=n(9),i="http://www.w3.org/2000/svg",o=8;t.initSVG=function(e,t,n){var a,s,l=!1;e&&e.querySelector?(s=e.querySelector("style"),null===s&&(l=!0)):(e=r.newEl("svg",i),l=!0),l&&(a=r.newEl("defs",i),s=r.newEl("style",i),r.setAttr(s,{type:"text/css"}),a.appendChild(s),e.appendChild(a)),e.webkitMatchesSelector&&e.setAttribute("xmlns",i);for(var h=0;h=0;l--){var h=s.createProcessingInstruction("xml-stylesheet",'href="'+a[l]+'" rel="stylesheet"');s.insertBefore(h,s.firstChild)}s.removeChild(s.documentElement),o=i.serializeToString(s)}var u=i.serializeToString(t);return u=u.replace(/\&(\#[0-9]{2,}\;)/g,"&$1"),o+u}}}).call(t,function(){return this}())},function(e,t){(function(e){t.newEl=function(t,n){if(e.document)return null==n?e.document.createElement(t):e.document.createElementNS(n,t)},t.setAttr=function(e,t){for(var n in t)e.setAttribute(n,t[n])},t.createXML=function(){if(e.DOMParser)return(new DOMParser).parseFromString("","application/xml")},t.getNodeArray=function(t){var n=null;return"string"==typeof t?n=document.querySelectorAll(t):e.NodeList&&t instanceof e.NodeList?n=t:e.Node&&t instanceof e.Node?n=[t]:e.HTMLCollection&&t instanceof e.HTMLCollection?n=t:t instanceof Array?n=t:null===t&&(n=[]),n=Array.prototype.slice.call(n)}}).call(t,function(){return this}())},function(e,t){var n=function(e,t){"string"==typeof e&&(this.original=e,"#"===e.charAt(0)&&(e=e.slice(1)),/[^a-f0-9]+/i.test(e)||(3===e.length&&(e=e.replace(/./g,"$&$&")),6===e.length&&(this.alpha=1,t&&t.alpha&&(this.alpha=t.alpha),this.set(parseInt(e,16)))))};n.rgb2hex=function(e,t,n){function r(e){var t=(0|e).toString(16);return e<16&&(t="0"+t),t}return[e,t,n].map(r).join("")},n.hsl2rgb=function(e,t,n){var r=e/60,i=(1-Math.abs(2*n-1))*t,o=i*(1-Math.abs(parseInt(r)%2-1)),a=n-i/2,s=0,l=0,h=0;return r>=0&&r<1?(s=i,l=o):r>=1&&r<2?(s=o,l=i):r>=2&&r<3?(l=i,h=o):r>=3&&r<4?(l=o,h=i):r>=4&&r<5?(s=o,h=i):r>=5&&r<6&&(s=i,h=o),s+=a,l+=a,h+=a,s=parseInt(255*s),l=parseInt(255*l),h=parseInt(255*h),[s,l,h]},n.prototype.set=function(e){this.raw=e;var t=(16711680&this.raw)>>16,n=(65280&this.raw)>>8,r=255&this.raw,i=.2126*t+.7152*n+.0722*r,o=-.09991*t-.33609*n+.436*r,a=.615*t-.55861*n-.05639*r;return this.rgb={r:t,g:n,b:r},this.yuv={y:i,u:o,v:a},this},n.prototype.lighten=function(e){var t=Math.min(1,Math.max(0,Math.abs(e)))*(e<0?-1:1),r=255*t|0,i=Math.min(255,Math.max(0,this.rgb.r+r)),o=Math.min(255,Math.max(0,this.rgb.g+r)),a=Math.min(255,Math.max(0,this.rgb.b+r)),s=n.rgb2hex(i,o,a);return new n(s)},n.prototype.toHex=function(e){return(e?"#":"")+this.raw.toString(16)},n.prototype.lighterThan=function(e){return e instanceof n||(e=new n(e)),this.yuv.y>e.yuv.y},n.prototype.blendAlpha=function(e){e instanceof n||(e=new n(e));var t=e,r=this,i=t.alpha*t.rgb.r+(1-t.alpha)*r.rgb.r,o=t.alpha*t.rgb.g+(1-t.alpha)*r.rgb.g,a=t.alpha*t.rgb.b+(1-t.alpha)*r.rgb.b;return new n(n.rgb2hex(i,o,a))},e.exports=n},function(e,t){e.exports={version:"2.9.4",svg_ns:"http://www.w3.org/2000/svg"}},function(e,t,n){function r(e,t){return c.element({tag:t,width:e.width,height:e.height,fill:e.properties.fill})}function i(e){return h.cssProps({fill:e.fill,"font-weight":e.font.weight,"font-family":e.font.family+", monospace","font-size":e.font.size+e.font.units})}function o(e,t,n){var r=n/2;return["M",r,r,"H",e-r,"V",t-r,"H",r,"V",0,"M",0,r,"L",e,t-r,"M",0,t-r,"L",e,r].join(" ")}var a=n(13),s=n(8),l=n(11),h=n(7),u=l.svg_ns,c={element:function(e){var t=e.tag,n=e.content||"";return delete e.tag,delete e.content,[t,n,e]}};e.exports=function(e,t){var n=t.engineSettings,l=n.stylesheets,h=l.map(function(e){return''}).join("\n"),d="holder_"+Number(new Date).toString(16),f=e.root,p=f.children.holderTextGroup,g="#"+d+" text { "+i(p.properties)+" } ";p.y+=.8*p.textPositionData.boundingBox.height;var m=[];Object.keys(p.children).forEach(function(e){var t=p.children[e];Object.keys(t.children).forEach(function(e){var n=t.children[e],r=p.x+t.x+n.x,i=p.y+t.y+n.y,o=c.element({tag:"text",content:n.properties.text,x:r,y:i});m.push(o)})});var v=c.element({tag:"g",content:m}),y=null;if(f.children.holderBg.properties.outline){var w=f.children.holderBg.properties.outline;y=c.element({tag:"path",d:o(f.children.holderBg.width,f.children.holderBg.height,w.width),"stroke-width":w.width,stroke:w.fill,fill:"none"})}var b=r(f.children.holderBg,"rect"),x=[];x.push(b),w&&x.push(y),x.push(v);var S=c.element({tag:"g",id:d,content:x}),A=c.element({tag:"style",content:g,type:"text/css"}),C=c.element({tag:"defs",content:A}),E=c.element({tag:"svg",content:[C,S],width:f.properties.width,height:f.properties.height,xmlns:u,viewBox:[0,0,f.properties.width,f.properties.height].join(" "),preserveAspectRatio:"none"}),k=a(E);k=h+k[0];var T=s.svgStringToDataURI(k,"background"===t.mode);return T}},function(e,t,n){n(14);e.exports=function r(e,t,n){"use strict";function i(e){var t=e.match(/^[\w-]+/),r={tag:t?t[0]:"div",attr:{},children:[]},i=e.match(/#([\w-]+)/),o=e.match(/\$([\w-]+)/),a=e.match(/\.[\w-]+/g);return i&&(r.attr.id=i[1],n[i[1]]=r),o&&(n[o[1]]=r),a&&(r.attr["class"]=a.join(" ").replace(/\./g,"")),e.match(/&$/g)&&(f=!1),r}function o(e,t){if(null!==t&&t!==!1&&void 0!==t)return"string"!=typeof t&&"object"!=typeof t?String(t):t}function a(e){return e||0===e?String(e).replace(/&/g,"&").replace(/"/g,"""):""}function s(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}var l,h,u,c,d=1,f=!0;if(n=n||{},"string"==typeof e[0])e[0]=i(e[0]);else{if(!Array.isArray(e[0]))throw new Error("First element of array must be a string, or an array and not "+JSON.stringify(e[0]));d=0}for(;d",e[0]=l}return n[0]=e[0],u&&u(e[0]),n}},function(e,t){"use strict";function n(e){var t=""+e,n=r.exec(t);if(!n)return t;var i,o="",a=0,s=0;for(a=n.index;a]/;e.exports=n},function(e,t,n){var r=n(9),i=n(7);e.exports=function(){var e=r.newEl("canvas"),t=null;return function(n){null==t&&(t=e.getContext("2d"));var r=i.canvasRatio(),o=n.root;e.width=r*o.properties.width,e.height=r*o.properties.height,t.textBaseline="middle";var a=o.children.holderBg,s=r*a.width,l=r*a.height,h=2,u=h/2;t.fillStyle=a.properties.fill,t.fillRect(0,0,s,l),a.properties.outline&&(t.strokeStyle=a.properties.outline.fill,t.lineWidth=a.properties.outline.width,t.moveTo(u,u),t.lineTo(s-u,u),t.lineTo(s-u,l-u),t.lineTo(u,l-u),t.lineTo(u,u),t.moveTo(0,u),t.lineTo(s,l-u),t.moveTo(0,l-u),t.lineTo(s,u),t.stroke());var c=o.children.holderTextGroup;t.font=c.properties.font.weight+" "+r*c.properties.font.size+c.properties.font.units+" "+c.properties.font.family+", monospace",t.fillStyle=c.properties.fill;for(var d in c.children){var f=c.children[d];for(var p in f.children){var g=f.children[p],m=r*(c.x+f.x+g.x),v=r*(c.y+f.y+g.y+c.properties.leading/2);t.fillText(g.properties.text,m,v)}}return e.toDataURL("image/png")}}()}])}),function(e,t){t&&(Holder=e.Holder); 11 | }(this,"undefined"!=typeof Meteor&&"undefined"!=typeof Package); 12 | $(function () { 13 | 14 | // project js 15 | Holder.addTheme('gray', { 16 | bg: '#757575', 17 | fg: 'rgba(255,255,255,.7)', 18 | font: 'Helvetica', 19 | fontweight: 'normal' 20 | }); 21 | 22 | }); -------------------------------------------------------------------------------- /project/js/material.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * pickadate v3.5.6 3 | * http://amsul.ca/pickadate.js/ 4 | */ 5 | !function(a){"function"==typeof define&&define.amd?define("picker",["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):this.Picker=a(jQuery)}(function(a){function b(f,g,i,m){function n(){return b._.node("div",b._.node("div",b._.node("div",b._.node("div",B.component.nodes(w.open),y.box),y.wrap),y.frame),y.holder,'tabindex="-1"')}function o(){z.data(g,B).addClass(y.input).val(z.data("value")?B.get("select",x.format):f.value),x.editable||z.on("focus."+w.id+" click."+w.id,function(a){a.preventDefault(),B.open()}).on("keydown."+w.id,u),e(f,{haspopup:!0,expanded:!1,readonly:!1,owns:f.id+"_root"})}function p(){e(B.$root[0],"hidden",!0)}function q(){B.$holder.on({keydown:u,"focus.toOpen":t,blur:function(){z.removeClass(y.target)},focusin:function(a){B.$root.removeClass(y.focused),a.stopPropagation()},"mousedown click":function(b){var c=b.target;c!=B.$holder[0]&&(b.stopPropagation(),"mousedown"!=b.type||a(c).is("input, select, textarea, button, option")||(b.preventDefault(),B.$holder[0].focus()))}}).on("click","[data-pick], [data-nav], [data-clear], [data-close]",function(){var b=a(this),c=b.data(),d=b.hasClass(y.navDisabled)||b.hasClass(y.disabled),e=h();e=e&&(e.type||e.href),(d||e&&!a.contains(B.$root[0],e))&&B.$holder[0].focus(),!d&&c.nav?B.set("highlight",B.component.item.highlight,{nav:c.nav}):!d&&"pick"in c?(B.set("select",c.pick),x.closeOnSelect&&B.close(!0)):c.clear?(B.clear(),x.closeOnClear&&B.close(!0)):c.close&&B.close(!0)})}function r(){var b;x.hiddenName===!0?(b=f.name,f.name=""):(b=["string"==typeof x.hiddenPrefix?x.hiddenPrefix:"","string"==typeof x.hiddenSuffix?x.hiddenSuffix:"_submit"],b=b[0]+f.name+b[1]),B._hidden=a('")[0],z.on("change."+w.id,function(){B._hidden.value=f.value?B.get("select",x.formatSubmit):""})}function s(){v&&l?B.$holder.find("."+y.frame).one("transitionend",function(){B.$holder[0].focus()}):B.$holder[0].focus()}function t(a){a.stopPropagation(),z.addClass(y.target),B.$root.addClass(y.focused),B.open()}function u(a){var b=a.keyCode,c=/^(8|46)$/.test(b);return 27==b?(B.close(!0),!1):void((32==b||c||!w.open&&B.component.key[b])&&(a.preventDefault(),a.stopPropagation(),c?B.clear().close():B.open()))}if(!f)return b;var v=!1,w={id:f.id||"P"+Math.abs(~~(Math.random()*new Date))},x=i?a.extend(!0,{},i.defaults,m):m||{},y=a.extend({},b.klasses(),x.klass),z=a(f),A=function(){return this.start()},B=A.prototype={constructor:A,$node:z,start:function(){return w&&w.start?B:(w.methods={},w.start=!0,w.open=!1,w.type=f.type,f.autofocus=f==h(),f.readOnly=!x.editable,f.id=f.id||w.id,"text"!=f.type&&(f.type="text"),B.component=new i(B,x),B.$root=a('
'),p(),B.$holder=a(n()).appendTo(B.$root),q(),x.formatSubmit&&r(),o(),x.containerHidden?a(x.containerHidden).append(B._hidden):z.after(B._hidden),x.container?a(x.container).append(B.$root):z.after(B.$root),B.on({start:B.component.onStart,render:B.component.onRender,stop:B.component.onStop,open:B.component.onOpen,close:B.component.onClose,set:B.component.onSet}).on({start:x.onStart,render:x.onRender,stop:x.onStop,open:x.onOpen,close:x.onClose,set:x.onSet}),v=c(B.$holder[0]),f.autofocus&&B.open(),B.trigger("start").trigger("render"))},render:function(b){return b?(B.$holder=a(n()),q(),B.$root.html(B.$holder)):B.$root.find("."+y.box).html(B.component.nodes(w.open)),B.trigger("render")},stop:function(){return w.start?(B.close(),B._hidden&&B._hidden.parentNode.removeChild(B._hidden),B.$root.remove(),z.removeClass(y.input).removeData(g),setTimeout(function(){z.off("."+w.id)},0),f.type=w.type,f.readOnly=!1,B.trigger("stop"),w.methods={},w.start=!1,B):B},open:function(c){return w.open?B:(z.addClass(y.active),e(f,"expanded",!0),setTimeout(function(){B.$root.addClass(y.opened),e(B.$root[0],"hidden",!1)},0),c!==!1&&(w.open=!0,v&&k.css("overflow","hidden").css("padding-right","+="+d()),s(),j.on("click."+w.id+" focusin."+w.id,function(a){var b=a.target;b!=f&&b!=document&&3!=a.which&&B.close(b===B.$holder[0])}).on("keydown."+w.id,function(c){var d=c.keyCode,e=B.component.key[d],f=c.target;27==d?B.close(!0):f!=B.$holder[0]||!e&&13!=d?a.contains(B.$root[0],f)&&13==d&&(c.preventDefault(),f.click()):(c.preventDefault(),e?b._.trigger(B.component.key.go,B,[b._.trigger(e)]):B.$root.find("."+y.highlighted).hasClass(y.disabled)||(B.set("select",B.component.item.highlight),x.closeOnSelect&&B.close(!0)))})),B.trigger("open"))},close:function(a){return a&&(x.editable?f.focus():(B.$holder.off("focus.toOpen").focus(),setTimeout(function(){B.$holder.on("focus.toOpen",t)},0))),z.removeClass(y.active),e(f,"expanded",!1),setTimeout(function(){B.$root.removeClass(y.opened+" "+y.focused),e(B.$root[0],"hidden",!0)},0),w.open?(w.open=!1,v&&k.css("overflow","").css("padding-right","-="+d()),j.off("."+w.id),B.trigger("close")):B},clear:function(a){return B.set("clear",null,a)},set:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(d=g&&a.isPlainObject(c)?c:d||{},b){g||(h[b]=c);for(e in h)f=h[e],e in B.component.item&&(void 0===f&&(f=null),B.component.set(e,f,d)),("select"==e||"clear"==e)&&z.val("clear"==e?"":B.get(e,x.format)).trigger("change");B.render()}return d.muted?B:B.trigger("set",h)},get:function(a,c){if(a=a||"value",null!=w[a])return w[a];if("valueSubmit"==a){if(B._hidden)return B._hidden.value;a="value"}if("value"==a)return f.value;if(a in B.component.item){if("string"==typeof c){var d=B.component.get(a);return d?b._.trigger(B.component.formats.toString,B.component,[c,d]):""}return B.component.get(a)}},on:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(b){g||(h[b]=c);for(e in h)f=h[e],d&&(e="_"+e),w.methods[e]=w.methods[e]||[],w.methods[e].push(f)}return B},off:function(){var a,b,c=arguments;for(a=0,namesCount=c.length;a').appendTo("body"),c=b[0].offsetWidth;b.css("overflow","scroll");var d=a('
').appendTo(b),e=d[0].offsetWidth;return b.remove(),c-e}function e(b,c,d){if(a.isPlainObject(c))for(var e in c)f(b,e,c[e]);else f(b,c,d)}function f(a,b,c){a.setAttribute(("role"==b?"":"aria-")+b,c)}function g(b,c){a.isPlainObject(b)||(b={attribute:c}),c="";for(var d in b){var e=("role"==d?"":"aria-")+d,f=b[d];c+=null==f?"":e+'="'+b[d]+'"'}return c}function h(){try{return document.activeElement}catch(a){}}var i=a(window),j=a(document),k=a(document.documentElement),l=null!=document.documentElement.style.transition;return b.klasses=function(a){return a=a||"picker",{picker:a,opened:a+"--opened",focused:a+"--focused",input:a+"__input",active:a+"__input--active",target:a+"__input--target",holder:a+"__holder",frame:a+"__frame",wrap:a+"__wrap",box:a+"__box"}},b._={group:function(a){for(var c,d="",e=b._.trigger(a.min,a);e<=b._.trigger(a.max,a,[e]);e+=a.i)c=b._.trigger(a.item,a,[e]),d+=b._.node(a.node,c[0],c[1],c[2]);return d},node:function(b,c,d,e){return c?(c=a.isArray(c)?c.join(""):c,d=d?' class="'+d+'"':"",e=e?" "+e:"","<"+b+d+e+">"+c+""):""},lead:function(a){return(10>a?"0":"")+a},trigger:function(a,b,c){return"function"==typeof a?a.apply(b,c||[]):a},digits:function(a){return/\d/.test(a[1])?2:1},isDate:function(a){return{}.toString.call(a).indexOf("Date")>-1&&this.isInteger(a.getDate())},isInteger:function(a){return{}.toString.call(a).indexOf("Number")>-1&&a%1===0},ariaAttr:g},b.extend=function(c,d){a.fn[c]=function(e,f){var g=this.data(c);return"picker"==e?g:g&&"string"==typeof e?b._.trigger(g[e],g,[f]):this.each(function(){var f=a(this);f.data(c)||new b(this,c,d,e)})},a.fn[c].defaults=d.defaults},b}); 6 | 7 | !function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):"object"==typeof exports?module.exports=a(require("./picker.js"),require("jquery")):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0],e=d.value,f=a.$node.data("value"),g=f||e,h=f?b.formatSubmit:b.format,i=function(){return d.currentStyle?"rtl"==d.currentStyle.direction:"rtl"==getComputedStyle(a.$root[0]).direction};c.settings=b,c.$node=a.$node,c.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"},c.item={},c.item.clear=null,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),g?c.set("select",g,{format:h,defaultValue:!0}):c.set("select",null).set("highlight",c.item.now),c.key={40:7,38:-7,39:function(){return i()?-1:1},37:function(){return i()?1:-1},go:function(a){var b=c.item.highlight,d=new Date(b.year,b.month,b.date+a);c.set("highlight",d,{interval:a}),this.render()}},a.on("render",function(){a.$root.find("."+b.klass.selectMonth).on("change",function(){var c=this.value;c&&(a.set("highlight",[a.get("view").year,c,a.get("highlight").date]),a.$root.find("."+b.klass.selectMonth).trigger("focus"))}),a.$root.find("."+b.klass.selectYear).on("change",function(){var c=this.value;c&&(a.set("highlight",[c,a.get("view").month,a.get("highlight").date]),a.$root.find("."+b.klass.selectYear).trigger("focus"))})},1).on("open",function(){var d="";c.disabled(c.get("now"))&&(d=":not(."+b.klass.buttonToday+")"),a.$root.find("button"+d+", select").attr("disabled",!1)},1).on("close",function(){a.$root.find("button, select").attr("disabled",!0)},1)}var d=7,e=6,f=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?("clear"==a&&(a="select"),e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):a.match(/^(flip|min|max|disable|enable)$/)&&(e.select&&d.disabled(e.select)&&d.set("select",e.select,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",e.highlight,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,d){var e,g=this;return c=void 0===c?a:c,c==-(1/0)||c==1/0?e=c:b.isPlainObject(c)&&f.isInteger(c.pick)?c=c.obj:b.isArray(c)?(c=new Date(c[0],c[1],c[2]),c=f.isDate(c)?c:g.create().obj):c=f.isInteger(c)||f.isDate(c)?g.normalize(new Date(c),d):g.now(a,c,d),{year:e||c.getFullYear(),month:e||c.getMonth(),date:e||c.getDate(),day:e||c.getDay(),obj:e||c,pick:e||c.getTime()}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||f.isDate(a)?d.create(a):a};return f.isInteger(a)||(a=e(a)),f.isInteger(c)||(c=e(c)),f.isInteger(a)&&b.isPlainObject(c)?a=[c.year,c.month,c.date+a]:f.isInteger(c)&&b.isPlainObject(a)&&(c=[a.year,a.month,a.date+c]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b,c){return b=new Date,c&&c.rel&&b.setDate(b.getDate()+c.rel),this.normalize(b,c)},c.prototype.navigate=function(a,c,d){var e,f,g,h,i=b.isArray(c),j=b.isPlainObject(c),k=this.item.view;if(i||j){for(j?(f=c.year,g=c.month,h=c.date):(f=+c[0],g=+c[1],h=+c[2]),d&&d.nav&&k&&k.month!==g&&(f=k.year,g=k.month),e=new Date(f,g+(d&&d.nav?d.nav:0),1),f=e.getFullYear(),g=e.getMonth();new Date(f,g,h).getMonth()!==g;)h-=1;c=[f,g,h]}return c},c.prototype.normalize=function(a){return a.setHours(0,0,0,0),a},c.prototype.measure=function(a,b){var c=this;return b?"string"==typeof b?b=c.parse(a,b):f.isInteger(b)&&(b=c.now(a,b,{rel:b})):b="min"==a?-(1/0):1/0,b},c.prototype.viewset=function(a,b){return this.create([b.year,b.month,1])},c.prototype.validate=function(a,c,d){var e,g,h,i,j=this,k=c,l=d&&d.interval?d.interval:1,m=-1===j.item.enable,n=j.item.min,o=j.item.max,p=m&&j.item.disable.filter(function(a){if(b.isArray(a)){var d=j.create(a).pick;dc.pick&&(g=!0)}return f.isInteger(a)}).length;if((!d||!d.nav&&!d.defaultValue)&&(!m&&j.disabled(c)||m&&j.disabled(c)&&(p||e||g)||!m&&(c.pick<=n.pick||c.pick>=o.pick)))for(m&&!p&&(!g&&l>0||!e&&0>l)&&(l*=-1);j.disabled(c)&&(Math.abs(l)>1&&(c.monthk.month)&&(c=k,l=l>0?1:-1),c.pick<=n.pick?(h=!0,l=1,c=j.create([n.year,n.month,n.date+(c.pick===n.pick?0:-1)])):c.pick>=o.pick&&(i=!0,l=-1,c=j.create([o.year,o.month,o.date+(c.pick===o.pick?0:1)])),!h||!i);)c=j.create([c.year,c.month,c.date+l]);return c},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return f.isInteger(d)?a.day===(c.settings.firstDay?d:d-1)%7:b.isArray(d)||f.isDate(d)?a.pick===c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[3]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pickc.item.max.pick},c.prototype.parse=function(a,b,c){var d=this,e={};return b&&"string"==typeof b?(c&&c.format||(c=c||{},c.format=d.settings.format),d.formats.toArray(c.format).map(function(a){var c=d.formats[a],g=c?f.trigger(c,d,[b,e]):a.replace(/^!/,"").length;c&&(e[a]=b.substr(0,g)),b=b.substr(g)}),[e.yyyy||e.yy,+(e.mm||e.m)-1,e.dd||e.d]):b},c.prototype.formats=function(){function a(a,b,c){var d=a.match(/[^\x00-\x7F]+|\w+/)[0];return c.mm||c.m||(c.m=b.indexOf(d)+1),d.length}function b(a){return a.match(/\w+/)[0].length}return{d:function(a,b){return a?f.digits(a):b.date},dd:function(a,b){return a?2:f.lead(b.date)},ddd:function(a,c){return a?b(a):this.settings.weekdaysShort[c.day]},dddd:function(a,c){return a?b(a):this.settings.weekdaysFull[c.day]},m:function(a,b){return a?f.digits(a):b.month+1},mm:function(a,b){return a?2:f.lead(b.month+1)},mmm:function(b,c){var d=this.settings.monthsShort;return b?a(b,d,c):d[c.month]},mmmm:function(b,c){var d=this.settings.monthsFull;return b?a(b,d,c):d[c.month]},yy:function(a,b){return a?2:(""+b.year).slice(2)},yyyy:function(a,b){return a?4:b.year},toArray:function(a){return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return f.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}}}(),c.prototype.isDateExact=function(a,c){var d=this;return f.isInteger(a)&&f.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(f.isDate(a)||b.isArray(a))&&(f.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isDateExact(a.from,c.from)&&d.isDateExact(a.to,c.to):!1},c.prototype.isDateOverlap=function(a,c){var d=this,e=d.settings.firstDay?1:0;return f.isInteger(a)&&(f.isDate(c)||b.isArray(c))?(a=a%7+e,a===d.create(c).day+1):f.isInteger(c)&&(f.isDate(a)||b.isArray(a))?(c=c%7+e,c===d.create(a).day+1):b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,g=0;gi;i+=1){if(h=e[i],d.isDateExact(h,a)){c=e[i]=null,j=!0;break}if(d.isDateOverlap(h,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[3]||c.push("inverted")):f.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;g>i;i+=1)if(d.isDateExact(e[i],a)){e[i]=null;break}if(j)for(i=0;g>i;i+=1)if(d.isDateOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.nodes=function(a){var b=this,c=b.settings,g=b.item,h=g.now,i=g.select,j=g.highlight,k=g.view,l=g.disable,m=g.min,n=g.max,o=function(a,b){return c.firstDay&&(a.push(a.shift()),b.push(b.shift())),f.node("thead",f.node("tr",f.group({min:0,max:d-1,i:1,node:"th",item:function(d){return[a[d],c.klass.weekdays,'scope=col title="'+b[d]+'"']}})))}((c.showWeekdaysFull?c.weekdaysFull:c.weekdaysShort).slice(0),c.weekdaysFull.slice(0)),p=function(a){return f.node("div"," ",c.klass["nav"+(a?"Next":"Prev")]+(a&&k.year>=n.year&&k.month>=n.month||!a&&k.year<=m.year&&k.month<=m.month?" "+c.klass.navDisabled:""),"data-nav="+(a||-1)+" "+f.ariaAttr({role:"button",controls:b.$node[0].id+"_table"})+' title="'+(a?c.labelMonthNext:c.labelMonthPrev)+'"')},q=function(){var d=c.showMonthsShort?c.monthsShort:c.monthsFull;return c.selectMonths?f.node("select",f.group({min:0,max:11,i:1,node:"option",item:function(a){return[d[a],0,"value="+a+(k.month==a?" selected":"")+(k.year==m.year&&an.month?" disabled":"")]}}),c.klass.selectMonth,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelMonthSelect+'"'):f.node("div",d[k.month],c.klass.month)},r=function(){var d=k.year,e=c.selectYears===!0?5:~~(c.selectYears/2);if(e){var g=m.year,h=n.year,i=d-e,j=d+e;if(g>i&&(j+=g-i,i=g),j>h){var l=i-g,o=j-h;i-=l>o?o:l,j=h}return f.node("select",f.group({min:i,max:j,i:1,node:"option",item:function(a){return[a,0,"value="+a+(d==a?" selected":"")]}}),c.klass.selectYear,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelYearSelect+'"')}return f.node("div",d,c.klass.year)};return f.node("div",(c.selectYears?r()+q():q()+r())+p()+p(1),c.klass.header)+f.node("table",o+f.node("tbody",f.group({min:0,max:e-1,i:1,node:"tr",item:function(a){var e=c.firstDay&&0===b.create([k.year,k.month,1]).day?-7:0;return[f.group({min:d*a-k.day+e+1,max:function(){return this.min+d-1},i:1,node:"td",item:function(a){a=b.create([k.year,k.month,a+(c.firstDay?1:0)]);var d=i&&i.pick==a.pick,e=j&&j.pick==a.pick,g=l&&b.disabled(a)||a.pickn.pick,o=f.trigger(b.formats.toString,b,[c.format,a]);return[f.node("div",a.date,function(b){return b.push(k.month==a.month?c.klass.infocus:c.klass.outfocus),h.pick==a.pick&&b.push(c.klass.now),d&&b.push(c.klass.selected),e&&b.push(c.klass.highlighted),g&&b.push(c.klass.disabled),b.join(" ")}([c.klass.day]),"data-pick="+a.pick+" "+f.ariaAttr({role:"gridcell",label:o,selected:d&&b.$node.val()===o?!0:null,activedescendant:e?!0:null,disabled:g?!0:null})),"",f.ariaAttr({role:"presentation"})]}})]}})),c.klass.table,'id="'+b.$node[0].id+'_table" '+f.ariaAttr({role:"grid",controls:b.$node[0].id,readonly:!0}))+f.node("div",f.node("button",c.today,c.klass.buttonToday,"type=button data-pick="+h.pick+(a&&!b.disabled(h)?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id}))+f.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id}))+f.node("button",c.close,c.klass.buttonClose,"type=button data-close=true "+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id})),c.klass.footer)},c.defaults=function(a){return{labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,format:"d mmmm, yyyy",klass:{table:a+"table",header:a+"header",navPrev:a+"nav--prev",navNext:a+"nav--next",navDisabled:a+"nav--disabled",month:a+"month",year:a+"year",selectMonth:a+"select--month",selectYear:a+"select--year",weekdays:a+"weekday",day:a+"day",disabled:a+"day--disabled",selected:a+"day--selected",highlighted:a+"day--highlighted",now:a+"day--today",infocus:a+"day--infocus",outfocus:a+"day--outfocus",footer:a+"footer",buttonClear:a+"button--clear",buttonToday:a+"button--today",buttonClose:a+"button--close"}}}(a.klasses().picker+"__"),a.extend("pickadate",c)}); 8 | 9 | /*! 10 | * textarea autosize v0.4.2 11 | * https://github.com/javierjulio/textarea-autosize 12 | */ 13 | !function(a,b,c,d){function h(b,c){this.element=b,this.$element=a(b),this.init()}var e="textareaAutoSize",f="plugin_"+e,g=function(a){return a.replace(/\s/g,"").length>0};h.prototype={init:function(){var c=parseInt(this.$element.css("paddingBottom"))+parseInt(this.$element.css("paddingTop"))+parseInt(this.$element.css("borderTopWidth"))+parseInt(this.$element.css("borderBottomWidth"))||0;g(this.element.value)&&this.$element.height(this.element.scrollHeight-c),this.$element.on("input keyup",function(d){var e=a(b),f=e.scrollTop();a(this).height(0).height(this.scrollHeight-c),e.scrollTop(f)})}},a.fn[e]=function(b){return this.each(function(){a.data(this,f)||a.data(this,f,new h(this,b))}),this}}(jQuery,window,document); 14 | 15 | /*! 16 | * waves v0.7.4 17 | * http://fian.my.id/Waves 18 | */ 19 | !function(a,b){"use strict";"function"==typeof define&&define.amd?define([],function(){return b.apply(a)}):"object"==typeof exports?module.exports=b.call(a):a.Waves=b.call(a)}("object"==typeof global?global:this,function(){"use strict";function e(a){return null!==a&&a===a.window}function f(a){return e(a)?a:9===a.nodeType&&a.defaultView}function g(a){var b=typeof a;return"function"===b||"object"===b&&!!a}function h(a){return g(a)&&a.nodeType>0}function i(a){var d=c.call(a);return"[object String]"===d?b(a):g(a)&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(d)&&a.hasOwnProperty("length")?a:h(a)?[a]:[]}function j(a){var b,c,d={top:0,left:0},e=a&&a.ownerDocument;return b=e.documentElement,"undefined"!=typeof a.getBoundingClientRect&&(d=a.getBoundingClientRect()),c=f(e),{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}}function k(a){var b="";for(var c in a)a.hasOwnProperty(c)&&(b+=c+":"+a[c]+";");return b}function n(a,b,c,d){if(c){d.classList.remove("waves-wrapping"),c.classList.remove("waves-rippling");var e=c.getAttribute("data-x"),f=c.getAttribute("data-y"),g=c.getAttribute("data-scale"),h=c.getAttribute("data-translate"),i=Date.now()-Number(c.getAttribute("data-hold")),j=350-i;0>j&&(j=0),"mousemove"===a.type&&(j=150);var m="mousemove"===a.type?2500:l.duration;setTimeout(function(){var a={top:f+"px",left:e+"px",opacity:"0","-webkit-transition-duration":m+"ms","-moz-transition-duration":m+"ms","-o-transition-duration":m+"ms","transition-duration":m+"ms","-webkit-transform":g+" "+h,"-moz-transform":g+" "+h,"-ms-transform":g+" "+h,"-o-transform":g+" "+h,transform:g+" "+h};c.setAttribute("style",k(a)),setTimeout(function(){try{d.removeChild(c),b.removeChild(d)}catch(a){return!1}},m)},j)}}function p(a){if(o.allowEvent(a)===!1)return null;for(var b=null,c=a.target||a.srcElement;null!==c.parentElement;){if(c.classList.contains("waves-effect")&&!(c instanceof SVGElement)){b=c;break}c=c.parentElement}return b}function q(a){var b=p(a);if(null!==b){if(b.disabled||b.getAttribute("disabled")||b.classList.contains("disabled"))return;if(o.registerEvent(a),"touchstart"===a.type&&l.delay){var c=!1,e=setTimeout(function(){e=null,l.show(a,b)},l.delay),f=function(d){e&&(clearTimeout(e),e=null,l.show(a,b)),c||(c=!0,l.hide(d,b))},g=function(a){e&&(clearTimeout(e),e=null),f(a)};b.addEventListener("touchmove",g,!1),b.addEventListener("touchend",f,!1),b.addEventListener("touchcancel",f,!1)}else l.show(a,b),d&&(b.addEventListener("touchend",l.hide,!1),b.addEventListener("touchcancel",l.hide,!1)),b.addEventListener("mouseup",l.hide,!1),b.addEventListener("mouseleave",l.hide,!1)}}var a=a||{},b=document.querySelectorAll.bind(document),c=Object.prototype.toString,d="ontouchstart"in window,l={duration:750,delay:200,show:function(a,b,c){if(2===a.button)return!1;b=b||this;var d=document.createElement("div");d.className="waves-wrap waves-wrapping",b.appendChild(d);var e=document.createElement("div");e.className="waves-ripple waves-rippling",d.appendChild(e);var f=j(b),g=0,h=0;"touches"in a&&a.touches.length?(g=a.touches[0].pageY-f.top,h=a.touches[0].pageX-f.left):(g=a.pageY-f.top,h=a.pageX-f.left),h=h>=0?h:0,g=g>=0?g:0;var i="scale("+b.clientWidth/100*3+")",m="translate(0,0)";c&&(m="translate("+c.x+"px, "+c.y+"px)"),e.setAttribute("data-hold",Date.now()),e.setAttribute("data-x",h),e.setAttribute("data-y",g),e.setAttribute("data-scale",i),e.setAttribute("data-translate",m);var n={top:g+"px",left:h+"px"};e.classList.add("waves-notransition"),e.setAttribute("style",k(n)),e.classList.remove("waves-notransition"),n["-webkit-transform"]=i+" "+m,n["-moz-transform"]=i+" "+m,n["-ms-transform"]=i+" "+m,n["-o-transform"]=i+" "+m,n.transform=i+" "+m,n.opacity="1";var o="mousemove"===a.type?2500:l.duration;n["-webkit-transition-duration"]=o+"ms",n["-moz-transition-duration"]=o+"ms",n["-o-transition-duration"]=o+"ms",n["transition-duration"]=o+"ms",e.setAttribute("style",k(n))},hide:function(a,b){b=b||this;for(var c=b.getElementsByClassName("waves-wrapping"),d=b.getElementsByClassName("waves-rippling"),e=0,f=d.length;f>e;e++)n(a,b,d[e],c[e])}},m={input:function(a){var b=a.parentNode;if("i"!==b.tagName.toLowerCase()||!b.classList.contains("waves-effect")){var c=document.createElement("i");c.className=a.className+" waves-input-wrapper",a.className="waves-button-input",b.replaceChild(c,a),c.appendChild(a);var d=window.getComputedStyle(a,null),e=d.color,f=d.backgroundColor;c.setAttribute("style","color:"+e+";background:"+f),a.setAttribute("style","background-color:rgba(0,0,0,0);")}},img:function(a){var b=a.parentNode;if("i"!==b.tagName.toLowerCase()||!b.classList.contains("waves-effect")){var c=document.createElement("i");b.replaceChild(c,a),c.appendChild(a)}}},o={touches:0,allowEvent:function(a){var b=!0;return/^(mousedown|mousemove)$/.test(a.type)&&o.touches&&(b=!1),b},registerEvent:function(a){var b=a.type;"touchstart"===b?o.touches+=1:/^(touchend|touchcancel)$/.test(b)&&setTimeout(function(){o.touches&&(o.touches-=1)},500)}};return a.init=function(a){var b=document.body;a=a||{},"duration"in a&&(l.duration=a.duration),"delay"in a&&(l.delay=a.delay),d&&(b.addEventListener("touchstart",q,!1),b.addEventListener("touchcancel",o.registerEvent,!1),b.addEventListener("touchend",o.registerEvent,!1)),b.addEventListener("mousedown",q,!1)},a.attach=function(a,b){a=i(a),"[object Array]"===c.call(b)&&(b=b.join(" ")),b=b?" "+b:"";for(var d,e,f=0,g=a.length;g>f;f++)d=a[f],e=d.tagName.toLowerCase(),-1!==["input","img"].indexOf(e)&&(m[e](d),d=d.parentElement),-1===d.className.indexOf("waves-effect")&&(d.className+=" waves-effect"+b)},a.ripple=function(a,b){a=i(a);var c=a.length;if(b=b||{},b.wait=b.wait||0,b.position=b.position||null,c)for(var d,e,f,g={},h=0,k={type:"mousedown",button:1},m=function(a,b){return function(){l.hide(a,b)}};c>h;h++)if(d=a[h],e=b.position||{x:d.clientWidth/2,y:d.clientHeight/2},f=j(d),g.x=f.left+e.x,g.y=f.top+e.y,k.pageX=g.x,k.pageY=g.y,l.show(k,d),b.wait>=0&&null!==b.wait){var n={type:"mouseup",button:1};setTimeout(m(n,d),b.wait)}},a.calm=function(a){a=i(a);for(var b={type:"mouseup",button:1},c=0,d=a.length;d>c;c++)l.hide(b,a[c])},a.displayEffect=function(b){console.error("Waves.displayEffect() has been deprecated and will be removed in future version. Please use Waves.init() to initialize Waves effect"),a.init(b)},a}); 20 | 21 | /*! 22 | * customise pickadate js for material 23 | * requires pickadate.js 24 | */ 25 | +function ($) { 26 | 'use strict'; 27 | 28 | var Datepicker = function (element, options) { 29 | this._element = element; 30 | this._options = options; 31 | }; 32 | 33 | if (typeof $.fn.pickadate === 'undefined') { 34 | throw new Error('Material\'s JavaScript requires pickadate.js'); 35 | }; 36 | 37 | Datepicker.DEFAULTS = { 38 | cancel : 'Cancel', 39 | closeOnCancel : true, 40 | closeOnSelect : false, 41 | container : 'body', 42 | disable : [], 43 | firstDay : 0, 44 | format : 'd/m/yyyy', 45 | formatSubmit : '', 46 | max : false, 47 | min : false, 48 | monthsFull : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 49 | monthsShort : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 50 | ok : 'OK', 51 | onClose : false, 52 | onOpen : false, 53 | onRender : false, 54 | onSet : false, 55 | onStart : false, 56 | onStop : false, 57 | selectMonths : false, 58 | selectYears : false, 59 | today : 'Today', 60 | weekdaysFull : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 61 | weekdaysShort : ['S', 'M', 'T', 'W', 'T', 'F', 'S'] 62 | }; 63 | 64 | Datepicker.prototype.display = function (datepickerApi, datepickerRoot, datepickerValue) { 65 | $('.picker__date-display', datepickerRoot).remove(); 66 | 67 | $('.picker__wrap', datepickerRoot).prepend('
' + 68 | '
' + 69 | '' + datepickerApi.get(datepickerValue, 'yyyy') + '' + 70 | '
' + 71 | '
' + 72 | '' + datepickerApi.get(datepickerValue, 'dddd') + '' + 73 | '' + datepickerApi.get(datepickerValue, 'd') + '' + 74 | '' + datepickerApi.get(datepickerValue, 'mmm') + '' + 75 | '
' + 76 | '
'); 77 | }; 78 | 79 | Datepicker.prototype.show = function () { 80 | var that = this; 81 | 82 | $(this._element).pickadate({ 83 | clear : that._options.cancel, 84 | close : that._options.ok, 85 | closeOnClear : that._options.closeOnCancel, 86 | closeOnSelect : that._options.closeOnSelect, 87 | container : that._options.container, 88 | disable : that._options.disable, 89 | firstDay : that._options.firstDay, 90 | format : that._options.format, 91 | formatSubmit : that._options.formatSubmit, 92 | klass : { 93 | buttonClear : 'btn btn-flat btn-brand picker__button--clear', 94 | buttonClose : 'btn btn-flat btn-brand picker__button--close', 95 | buttonToday : 'btn btn-flat btn-brand picker__button--today', 96 | navPrev : 'material-icons picker__nav--prev', 97 | navNext : 'material-icons picker__nav--next', 98 | }, 99 | max : that._options.max, 100 | min : that._options.min, 101 | monthsFull : that._options.monthsFull, 102 | monthsShort : that._options.monthsShort, 103 | onClose : that._options.onClose, 104 | onOpen : that._options.onOpen, 105 | onRender : that._options.onRender, 106 | onSet : that._options.onSet, 107 | onStart : that._options.onStart, 108 | onStop : that._options.onStop, 109 | selectMonths : that._options.selectMonths, 110 | selectYears : that._options.selectYears, 111 | today : that._options.today, 112 | weekdaysFull : that._options.weekdaysFull, 113 | weekdaysShort : that._options.weekdaysShort 114 | }); 115 | 116 | var datepickerApi = $(this._element).pickadate('picker'), 117 | datepickerNode = datepickerApi.$node, 118 | datepickerRoot = datepickerApi.$root; 119 | 120 | datepickerApi.on({ 121 | close: function () { 122 | $(document.activeElement).blur(); 123 | }, 124 | open: function () { 125 | if (!$('.picker__date-display', datepickerRoot).length) { 126 | that.display(datepickerApi, datepickerRoot, 'highlight'); 127 | }; 128 | }, 129 | set: function () { 130 | if (datepickerApi.get('select') !== null) { 131 | that.display(datepickerApi, datepickerRoot, 'select'); 132 | }; 133 | } 134 | }); 135 | }; 136 | 137 | function Plugin (option) { 138 | return this.each(function () { 139 | var data = $(this).data('bs.pickdate'); 140 | var options = $.extend({}, Datepicker.DEFAULTS, $(this).data(), typeof option == 'object' && option); 141 | 142 | if (!data) { 143 | $(this).data('bs.pickdate', (data = new Datepicker(this, options))); 144 | }; 145 | 146 | data.show(); 147 | }); 148 | }; 149 | 150 | var old = $.fn.pickdate; 151 | 152 | $.fn.pickdate = Plugin; 153 | $.fn.pickdate.Constructor = Datepicker; 154 | 155 | $.fn.pickdate.noConflict = function () { 156 | $.fn.pickdate = old; 157 | return this; 158 | }; 159 | }(jQuery); 160 | 161 | /*! 162 | * activate textarea-autosize for material 163 | * requires textarea-autosize.js 164 | */ 165 | $(function () { 166 | if ($('.textarea-autosize').length && (typeof $.fn.textareaAutoSize !== 'undefined')) { 167 | $('.textarea-autosize').textareaAutoSize(); 168 | }; 169 | }); 170 | 171 | /*! 172 | * activate waves for material 173 | * requires waves.js 174 | */ 175 | $(function () { 176 | if ($('.waves-attach').length && (typeof Waves !== 'undefined')) { 177 | Waves.attach('.waves-attach'); 178 | Waves.init({ 179 | duration: 300 180 | }); 181 | }; 182 | }); 183 | 184 | /*! 185 | * Material 186 | */ 187 | if (typeof jQuery === 'undefined') { 188 | throw new Error('Material\'s JavaScript requires jQuery') 189 | } 190 | 191 | +function ($) { 192 | var version = $.fn.jquery.split(' ')[0].split('.') 193 | if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) { 194 | throw new Error('Material\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0') 195 | } 196 | }(jQuery); 197 | 198 | +function ($) { 199 | 'use strict'; 200 | 201 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; 202 | 203 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 204 | 205 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 206 | 207 | /*! 208 | * floating label: 209 | * when a user engages with the text input field, 210 | * the floating inline labels move to float above the field 211 | */ 212 | var FloatingLabel = function ($) { 213 | // constants >>> 214 | var DATA_API_KEY = '.data-api'; 215 | var DATA_KEY = 'md.floatinglabel'; 216 | var EVENT_KEY = '.' + DATA_KEY; 217 | var NAME = 'floatinglabel'; 218 | var NO_CONFLICT = $.fn[NAME]; 219 | 220 | var ClassName = { 221 | IS_FOCUSED: 'is-focused', 222 | HAS_VALUE: 'has-value' 223 | }; 224 | 225 | var Event = { 226 | CHANGE: 'change' + EVENT_KEY, 227 | FOCUSIN: 'focusin' + EVENT_KEY, 228 | FOCUSOUT: 'focusout' + EVENT_KEY 229 | }; 230 | 231 | var Selector = { 232 | DATA_PARENT: '.floating-label', 233 | DATA_TOGGLE: '.floating-label .form-control' 234 | }; 235 | // <<< constants 236 | 237 | var FloatingLabel = function () { 238 | function FloatingLabel(element) { 239 | _classCallCheck(this, FloatingLabel); 240 | 241 | this._element = element; 242 | } 243 | 244 | _createClass(FloatingLabel, [{ 245 | key: 'change', 246 | value: function change(relatedTarget) { 247 | if ($(this._element).val() || $(this._element).is('select') && $('option:first-child', $(this._element)).html().replace(' ', '') !== '') { 248 | $(relatedTarget).addClass(ClassName.HAS_VALUE); 249 | } else { 250 | $(relatedTarget).removeClass(ClassName.HAS_VALUE); 251 | } 252 | } 253 | }, { 254 | key: 'focusin', 255 | value: function focusin(relatedTarget) { 256 | $(relatedTarget).addClass(ClassName.IS_FOCUSED); 257 | } 258 | }, { 259 | key: 'focusout', 260 | value: function focusout(relatedTarget) { 261 | $(relatedTarget).removeClass(ClassName.IS_FOCUSED); 262 | } 263 | }], [{ 264 | key: '_jQueryInterface', 265 | value: function _jQueryInterface(event) { 266 | return this.each(function () { 267 | var data = $(this).data(DATA_KEY); 268 | var _event = event ? event : 'change'; 269 | 270 | if (!data) { 271 | data = new FloatingLabel(this); 272 | $(this).data(DATA_KEY, data); 273 | } 274 | 275 | if (typeof _event === 'string') { 276 | if (data[_event] === undefined) { 277 | throw new Error('No method named "' + _event + '"'); 278 | } 279 | 280 | data[_event]($(this).closest(Selector.DATA_PARENT)); 281 | } 282 | }); 283 | } 284 | }]); 285 | 286 | return FloatingLabel; 287 | }(); 288 | 289 | $(document).on(Event.CHANGE + ' ' + Event.FOCUSIN + ' ' + Event.FOCUSOUT, Selector.DATA_TOGGLE, function (event) { 290 | var data = $(this).data(DATA_KEY); 291 | 292 | FloatingLabel._jQueryInterface.call($(this), event.type); 293 | }); 294 | 295 | $.fn[NAME] = FloatingLabel._jQueryInterface; 296 | $.fn[NAME].Constructor = FloatingLabel; 297 | $.fn[NAME].noConflict = function () { 298 | $.fn[NAME] = NO_CONFLICT; 299 | return FloatingLabel._jQueryInterface; 300 | }; 301 | 302 | return FloatingLabel; 303 | }(jQuery); 304 | 305 | /*! 306 | * navigation drawer 307 | * based on bootstrap's (v4.0.0-alpha.5) modal.js 308 | */ 309 | var NavDrawer = function ($) { 310 | // constants >>> 311 | var DATA_API_KEY = '.data-api'; 312 | var DATA_KEY = 'md.navdrawer'; 313 | var EVENT_KEY = '.' + DATA_KEY; 314 | var NAME = 'navdrawer'; 315 | var NO_CONFLICT = $.fn[NAME]; 316 | var TRANSITION_DURATION = 375; 317 | var TRANSITION_DURATION_BACKDROP = 225; 318 | 319 | var ClassName = { 320 | BACKDROP: 'navdrawer-backdrop', 321 | OPEN: 'navdrawer-open', 322 | SHOW: 'show' 323 | }; 324 | 325 | var Default = { 326 | breakpoint: 1280, 327 | keyboard: true, 328 | show: true, 329 | type: 'default' 330 | }; 331 | 332 | var DefaultType = { 333 | keyboard: 'boolean', 334 | show: 'boolean', 335 | type: 'string' 336 | }; 337 | 338 | var Event = { 339 | CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, 340 | CLICK_DISMISS: 'click.dismiss' + EVENT_KEY, 341 | FOCUSIN: 'focusin' + EVENT_KEY, 342 | HIDDEN: 'hidden' + EVENT_KEY, 343 | HIDE: 'hide' + EVENT_KEY, 344 | KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY, 345 | MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY, 346 | MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY, 347 | SHOW: 'show' + EVENT_KEY, 348 | SHOWN: 'shown' + EVENT_KEY 349 | }; 350 | 351 | var Selector = { 352 | CONTENT: '.navdrawer-content', 353 | DATA_DISMISS: '[data-dismiss="navdrawer"]', 354 | DATA_TOGGLE: '[data-toggle="navdrawer"]' 355 | }; 356 | // <<< constants 357 | 358 | var NavDrawer = function () { 359 | function NavDrawer(element, config) { 360 | _classCallCheck(this, NavDrawer); 361 | 362 | this._backdrop = null; 363 | this._config = this._getConfig(config); 364 | this._content = $(element).find(Selector.CONTENT)[0]; 365 | this._element = element; 366 | this._ignoreBackdropClick = false; 367 | this._isShown = false; 368 | } 369 | 370 | _createClass(NavDrawer, [{ 371 | key: 'hide', 372 | value: function hide(event) { 373 | if (event) { 374 | event.preventDefault(); 375 | } 376 | 377 | var hideClassName = ClassName.OPEN + '-' + this._config.type; 378 | var hideEvent = $.Event(Event.HIDE); 379 | 380 | $(this._element).trigger(hideEvent); 381 | 382 | if (!this._isShown || hideEvent.isDefaultPrevented()) { 383 | return; 384 | } 385 | 386 | this._isShown = false; 387 | this._setEscapeEvent(); 388 | $(document).off(Event.FOCUSIN); 389 | $(this._content).off(Event.MOUSEDOWN_DISMISS); 390 | 391 | $(this._element).off(Event.CLICK_DISMISS).removeClass(ClassName.SHOW); 392 | 393 | if (Util.supportsTransitionEnd()) { 394 | $(this._element).one(Util.TRANSITION_END, $.proxy(this._hideNavdrawer, this, hideClassName)).emulateTransitionEnd(TRANSITION_DURATION); 395 | } else { 396 | this._hideNavdrawer(); 397 | } 398 | } 399 | }, { 400 | key: 'show', 401 | value: function show(relatedTarget) { 402 | var _this = this; 403 | 404 | var showEvent = $.Event(Event.SHOW, { 405 | relatedTarget: relatedTarget 406 | }); 407 | 408 | $(this._element).trigger(showEvent); 409 | 410 | if (this._isShown || showEvent.isDefaultPrevented()) { 411 | return; 412 | } 413 | 414 | this._isShown = true; 415 | $(document.body).addClass(ClassName.OPEN + '-' + this._config.type); 416 | this._setEscapeEvent(); 417 | $(this._element).addClass(NAME + '-' + this._config.type); 418 | $(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this)); 419 | 420 | $(this._content).on(Event.MOUSEDOWN_DISMISS, function () { 421 | $(_this._element).one(Event.MOUSEUP_DISMISS, function (event) { 422 | if ($(event.target).is(_this._element)) { 423 | _this._ignoreBackdropClick = true; 424 | } 425 | }); 426 | }); 427 | 428 | this._showBackdrop($.proxy(this._showElement, this, relatedTarget)); 429 | } 430 | }, { 431 | key: 'toggle', 432 | value: function toggle(relatedTarget) { 433 | return this._isShown ? this.hide() : this.show(relatedTarget); 434 | } 435 | }, { 436 | key: '_enforceFocus', 437 | value: function _enforceFocus() { 438 | var _this2 = this; 439 | 440 | $(document).off(Event.FOCUSIN).on(Event.FOCUSIN, function (event) { 441 | if (_this2._config.type === 'default' || $(window).width() <= _this2._config.breakpoint) { 442 | if (_this2._element !== event.target && !$(_this2._element).has(event.target).length) { 443 | _this2._element.focus(); 444 | } 445 | } 446 | }); 447 | } 448 | }, { 449 | key: '_getConfig', 450 | value: function _getConfig(config) { 451 | config = $.extend({}, Default, config); 452 | Util.typeCheckConfig(NAME, config, DefaultType); 453 | return config; 454 | } 455 | }, { 456 | key: '_hideNavdrawer', 457 | value: function _hideNavdrawer(className) { 458 | var _this3 = this; 459 | 460 | this._element.style.display = 'none'; 461 | 462 | this._showBackdrop(function () { 463 | $(document.body).removeClass(className); 464 | $(_this3._element).trigger(Event.HIDDEN); 465 | }); 466 | } 467 | }, { 468 | key: '_removeBackdrop', 469 | value: function _removeBackdrop() { 470 | if (this._backdrop) { 471 | $(this._backdrop).remove(); 472 | this._backdrop = null; 473 | } 474 | } 475 | }, { 476 | key: '_setEscapeEvent', 477 | value: function _setEscapeEvent() { 478 | var _this4 = this; 479 | 480 | if (this._isShown && this._config.keyboard) { 481 | $(this._element).on(Event.KEYDOWN_DISMISS, function (event) { 482 | if (event.which === 27) { 483 | _this4.hide(); 484 | } 485 | }); 486 | } else if (!this._isShown) { 487 | $(this._element).off(Event.KEYDOWN_DISMISS); 488 | } 489 | } 490 | }, { 491 | key: '_showBackdrop', 492 | value: function _showBackdrop(callback) { 493 | var _this5 = this; 494 | 495 | var supportsTransition = Util.supportsTransitionEnd(); 496 | 497 | if (this._isShown) { 498 | this._backdrop = document.createElement('div'); 499 | 500 | $(this._backdrop).addClass(ClassName.BACKDROP).addClass(ClassName.BACKDROP + '-' + this._config.type).appendTo(document.body); 501 | 502 | $(this._element).on(Event.CLICK_DISMISS, function (event) { 503 | if (_this5._ignoreBackdropClick) { 504 | _this5._ignoreBackdropClick = false; 505 | return; 506 | } 507 | 508 | if (event.target !== event.currentTarget) { 509 | return; 510 | } 511 | 512 | _this5.hide(); 513 | }); 514 | 515 | if (supportsTransition) { 516 | Util.reflow(this._backdrop); 517 | } 518 | 519 | $(this._backdrop).addClass(ClassName.SHOW); 520 | 521 | if (!callback) { 522 | return; 523 | } 524 | 525 | if (!supportsTransition) { 526 | callback(); 527 | return; 528 | } 529 | 530 | $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(TRANSITION_DURATION_BACKDROP); 531 | } else if (this._backdrop && !this._isShown) { 532 | $(this._backdrop).removeClass(ClassName.SHOW); 533 | 534 | var callbackRemove = function callbackRemove() { 535 | _this5._removeBackdrop(); 536 | 537 | if (callback) { 538 | callback(); 539 | } 540 | }; 541 | 542 | if (supportsTransition) { 543 | $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(TRANSITION_DURATION_BACKDROP); 544 | } else { 545 | callbackRemove(); 546 | } 547 | } else if (callback) { 548 | callback(); 549 | } 550 | } 551 | }, { 552 | key: '_showElement', 553 | value: function _showElement(relatedTarget) { 554 | var _this6 = this; 555 | 556 | var supportsTransition = Util.supportsTransitionEnd(); 557 | 558 | if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 559 | document.body.appendChild(this._element); 560 | } 561 | 562 | this._element.style.display = 'block'; 563 | 564 | if (supportsTransition) { 565 | Util.reflow(this._element); 566 | } 567 | 568 | $(this._element).addClass(ClassName.SHOW); 569 | this._enforceFocus(); 570 | 571 | var shownEvent = $.Event(Event.SHOWN, { 572 | relatedTarget: relatedTarget 573 | }); 574 | 575 | var transitionComplete = function transitionComplete() { 576 | _this6._element.focus(); 577 | $(_this6._element).trigger(shownEvent); 578 | }; 579 | 580 | if (supportsTransition) { 581 | $(this._content).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION); 582 | } else { 583 | transitionComplete(); 584 | } 585 | } 586 | }], [{ 587 | key: '_jQueryInterface', 588 | value: function _jQueryInterface(config, relatedTarget) { 589 | return this.each(function () { 590 | var data = $(this).data(DATA_KEY); 591 | var _config = $.extend({}, NavDrawer.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config); 592 | 593 | if (!data) { 594 | data = new NavDrawer(this, _config); 595 | $(this).data(DATA_KEY, data); 596 | } 597 | 598 | if (typeof config === 'string') { 599 | if (data[config] === undefined) { 600 | throw new Error('No method named "' + config + '"'); 601 | } 602 | 603 | data[config](relatedTarget); 604 | } else if (_config.show) { 605 | data.show(relatedTarget); 606 | } 607 | }); 608 | } 609 | }, { 610 | key: 'Default', 611 | get: function get() { 612 | return Default; 613 | } 614 | }]); 615 | 616 | return NavDrawer; 617 | }(); 618 | 619 | $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { 620 | var _this7 = this; 621 | 622 | var selector = Util.getSelectorFromElement(this); 623 | var target = void 0; 624 | 625 | if (selector) { 626 | target = $(selector)[0]; 627 | } 628 | 629 | var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data()); 630 | 631 | if (this.tagName === 'A') { 632 | event.preventDefault(); 633 | } 634 | 635 | var $target = $(target).one(Event.SHOW, function (showEvent) { 636 | if (showEvent.isDefaultPrevented()) { 637 | return; 638 | } 639 | 640 | $target.one(Event.HIDDEN, function () { 641 | if ($(_this7).is(':visible')) { 642 | _this7.focus(); 643 | } 644 | }); 645 | }); 646 | 647 | NavDrawer._jQueryInterface.call($(target), config, this); 648 | }); 649 | 650 | $.fn[NAME] = NavDrawer._jQueryInterface; 651 | $.fn[NAME].Constructor = NavDrawer; 652 | $.fn[NAME].noConflict = function () { 653 | $.fn[NAME] = NO_CONFLICT; 654 | return NavDrawer._jQueryInterface; 655 | }; 656 | 657 | return NavDrawer; 658 | }(jQuery); 659 | 660 | /*! 661 | * tab indicator animation 662 | * requires bootstrap's (v4.0.0-alpha.5) tab.js 663 | */ 664 | var TabSwitch = function ($) { 665 | // constants >>> 666 | var DATA_KEY = 'md.tabswitch'; 667 | var NAME = 'tabswitch'; 668 | var NO_CONFLICT = $.fn[NAME]; 669 | var TRANSITION_DURATION = 300; 670 | 671 | var ClassName = { 672 | ANIMATE: 'animate', 673 | INDICATOR: 'nav-tabs-indicator', 674 | MATERIAL: 'nav-tabs-material', 675 | SCROLLABLE: 'nav-tabs-scrollable', 676 | SHOW: 'show' 677 | }; 678 | 679 | var Event = { 680 | SHOW_BS_TAB: 'show.bs.tab' 681 | }; 682 | 683 | var Selector = { 684 | DATA_TOGGLE: '.nav-tabs [data-toggle="tab"]', 685 | NAV: '.nav-tabs', 686 | NAV_ITEM: '.nav-item' 687 | }; 688 | // <<< constants 689 | 690 | var TabSwitch = function () { 691 | function TabSwitch(nav) { 692 | _classCallCheck(this, TabSwitch); 693 | 694 | if (typeof $.fn.tab === 'undefined') { 695 | throw new Error('Material\'s JavaScript requires Bootstrap\'s tab.js'); 696 | }; 697 | 698 | this._nav = nav; 699 | this._navindicator = null; 700 | } 701 | 702 | _createClass(TabSwitch, [{ 703 | key: 'switch', 704 | value: function _switch(element, relatedTarget) { 705 | var _this8 = this; 706 | 707 | var supportsTransition = Util.supportsTransitionEnd(); 708 | 709 | if (!this._navindicator) { 710 | this._createIndicator(); 711 | } 712 | 713 | var elLeft = $(element).closest(Selector.NAV_ITEM).offset().left; 714 | var elWidth = $(element).closest(Selector.NAV_ITEM).outerWidth(); 715 | var navLeft = $(this._nav).offset().left; 716 | var navScrollLeft = $(this._nav).scrollLeft(); 717 | var navWidth = $(this._nav).outerWidth(); 718 | 719 | if (relatedTarget !== undefined) { 720 | var relatedLeft = $(relatedTarget).closest(Selector.NAV_ITEM).offset().left; 721 | var relatedWidth = $(relatedTarget).closest(Selector.NAV_ITEM).outerWidth(); 722 | 723 | $(this._navindicator).css({ 724 | left: relatedLeft + navScrollLeft - navLeft, 725 | right: navWidth - (relatedLeft + navScrollLeft - navLeft + relatedWidth) 726 | }); 727 | 728 | $(this._navindicator).addClass(ClassName.SHOW); 729 | Util.reflow(this._navindicator); 730 | 731 | if (supportsTransition) { 732 | $(this._nav).addClass(ClassName.ANIMATE); 733 | } 734 | } 735 | 736 | $(this._navindicator).css({ 737 | left: elLeft + navScrollLeft - navLeft, 738 | right: navWidth - (elLeft + navScrollLeft - navLeft + elWidth) 739 | }); 740 | 741 | var complete = function complete() { 742 | $(_this8._nav).removeClass(ClassName.ANIMATE); 743 | $(_this8._navindicator).removeClass(ClassName.SHOW); 744 | }; 745 | 746 | if (!supportsTransition) { 747 | complete(); 748 | return; 749 | } 750 | 751 | $(this._navindicator).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION); 752 | } 753 | }, { 754 | key: '_createIndicator', 755 | value: function _createIndicator() { 756 | this._navindicator = document.createElement('div'); 757 | 758 | $(this._navindicator).addClass(ClassName.INDICATOR).appendTo(this._nav); 759 | 760 | $(this._nav).addClass(ClassName.MATERIAL); 761 | } 762 | }], [{ 763 | key: '_jQueryInterface', 764 | value: function _jQueryInterface(relatedTarget) { 765 | return this.each(function () { 766 | var nav = $(this).closest(Selector.NAV)[0]; 767 | 768 | if (!nav) { 769 | return; 770 | } 771 | 772 | var data = $(nav).data(DATA_KEY); 773 | 774 | if (!data) { 775 | data = new TabSwitch(nav); 776 | $(nav).data(DATA_KEY, data); 777 | } 778 | 779 | data.switch(this, relatedTarget); 780 | }); 781 | } 782 | }]); 783 | 784 | return TabSwitch; 785 | }(); 786 | 787 | $(document).on(Event.SHOW_BS_TAB, Selector.DATA_TOGGLE, function (event) { 788 | TabSwitch._jQueryInterface.call($(event.target), event.relatedTarget); 789 | }); 790 | 791 | $.fn[NAME] = TabSwitch._jQueryInterface; 792 | $.fn[NAME].Constructor = TabSwitch; 793 | $.fn[NAME].noConflict = function () { 794 | $.fn[NAME] = NO_CONFLICT; 795 | return TabSwitch._jQueryInterface; 796 | }; 797 | 798 | return TabSwitch; 799 | }(jQuery); 800 | 801 | /*! 802 | * global util js 803 | * based on bootstrap's (v4.0.0-alpha.5) util.js 804 | */ 805 | var Util = function ($) { 806 | var transition = false; 807 | 808 | var TransitionEndEvent = { 809 | WebkitTransition: 'webkitTransitionEnd', 810 | MozTransition: 'transitionend', 811 | OTransition: 'oTransitionEnd otransitionend', 812 | transition: 'transitionend' 813 | }; 814 | 815 | function getSpecialTransitionEndEvent() { 816 | return { 817 | bindType: transition.end, 818 | delegateType: transition.end, 819 | handle: function handle(event) { 820 | if ($(event.target).is(this)) { 821 | return event.handleObj.handler.apply(this, arguments); 822 | } 823 | return undefined; 824 | } 825 | }; 826 | } 827 | 828 | function isElement(obj) { 829 | return (obj[0] || obj).nodeType; 830 | } 831 | 832 | function setTransitionEndSupport() { 833 | transition = transitionEndTest(); 834 | 835 | $.fn.emulateTransitionEnd = transitionEndEmulator; 836 | 837 | if (Util.supportsTransitionEnd()) { 838 | $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 839 | } 840 | } 841 | 842 | function toType(obj) { 843 | return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); 844 | } 845 | 846 | function transitionEndEmulator(duration) { 847 | var _this9 = this; 848 | 849 | var called = false; 850 | 851 | $(this).one(Util.TRANSITION_END, function () { 852 | called = true; 853 | }); 854 | 855 | setTimeout(function () { 856 | if (!called) { 857 | Util.triggerTransitionEnd(_this9); 858 | } 859 | }, duration); 860 | 861 | return this; 862 | } 863 | 864 | function transitionEndTest() { 865 | if (window.QUnit) { 866 | return false; 867 | } 868 | 869 | var el = document.createElement('material'); 870 | 871 | for (var name in TransitionEndEvent) { 872 | if (el.style[name] !== undefined) { 873 | return { end: TransitionEndEvent[name] }; 874 | } 875 | }; 876 | 877 | return false; 878 | } 879 | 880 | var Util = { 881 | TRANSITION_END: 'mdTransitionEnd', 882 | 883 | getSelectorFromElement: function getSelectorFromElement(element) { 884 | var selector = element.getAttribute('data-target'); 885 | 886 | if (!selector) { 887 | selector = element.getAttribute('href') || ''; 888 | selector = /^#[a-z]/i.test(selector) ? selector : null; 889 | } 890 | 891 | return selector; 892 | }, 893 | getUID: function getUID(prefix) { 894 | do { 895 | prefix += ~ ~(Math.random() * 1000000); 896 | } while (document.getElementById(prefix)); 897 | return prefix; 898 | }, 899 | reflow: function reflow(element) { 900 | new Function('md', 'return md')(element.offsetHeight); 901 | }, 902 | supportsTransitionEnd: function supportsTransitionEnd() { 903 | return Boolean(transition); 904 | }, 905 | triggerTransitionEnd: function triggerTransitionEnd(element) { 906 | $(element).trigger(transition.end); 907 | }, 908 | typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 909 | for (var property in configTypes) { 910 | if (configTypes.hasOwnProperty(property)) { 911 | var expectedTypes = configTypes[property]; 912 | var value = config[property]; 913 | var valueType = void 0; 914 | 915 | if (value && isElement(value)) { 916 | valueType = 'element'; 917 | } else { 918 | valueType = toType(value); 919 | } 920 | 921 | if (!new RegExp(expectedTypes).test(valueType)) { 922 | throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".')); 923 | } 924 | } 925 | }; 926 | } 927 | }; 928 | 929 | setTransitionEndSupport(); 930 | 931 | return Util; 932 | }(jQuery); 933 | 934 | }(jQuery); --------------------------------------------------------------------------------