Commit d5179b3a authored by John Punzalan's avatar John Punzalan

Update Funasaka

parent efe4e965
......@@ -6,7 +6,7 @@
*
*/
module.exports = function(grunt) {
module.exports = function(grunt) {
// Initialize configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
......@@ -19,7 +19,7 @@ module.exports = function(grunt) {
'library/components/foundation-sites/scss',
'library/components/motion-ui'
],
noCache: true
noCache: true
},
dist: {
options: {
......@@ -56,6 +56,8 @@ module.exports = function(grunt) {
// Owl
'library/components/OwlCarousel/owl-carousel/owl.carousel.css',
'library/components/OwlCarousel/owl-carousel/owl.transitions.css',
// Magnific Popup
'library/components/magnific-popup/dist/magnific-popup.css',
// Lightbox2
'library/components/lightbox2/dist/css/lightbox.min.css',
// Animate
......@@ -117,16 +119,14 @@ module.exports = function(grunt) {
'library/components/foundation-sites/dist/js/plugins/foundation.equalizer.js', // equalizer
'library/components/foundation-sites/dist/js/plugins/foundation.toggler.js', // toggler
'library/components/foundation-sites/dist/js/plugins/foundation.responsiveToggle.js', // responsive toggle
// materialize
'library/components/materialize/js/global.js', // global
'library/components/materialize/js/jquery.easing.1.3.js', // easing
'library/components/materialize/js/scrollspy.js', // scroll spy
// owl
'library/components/OwlCarousel/owl-carousel/owl.carousel.min.js',
// Magnific Popup
'library/components/magnific-popup/dist/jquery.magnific-popup.min.js',
// images loaded
'library/components/imagesloaded/imagesloaded.pkgd.min.js',
// lightbox2
'library/components/lightbox2/dist/js/lightbox.min.js',
'library/components/lightbox2/dist/js/lightbox.min.js',
// stellar
'library/components/jquery.stellar/jquery.stellar.min.js',
// wow
......@@ -167,38 +167,34 @@ module.exports = function(grunt) {
reload: true
},
files: ['Gruntfile.js'],
tasks: ['jshint:grunt']
tasks: ['newer:jshint:grunt']
},
// Syntactically Awesome Stylesheets
sass: {
files: 'library/scss/**/*.scss',
tasks: ['sass', 'autoprefixer']
tasks: ['newer:sass', 'newer:autoprefixer']
},
// Library scripts
scripts: {
files: ['library/js/app.js'],
tasks: ['jshint:scripts']
tasks: ['newer:jshint:scripts']
},
// .mo files
mo: {
files: ['library/translations/*.po'],
tasks: ['potomo']
tasks: ['newer:potomo']
}
},
// Image minifier
// https://www.npmjs.com/package/grunt-contrib-imagemin
imagemin: {
options: {
optimizationLevel: 7
},
uploads: { // wp-content/uploads
uploads: { // wp-content/uploads
files: [{
expand: true, // Enable dynamic expansion
cwd: '../../uploads', // src matches are relative to this path
src: ['**/*.{png,jpg,gif}'], // Actual patterns to match
dest: '../../uploads' // Destination path prefix
cwd: '../../uploads', // src matches are relative to this path
src: ['**/*.{png,jpg,gif,svg}'], // Actual patterns to match
dest: '../../uploads.min' // Destination path prefix
}]
},
......@@ -206,8 +202,8 @@ module.exports = function(grunt) {
files: [{
expand: true, // Enable dynamic expansion
cwd: 'library/images', // src matches are relative to this path
src: ['**/*.{png,jpg,gif}'], // Actual patterns to match
dest: 'library/images' // Destination path prefix
src: ['**/*.{png,jpg,gif,svg}'], // Actual patterns to match
dest: 'library/images.min' // Destination path prefix
}]
}
},
......@@ -286,13 +282,14 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-browser-sync'); // Browsing testing synchronization
grunt.loadNpmTasks('grunt-pot'); // Internationalization
grunt.loadNpmTasks('grunt-potomo'); // .po to .mo file
grunt.loadNpmTasks('grunt-newer');
// Register task(s)
grunt.registerTask('build', [
'sass',
'autoprefixer',
'jshint',
'potomo',
'newer:sass',
'newer:autoprefixer',
'newer:jshint',
'newer:potomo',
'browserSync',
'watch'
]); // Run this task with 'grunt build' command
......@@ -304,11 +301,11 @@ module.exports = function(grunt) {
'jshint',
'concat',
'uglify',
// 'imagemin',
'potomo'
'newer:imagemin',
'newer:potomo'
]); // Run this task on deployment with 'grunt deploy' command
grunt.registerTask('translate', 'pot'); // Run this task to generate a new .pot file
grunt.registerTask('translate', 'newer:pot'); // Run this task to generate a new .pot file
grunt.registerTask('default', 'build'); // Default task
};
......@@ -31,11 +31,11 @@
"jquery.form": "http://malsup.github.io/jquery.form.js",
"browsersize-tooltip": "*",
"motion-ui": "^1.2.2",
"materialize": "^0.97.8",
"animate.css": "^3.5.2",
"jquery": "2.2.4",
"jquery.stellar": "stellar#^0.6.2",
"wow": "^1.1.2"
"wow": "^1.1.2",
"magnific-popup": "^1.1.0"
},
"resolutions": {
"what-input": "~4.0.3"
......
{
"name": "materialize",
"description": "A modern responsive front-end framework based on Material Design",
"keywords": [
"css",
"js",
"sass",
"mobile-first",
"responsive",
"front-end",
"framework",
"ux",
"material",
"design"
],
"main": [
"bin/materialize.css",
"bin/materialize.js"
],
"ignore": [
"jade/",
".gitignore",
"CNAME",
"css/",
"bower.json",
"README.md",
"images/",
"js/jquery.timeago.js",
"js/init.js",
"js/prism.js",
"res/",
"sass/style.scss",
"sass/ghpages-materialize.scss",
"**/*.html",
"**/*.zip",
"**/*.txt",
"sitemap.xml",
"package.json",
"Gruntfile.js"
],
"dependencies": {
"jquery": ">=2.1.1"
},
"devDependencies": {},
"homepage": "https://github.com/Dogfalo/materialize",
"version": "0.97.8",
"_release": "0.97.8",
"_resolution": {
"type": "version",
"tag": "v0.97.8",
"commit": "edbc5a16e43a6ad35f095fc313d5a8fd4e511ea5"
},
"_source": "https://github.com/Dogfalo/materialize.git",
"_target": "^0.97.8",
"_originalSource": "materialize"
}
\ No newline at end of file
root = true
[*.{js,scss}]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
* text=auto
**/*.html linguist-documentation
js/velocity.min.js linguist-vendored
js/hammer.min.js linguist-vendored
js/jquery.easing.1.3.js linguist-vendored
js/jquery.timeago.min.js linguist-vendored
\ No newline at end of file
images/
.sass-cache/
.grunt/
.DS_Store
prepros.cfg
Thumbs.db
.projectile
**/*.log
language: node_js
node_js:
- "0.12"
before_install:
- npm install -g grunt-cli
git:
depth: 10
## v0.97.4 (Dec 20, 2015)
- Added Jasmine testing with Travis CI
- Select bugfixes
- Grid Offset bugfix
- Dropdown overflow bugfix
- Range slider error bugfix
## v0.97.3 (Nov 15, 2015)
- Meteor font issues fixed
- Select rendering issue fixed
- Added Push and Pull to grid
- Dynamic accordion appends fixed
## v0.97.2 (Nov 8, 2015)
- Image support inside select
- Optgroup supported in select
- Multiple select added
- Card styling fixes
- Breadcrumbs added
- Scrollable tabs
- Tooltips and dropdowns position themselves more intelligently inside the window
- FAB menu is click-toggleable
- Horizontal FAB support added
## v0.97.1 (Sep 13, 2015)
- Added new range slider with uses noUiSlider to provide powerful options
- Added CSS for Chips
- Toasts support adding of html elements
- Fixed select destroy/creation bug
- Bugfixes for dropdown, badges, collections, scrollfire
- Added default preloader color variable
- File input now supports multiple files and dynamically loaded elements
## v0.97.0 (June 21, 2015)
- **Documentation changed to use Official Google Icon web font**
- **Input errors added**
- Flicker on Firefox on dropdowns fixed
- Pagination made more responsive
- Modal now prevents scrolling
- Modal animation added
- Support for multiple modals added
- Programmatic control of FAB to open/close added
- Programmatic control of slider to play/pause added
- Plus many more bug fixes
## v0.96.0 (April 1, 2015)
- Toasts, transitions, scrollfire added under Materialize namespace
- Dropdown is now created as a child of its parent
- Collapsibles supports nesting
- Modal Bottom Sheet added
- Indeterminate Checkboxes added
- New Checkbox Style added
- Text Inputs supports placeholder/readonly
- Google Inbox-like Collapsible added
- Text Character Counter added
- Waves no longer breaks on SVGs
## v0.95.3 (Feb 25, 2015)
- Parallax image loading / responsiveness fixes
- Date picker supports month/year as dropdown
- Dismissable collection items
- Avatar collection items
- Pagination Added
- ScrollFire fixes
## v0.95.2 (Feb 10, 2015)
- Switches added
- Transition animation functions added
- ScrollFire Plugin added (fires functions dependent on scroll position)
- Responsive Video tag added
- Custom File Input Button added
- Modals has a fixed footer option
- SideNav implementation changed (needs 2 UL menus)
- Slider Responsive Fixes
## v0.95.1 (Jan 26, 2015)
- Sidenav Fixes
- Dropdown alignment/gutter options added
- Parallax fixes
- JavaScript Initialization no longer needed for many components
- HTML options through data-attributes
- Site colors can be defined through Primary and Secondary color in Sass
- Tables no longer resonsive by default
## v0.95.0 (Jan 17, 2015)
- Drag Out Menu fixed with Touch Interactions
- Toasts minor bugfix
- OL element has default styling
- Fullscreen Slider added
- Footer requires page-footer class
- Progress Bars added
- Form autofill support added
- Responsive Tables support added
- Scrollspy Plugin released
- Waves events are now delegated / behavior enhanced
## v0.94.0 (Dec 30, 2014)
- Sidenav supports right edge positioning
- Responsive Embeds
- Image Vertical align classes
- border-box added
- Variable file created
- Pushpin added
- Tooltips support all directions
- Layout helper classes added
- Materialbox Fixes
- Form Element Enhancements
- Navbar supports search bar
- Waves fixes
- Materialbox Captions
- Image Slider Fixes
## v0.93.1 (Dec 20, 2014)
- Flexbox Sticky Footer removed due to IE incompatibility
## v0.93.0 (Dec 19, 2014)
- Card Reveal
- Image Slider
- Dynamically loaded forms work correctly
- Badges added
- Circular Image
- Waves Fixes
- Footer Added
- Toast support Custom HTML
- Modals support programmatic opening/closing
- Responsive Image support
## v0.92.1 (Dec 14, 2014)
- Bower semver fix
- Added new radio button style
## v0.92.0 (Dec 13, 2014)
- Clicking icon in dropdown in navbar no longer closes dropdown immediately
- Multiple select inputs now work properly
- Mobile navbar no longer extends past screen width
- Parallax improved
- Modal restructured / can be opened programmatically
- Callbacks added to modals
- Added dist folder to repo
- Cards restructured
## v0.91 (Dec 3, 2014)
- bug fixes to forms
- added waves color classes
- toast thickened to look better on mobile
- many other bug fixes
## v0.9 (Nov 30, 2014)
- Touch interactions added
- tons more...
\ No newline at end of file
## Contributing
- Compiling Files
- `npm install`
- `grunt monitor`, this will compile .scss, .js., .jade files
- Documentation
- If you notice an error in the documentation, please edit the corresponding .html page under jade/page-contents/.
- Issues
- If you have an issue please make sure you document the problems in depth.
- Create screenshots of your issue and include a [Codepen](http://codepen.io/Dogfalo/pen/xbzPQV) of the problem where applicable
- Unclear issues with little explanations will be closed.
- Issues without a Codepen (where applicable) will be closed or ignored.
- Feature Requests
- We like feature requests but make sure that it can be seen within the goals of the project and not just something you need individually. Also you should try and give as much examples and details about the new feature as possible.
- Code Examples
- Use this [Codepen](http://codepen.io/Dogfalo/pen/xbzPQV) to illustrate your problem.
## Contribution 101
- Fork this repo to your own git
- Make your changes
- Submit a pull request with full remarks documenting your changes
- Pull request MAY then be accepted by project creators
- Make sure you are altering the correct source files (Never alter compiled / dist files)
## Jasmine Testing Guide
**References:**
- [Jasmine Documentation](http://jasmine.github.io/2.0/introduction.html)
- [Grunt Jasmine Plugin](https://github.com/gruntjs/grunt-contrib-jasmine)
- [Example Jasmine Tests](https://github.com/Dogfalo/materialize/tree/master/tests/spec)
- [Travis CI](https://travis-ci.org/Dogfalo/materialize)
Before you start, make sure you install grunt and all its dependencies. To verify you have all the correct dependencies you can run `grunt travis` and it will run the tests. If you get an errors and have not made any changes, it means you have not installed the proper dependencies.
Materialize uses Jasmine as the testing framework. We also include a jQuery library which allows you to write tests using jQuery syntax.
### Starting Out
First to familiarize yourself with how the tests are structured, you can take a look inside the `tests/` directory. Each component should have its own folder. Follow the file-naming conventions that are used in the existing tests.
Before writing tests, make sure you are working off of a clean git branch of your fork. This will greatly simplify the Pull Request process.
### Writing Tests
Before writing tests, make sure you understand what the expected-behavior of the component actually is. Reading over the component code and documentation will greatly aid you in this regard.
Use `describe` blocks to section disparate portions of tests and `it` blocks inside those to further break up tests into features. Inside `it` blocks, you can have multiple except statements. As a general testing principle, be sure to try and test both the case and its “inverse” to lessen the chance for false positives.
Example:
```javascript
expect(toast.first('span').text()).toBe('I am toast content');
expect(toast.first('span').text()).not.toBe('I am toast');
```
You can use beforeEach, and afterEach in either block to designate code that will execute before or after each item. This is useful if you need to setup some scenario for each test, or reset some things after each test.
When writing expect statements (Jasmine’s form of assert), it is very important to write an expected behavior string so in the event of an error, the test that failed is very clear.
Example:
```javascript
expect(toast.length).toBe(0, 'because toast should be removed by now');
```
When this expect statement fails it will list the reason as “because toast should be removed by now”.
Because our components are very front end heavy, familiarize yourself with jQuery ways of interacting with the dom and our components. You can use methods like [trigger](http://api.jquery.com/trigger/), to simulate certain events like the user clicking a button.
We also understand that testing CSS properties is pretty tough so you’ll have to be creative when writing good tests that ensure the styling is still working. Try and cover as many cases as you can but don’t worry if there are some edge cases. You can add comments describing some problematic edge cases in TODOs so we know about them.
### Submitting Your Pull Request
Try and keep your commit history clean and concise. Once you submit your pull request, [Travis CI](https://travis-ci.org/Dogfalo/materialize) will automatically run your tests and will show a checkmark to show that all the tests have passed. Once this is done, we’ll review your tests and code and make comments if there are issues or things we think could be improved. Then once everything looks good we’ll merge the code in!
### Useful Jasmine Tips
1. To only run a specific spec at a time, to avoid wasting your time running all our other tests, you can set the flag `--filter`. For example:
```
`grunt travis --filter=tabs`
```
This would only run specs with tabs in its name.
2. If you need a timeout in your test (waiting for some animation or action to be executed) you need to use the done callback. In your `it()` behavior function set done as an argument to your anonymous function. Then you can use javascript’s window `setTimeout`s normally. And when you want the test to finish just call the `done()` function. For example:
```javascript
it ('should wait for a timeout', function(done) {
// Execute action
timeout(setTimeout(function() {
// Wait a second
// Test for result
done();
}, 1000);
});
```
**Note:** If you add done as a callback, and you don’t call the `done()` function, it will stall forever and error after a max limit of around 5 seconds.
The MIT License (MIT)
Copyright (c) 2014-2016 Materialize
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "materialize",
"description": "A modern responsive front-end framework based on Material Design",
"keywords": [
"css",
"js",
"sass",
"mobile-first",
"responsive",
"front-end",
"framework",
"ux",
"material",
"design"
],
"main": [
"bin/materialize.css",
"bin/materialize.js"
],
"ignore": [
"jade/",
".gitignore",
"CNAME",
"css/",
"bower.json",
"README.md",
"images/",
"js/jquery.timeago.js",
"js/init.js",
"js/prism.js",
"res/",
"sass/style.scss",
"sass/ghpages-materialize.scss",
"**/*.html",
"**/*.zip",
"**/*.txt",
"sitemap.xml",
"package.json",
"Gruntfile.js"
],
"dependencies": {
"jquery": ">=2.1.1"
},
"devDependencies": {
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* Materialize v0.97.8 (http://materializecss.com)
* Copyright 2014-2015 Materialize
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
*/
/* Functional styling;
* These styles are required for noUiSlider to function.
* You don't need to change these rules to apply your design.
*/
.noUi-target,
.noUi-target * {
-webkit-touch-callout: none;
-webkit-user-select: none;
-ms-touch-action: none;
-ms-user-select: none;
-moz-user-select: none;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.noUi-target {
position: relative;
direction: ltr;
}
.noUi-base {
width: 100%;
height: 100%;
position: relative;
z-index: 1; /* Fix 401 */
}
.noUi-origin {
position: absolute;
right: 0;
top: 6px;
left: 0;
bottom: 0;
}
.noUi-handle {
position: relative;
z-index: 1;
}
.noUi-stacking .noUi-handle {
/* This class is applied to the lower origin when
its values is > 50%. */
z-index: 10;
}
.noUi-state-tap .noUi-origin {
-webkit-transition: left 0.25s, top 0.25s;
transition: left 0.25s, top 0.25s;
}
.noUi-state-drag * {
cursor: inherit !important;
}
/* Painting and performance;
* Browsers can paint handles in their own layer.
*/
.noUi-base {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
/* Slider size and handle placement;
*/
.noUi-horizontal {
height: 18px;
}
.noUi-horizontal .noUi-handle {
width: 34px;
height: 28px;
left: -17px;
top: -6px;
}
.noUi-vertical {
width: 18px;
}
.noUi-vertical .noUi-handle {
width: 28px;
height: 34px;
left: -6px;
top: -17px;
}
/* Styling;
*/
.noUi-background {
background: #FAFAFA;
box-shadow: inset 0 1px 1px #f0f0f0;
}
.noUi-connect {
background: #3FB8AF;
box-shadow: inset 0 0 3px rgba(51,51,51,0.45);
-webkit-transition: background 450ms;
transition: background 450ms;
}
.noUi-origin {
border-radius: 2px;
}
.noUi-target {
border-radius: 4px;
border: 1px solid #D3D3D3;
box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB;
}
.noUi-target.noUi-connect {
box-shadow: inset 0 0 3px rgba(51,51,51,0.45), 0 3px 6px -5px #BBB;
}
/* Handles and cursors;
*/
.noUi-dragable {
cursor: w-resize;
}
.noUi-vertical .noUi-dragable {
cursor: n-resize;
}
.noUi-handle {
border: 1px solid #D9D9D9;
border-radius: 3px;
background: #FFF;
cursor: default;
box-shadow: inset 0 0 1px #FFF,
inset 0 1px 7px #EBEBEB,
0 3px 6px -3px #BBB;
}
.noUi-active {
box-shadow: inset 0 0 1px #FFF,
inset 0 1px 7px #DDD,
0 3px 6px -3px #BBB;
}
/* Handle stripes;
*/
.noUi-handle:before,
.noUi-handle:after {
content: "";
display: block;
position: absolute;
height: 14px;
width: 1px;
background: #E8E7E6;
left: 14px;
top: 6px;
}
.noUi-handle:after {
left: 17px;
}
.noUi-vertical .noUi-handle:before,
.noUi-vertical .noUi-handle:after {
width: 14px;
height: 1px;
left: 6px;
top: 14px;
}
.noUi-vertical .noUi-handle:after {
top: 17px;
}
/* Disabled state;
*/
[disabled].noUi-connect,
[disabled] .noUi-connect {
background: #B8B8B8;
}
[disabled].noUi-origin,
[disabled] .noUi-handle {
cursor: not-allowed;
}
/*Materialize Theming*/
.noUi-target {
box-shadow: none;
border: none;
}
.noUi-base {
height: 15px;
top: -6px;
}
.noUi-background {
height: 3px;
top: 6px;
background-color: #bfbfbf;
box-shadow: none;
}
.noUi-horizontal {
height: 3px;
}
.noUi-connect {
height: 3px;
top: 6px;
background-color: #26A69A;
box-shadow: none;
}
/*Handle*/
.noUi-horizontal .noUi-handle {
width: 15px;
height: 15px;
border-radius: 50%;
box-shadow: none;
background-color: #26A69A;
border: none;
left: -5px;
top: -6px;
transition: width .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
height .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
left .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
top .2s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
.noUi-handle:before {
content: none;
}
.noUi-handle:after {
content: none;
}
/*Handle on Drag*/
.noUi-target .noUi-active.noUi-handle {
width: 3px;
height: 3px;
left: 0;
top: 0;
}
.noUi-target .noUi-active .range-label span {
}
.noUi-target .range-label {
position: absolute;
height: 30px;
width: 30px;
top: -17px;
left: -2px;
background-color: #26A69A;
border-radius: 50%;
transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000),
transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
transform: scale(.5) rotate(-45deg);
transform-origin: 50% 100%;
}
.noUi-target .noUi-active .range-label {
border-radius: 15px 15px 15px 0;
transform: rotate(-45deg) translate(23px, -25px);
}
.range-label span {
width: 100%;
text-align: center;
color: #fff;
font-size: 12px;
transform: rotate(45deg);
opacity: 0;
position: absolute;
top: 7px;
left: -1px;
transition: opacity .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
.noUi-active .range-label span {
opacity: 1;
}
// Custom Easing
jQuery.extend( jQuery.easing,
{
easeInOutMaterial: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return c/4*((t-=2)*t*t + 2) + b;
}
});
(function ($) {
$(document).ready(function() {
// jQuery reverse
$.fn.reverse = [].reverse;
// Hover behaviour: make sure this doesn't work on .click-to-toggle FABs!
$(document).on('mouseenter.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle):not(.toolbar)', function(e) {
var $this = $(this);
openFABMenu($this);
});
$(document).on('mouseleave.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle):not(.toolbar)', function(e) {
var $this = $(this);
closeFABMenu($this);
});
// Toggle-on-click behaviour.
$(document).on('click.fabClickToggle', '.fixed-action-btn.click-to-toggle > a', function(e) {
var $this = $(this);
var $menu = $this.parent();
if ($menu.hasClass('active')) {
closeFABMenu($menu);
} else {
openFABMenu($menu);
}
});
// Toolbar transition behaviour.
$(document).on('click.fabToolbar', '.fixed-action-btn.toolbar > a', function(e) {
var $this = $(this);
var $menu = $this.parent();
FABtoToolbar($menu);
});
});
$.fn.extend({
openFAB: function() {
openFABMenu($(this));
},
closeFAB: function() {
closeFABMenu($(this));
},
openToolbar: function() {
FABtoToolbar($(this));
},
closeToolbar: function() {
toolbarToFAB($(this));
}
});
var openFABMenu = function (btn) {
var $this = btn;
if ($this.hasClass('active') === false) {
// Get direction option
var horizontal = $this.hasClass('horizontal');
var offsetY, offsetX;
if (horizontal === true) {
offsetX = 40;
} else {
offsetY = 40;
}
$this.addClass('active');
$this.find('ul .btn-floating').velocity(
{ scaleY: ".4", scaleX: ".4", translateY: offsetY + 'px', translateX: offsetX + 'px'},
{ duration: 0 });
var time = 0;
$this.find('ul .btn-floating').reverse().each( function () {
$(this).velocity(
{ opacity: "1", scaleX: "1", scaleY: "1", translateY: "0", translateX: '0'},
{ duration: 80, delay: time });
time += 40;
});
}
};
var closeFABMenu = function (btn) {
var $this = btn;
// Get direction option
var horizontal = $this.hasClass('horizontal');
var offsetY, offsetX;
if (horizontal === true) {
offsetX = 40;
} else {
offsetY = 40;
}
$this.removeClass('active');
var time = 0;
$this.find('ul .btn-floating').velocity("stop", true);
$this.find('ul .btn-floating').velocity(
{ opacity: "0", scaleX: ".4", scaleY: ".4", translateY: offsetY + 'px', translateX: offsetX + 'px'},
{ duration: 80 }
);
};
/**
* Transform FAB into toolbar
* @param {Object} object jQuery object
*/
var FABtoToolbar = function(btn) {
if (btn.attr('data-open') === "true") {
return;
}
var offsetX, offsetY, scaleFactor;
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
var btnRect = btn[0].getBoundingClientRect();
var anchor = btn.find('> a').first();
var menu = btn.find('> ul').first();
var backdrop = $('<div class="fab-backdrop"></div>');
var fabColor = anchor.css('background-color');
anchor.append(backdrop);
offsetX = btnRect.left - (windowWidth / 2) + (btnRect.width / 2);
offsetY = windowHeight - btnRect.bottom;
scaleFactor = windowWidth / backdrop.width();
btn.attr('data-origin-bottom', btnRect.bottom);
btn.attr('data-origin-left', btnRect.left);
btn.attr('data-origin-width', btnRect.width);
// Set initial state
btn.addClass('active');
btn.attr('data-open', true);
btn.css({
'text-align': 'center',
width: '100%',
bottom: 0,
left: 0,
transform: 'translateX(' + offsetX + 'px)',
transition: 'none'
});
anchor.css({
transform: 'translateY(' + -offsetY + 'px)',
transition: 'none'
});
backdrop.css({
'background-color': fabColor
});
setTimeout(function() {
btn.css({
transform: '',
transition: 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'
});
anchor.css({
overflow: 'visible',
transform: '',
transition: 'transform .2s'
});
setTimeout(function() {
btn.css({
overflow: 'hidden',
'background-color': fabColor
});
backdrop.css({
transform: 'scale(' + scaleFactor + ')',
transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
});
menu.find('> li > a').css({
opacity: 1
});
// Scroll to close.
$(window).on('scroll.fabToolbarClose', function() {
toolbarToFAB(btn);
$(window).off('scroll.fabToolbarClose');
$(document).off('click.fabToolbarClose');
});
$(document).on('click.fabToolbarClose', function(e) {
if (!$(e.target).closest(menu).length) {
toolbarToFAB(btn);
$(window).off('scroll.fabToolbarClose');
$(document).off('click.fabToolbarClose');
}
});
}, 100);
}, 0);
};
/**
* Transform toolbar back into FAB
* @param {Object} object jQuery object
*/
var toolbarToFAB = function(btn) {
if (btn.attr('data-open') !== "true") {
return;
}
var offsetX, offsetY, scaleFactor;
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
var btnWidth = btn.attr('data-origin-width');
var btnBottom = btn.attr('data-origin-bottom');
var btnLeft = btn.attr('data-origin-left');
var anchor = btn.find('> .btn-floating').first();
var menu = btn.find('> ul').first();
var backdrop = btn.find('.fab-backdrop');
var fabColor = anchor.css('background-color');
offsetX = btnLeft - (windowWidth / 2) + (btnWidth / 2);
offsetY = windowHeight - btnBottom;
scaleFactor = windowWidth / backdrop.width();
// Hide backdrop
btn.removeClass('active');
btn.attr('data-open', false);
btn.css({
'background-color': 'transparent',
transition: 'none'
});
anchor.css({
transition: 'none'
});
backdrop.css({
transform: 'scale(0)',
'background-color': fabColor
});
menu.find('> li > a').css({
opacity: ''
});
setTimeout(function() {
backdrop.remove();
// Set initial state.
btn.css({
'text-align': '',
width: '',
bottom: '',
left: '',
overflow: '',
'background-color': '',
transform: 'translate3d(' + -offsetX + 'px,0,0)'
});
anchor.css({
overflow: '',
transform: 'translate3d(0,' + offsetY + 'px,0)'
});
setTimeout(function() {
btn.css({
transform: 'translate3d(0,0,0)',
transition: 'transform .2s'
});
anchor.css({
transform: 'translate3d(0,0,0)',
transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
});
}, 20);
}, 200);
};
}( jQuery ));
(function ($) {
$(document).ready(function() {
$(document).on('click.card', '.card', function (e) {
if ($(this).find('> .card-reveal').length) {
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
// Make Reveal animate down and display none
$(this).find('.card-reveal').velocity(
{translateY: 0}, {
duration: 225,
queue: false,
easing: 'easeInOutQuad',
complete: function() { $(this).css({ display: 'none'}); }
}
);
}
else if ($(e.target).is($('.card .activator')) ||
$(e.target).is($('.card .activator i')) ) {
$(e.target).closest('.card').css('overflow', 'hidden');
$(this).find('.card-reveal').css({ display: 'block'}).velocity("stop", false).velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
}
}
});
});
}( jQuery ));
\ No newline at end of file
(function ($) {
$.fn.characterCounter = function(){
return this.each(function(){
var $input = $(this);
var $counterElement = $input.parent().find('span[class="character-counter"]');
// character counter has already been added appended to the parent container
if ($counterElement.length) {
return;
}
var itHasLengthAttribute = $input.attr('length') !== undefined;
if(itHasLengthAttribute){
$input.on('input', updateCounter);
$input.on('focus', updateCounter);
$input.on('blur', removeCounterElement);
addCounterElement($input);
}
});
};
function updateCounter(){
var maxLength = +$(this).attr('length'),
actualLength = +$(this).val().length,
isValidLength = actualLength <= maxLength;
$(this).parent().find('span[class="character-counter"]')
.html( actualLength + '/' + maxLength);
addInputStyle(isValidLength, $(this));
}
function addCounterElement($input) {
var $counterElement = $input.parent().find('span[class="character-counter"]');
if ($counterElement.length) {
return;
}
$counterElement = $('<span/>')
.addClass('character-counter')
.css('float','right')
.css('font-size','12px')
.css('height', 1);
$input.parent().append($counterElement);
}
function removeCounterElement(){
$(this).parent().find('span[class="character-counter"]').html('');
}
function addInputStyle(isValidLength, $input){
var inputHasInvalidClass = $input.hasClass('invalid');
if (isValidLength && inputHasInvalidClass) {
$input.removeClass('invalid');
}
else if(!isValidLength && !inputHasInvalidClass){
$input.removeClass('valid');
$input.addClass('invalid');
}
}
$(document).ready(function(){
$('input, textarea').characterCounter();
});
}( jQuery ));
(function ($) {
var chipsHandleEvents = false;
var materialChipsDefaults = {
data: [],
placeholder: '',
secondaryPlaceholder: '',
};
$(document).ready(function() {
// Handle removal of static chips.
$(document).on('click', '.chip .close', function(e){
var $chips = $(this).closest('.chips');
if ($chips.attr('data-initialized')) {
return;
}
$(this).closest('.chip').remove();
});
});
$.fn.material_chip = function (options) {
var self = this;
this.$el = $(this);
this.$document = $(document);
this.SELS = {
CHIPS: '.chips',
CHIP: '.chip',
INPUT: 'input',
DELETE: '.material-icons',
SELECTED_CHIP: '.selected',
};
if ('data' === options) {
return this.$el.data('chips');
}
var curr_options = $.extend({}, materialChipsDefaults, options);
// Initialize
this.init = function() {
var i = 0;
var chips;
self.$el.each(function(){
var $chips = $(this);
var chipId = Materialize.guid();
if (!curr_options.data || !(curr_options.data instanceof Array)) {
curr_options.data = [];
}
$chips.data('chips', curr_options.data);
$chips.attr('data-index', i);
$chips.attr('data-initialized', true);
if (!$chips.hasClass(self.SELS.CHIPS)) {
$chips.addClass('chips');
}
self.chips($chips, chipId);
i++;
});
};
this.handleEvents = function(){
var SELS = self.SELS;
self.$document.off('click.chips-focus', SELS.CHIPS).on('click.chips-focus', SELS.CHIPS, function(e){
$(e.target).find(SELS.INPUT).focus();
});
self.$document.off('click.chips-select', SELS.CHIP).on('click.chips-select', SELS.CHIP, function(e){
$(SELS.CHIP).removeClass('selected');
$(this).toggleClass('selected');
});
self.$document.off('keydown.chips').on('keydown.chips', function(e){
if ($(e.target).is('input, textarea')) {
return;
}
// delete
var $chip = self.$document.find(SELS.CHIP + SELS.SELECTED_CHIP);
var $chips = $chip.closest(SELS.CHIPS);
var length = $chip.siblings(SELS.CHIP).length;
var index;
if (!$chip.length) {
return;
}
if (e.which === 8 || e.which === 46) {
e.preventDefault();
index = $chip.index();
self.deleteChip(index, $chips);
var selectIndex = null;
if ((index + 1) < length) {
selectIndex = index;
} else if (index === length || (index + 1) === length) {
selectIndex = length - 1;
}
if (selectIndex < 0) selectIndex = null;
if (null !== selectIndex) {
self.selectChip(selectIndex, $chips);
}
if (!length) $chips.find('input').focus();
// left
} else if (e.which === 37) {
index = $chip.index() - 1;
if (index < 0) {
return;
}
$(SELS.CHIP).removeClass('selected');
self.selectChip(index, $chips);
// right
} else if (e.which === 39) {
index = $chip.index() + 1;
$(SELS.CHIP).removeClass('selected');
if (index > length) {
$chips.find('input').focus();
return;
}
self.selectChip(index, $chips);
}
});
self.$document.off('focusin.chips', SELS.CHIPS + ' ' + SELS.INPUT).on('focusin.chips', SELS.CHIPS + ' ' + SELS.INPUT, function(e){
var $currChips = $(e.target).closest(SELS.CHIPS);
$currChips.addClass('focus');
$currChips.siblings('label, .prefix').addClass('active');
$(SELS.CHIP).removeClass('selected');
});
self.$document.off('focusout.chips', SELS.CHIPS + ' ' + SELS.INPUT).on('focusout.chips', SELS.CHIPS + ' ' + SELS.INPUT, function(e){
var $currChips = $(e.target).closest(SELS.CHIPS);
$currChips.removeClass('focus');
// Remove active if empty
if (!$currChips.data('chips').length) {
$currChips.siblings('label').removeClass('active');
}
$currChips.siblings('.prefix').removeClass('active');
});
self.$document.off('keydown.chips-add', SELS.CHIPS + ' ' + SELS.INPUT).on('keydown.chips-add', SELS.CHIPS + ' ' + SELS.INPUT, function(e){
var $target = $(e.target);
var $chips = $target.closest(SELS.CHIPS);
var chipsLength = $chips.children(SELS.CHIP).length;
// enter
if (13 === e.which) {
e.preventDefault();
self.addChip({tag: $target.val()}, $chips);
$target.val('');
return;
}
// delete or left
if ((8 === e.keyCode || 37 === e.keyCode) && '' === $target.val() && chipsLength) {
self.selectChip(chipsLength - 1, $chips);
$target.blur();
return;
}
});
// Click on delete icon in chip.
self.$document.off('click.chips-delete', SELS.CHIPS + ' ' + SELS.DELETE).on('click.chips-delete', SELS.CHIPS + ' ' + SELS.DELETE, function(e) {
var $target = $(e.target);
var $chips = $target.closest(SELS.CHIPS);
var $chip = $target.closest(SELS.CHIP);
e.stopPropagation();
self.deleteChip($chip.index(), $chips);
$chips.find('input').focus();
});
};
this.chips = function($chips, chipId) {
var html = '';
$chips.data('chips').forEach(function(elem){
html += self.renderChip(elem);
});
html += '<input id="' + chipId +'" class="input" placeholder="">';
$chips.html(html);
self.setPlaceholder($chips);
// Set for attribute for label
var label = $chips.next('label');
if (label.length) {
label.attr('for', chipId);
if ($chips.data('chips').length) {
label.addClass('active');
}
}
};
this.renderChip = function(elem) {
if (!elem.tag) return;
var html = '<div class="chip">' + elem.tag;
if (elem.image) {
html += ' <img src="' + elem.image + '"> ';
}
html += '<i class="material-icons close">close</i>';
html += '</div>';
return html;
};
this.setPlaceholder = function($chips) {
if ($chips.data('chips').length && curr_options.placeholder) {
$chips.find('input').prop('placeholder', curr_options.placeholder);
} else if (!$chips.data('chips').length && curr_options.secondaryPlaceholder) {
$chips.find('input').prop('placeholder', curr_options.secondaryPlaceholder);
}
};
this.isValid = function($chips, elem) {
var chips = $chips.data('chips');
var exists = false;
for (var i=0; i < chips.length; i++) {
if (chips[i].tag === elem.tag) {
exists = true;
return;
}
}
return '' !== elem.tag && !exists;
};
this.addChip = function(elem, $chips) {
if (!self.isValid($chips, elem)) {
return;
}
var chipHtml = self.renderChip(elem);
var newData = [];
var oldData = $chips.data('chips');
for (var i = 0; i < oldData.length; i++) {
newData.push(oldData[i]);
}
newData.push(elem);
$chips.data('chips', newData);
$(chipHtml).insertBefore($chips.find('input'));
$chips.trigger('chip.add', elem);
self.setPlaceholder($chips);
};
this.deleteChip = function(chipIndex, $chips) {
var chip = $chips.data('chips')[chipIndex];
$chips.find('.chip').eq(chipIndex).remove();
var newData = [];
var oldData = $chips.data('chips');
for (var i = 0; i < oldData.length; i++) {
if (i !== chipIndex) {
newData.push(oldData[i]);
}
}
$chips.data('chips', newData);
$chips.trigger('chip.delete', chip);
self.setPlaceholder($chips);
};
this.selectChip = function(chipIndex, $chips) {
var $chip = $chips.find('.chip').eq(chipIndex);
if ($chip && false === $chip.hasClass('selected')) {
$chip.addClass('selected');
$chips.trigger('chip.select', $chips.data('chips')[chipIndex]);
}
};
this.getChipsElement = function(index, $chips) {
return $chips.eq(index);
};
// init
this.init();
if (!chipsHandleEvents) {
this.handleEvents();
chipsHandleEvents = true;
}
};
}( jQuery ));
\ No newline at end of file
(function ($) {
$.fn.collapsible = function(options) {
var defaults = {
accordion: undefined,
onOpen: undefined,
onClose: undefined
};
options = $.extend(defaults, options);
return this.each(function() {
var $this = $(this);
var $panel_headers = $(this).find('> li > .collapsible-header');
var collapsible_type = $this.data("collapsible");
// Turn off any existing event handlers
$this.off('click.collapse', '> li > .collapsible-header');
$panel_headers.off('click.collapse');
/****************
Helper Functions
****************/
// Accordion Open
function accordionOpen(object) {
$panel_headers = $this.find('> li > .collapsible-header');
if (object.hasClass('active')) {
object.parent().addClass('active');
}
else {
object.parent().removeClass('active');
}
if (object.parent().hasClass('active')){
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
else{
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
$panel_headers.not(object).removeClass('active').parent().removeClass('active');
// Close previously open accordion elements.
$panel_headers.not(object).parent().children('.collapsible-body').stop(true,false).each(function() {
if ($(this).is(':visible')) {
$(this).slideUp({
duration: 350,
easing: "easeOutQuart",
queue: false,
complete:
function() {
$(this).css('height', '');
execCallbacks($(this).siblings('.collapsible-header'));
}
});
}
});
}
// Expandable Open
function expandableOpen(object) {
if (object.hasClass('active')) {
object.parent().addClass('active');
}
else {
object.parent().removeClass('active');
}
if (object.parent().hasClass('active')){
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
else {
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
}
// Open collapsible. object: .collapsible-header
function collapsibleOpen(object) {
if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
accordionOpen(object);
} else { // Handle Expandables
expandableOpen(object);
}
execCallbacks(object);
}
// Handle callbacks
function execCallbacks(object) {
if (object.hasClass('active')) {
if (typeof(options.onOpen) === "function") {
options.onOpen.call(this, object.parent());
}
} else {
if (typeof(options.onClose) === "function") {
options.onClose.call(this, object.parent());
}
}
}
/**
* Check if object is children of panel header
* @param {Object} object Jquery object
* @return {Boolean} true if it is children
*/
function isChildrenOfPanelHeader(object) {
var panelHeader = getPanelHeader(object);
return panelHeader.length > 0;
}
/**
* Get panel header from a children element
* @param {Object} object Jquery object
* @return {Object} panel header object
*/
function getPanelHeader(object) {
return object.closest('li > .collapsible-header');
}
/***** End Helper Functions *****/
// Add click handler to only direct collapsible header children
$this.on('click.collapse', '> li > .collapsible-header', function(e) {
var element = $(e.target);
if (isChildrenOfPanelHeader(element)) {
element = getPanelHeader(element);
}
element.toggleClass('active');
collapsibleOpen(element);
});
// Open first active
if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
collapsibleOpen($panel_headers.filter('.active').first());
} else { // Handle Expandables
$panel_headers.filter('.active').each(function() {
collapsibleOpen($(this));
});
}
});
};
$(document).ready(function(){
$('.collapsible').collapsible();
});
}( jQuery ));
\ No newline at end of file
// Check for jQuery.
if (typeof(jQuery) === 'undefined') {
var jQuery;
// Check if require is a defined function.
if (typeof(require) === 'function') {
jQuery = $ = require('jquery');
// Else use the dollar sign alias.
} else {
jQuery = $;
}
}
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'hammerjs'], factory);
} else if (typeof exports === 'object') {
factory(require('jquery'), require('hammerjs'));
} else {
factory(jQuery, Hammer);
}
}(function($, Hammer) {
function hammerify(el, options) {
var $el = $(el);
if(!$el.data("hammer")) {
$el.data("hammer", new Hammer($el[0], options));
}
}
$.fn.hammer = function(options) {
return this.each(function() {
hammerify(this, options);
});
};
// extend the emit method to also trigger jQuery events
Hammer.Manager.prototype.emit = (function(originalEmit) {
return function(type, data) {
originalEmit.call(this, type, data);
$(this.element).trigger({
type: type,
gesture: data
});
};
})(Hammer.Manager.prototype.emit);
}));
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(){var e=a(this),o=r.settings;return isNaN(e.datetime)||(0==o.cutoff||Math.abs(n(e.datetime))<o.cutoff)&&t(this).text(i(e.datetime)),this}function a(e){if(e=t(e),!e.data("timeago")){e.data("timeago",{datetime:r.datetime(e)});var a=t.trim(e.text());r.settings.localeTitle?e.attr("title",e.data("timeago").datetime.toLocaleString()):!(a.length>0)||r.isTime(e)&&e.attr("title")||e.attr("title",a)}return e.data("timeago")}function i(t){return r.inWords(n(t))}function n(t){return(new Date).getTime()-t.getTime()}t.timeago=function(e){return i(e instanceof Date?e:"string"==typeof e?t.timeago.parse(e):"number"==typeof e?new Date(e):t.timeago.datetime(e))};var r=t.timeago;t.extend(t.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(e){function a(a,n){var r=t.isFunction(a)?a(n,e):a,o=i.numbers&&i.numbers[n]||n;return r.replace(/%d/i,o)}if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var i=this.settings.strings,n=i.prefixAgo,r=i.suffixAgo;if(this.settings.allowFuture&&0>e&&(n=i.prefixFromNow,r=i.suffixFromNow),!this.settings.allowPast&&e>=0)return this.settings.strings.inPast;var o=Math.abs(e)/1e3,s=o/60,u=s/60,m=u/24,l=m/365,d=45>o&&a(i.seconds,Math.round(o))||90>o&&a(i.minute,1)||45>s&&a(i.minutes,Math.round(s))||90>s&&a(i.hour,1)||24>u&&a(i.hours,Math.round(u))||42>u&&a(i.day,1)||30>m&&a(i.days,Math.round(m))||45>m&&a(i.month,1)||365>m&&a(i.months,Math.round(m/30))||1.5>l&&a(i.year,1)||a(i.years,Math.round(l)),f=i.wordSeparator||"";return void 0===i.wordSeparator&&(f=" "),t.trim([n,d,r].join(f))},parse:function(e){var a=t.trim(e);return a=a.replace(/\.\d+/,""),a=a.replace(/-/,"/").replace(/-/,"/"),a=a.replace(/T/," ").replace(/Z/," UTC"),a=a.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),a=a.replace(/([\+\-]\d\d)$/," $100"),new Date(a)},datetime:function(e){var a=t(e).attr(r.isTime(e)?"datetime":"title");return r.parse(a)},isTime:function(e){return"time"===t(e).get(0).tagName.toLowerCase()}});var o={init:function(){var a=t.proxy(e,this);a();var i=r.settings;i.refreshMillis>0&&(this._timeagoInterval=setInterval(a,i.refreshMillis))},update:function(a){var i=r.parse(a);t(this).data("timeago",{datetime:i}),r.settings.localeTitle&&t(this).attr("title",i.toLocaleString()),e.apply(this)},updateFromDOM:function(){t(this).data("timeago",{datetime:r.parse(t(this).attr(r.isTime(this)?"datetime":"title"))}),e.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};t.fn.timeago=function(t,e){var a=t?o[t]:o.init;if(!a)throw new Error("Unknown function name '"+t+"' for timeago");return this.each(function(){a.call(this,e)}),this},document.createElement("abbr"),document.createElement("time")});
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment