mirror of
https://github.com/documize/community.git
synced 2025-08-05 13:35:25 +02:00
moved emberjs to gui folder
This commit is contained in:
parent
6a18d18f91
commit
dc49dbbeff
999 changed files with 677 additions and 651 deletions
1204
gui/vendor/bootstrap.css
vendored
Executable file
1204
gui/vendor/bootstrap.css
vendored
Executable file
File diff suppressed because it is too large
Load diff
390
gui/vendor/bootstrap.json
vendored
Executable file
390
gui/vendor/bootstrap.json
vendored
Executable file
|
@ -0,0 +1,390 @@
|
|||
{
|
||||
"vars": {
|
||||
"@gray-base": "#000",
|
||||
"@gray-darker": "lighten(@gray-base, 13.5%)",
|
||||
"@gray-dark": "lighten(@gray-base, 20%)",
|
||||
"@gray": "lighten(@gray-base, 33.5%)",
|
||||
"@gray-light": "lighten(@gray-base, 46.7%)",
|
||||
"@gray-lighter": "lighten(@gray-base, 93.5%)",
|
||||
"@brand-primary": "darken(#428bca, 6.5%)",
|
||||
"@brand-success": "#5cb85c",
|
||||
"@brand-info": "#5bc0de",
|
||||
"@brand-warning": "#f0ad4e",
|
||||
"@brand-danger": "#d9534f",
|
||||
"@body-bg": "#fff",
|
||||
"@text-color": "@gray-dark",
|
||||
"@link-color": "@brand-primary",
|
||||
"@link-hover-color": "darken(@link-color, 15%)",
|
||||
"@link-hover-decoration": "underline",
|
||||
"@font-family-sans-serif": "\"Helvetica Neue\", Helvetica, Arial, sans-serif",
|
||||
"@font-family-serif": "Georgia, \"Times New Roman\", Times, serif",
|
||||
"@font-family-monospace": "Menlo, Monaco, Consolas, \"Courier New\", monospace",
|
||||
"@font-family-base": "@font-family-sans-serif",
|
||||
"@font-size-base": "14px",
|
||||
"@font-size-large": "ceil((@font-size-base * 1.25))",
|
||||
"@font-size-small": "ceil((@font-size-base * 0.85))",
|
||||
"@font-size-h1": "floor((@font-size-base * 2.6))",
|
||||
"@font-size-h2": "floor((@font-size-base * 2.15))",
|
||||
"@font-size-h3": "ceil((@font-size-base * 1.7))",
|
||||
"@font-size-h4": "ceil((@font-size-base * 1.25))",
|
||||
"@font-size-h5": "@font-size-base",
|
||||
"@font-size-h6": "ceil((@font-size-base * 0.85))",
|
||||
"@line-height-base": "1.428571429",
|
||||
"@line-height-computed": "floor((@font-size-base * @line-height-base))",
|
||||
"@headings-font-family": "inherit",
|
||||
"@headings-font-weight": "500",
|
||||
"@headings-line-height": "1.1",
|
||||
"@headings-color": "inherit",
|
||||
"@icon-font-path": "\"../fonts/\"",
|
||||
"@icon-font-name": "\"glyphicons-halflings-regular\"",
|
||||
"@icon-font-svg-id": "\"glyphicons_halflingsregular\"",
|
||||
"@padding-base-vertical": "6px",
|
||||
"@padding-base-horizontal": "12px",
|
||||
"@padding-large-vertical": "10px",
|
||||
"@padding-large-horizontal": "16px",
|
||||
"@padding-small-vertical": "5px",
|
||||
"@padding-small-horizontal": "10px",
|
||||
"@padding-xs-vertical": "1px",
|
||||
"@padding-xs-horizontal": "5px",
|
||||
"@line-height-large": "1.3333333",
|
||||
"@line-height-small": "1.5",
|
||||
"@border-radius-base": "4px",
|
||||
"@border-radius-large": "6px",
|
||||
"@border-radius-small": "3px",
|
||||
"@component-active-color": "#fff",
|
||||
"@component-active-bg": "@brand-primary",
|
||||
"@caret-width-base": "4px",
|
||||
"@caret-width-large": "5px",
|
||||
"@table-cell-padding": "8px",
|
||||
"@table-condensed-cell-padding": "5px",
|
||||
"@table-bg": "transparent",
|
||||
"@table-bg-accent": "#f9f9f9",
|
||||
"@table-bg-hover": "#f5f5f5",
|
||||
"@table-bg-active": "@table-bg-hover",
|
||||
"@table-border-color": "#ddd",
|
||||
"@btn-font-weight": "normal",
|
||||
"@btn-default-color": "#333",
|
||||
"@btn-default-bg": "#fff",
|
||||
"@btn-default-border": "#ccc",
|
||||
"@btn-primary-color": "#fff",
|
||||
"@btn-primary-bg": "@brand-primary",
|
||||
"@btn-primary-border": "darken(@btn-primary-bg, 5%)",
|
||||
"@btn-success-color": "#fff",
|
||||
"@btn-success-bg": "@brand-success",
|
||||
"@btn-success-border": "darken(@btn-success-bg, 5%)",
|
||||
"@btn-info-color": "#fff",
|
||||
"@btn-info-bg": "@brand-info",
|
||||
"@btn-info-border": "darken(@btn-info-bg, 5%)",
|
||||
"@btn-warning-color": "#fff",
|
||||
"@btn-warning-bg": "@brand-warning",
|
||||
"@btn-warning-border": "darken(@btn-warning-bg, 5%)",
|
||||
"@btn-danger-color": "#fff",
|
||||
"@btn-danger-bg": "@brand-danger",
|
||||
"@btn-danger-border": "darken(@btn-danger-bg, 5%)",
|
||||
"@btn-link-disabled-color": "@gray-light",
|
||||
"@btn-border-radius-base": "@border-radius-base",
|
||||
"@btn-border-radius-large": "@border-radius-large",
|
||||
"@btn-border-radius-small": "@border-radius-small",
|
||||
"@input-bg": "#fff",
|
||||
"@input-bg-disabled": "@gray-lighter",
|
||||
"@input-color": "@gray",
|
||||
"@input-border": "#ccc",
|
||||
"@input-border-radius": "@border-radius-base",
|
||||
"@input-border-radius-large": "@border-radius-large",
|
||||
"@input-border-radius-small": "@border-radius-small",
|
||||
"@input-border-focus": "#66afe9",
|
||||
"@input-color-placeholder": "#999",
|
||||
"@input-height-base": "(@line-height-computed + (@padding-base-vertical * 2) + 2)",
|
||||
"@input-height-large": "(ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2)",
|
||||
"@input-height-small": "(floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2)",
|
||||
"@form-group-margin-bottom": "15px",
|
||||
"@legend-color": "@gray-dark",
|
||||
"@legend-border-color": "#e5e5e5",
|
||||
"@input-group-addon-bg": "@gray-lighter",
|
||||
"@input-group-addon-border-color": "@input-border",
|
||||
"@cursor-disabled": "not-allowed",
|
||||
"@dropdown-bg": "#fff",
|
||||
"@dropdown-border": "rgba(0,0,0,.15)",
|
||||
"@dropdown-fallback-border": "#ccc",
|
||||
"@dropdown-divider-bg": "#e5e5e5",
|
||||
"@dropdown-link-color": "@gray-dark",
|
||||
"@dropdown-link-hover-color": "darken(@gray-dark, 5%)",
|
||||
"@dropdown-link-hover-bg": "#f5f5f5",
|
||||
"@dropdown-link-active-color": "@component-active-color",
|
||||
"@dropdown-link-active-bg": "@component-active-bg",
|
||||
"@dropdown-link-disabled-color": "@gray-light",
|
||||
"@dropdown-header-color": "@gray-light",
|
||||
"@dropdown-caret-color": "#000",
|
||||
"@screen-xs": "480px",
|
||||
"@screen-xs-min": "@screen-xs",
|
||||
"@screen-phone": "@screen-xs-min",
|
||||
"@screen-sm": "768px",
|
||||
"@screen-sm-min": "@screen-sm",
|
||||
"@screen-tablet": "@screen-sm-min",
|
||||
"@screen-md": "992px",
|
||||
"@screen-md-min": "@screen-md",
|
||||
"@screen-desktop": "@screen-md-min",
|
||||
"@screen-lg": "1200px",
|
||||
"@screen-lg-min": "@screen-lg",
|
||||
"@screen-lg-desktop": "@screen-lg-min",
|
||||
"@screen-xs-max": "(@screen-sm-min - 1)",
|
||||
"@screen-sm-max": "(@screen-md-min - 1)",
|
||||
"@screen-md-max": "(@screen-lg-min - 1)",
|
||||
"@grid-columns": "12",
|
||||
"@grid-gutter-width": "30px",
|
||||
"@grid-float-breakpoint": "@screen-sm-min",
|
||||
"@grid-float-breakpoint-max": "(@grid-float-breakpoint - 1)",
|
||||
"@container-tablet": "(720px + @grid-gutter-width)",
|
||||
"@container-sm": "@container-tablet",
|
||||
"@container-desktop": "(940px + @grid-gutter-width)",
|
||||
"@container-md": "@container-desktop",
|
||||
"@container-large-desktop": "(1140px + @grid-gutter-width)",
|
||||
"@container-lg": "@container-large-desktop",
|
||||
"@navbar-height": "50px",
|
||||
"@navbar-margin-bottom": "@line-height-computed",
|
||||
"@navbar-border-radius": "@border-radius-base",
|
||||
"@navbar-padding-horizontal": "floor((@grid-gutter-width / 2))",
|
||||
"@navbar-padding-vertical": "((@navbar-height - @line-height-computed) / 2)",
|
||||
"@navbar-collapse-max-height": "340px",
|
||||
"@navbar-default-color": "#777",
|
||||
"@navbar-default-bg": "#f8f8f8",
|
||||
"@navbar-default-border": "darken(@navbar-default-bg, 6.5%)",
|
||||
"@navbar-default-link-color": "#777",
|
||||
"@navbar-default-link-hover-color": "#333",
|
||||
"@navbar-default-link-hover-bg": "transparent",
|
||||
"@navbar-default-link-active-color": "#555",
|
||||
"@navbar-default-link-active-bg": "darken(@navbar-default-bg, 6.5%)",
|
||||
"@navbar-default-link-disabled-color": "#ccc",
|
||||
"@navbar-default-link-disabled-bg": "transparent",
|
||||
"@navbar-default-brand-color": "@navbar-default-link-color",
|
||||
"@navbar-default-brand-hover-color": "darken(@navbar-default-brand-color, 10%)",
|
||||
"@navbar-default-brand-hover-bg": "transparent",
|
||||
"@navbar-default-toggle-hover-bg": "#ddd",
|
||||
"@navbar-default-toggle-icon-bar-bg": "#888",
|
||||
"@navbar-default-toggle-border-color": "#ddd",
|
||||
"@navbar-inverse-color": "lighten(@gray-light, 15%)",
|
||||
"@navbar-inverse-bg": "#222",
|
||||
"@navbar-inverse-border": "darken(@navbar-inverse-bg, 10%)",
|
||||
"@navbar-inverse-link-color": "lighten(@gray-light, 15%)",
|
||||
"@navbar-inverse-link-hover-color": "#fff",
|
||||
"@navbar-inverse-link-hover-bg": "transparent",
|
||||
"@navbar-inverse-link-active-color": "@navbar-inverse-link-hover-color",
|
||||
"@navbar-inverse-link-active-bg": "darken(@navbar-inverse-bg, 10%)",
|
||||
"@navbar-inverse-link-disabled-color": "#444",
|
||||
"@navbar-inverse-link-disabled-bg": "transparent",
|
||||
"@navbar-inverse-brand-color": "@navbar-inverse-link-color",
|
||||
"@navbar-inverse-brand-hover-color": "#fff",
|
||||
"@navbar-inverse-brand-hover-bg": "transparent",
|
||||
"@navbar-inverse-toggle-hover-bg": "#333",
|
||||
"@navbar-inverse-toggle-icon-bar-bg": "#fff",
|
||||
"@navbar-inverse-toggle-border-color": "#333",
|
||||
"@nav-link-padding": "10px 15px",
|
||||
"@nav-link-hover-bg": "@gray-lighter",
|
||||
"@nav-disabled-link-color": "@gray-light",
|
||||
"@nav-disabled-link-hover-color": "@gray-light",
|
||||
"@nav-tabs-border-color": "#ddd",
|
||||
"@nav-tabs-link-hover-border-color": "@gray-lighter",
|
||||
"@nav-tabs-active-link-hover-bg": "@body-bg",
|
||||
"@nav-tabs-active-link-hover-color": "@gray",
|
||||
"@nav-tabs-active-link-hover-border-color": "#ddd",
|
||||
"@nav-tabs-justified-link-border-color": "#ddd",
|
||||
"@nav-tabs-justified-active-link-border-color": "@body-bg",
|
||||
"@nav-pills-border-radius": "@border-radius-base",
|
||||
"@nav-pills-active-link-hover-bg": "@component-active-bg",
|
||||
"@nav-pills-active-link-hover-color": "@component-active-color",
|
||||
"@pagination-color": "@link-color",
|
||||
"@pagination-bg": "#fff",
|
||||
"@pagination-border": "#ddd",
|
||||
"@pagination-hover-color": "@link-hover-color",
|
||||
"@pagination-hover-bg": "@gray-lighter",
|
||||
"@pagination-hover-border": "#ddd",
|
||||
"@pagination-active-color": "#fff",
|
||||
"@pagination-active-bg": "@brand-primary",
|
||||
"@pagination-active-border": "@brand-primary",
|
||||
"@pagination-disabled-color": "@gray-light",
|
||||
"@pagination-disabled-bg": "#fff",
|
||||
"@pagination-disabled-border": "#ddd",
|
||||
"@pager-bg": "@pagination-bg",
|
||||
"@pager-border": "@pagination-border",
|
||||
"@pager-border-radius": "15px",
|
||||
"@pager-hover-bg": "@pagination-hover-bg",
|
||||
"@pager-active-bg": "@pagination-active-bg",
|
||||
"@pager-active-color": "@pagination-active-color",
|
||||
"@pager-disabled-color": "@pagination-disabled-color",
|
||||
"@jumbotron-padding": "30px",
|
||||
"@jumbotron-color": "inherit",
|
||||
"@jumbotron-bg": "@gray-lighter",
|
||||
"@jumbotron-heading-color": "inherit",
|
||||
"@jumbotron-font-size": "ceil((@font-size-base * 1.5))",
|
||||
"@jumbotron-heading-font-size": "ceil((@font-size-base * 4.5))",
|
||||
"@state-success-text": "#3c763d",
|
||||
"@state-success-bg": "#dff0d8",
|
||||
"@state-success-border": "darken(spin(@state-success-bg, -10), 5%)",
|
||||
"@state-info-text": "#31708f",
|
||||
"@state-info-bg": "#d9edf7",
|
||||
"@state-info-border": "darken(spin(@state-info-bg, -10), 7%)",
|
||||
"@state-warning-text": "#8a6d3b",
|
||||
"@state-warning-bg": "#fcf8e3",
|
||||
"@state-warning-border": "darken(spin(@state-warning-bg, -10), 5%)",
|
||||
"@state-danger-text": "#a94442",
|
||||
"@state-danger-bg": "#f2dede",
|
||||
"@state-danger-border": "darken(spin(@state-danger-bg, -10), 5%)",
|
||||
"@tooltip-max-width": "200px",
|
||||
"@tooltip-color": "#fff",
|
||||
"@tooltip-bg": "#000",
|
||||
"@tooltip-opacity": ".9",
|
||||
"@tooltip-arrow-width": "5px",
|
||||
"@tooltip-arrow-color": "@tooltip-bg",
|
||||
"@popover-bg": "#fff",
|
||||
"@popover-max-width": "276px",
|
||||
"@popover-border-color": "rgba(0,0,0,.2)",
|
||||
"@popover-fallback-border-color": "#ccc",
|
||||
"@popover-title-bg": "darken(@popover-bg, 3%)",
|
||||
"@popover-arrow-width": "10px",
|
||||
"@popover-arrow-color": "@popover-bg",
|
||||
"@popover-arrow-outer-width": "(@popover-arrow-width + 1)",
|
||||
"@popover-arrow-outer-color": "fadein(@popover-border-color, 5%)",
|
||||
"@popover-arrow-outer-fallback-color": "darken(@popover-fallback-border-color, 20%)",
|
||||
"@label-default-bg": "@gray-light",
|
||||
"@label-primary-bg": "@brand-primary",
|
||||
"@label-success-bg": "@brand-success",
|
||||
"@label-info-bg": "@brand-info",
|
||||
"@label-warning-bg": "@brand-warning",
|
||||
"@label-danger-bg": "@brand-danger",
|
||||
"@label-color": "#fff",
|
||||
"@label-link-hover-color": "#fff",
|
||||
"@modal-inner-padding": "15px",
|
||||
"@modal-title-padding": "15px",
|
||||
"@modal-title-line-height": "@line-height-base",
|
||||
"@modal-content-bg": "#fff",
|
||||
"@modal-content-border-color": "rgba(0,0,0,.2)",
|
||||
"@modal-content-fallback-border-color": "#999",
|
||||
"@modal-backdrop-bg": "#000",
|
||||
"@modal-backdrop-opacity": ".5",
|
||||
"@modal-header-border-color": "#e5e5e5",
|
||||
"@modal-footer-border-color": "@modal-header-border-color",
|
||||
"@modal-lg": "900px",
|
||||
"@modal-md": "600px",
|
||||
"@modal-sm": "300px",
|
||||
"@alert-padding": "15px",
|
||||
"@alert-border-radius": "@border-radius-base",
|
||||
"@alert-link-font-weight": "bold",
|
||||
"@alert-success-bg": "@state-success-bg",
|
||||
"@alert-success-text": "@state-success-text",
|
||||
"@alert-success-border": "@state-success-border",
|
||||
"@alert-info-bg": "@state-info-bg",
|
||||
"@alert-info-text": "@state-info-text",
|
||||
"@alert-info-border": "@state-info-border",
|
||||
"@alert-warning-bg": "@state-warning-bg",
|
||||
"@alert-warning-text": "@state-warning-text",
|
||||
"@alert-warning-border": "@state-warning-border",
|
||||
"@alert-danger-bg": "@state-danger-bg",
|
||||
"@alert-danger-text": "@state-danger-text",
|
||||
"@alert-danger-border": "@state-danger-border",
|
||||
"@progress-bg": "#f5f5f5",
|
||||
"@progress-bar-color": "#fff",
|
||||
"@progress-border-radius": "@border-radius-base",
|
||||
"@progress-bar-bg": "@brand-primary",
|
||||
"@progress-bar-success-bg": "@brand-success",
|
||||
"@progress-bar-warning-bg": "@brand-warning",
|
||||
"@progress-bar-danger-bg": "@brand-danger",
|
||||
"@progress-bar-info-bg": "@brand-info",
|
||||
"@list-group-bg": "#fff",
|
||||
"@list-group-border": "#ddd",
|
||||
"@list-group-border-radius": "@border-radius-base",
|
||||
"@list-group-hover-bg": "#f5f5f5",
|
||||
"@list-group-active-color": "@component-active-color",
|
||||
"@list-group-active-bg": "@component-active-bg",
|
||||
"@list-group-active-border": "@list-group-active-bg",
|
||||
"@list-group-active-text-color": "lighten(@list-group-active-bg, 40%)",
|
||||
"@list-group-disabled-color": "@gray-light",
|
||||
"@list-group-disabled-bg": "@gray-lighter",
|
||||
"@list-group-disabled-text-color": "@list-group-disabled-color",
|
||||
"@list-group-link-color": "#555",
|
||||
"@list-group-link-hover-color": "@list-group-link-color",
|
||||
"@list-group-link-heading-color": "#333",
|
||||
"@panel-bg": "#fff",
|
||||
"@panel-body-padding": "15px",
|
||||
"@panel-heading-padding": "10px 15px",
|
||||
"@panel-footer-padding": "@panel-heading-padding",
|
||||
"@panel-border-radius": "@border-radius-base",
|
||||
"@panel-inner-border": "#ddd",
|
||||
"@panel-footer-bg": "#f5f5f5",
|
||||
"@panel-default-text": "@gray-dark",
|
||||
"@panel-default-border": "#ddd",
|
||||
"@panel-default-heading-bg": "#f5f5f5",
|
||||
"@panel-primary-text": "#fff",
|
||||
"@panel-primary-border": "@brand-primary",
|
||||
"@panel-primary-heading-bg": "@brand-primary",
|
||||
"@panel-success-text": "@state-success-text",
|
||||
"@panel-success-border": "@state-success-border",
|
||||
"@panel-success-heading-bg": "@state-success-bg",
|
||||
"@panel-info-text": "@state-info-text",
|
||||
"@panel-info-border": "@state-info-border",
|
||||
"@panel-info-heading-bg": "@state-info-bg",
|
||||
"@panel-warning-text": "@state-warning-text",
|
||||
"@panel-warning-border": "@state-warning-border",
|
||||
"@panel-warning-heading-bg": "@state-warning-bg",
|
||||
"@panel-danger-text": "@state-danger-text",
|
||||
"@panel-danger-border": "@state-danger-border",
|
||||
"@panel-danger-heading-bg": "@state-danger-bg",
|
||||
"@thumbnail-padding": "4px",
|
||||
"@thumbnail-bg": "@body-bg",
|
||||
"@thumbnail-border": "#ddd",
|
||||
"@thumbnail-border-radius": "@border-radius-base",
|
||||
"@thumbnail-caption-color": "@text-color",
|
||||
"@thumbnail-caption-padding": "9px",
|
||||
"@well-bg": "#f5f5f5",
|
||||
"@well-border": "darken(@well-bg, 7%)",
|
||||
"@badge-color": "#fff",
|
||||
"@badge-link-hover-color": "#fff",
|
||||
"@badge-bg": "@gray-light",
|
||||
"@badge-active-color": "@link-color",
|
||||
"@badge-active-bg": "#fff",
|
||||
"@badge-font-weight": "bold",
|
||||
"@badge-line-height": "1",
|
||||
"@badge-border-radius": "10px",
|
||||
"@breadcrumb-padding-vertical": "8px",
|
||||
"@breadcrumb-padding-horizontal": "15px",
|
||||
"@breadcrumb-bg": "#f5f5f5",
|
||||
"@breadcrumb-color": "#ccc",
|
||||
"@breadcrumb-active-color": "@gray-light",
|
||||
"@breadcrumb-separator": "\"/\"",
|
||||
"@carousel-text-shadow": "0 1px 2px rgba(0,0,0,.6)",
|
||||
"@carousel-control-color": "#fff",
|
||||
"@carousel-control-width": "15%",
|
||||
"@carousel-control-opacity": ".5",
|
||||
"@carousel-control-font-size": "20px",
|
||||
"@carousel-indicator-active-bg": "#fff",
|
||||
"@carousel-indicator-border-color": "#fff",
|
||||
"@carousel-caption-color": "#fff",
|
||||
"@close-font-weight": "bold",
|
||||
"@close-color": "#000",
|
||||
"@close-text-shadow": "0 1px 0 #fff",
|
||||
"@code-color": "#c7254e",
|
||||
"@code-bg": "#f9f2f4",
|
||||
"@kbd-color": "#fff",
|
||||
"@kbd-bg": "#333",
|
||||
"@pre-bg": "#f5f5f5",
|
||||
"@pre-color": "@gray-dark",
|
||||
"@pre-border-color": "#ccc",
|
||||
"@pre-scrollable-max-height": "340px",
|
||||
"@component-offset-horizontal": "180px",
|
||||
"@text-muted": "@gray-light",
|
||||
"@abbr-border-color": "@gray-light",
|
||||
"@headings-small-color": "@gray-light",
|
||||
"@blockquote-small-color": "@gray-light",
|
||||
"@blockquote-font-size": "(@font-size-base * 1.25)",
|
||||
"@blockquote-border-color": "@gray-lighter",
|
||||
"@page-header-border-color": "@gray-lighter",
|
||||
"@dl-horizontal-offset": "@component-offset-horizontal",
|
||||
"@dl-horizontal-breakpoint": "@grid-float-breakpoint",
|
||||
"@hr-border": "@gray-lighter"
|
||||
},
|
||||
"css": [
|
||||
"grid.less",
|
||||
"responsive-utilities.less"
|
||||
],
|
||||
"js": [],
|
||||
"customizerUrl": "http://getbootstrap.com/customize/?id=5d94a03518396aadcd15"
|
||||
}
|
2
gui/vendor/datetimepicker.min.js
vendored
Normal file
2
gui/vendor/datetimepicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
28
gui/vendor/documize.js
vendored
Normal file
28
gui/vendor/documize.js
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
$.fn.inView = function(){
|
||||
var win = $(window);
|
||||
var obj = $(this);
|
||||
|
||||
// trap for no object
|
||||
if (obj.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var scrollPosition = win.scrollTop();
|
||||
|
||||
var visibleArea = win.scrollTop() + win.height();
|
||||
|
||||
var objPos = obj.offset().top;// + obj.outerHeight();
|
||||
|
||||
return(visibleArea >= objPos && scrollPosition <= objPos ? true : false);
|
||||
};
|
561
gui/vendor/drop.js
vendored
Normal file
561
gui/vendor/drop.js
vendored
Normal file
|
@ -0,0 +1,561 @@
|
|||
// https://github.com/HubSpot/drop
|
||||
/*! tether-drop 1.4.1 */
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(["tether"], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
module.exports = factory(require('tether'));
|
||||
} else {
|
||||
root.Drop = factory(root.Tether);
|
||||
}
|
||||
}(this, function(Tether) {
|
||||
|
||||
/* global Tether */
|
||||
'use strict';
|
||||
|
||||
var _bind = Function.prototype.bind;
|
||||
|
||||
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
|
||||
|
||||
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; }; })();
|
||||
|
||||
var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _Tether$Utils = Tether.Utils;
|
||||
var extend = _Tether$Utils.extend;
|
||||
var addClass = _Tether$Utils.addClass;
|
||||
var removeClass = _Tether$Utils.removeClass;
|
||||
var hasClass = _Tether$Utils.hasClass;
|
||||
var Evented = _Tether$Utils.Evented;
|
||||
|
||||
function sortAttach(str) {
|
||||
var _str$split = str.split(' ');
|
||||
|
||||
var _str$split2 = _slicedToArray(_str$split, 2);
|
||||
|
||||
var first = _str$split2[0];
|
||||
var second = _str$split2[1];
|
||||
|
||||
if (['left', 'right'].indexOf(first) >= 0) {
|
||||
var _ref = [second, first];
|
||||
first = _ref[0];
|
||||
second = _ref[1];
|
||||
}
|
||||
return [first, second].join(' ');
|
||||
}
|
||||
|
||||
function removeFromArray(arr, item) {
|
||||
var index = undefined;
|
||||
var results = [];
|
||||
while ((index = arr.indexOf(item)) !== -1) {
|
||||
results.push(arr.splice(index, 1));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
var clickEvents = ['click'];
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
clickEvents.push('touchstart');
|
||||
}
|
||||
|
||||
var transitionEndEvents = {
|
||||
'WebkitTransition': 'webkitTransitionEnd',
|
||||
'MozTransition': 'transitionend',
|
||||
'OTransition': 'otransitionend',
|
||||
'transition': 'transitionend'
|
||||
};
|
||||
|
||||
var transitionEndEvent = '';
|
||||
for (var _name in transitionEndEvents) {
|
||||
if (({}).hasOwnProperty.call(transitionEndEvents, _name)) {
|
||||
var tempEl = document.createElement('p');
|
||||
if (typeof tempEl.style[_name] !== 'undefined') {
|
||||
transitionEndEvent = transitionEndEvents[_name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var MIRROR_ATTACH = {
|
||||
left: 'right',
|
||||
right: 'left',
|
||||
top: 'bottom',
|
||||
bottom: 'top',
|
||||
middle: 'middle',
|
||||
center: 'center'
|
||||
};
|
||||
|
||||
var allDrops = {};
|
||||
|
||||
// Drop can be included in external libraries. Calling createContext gives you a fresh
|
||||
// copy of drop which won't interact with other copies on the page (beyond calling the document events).
|
||||
|
||||
function createContext() {
|
||||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||
|
||||
var drop = function drop() {
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return new (_bind.apply(DropInstance, [null].concat(args)))();
|
||||
};
|
||||
|
||||
extend(drop, {
|
||||
createContext: createContext,
|
||||
drops: [],
|
||||
defaults: {}
|
||||
});
|
||||
|
||||
var defaultOptions = {
|
||||
classPrefix: 'drop',
|
||||
defaults: {
|
||||
position: 'bottom left',
|
||||
openOn: 'click',
|
||||
beforeClose: null,
|
||||
constrainToScrollParent: true,
|
||||
constrainToWindow: true,
|
||||
classes: '',
|
||||
remove: false,
|
||||
openDelay: 0,
|
||||
closeDelay: 50,
|
||||
// inherited from openDelay and closeDelay if not explicitly defined
|
||||
focusDelay: null,
|
||||
blurDelay: null,
|
||||
hoverOpenDelay: null,
|
||||
hoverCloseDelay: null,
|
||||
tetherOptions: {}
|
||||
}
|
||||
};
|
||||
|
||||
extend(drop, defaultOptions, options);
|
||||
extend(drop.defaults, defaultOptions.defaults, options.defaults);
|
||||
|
||||
if (typeof allDrops[drop.classPrefix] === 'undefined') {
|
||||
allDrops[drop.classPrefix] = [];
|
||||
}
|
||||
|
||||
drop.updateBodyClasses = function () {
|
||||
// There is only one body, so despite the context concept, we still iterate through all
|
||||
// drops which share our classPrefix.
|
||||
|
||||
var anyOpen = false;
|
||||
var drops = allDrops[drop.classPrefix];
|
||||
var len = drops.length;
|
||||
for (var i = 0; i < len; ++i) {
|
||||
if (drops[i].isOpened()) {
|
||||
anyOpen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (anyOpen) {
|
||||
addClass(document.body, drop.classPrefix + '-open');
|
||||
} else {
|
||||
removeClass(document.body, drop.classPrefix + '-open');
|
||||
}
|
||||
};
|
||||
|
||||
var DropInstance = (function (_Evented) {
|
||||
_inherits(DropInstance, _Evented);
|
||||
|
||||
function DropInstance(opts) {
|
||||
_classCallCheck(this, DropInstance);
|
||||
|
||||
_get(Object.getPrototypeOf(DropInstance.prototype), 'constructor', this).call(this);
|
||||
this.options = extend({}, drop.defaults, opts);
|
||||
this.target = this.options.target;
|
||||
|
||||
if (typeof this.target === 'undefined') {
|
||||
throw new Error('Drop Error: You must provide a target.');
|
||||
}
|
||||
|
||||
var dataPrefix = 'data-' + drop.classPrefix;
|
||||
|
||||
var contentAttr = this.target.getAttribute(dataPrefix);
|
||||
if (contentAttr && this.options.content == null) {
|
||||
this.options.content = contentAttr;
|
||||
}
|
||||
|
||||
var attrsOverride = ['position', 'openOn'];
|
||||
for (var i = 0; i < attrsOverride.length; ++i) {
|
||||
|
||||
var override = this.target.getAttribute(dataPrefix + '-' + attrsOverride[i]);
|
||||
if (override && this.options[attrsOverride[i]] == null) {
|
||||
this.options[attrsOverride[i]] = override;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.classes && this.options.addTargetClasses !== false) {
|
||||
addClass(this.target, this.options.classes);
|
||||
}
|
||||
|
||||
drop.drops.push(this);
|
||||
allDrops[drop.classPrefix].push(this);
|
||||
|
||||
this._boundEvents = [];
|
||||
this.bindMethods();
|
||||
this.setupElements();
|
||||
this.setupEvents();
|
||||
this.setupTether();
|
||||
}
|
||||
|
||||
_createClass(DropInstance, [{
|
||||
key: '_on',
|
||||
value: function _on(element, event, handler) {
|
||||
this._boundEvents.push({ element: element, event: event, handler: handler });
|
||||
element.addEventListener(event, handler);
|
||||
}
|
||||
}, {
|
||||
key: 'bindMethods',
|
||||
value: function bindMethods() {
|
||||
this.transitionEndHandler = this._transitionEndHandler.bind(this);
|
||||
}
|
||||
}, {
|
||||
key: 'setupElements',
|
||||
value: function setupElements() {
|
||||
var _this = this;
|
||||
|
||||
this.drop = document.createElement('div');
|
||||
addClass(this.drop, drop.classPrefix);
|
||||
|
||||
if (this.options.classes) {
|
||||
addClass(this.drop, this.options.classes);
|
||||
}
|
||||
|
||||
this.content = document.createElement('div');
|
||||
addClass(this.content, drop.classPrefix + '-content');
|
||||
|
||||
if (typeof this.options.content === 'function') {
|
||||
var generateAndSetContent = function generateAndSetContent() {
|
||||
// content function might return a string or an element
|
||||
var contentElementOrHTML = _this.options.content.call(_this, _this);
|
||||
|
||||
if (typeof contentElementOrHTML === 'string') {
|
||||
_this.content.innerHTML = contentElementOrHTML;
|
||||
} else if (typeof contentElementOrHTML === 'object') {
|
||||
_this.content.innerHTML = '';
|
||||
_this.content.appendChild(contentElementOrHTML);
|
||||
} else {
|
||||
throw new Error('Drop Error: Content function should return a string or HTMLElement.');
|
||||
}
|
||||
};
|
||||
|
||||
generateAndSetContent();
|
||||
this.on('open', generateAndSetContent.bind(this));
|
||||
} else if (typeof this.options.content === 'object') {
|
||||
this.content.appendChild(this.options.content);
|
||||
} else {
|
||||
this.content.innerHTML = this.options.content;
|
||||
}
|
||||
|
||||
this.drop.appendChild(this.content);
|
||||
}
|
||||
}, {
|
||||
key: 'setupTether',
|
||||
value: function setupTether() {
|
||||
// Tether expects two attachment points, one in the target element, one in the
|
||||
// drop. We use a single one, and use the order as well, to allow us to put
|
||||
// the drop on either side of any of the four corners. This magic converts between
|
||||
// the two:
|
||||
var dropAttach = this.options.position.split(' ');
|
||||
dropAttach[0] = MIRROR_ATTACH[dropAttach[0]];
|
||||
dropAttach = dropAttach.join(' ');
|
||||
|
||||
var constraints = [];
|
||||
if (this.options.constrainToScrollParent) {
|
||||
constraints.push({
|
||||
to: 'scrollParent',
|
||||
pin: 'top, bottom',
|
||||
attachment: 'together none'
|
||||
});
|
||||
} else {
|
||||
// To get 'out of bounds' classes
|
||||
constraints.push({
|
||||
to: 'scrollParent'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.constrainToWindow !== false) {
|
||||
constraints.push({
|
||||
to: 'window',
|
||||
attachment: 'together'
|
||||
});
|
||||
} else {
|
||||
// To get 'out of bounds' classes
|
||||
constraints.push({
|
||||
to: 'window'
|
||||
});
|
||||
}
|
||||
|
||||
var opts = {
|
||||
element: this.drop,
|
||||
target: this.target,
|
||||
attachment: sortAttach(dropAttach),
|
||||
targetAttachment: sortAttach(this.options.position),
|
||||
classPrefix: drop.classPrefix,
|
||||
offset: '0 0',
|
||||
targetOffset: '0 0',
|
||||
enabled: false,
|
||||
constraints: constraints,
|
||||
addTargetClasses: this.options.addTargetClasses
|
||||
};
|
||||
|
||||
if (this.options.tetherOptions !== false) {
|
||||
this.tether = new Tether(extend({}, opts, this.options.tetherOptions));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'setupEvents',
|
||||
value: function setupEvents() {
|
||||
var _this2 = this;
|
||||
|
||||
if (!this.options.openOn) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.openOn === 'always') {
|
||||
setTimeout(this.open.bind(this));
|
||||
return;
|
||||
}
|
||||
|
||||
var events = this.options.openOn.split(' ');
|
||||
|
||||
if (events.indexOf('click') >= 0) {
|
||||
var openHandler = function openHandler(event) {
|
||||
_this2.toggle(event);
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
var closeHandler = function closeHandler(event) {
|
||||
if (!_this2.isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clicking inside dropdown
|
||||
if (event.target === _this2.drop || _this2.drop.contains(event.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clicking target
|
||||
if (event.target === _this2.target || _this2.target.contains(event.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this2.close(event);
|
||||
};
|
||||
|
||||
for (var i = 0; i < clickEvents.length; ++i) {
|
||||
var clickEvent = clickEvents[i];
|
||||
this._on(this.target, clickEvent, openHandler);
|
||||
this._on(document, clickEvent, closeHandler);
|
||||
}
|
||||
}
|
||||
|
||||
var inTimeout = null;
|
||||
var outTimeout = null;
|
||||
|
||||
var inHandler = function inHandler(event) {
|
||||
if (outTimeout !== null) {
|
||||
clearTimeout(outTimeout);
|
||||
} else {
|
||||
inTimeout = setTimeout(function () {
|
||||
_this2.open(event);
|
||||
inTimeout = null;
|
||||
}, (event.type === 'focus' ? _this2.options.focusDelay : _this2.options.hoverOpenDelay) || _this2.options.openDelay);
|
||||
}
|
||||
};
|
||||
|
||||
var outHandler = function outHandler(event) {
|
||||
if (inTimeout !== null) {
|
||||
clearTimeout(inTimeout);
|
||||
} else {
|
||||
outTimeout = setTimeout(function () {
|
||||
_this2.close(event);
|
||||
outTimeout = null;
|
||||
}, (event.type === 'blur' ? _this2.options.blurDelay : _this2.options.hoverCloseDelay) || _this2.options.closeDelay);
|
||||
}
|
||||
};
|
||||
|
||||
if (events.indexOf('hover') >= 0) {
|
||||
this._on(this.target, 'mouseover', inHandler);
|
||||
this._on(this.drop, 'mouseover', inHandler);
|
||||
this._on(this.target, 'mouseout', outHandler);
|
||||
this._on(this.drop, 'mouseout', outHandler);
|
||||
}
|
||||
|
||||
if (events.indexOf('focus') >= 0) {
|
||||
this._on(this.target, 'focus', inHandler);
|
||||
this._on(this.drop, 'focus', inHandler);
|
||||
this._on(this.target, 'blur', outHandler);
|
||||
this._on(this.drop, 'blur', outHandler);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'isOpened',
|
||||
value: function isOpened() {
|
||||
if (this.drop) {
|
||||
return hasClass(this.drop, drop.classPrefix + '-open');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'toggle',
|
||||
value: function toggle(event) {
|
||||
if (this.isOpened()) {
|
||||
this.close(event);
|
||||
} else {
|
||||
this.open(event);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'open',
|
||||
value: function open(event) {
|
||||
var _this3 = this;
|
||||
|
||||
/* eslint no-unused-vars: 0 */
|
||||
if (this.isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.drop.parentNode) {
|
||||
document.body.appendChild(this.drop);
|
||||
}
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.enable();
|
||||
}
|
||||
|
||||
addClass(this.drop, drop.classPrefix + '-open');
|
||||
addClass(this.drop, drop.classPrefix + '-open-transitionend');
|
||||
|
||||
setTimeout(function () {
|
||||
if (_this3.drop) {
|
||||
addClass(_this3.drop, drop.classPrefix + '-after-open');
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.position();
|
||||
}
|
||||
|
||||
this.trigger('open');
|
||||
|
||||
drop.updateBodyClasses();
|
||||
}
|
||||
}, {
|
||||
key: '_transitionEndHandler',
|
||||
value: function _transitionEndHandler(e) {
|
||||
if (e.target !== e.currentTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasClass(this.drop, drop.classPrefix + '-open')) {
|
||||
removeClass(this.drop, drop.classPrefix + '-open-transitionend');
|
||||
}
|
||||
this.drop.removeEventListener(transitionEndEvent, this.transitionEndHandler);
|
||||
}
|
||||
}, {
|
||||
key: 'beforeCloseHandler',
|
||||
value: function beforeCloseHandler(event) {
|
||||
var shouldClose = true;
|
||||
|
||||
if (!this.isClosing && typeof this.options.beforeClose === 'function') {
|
||||
this.isClosing = true;
|
||||
shouldClose = this.options.beforeClose(event, this) !== false;
|
||||
}
|
||||
|
||||
this.isClosing = false;
|
||||
|
||||
return shouldClose;
|
||||
}
|
||||
}, {
|
||||
key: 'close',
|
||||
value: function close(event) {
|
||||
if (!this.isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.beforeCloseHandler(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
removeClass(this.drop, drop.classPrefix + '-open');
|
||||
removeClass(this.drop, drop.classPrefix + '-after-open');
|
||||
|
||||
this.drop.addEventListener(transitionEndEvent, this.transitionEndHandler);
|
||||
|
||||
this.trigger('close');
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.disable();
|
||||
}
|
||||
|
||||
drop.updateBodyClasses();
|
||||
|
||||
if (this.options.remove) {
|
||||
this.remove(event);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'remove',
|
||||
value: function remove(event) {
|
||||
this.close(event);
|
||||
if (this.drop.parentNode) {
|
||||
this.drop.parentNode.removeChild(this.drop);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'position',
|
||||
value: function position() {
|
||||
if (this.isOpened() && typeof this.tether !== 'undefined') {
|
||||
this.tether.position();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'destroy',
|
||||
value: function destroy() {
|
||||
this.remove();
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.destroy();
|
||||
}
|
||||
|
||||
for (var i = 0; i < this._boundEvents.length; ++i) {
|
||||
var _boundEvents$i = this._boundEvents[i];
|
||||
var element = _boundEvents$i.element;
|
||||
var _event = _boundEvents$i.event;
|
||||
var handler = _boundEvents$i.handler;
|
||||
|
||||
element.removeEventListener(_event, handler);
|
||||
}
|
||||
|
||||
this._boundEvents = [];
|
||||
|
||||
this.tether = null;
|
||||
this.drop = null;
|
||||
this.content = null;
|
||||
this.target = null;
|
||||
|
||||
removeFromArray(allDrops[drop.classPrefix], this);
|
||||
removeFromArray(drop.drops, this);
|
||||
}
|
||||
}]);
|
||||
|
||||
return DropInstance;
|
||||
})(Evented);
|
||||
|
||||
return drop;
|
||||
}
|
||||
|
||||
var Drop = createContext();
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
Drop.updateBodyClasses();
|
||||
});
|
||||
return Drop;
|
||||
|
||||
}));
|
1767
gui/vendor/dropzone.js
vendored
Executable file
1767
gui/vendor/dropzone.js
vendored
Executable file
File diff suppressed because it is too large
Load diff
158
gui/vendor/hoverIntent.js
vendored
Executable file
158
gui/vendor/hoverIntent.js
vendored
Executable file
|
@ -0,0 +1,158 @@
|
|||
/*!
|
||||
* hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+
|
||||
* http://briancherne.github.io/jquery-hoverIntent/
|
||||
*
|
||||
* You may use hoverIntent under the terms of the MIT license. Basically that
|
||||
* means you are free to use hoverIntent as long as this header is left intact.
|
||||
* Copyright 2007, 2014 Brian Cherne
|
||||
*/
|
||||
|
||||
/* hoverIntent is similar to jQuery's built-in "hover" method except that
|
||||
* instead of firing the handlerIn function immediately, hoverIntent checks
|
||||
* to see if the user's mouse has slowed down (beneath the sensitivity
|
||||
* threshold) before firing the event. The handlerOut function is only
|
||||
* called after a matching handlerIn.
|
||||
*
|
||||
* // basic usage ... just like .hover()
|
||||
* .hoverIntent( handlerIn, handlerOut )
|
||||
* .hoverIntent( handlerInOut )
|
||||
*
|
||||
* // basic usage ... with event delegation!
|
||||
* .hoverIntent( handlerIn, handlerOut, selector )
|
||||
* .hoverIntent( handlerInOut, selector )
|
||||
*
|
||||
* // using a basic configuration object
|
||||
* .hoverIntent( config )
|
||||
*
|
||||
* @param handlerIn function OR configuration object
|
||||
* @param handlerOut function OR selector for delegation OR undefined
|
||||
* @param selector selector OR undefined
|
||||
* @author Brian Cherne <brian(at)cherne(dot)net>
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if (jQuery && !jQuery.fn.hoverIntent) {
|
||||
factory(jQuery);
|
||||
}
|
||||
})(function($) {
|
||||
'use strict';
|
||||
|
||||
// default configuration values
|
||||
var _cfg = {
|
||||
interval: 100,
|
||||
sensitivity: 6,
|
||||
timeout: 0
|
||||
};
|
||||
|
||||
// counter used to generate an ID for each instance
|
||||
var INSTANCE_COUNT = 0;
|
||||
|
||||
// current X and Y position of mouse, updated during mousemove tracking (shared across instances)
|
||||
var cX, cY;
|
||||
|
||||
// saves the current pointer position coordinates based on the given mousemove event
|
||||
var track = function(ev) {
|
||||
cX = ev.pageX;
|
||||
cY = ev.pageY;
|
||||
};
|
||||
|
||||
// compares current and previous mouse positions
|
||||
var compare = function(ev,$el,s,cfg) {
|
||||
// compare mouse positions to see if pointer has slowed enough to trigger `over` function
|
||||
if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) {
|
||||
$el.off(s.event,track);
|
||||
delete s.timeoutId;
|
||||
// set hoverIntent state as active for this element (permits `out` handler to trigger)
|
||||
s.isActive = true;
|
||||
// overwrite old mouseenter event coordinates with most recent pointer position
|
||||
ev.pageX = cX; ev.pageY = cY;
|
||||
// clear coordinate data from state object
|
||||
delete s.pX; delete s.pY;
|
||||
return cfg.over.apply($el[0],[ev]);
|
||||
} else {
|
||||
// set previous coordinates for next comparison
|
||||
s.pX = cX; s.pY = cY;
|
||||
// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
|
||||
s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval );
|
||||
}
|
||||
};
|
||||
|
||||
// triggers given `out` function at configured `timeout` after a mouseleave and clears state
|
||||
var delay = function(ev,$el,s,out) {
|
||||
delete $el.data('hoverIntent')[s.id];
|
||||
return out.apply($el[0],[ev]);
|
||||
};
|
||||
|
||||
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
|
||||
// instance ID, used as a key to store and retrieve state information on an element
|
||||
var instanceId = INSTANCE_COUNT++;
|
||||
|
||||
// extend the default configuration and parse parameters
|
||||
var cfg = $.extend({}, _cfg);
|
||||
if ( $.isPlainObject(handlerIn) ) {
|
||||
cfg = $.extend(cfg, handlerIn);
|
||||
if ( !$.isFunction(cfg.out) ) {
|
||||
cfg.out = cfg.over;
|
||||
}
|
||||
} else if ( $.isFunction(handlerOut) ) {
|
||||
cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
|
||||
} else {
|
||||
cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
|
||||
}
|
||||
|
||||
// A private function for handling mouse 'hovering'
|
||||
var handleHover = function(e) {
|
||||
// cloned event to pass to handlers (copy required for event object to be passed in IE)
|
||||
var ev = $.extend({},e);
|
||||
|
||||
// the current target of the mouse event, wrapped in a jQuery object
|
||||
var $el = $(this);
|
||||
|
||||
// read hoverIntent data from element (or initialize if not present)
|
||||
var hoverIntentData = $el.data('hoverIntent');
|
||||
if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); }
|
||||
|
||||
// read per-instance state from element (or initialize if not present)
|
||||
var state = hoverIntentData[instanceId];
|
||||
if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; }
|
||||
|
||||
// state properties:
|
||||
// id = instance ID, used to clean up data
|
||||
// timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler
|
||||
// isActive = plugin state, true after `over` is called just until `out` is called
|
||||
// pX, pY = previously-measured pointer coordinates, updated at each polling interval
|
||||
// event = string representing the namespaced event used for mouse tracking
|
||||
|
||||
// clear any existing timeout
|
||||
if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); }
|
||||
|
||||
// namespaced event used to register and unregister mousemove tracking
|
||||
var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId;
|
||||
|
||||
// handle the event, based on its type
|
||||
if (e.type === 'mouseenter') {
|
||||
// do nothing if already active
|
||||
if (state.isActive) { return; }
|
||||
// set "previous" X and Y position based on initial entry point
|
||||
state.pX = ev.pageX; state.pY = ev.pageY;
|
||||
// update "current" X and Y position based on mousemove
|
||||
$el.off(mousemove,track).on(mousemove,track);
|
||||
// start polling interval (self-calling timeout) to compare mouse coordinates over time
|
||||
state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval );
|
||||
} else { // "mouseleave"
|
||||
// do nothing if not already active
|
||||
if (!state.isActive) { return; }
|
||||
// unbind expensive mousemove event
|
||||
$el.off(mousemove,track);
|
||||
// if hoverIntent state is true, then call the mouseOut function after the specified delay
|
||||
state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout );
|
||||
}
|
||||
};
|
||||
|
||||
// listen for mouseenter and mouseleave
|
||||
return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
|
||||
};
|
||||
});
|
907
gui/vendor/is.js
vendored
Normal file
907
gui/vendor/is.js
vendored
Normal file
|
@ -0,0 +1,907 @@
|
|||
/*!
|
||||
* is.js 0.9.0
|
||||
* Author: Aras Atasaygin
|
||||
*/
|
||||
|
||||
// AMD with global, Node, or global
|
||||
;(function(root, factory) { // eslint-disable-line no-extra-semi
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(function() {
|
||||
// Also create a global in case some scripts
|
||||
// that are loaded still are looking for
|
||||
// a global even when an AMD loader is in use.
|
||||
return (root.is = factory());
|
||||
});
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like enviroments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory();
|
||||
} else {
|
||||
// Browser globals (root is self)
|
||||
root.is = factory();
|
||||
}
|
||||
}(this, function() {
|
||||
|
||||
// Baseline
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
// define 'is' object and current version
|
||||
var is = {};
|
||||
is.VERSION = '0.9.0';
|
||||
|
||||
// define interfaces
|
||||
is.not = {};
|
||||
is.all = {};
|
||||
is.any = {};
|
||||
|
||||
// cache some methods to call later on
|
||||
var toString = Object.prototype.toString;
|
||||
var slice = Array.prototype.slice;
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
// helper function which reverses the sense of predicate result
|
||||
function not(func) {
|
||||
return function() {
|
||||
return !func.apply(null, slice.call(arguments));
|
||||
};
|
||||
}
|
||||
|
||||
// helper function which call predicate function per parameter and return true if all pass
|
||||
function all(func) {
|
||||
return function() {
|
||||
var params = getParams(arguments);
|
||||
var length = params.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
if (!func.call(null, params[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
// helper function which call predicate function per parameter and return true if any pass
|
||||
function any(func) {
|
||||
return function() {
|
||||
var params = getParams(arguments);
|
||||
var length = params.length;
|
||||
for (var i = 0; i < length; i++) {
|
||||
if (func.call(null, params[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
// build a 'comparator' object for various comparison checks
|
||||
var comparator = {
|
||||
'<': function(a, b) { return a < b; },
|
||||
'<=': function(a, b) { return a <= b; },
|
||||
'>': function(a, b) { return a > b; },
|
||||
'>=': function(a, b) { return a >= b; }
|
||||
};
|
||||
|
||||
// helper function which compares a version to a range
|
||||
function compareVersion(version, range) {
|
||||
var string = (range + '');
|
||||
var n = +(string.match(/\d+/) || NaN);
|
||||
var op = string.match(/^[<>]=?|/)[0];
|
||||
return comparator[op] ? comparator[op](version, n) : (version == n || n !== n);
|
||||
}
|
||||
|
||||
// helper function which extracts params from arguments
|
||||
function getParams(args) {
|
||||
var params = slice.call(args);
|
||||
var length = params.length;
|
||||
if (length === 1 && is.array(params[0])) { // support array
|
||||
params = params[0];
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
// Type checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
// is a given value Arguments?
|
||||
is.arguments = function(value) { // fallback check is for IE
|
||||
return toString.call(value) === '[object Arguments]' ||
|
||||
(value != null && typeof value === 'object' && 'callee' in value);
|
||||
};
|
||||
|
||||
// is a given value Array?
|
||||
is.array = Array.isArray || function(value) { // check native isArray first
|
||||
return toString.call(value) === '[object Array]';
|
||||
};
|
||||
|
||||
// is a given value Boolean?
|
||||
is.boolean = function(value) {
|
||||
return value === true || value === false || toString.call(value) === '[object Boolean]';
|
||||
};
|
||||
|
||||
// is a given value Char?
|
||||
is.char = function(value) {
|
||||
return is.string(value) && value.length === 1;
|
||||
};
|
||||
|
||||
// is a given value Date Object?
|
||||
is.date = function(value) {
|
||||
return toString.call(value) === '[object Date]';
|
||||
};
|
||||
|
||||
// is a given object a DOM node?
|
||||
is.domNode = function(object) {
|
||||
return is.object(object) && object.nodeType > 0;
|
||||
};
|
||||
|
||||
// is a given value Error object?
|
||||
is.error = function(value) {
|
||||
return toString.call(value) === '[object Error]';
|
||||
};
|
||||
|
||||
// is a given value function?
|
||||
is['function'] = function(value) { // fallback check is for IE
|
||||
return toString.call(value) === '[object Function]' || typeof value === 'function';
|
||||
};
|
||||
|
||||
// is given value a pure JSON object?
|
||||
is.json = function(value) {
|
||||
return toString.call(value) === '[object Object]';
|
||||
};
|
||||
|
||||
// is a given value NaN?
|
||||
is.nan = function(value) { // NaN is number :) Also it is the only value which does not equal itself
|
||||
return value !== value;
|
||||
};
|
||||
|
||||
// is a given value null?
|
||||
is['null'] = function(value) {
|
||||
return value === null;
|
||||
};
|
||||
|
||||
// is a given value number?
|
||||
is.number = function(value) {
|
||||
return is.not.nan(value) && toString.call(value) === '[object Number]';
|
||||
};
|
||||
|
||||
// is a given value object?
|
||||
is.object = function(value) {
|
||||
return Object(value) === value;
|
||||
};
|
||||
|
||||
// is a given value RegExp?
|
||||
is.regexp = function(value) {
|
||||
return toString.call(value) === '[object RegExp]';
|
||||
};
|
||||
|
||||
// are given values same type?
|
||||
// prevent NaN, Number same type check
|
||||
is.sameType = function(value, other) {
|
||||
var tag = toString.call(value);
|
||||
if (tag !== toString.call(other)) {
|
||||
return false;
|
||||
}
|
||||
if (tag === '[object Number]') {
|
||||
return !is.any.nan(value, other) || is.all.nan(value, other);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
// sameType method does not support 'all' and 'any' interfaces
|
||||
is.sameType.api = ['not'];
|
||||
|
||||
// is a given value String?
|
||||
is.string = function(value) {
|
||||
return toString.call(value) === '[object String]';
|
||||
};
|
||||
|
||||
// is a given value undefined?
|
||||
is.undefined = function(value) {
|
||||
return value === void 0;
|
||||
};
|
||||
|
||||
// is a given value window?
|
||||
// setInterval method is only available for window object
|
||||
is.windowObject = function(value) {
|
||||
return value != null && typeof value === 'object' && 'setInterval' in value;
|
||||
};
|
||||
|
||||
// Presence checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
//is a given value empty? Objects, arrays, strings
|
||||
is.empty = function(value) {
|
||||
if (is.object(value)) {
|
||||
var length = Object.getOwnPropertyNames(value).length;
|
||||
if (length === 0 || (length === 1 && is.array(value)) ||
|
||||
(length === 2 && is.arguments(value))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return value === '';
|
||||
};
|
||||
|
||||
// is a given value existy?
|
||||
is.existy = function(value) {
|
||||
return value != null;
|
||||
};
|
||||
|
||||
// is a given value falsy?
|
||||
is.falsy = function(value) {
|
||||
return !value;
|
||||
};
|
||||
|
||||
// is a given value truthy?
|
||||
is.truthy = not(is.falsy);
|
||||
|
||||
// Arithmetic checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
// is a given number above minimum parameter?
|
||||
is.above = function(n, min) {
|
||||
return is.all.number(n, min) && n > min;
|
||||
};
|
||||
// above method does not support 'all' and 'any' interfaces
|
||||
is.above.api = ['not'];
|
||||
|
||||
// is a given number decimal?
|
||||
is.decimal = function(n) {
|
||||
return is.number(n) && n % 1 !== 0;
|
||||
};
|
||||
|
||||
// are given values equal? supports numbers, strings, regexes, booleans
|
||||
// TODO: Add object and array support
|
||||
is.equal = function(value, other) {
|
||||
// check 0 and -0 equity with Infinity and -Infinity
|
||||
if (is.all.number(value, other)) {
|
||||
return value === other && 1 / value === 1 / other;
|
||||
}
|
||||
// check regexes as strings too
|
||||
if (is.all.string(value, other) || is.all.regexp(value, other)) {
|
||||
return '' + value === '' + other;
|
||||
}
|
||||
if (is.all.boolean(value, other)) {
|
||||
return value === other;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
// equal method does not support 'all' and 'any' interfaces
|
||||
is.equal.api = ['not'];
|
||||
|
||||
// is a given number even?
|
||||
is.even = function(n) {
|
||||
return is.number(n) && n % 2 === 0;
|
||||
};
|
||||
|
||||
// is a given number finite?
|
||||
is.finite = isFinite || function(n) {
|
||||
return is.not.infinite(n) && is.not.nan(n);
|
||||
};
|
||||
|
||||
// is a given number infinite?
|
||||
is.infinite = function(n) {
|
||||
return n === Infinity || n === -Infinity;
|
||||
};
|
||||
|
||||
// is a given number integer?
|
||||
is.integer = function(n) {
|
||||
return is.number(n) && n % 1 === 0;
|
||||
};
|
||||
|
||||
// is a given number negative?
|
||||
is.negative = function(n) {
|
||||
return is.number(n) && n < 0;
|
||||
};
|
||||
|
||||
// is a given number odd?
|
||||
is.odd = function(n) {
|
||||
return is.number(n) && n % 2 === 1;
|
||||
};
|
||||
|
||||
// is a given number positive?
|
||||
is.positive = function(n) {
|
||||
return is.number(n) && n > 0;
|
||||
};
|
||||
|
||||
// is a given number above maximum parameter?
|
||||
is.under = function(n, max) {
|
||||
return is.all.number(n, max) && n < max;
|
||||
};
|
||||
// least method does not support 'all' and 'any' interfaces
|
||||
is.under.api = ['not'];
|
||||
|
||||
// is a given number within minimum and maximum parameters?
|
||||
is.within = function(n, min, max) {
|
||||
return is.all.number(n, min, max) && n > min && n < max;
|
||||
};
|
||||
// within method does not support 'all' and 'any' interfaces
|
||||
is.within.api = ['not'];
|
||||
|
||||
// Regexp checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
// Steven Levithan, Jan Goyvaerts: Regular Expressions Cookbook
|
||||
// Scott Gonzalez: Email address validation
|
||||
|
||||
// dateString match m/d/yy and mm/dd/yyyy, allowing any combination of one or two digits for the day and month, and two or four digits for the year
|
||||
// eppPhone match extensible provisioning protocol format
|
||||
// nanpPhone match north american number plan format
|
||||
// time match hours, minutes, and seconds, 24-hour clock
|
||||
var regexes = {
|
||||
affirmative: /^(?:1|t(?:rue)?|y(?:es)?|ok(?:ay)?)$/,
|
||||
alphaNumeric: /^[A-Za-z0-9]+$/,
|
||||
caPostalCode: /^(?!.*[DFIOQU])[A-VXY][0-9][A-Z]\s?[0-9][A-Z][0-9]$/,
|
||||
creditCard: /^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/,
|
||||
dateString: /^(1[0-2]|0?[1-9])([\/-])(3[01]|[12][0-9]|0?[1-9])(?:\2)(?:[0-9]{2})?[0-9]{2}$/,
|
||||
email: /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i, // eslint-disable-line no-control-regex
|
||||
eppPhone: /^\+[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$/,
|
||||
hexadecimal: /^(?:0x)?[0-9a-fA-F]+$/,
|
||||
hexColor: /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,
|
||||
ipv4: /^(?:(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$/,
|
||||
ipv6: /^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,
|
||||
nanpPhone: /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,
|
||||
socialSecurityNumber: /^(?!000|666)[0-8][0-9]{2}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4}$/,
|
||||
timeString: /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/,
|
||||
ukPostCode: /^[A-Z]{1,2}[0-9RCHNQ][0-9A-Z]?\s?[0-9][ABD-HJLNP-UW-Z]{2}$|^[A-Z]{2}-?[0-9]{4}$/,
|
||||
url: /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/i,
|
||||
usZipCode: /^[0-9]{5}(?:-[0-9]{4})?$/
|
||||
};
|
||||
|
||||
function regexpCheck(regexp, regexes) {
|
||||
is[regexp] = function(value) {
|
||||
return is.existy(value) && regexes[regexp].test(value);
|
||||
};
|
||||
}
|
||||
|
||||
// create regexp checks methods from 'regexes' object
|
||||
for (var regexp in regexes) {
|
||||
if (regexes.hasOwnProperty(regexp)) {
|
||||
regexpCheck(regexp, regexes);
|
||||
}
|
||||
}
|
||||
|
||||
// simplify IP checks by calling the regex helpers for IPv4 and IPv6
|
||||
is.ip = function(value) {
|
||||
return is.ipv4(value) || is.ipv6(value);
|
||||
};
|
||||
|
||||
// String checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
// is a given string or sentence capitalized?
|
||||
is.capitalized = function(string) {
|
||||
if (is.not.string(string)) {
|
||||
return false;
|
||||
}
|
||||
var words = string.split(' ');
|
||||
for (var i = 0; i < words.length; i++) {
|
||||
var word = words[i];
|
||||
if (word.length) {
|
||||
var chr = word.charAt(0);
|
||||
if (chr !== chr.toUpperCase()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// is string end with a given target parameter?
|
||||
is.endWith = function(string, target) {
|
||||
if (is.not.string(string)) {
|
||||
return false;
|
||||
}
|
||||
target += '';
|
||||
var position = string.length - target.length;
|
||||
return position >= 0 && string.indexOf(target, position) === position;
|
||||
};
|
||||
// endWith method does not support 'all' and 'any' interfaces
|
||||
is.endWith.api = ['not'];
|
||||
|
||||
// is a given string include parameter target?
|
||||
is.include = function(string, target) {
|
||||
return string.indexOf(target) > -1;
|
||||
};
|
||||
// include method does not support 'all' and 'any' interfaces
|
||||
is.include.api = ['not'];
|
||||
|
||||
// is a given string all lowercase?
|
||||
is.lowerCase = function(string) {
|
||||
return is.string(string) && string === string.toLowerCase();
|
||||
};
|
||||
|
||||
// is a given string palindrome?
|
||||
is.palindrome = function(string) {
|
||||
if (is.not.string(string)) {
|
||||
return false;
|
||||
}
|
||||
string = string.replace(/[^a-zA-Z0-9]+/g, '').toLowerCase();
|
||||
var length = string.length - 1;
|
||||
for (var i = 0, half = Math.floor(length / 2); i <= half; i++) {
|
||||
if (string.charAt(i) !== string.charAt(length - i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// is a given value space?
|
||||
// horizontal tab: 9, line feed: 10, vertical tab: 11, form feed: 12, carriage return: 13, space: 32
|
||||
is.space = function(value) {
|
||||
if (is.not.char(value)) {
|
||||
return false;
|
||||
}
|
||||
var charCode = value.charCodeAt(0);
|
||||
return (charCode > 8 && charCode < 14) || charCode === 32;
|
||||
};
|
||||
|
||||
// is string start with a given target parameter?
|
||||
is.startWith = function(string, target) {
|
||||
return is.string(string) && string.indexOf(target) === 0;
|
||||
};
|
||||
// startWith method does not support 'all' and 'any' interfaces
|
||||
is.startWith.api = ['not'];
|
||||
|
||||
// is a given string all uppercase?
|
||||
is.upperCase = function(string) {
|
||||
return is.string(string) && string === string.toUpperCase();
|
||||
};
|
||||
|
||||
// Time checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
var days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
|
||||
var months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];
|
||||
|
||||
// is a given dates day equal given day parameter?
|
||||
is.day = function(date, day) {
|
||||
return is.date(date) && day.toLowerCase() === days[date.getDay()];
|
||||
};
|
||||
// day method does not support 'all' and 'any' interfaces
|
||||
is.day.api = ['not'];
|
||||
|
||||
// is a given date in daylight saving time?
|
||||
is.dayLightSavingTime = function(date) {
|
||||
var january = new Date(date.getFullYear(), 0, 1);
|
||||
var july = new Date(date.getFullYear(), 6, 1);
|
||||
var stdTimezoneOffset = Math.max(january.getTimezoneOffset(), july.getTimezoneOffset());
|
||||
return date.getTimezoneOffset() < stdTimezoneOffset;
|
||||
};
|
||||
|
||||
// is a given date future?
|
||||
is.future = function(date) {
|
||||
var now = new Date();
|
||||
return is.date(date) && date.getTime() > now.getTime();
|
||||
};
|
||||
|
||||
// is date within given range?
|
||||
is.inDateRange = function(date, start, end) {
|
||||
if (is.not.date(date) || is.not.date(start) || is.not.date(end)) {
|
||||
return false;
|
||||
}
|
||||
var stamp = date.getTime();
|
||||
return stamp > start.getTime() && stamp < end.getTime();
|
||||
};
|
||||
// inDateRange method does not support 'all' and 'any' interfaces
|
||||
is.inDateRange.api = ['not'];
|
||||
|
||||
// is a given date in last month range?
|
||||
is.inLastMonth = function(date) {
|
||||
return is.inDateRange(date, new Date(new Date().setMonth(new Date().getMonth() - 1)), new Date());
|
||||
};
|
||||
|
||||
// is a given date in last week range?
|
||||
is.inLastWeek = function(date) {
|
||||
return is.inDateRange(date, new Date(new Date().setDate(new Date().getDate() - 7)), new Date());
|
||||
};
|
||||
|
||||
// is a given date in last year range?
|
||||
is.inLastYear = function(date) {
|
||||
return is.inDateRange(date, new Date(new Date().setFullYear(new Date().getFullYear() - 1)), new Date());
|
||||
};
|
||||
|
||||
// is a given date in next month range?
|
||||
is.inNextMonth = function(date) {
|
||||
return is.inDateRange(date, new Date(), new Date(new Date().setMonth(new Date().getMonth() + 1)));
|
||||
};
|
||||
|
||||
// is a given date in next week range?
|
||||
is.inNextWeek = function(date) {
|
||||
return is.inDateRange(date, new Date(), new Date(new Date().setDate(new Date().getDate() + 7)));
|
||||
};
|
||||
|
||||
// is a given date in next year range?
|
||||
is.inNextYear = function(date) {
|
||||
return is.inDateRange(date, new Date(), new Date(new Date().setFullYear(new Date().getFullYear() + 1)));
|
||||
};
|
||||
|
||||
// is the given year a leap year?
|
||||
is.leapYear = function(year) {
|
||||
return is.number(year) && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);
|
||||
};
|
||||
|
||||
// is a given dates month equal given month parameter?
|
||||
is.month = function(date, month) {
|
||||
return is.date(date) && month.toLowerCase() === months[date.getMonth()];
|
||||
};
|
||||
// month method does not support 'all' and 'any' interfaces
|
||||
is.month.api = ['not'];
|
||||
|
||||
// is a given date past?
|
||||
is.past = function(date) {
|
||||
var now = new Date();
|
||||
return is.date(date) && date.getTime() < now.getTime();
|
||||
};
|
||||
|
||||
// is a given date in the parameter quarter?
|
||||
is.quarterOfYear = function(date, quarter) {
|
||||
return is.date(date) && is.number(quarter) && quarter === Math.floor((date.getMonth() + 3) / 3);
|
||||
};
|
||||
// quarterOfYear method does not support 'all' and 'any' interfaces
|
||||
is.quarterOfYear.api = ['not'];
|
||||
|
||||
// is a given date indicate today?
|
||||
is.today = function(date) {
|
||||
var now = new Date();
|
||||
var todayString = now.toDateString();
|
||||
return is.date(date) && date.toDateString() === todayString;
|
||||
};
|
||||
|
||||
// is a given date indicate tomorrow?
|
||||
is.tomorrow = function(date) {
|
||||
var now = new Date();
|
||||
var tomorrowString = new Date(now.setDate(now.getDate() + 1)).toDateString();
|
||||
return is.date(date) && date.toDateString() === tomorrowString;
|
||||
};
|
||||
|
||||
// is a given date weekend?
|
||||
// 6: Saturday, 0: Sunday
|
||||
is.weekend = function(date) {
|
||||
return is.date(date) && (date.getDay() === 6 || date.getDay() === 0);
|
||||
};
|
||||
|
||||
// is a given date weekday?
|
||||
is.weekday = not(is.weekend);
|
||||
|
||||
// is a given dates year equal given year parameter?
|
||||
is.year = function(date, year) {
|
||||
return is.date(date) && is.number(year) && year === date.getFullYear();
|
||||
};
|
||||
// year method does not support 'all' and 'any' interfaces
|
||||
is.year.api = ['not'];
|
||||
|
||||
// is a given date indicate yesterday?
|
||||
is.yesterday = function(date) {
|
||||
var now = new Date();
|
||||
var yesterdayString = new Date(now.setDate(now.getDate() - 1)).toDateString();
|
||||
return is.date(date) && date.toDateString() === yesterdayString;
|
||||
};
|
||||
|
||||
// Environment checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
var freeGlobal = is.windowObject(typeof global == 'object' && global) && global;
|
||||
var freeSelf = is.windowObject(typeof self == 'object' && self) && self;
|
||||
var thisGlobal = is.windowObject(typeof this == 'object' && this) && this;
|
||||
var root = freeGlobal || freeSelf || thisGlobal || Function('return this')();
|
||||
|
||||
var document = freeSelf && freeSelf.document;
|
||||
var previousIs = root.is;
|
||||
|
||||
// store navigator properties to use later
|
||||
var navigator = freeSelf && freeSelf.navigator;
|
||||
var appVersion = (navigator && navigator.appVersion || '').toLowerCase();
|
||||
var userAgent = (navigator && navigator.userAgent || '').toLowerCase();
|
||||
var vendor = (navigator && navigator.vendor || '').toLowerCase();
|
||||
|
||||
// is current device android?
|
||||
is.android = function() {
|
||||
return /android/.test(userAgent);
|
||||
};
|
||||
// android method does not support 'all' and 'any' interfaces
|
||||
is.android.api = ['not'];
|
||||
|
||||
// is current device android phone?
|
||||
is.androidPhone = function() {
|
||||
return /android/.test(userAgent) && /mobile/.test(userAgent);
|
||||
};
|
||||
// androidPhone method does not support 'all' and 'any' interfaces
|
||||
is.androidPhone.api = ['not'];
|
||||
|
||||
// is current device android tablet?
|
||||
is.androidTablet = function() {
|
||||
return /android/.test(userAgent) && !/mobile/.test(userAgent);
|
||||
};
|
||||
// androidTablet method does not support 'all' and 'any' interfaces
|
||||
is.androidTablet.api = ['not'];
|
||||
|
||||
// is current device blackberry?
|
||||
is.blackberry = function() {
|
||||
return /blackberry/.test(userAgent) || /bb10/.test(userAgent);
|
||||
};
|
||||
// blackberry method does not support 'all' and 'any' interfaces
|
||||
is.blackberry.api = ['not'];
|
||||
|
||||
// is current browser chrome?
|
||||
// parameter is optional
|
||||
is.chrome = function(range) {
|
||||
var match = /google inc/.test(vendor) ? userAgent.match(/(?:chrome|crios)\/(\d+)/) : null;
|
||||
return match !== null && is.not.opera() && compareVersion(match[1], range);
|
||||
};
|
||||
// chrome method does not support 'all' and 'any' interfaces
|
||||
is.chrome.api = ['not'];
|
||||
|
||||
// is current device desktop?
|
||||
is.desktop = function() {
|
||||
return is.not.mobile() && is.not.tablet();
|
||||
};
|
||||
// desktop method does not support 'all' and 'any' interfaces
|
||||
is.desktop.api = ['not'];
|
||||
|
||||
// is current browser edge?
|
||||
// parameter is optional
|
||||
is.edge = function(range) {
|
||||
var match = userAgent.match(/edge\/(\d+)/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// edge method does not support 'all' and 'any' interfaces
|
||||
is.edge.api = ['not'];
|
||||
|
||||
// is current browser firefox?
|
||||
// parameter is optional
|
||||
is.firefox = function(range) {
|
||||
var match = userAgent.match(/(?:firefox|fxios)\/(\d+)/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// firefox method does not support 'all' and 'any' interfaces
|
||||
is.firefox.api = ['not'];
|
||||
|
||||
// is current browser internet explorer?
|
||||
// parameter is optional
|
||||
is.ie = function(range) {
|
||||
var match = userAgent.match(/(?:msie |trident.+?; rv:)(\d+)/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// ie method does not support 'all' and 'any' interfaces
|
||||
is.ie.api = ['not'];
|
||||
|
||||
// is current device ios?
|
||||
is.ios = function() {
|
||||
return is.iphone() || is.ipad() || is.ipod();
|
||||
};
|
||||
// ios method does not support 'all' and 'any' interfaces
|
||||
is.ios.api = ['not'];
|
||||
|
||||
// is current device ipad?
|
||||
// parameter is optional
|
||||
is.ipad = function(range) {
|
||||
var match = userAgent.match(/ipad.+?os (\d+)/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// ipad method does not support 'all' and 'any' interfaces
|
||||
is.ipad.api = ['not'];
|
||||
|
||||
// is current device iphone?
|
||||
// parameter is optional
|
||||
is.iphone = function(range) {
|
||||
// avoid false positive for Facebook in-app browser on ipad;
|
||||
// original iphone doesn't have the OS portion of the UA
|
||||
var match = is.ipad() ? null : userAgent.match(/iphone(?:.+?os (\d+))?/);
|
||||
return match !== null && compareVersion(match[1] || 1, range);
|
||||
};
|
||||
// iphone method does not support 'all' and 'any' interfaces
|
||||
is.iphone.api = ['not'];
|
||||
|
||||
// is current device ipod?
|
||||
// parameter is optional
|
||||
is.ipod = function(range) {
|
||||
var match = userAgent.match(/ipod.+?os (\d+)/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// ipod method does not support 'all' and 'any' interfaces
|
||||
is.ipod.api = ['not'];
|
||||
|
||||
// is current operating system linux?
|
||||
is.linux = function() {
|
||||
return /linux/.test(appVersion);
|
||||
};
|
||||
// linux method does not support 'all' and 'any' interfaces
|
||||
is.linux.api = ['not'];
|
||||
|
||||
// is current operating system mac?
|
||||
is.mac = function() {
|
||||
return /mac/.test(appVersion);
|
||||
};
|
||||
// mac method does not support 'all' and 'any' interfaces
|
||||
is.mac.api = ['not'];
|
||||
|
||||
// is current device mobile?
|
||||
is.mobile = function() {
|
||||
return is.iphone() || is.ipod() || is.androidPhone() || is.blackberry() || is.windowsPhone();
|
||||
};
|
||||
// mobile method does not support 'all' and 'any' interfaces
|
||||
is.mobile.api = ['not'];
|
||||
|
||||
// is current state offline?
|
||||
is.offline = not(is.online);
|
||||
// offline method does not support 'all' and 'any' interfaces
|
||||
is.offline.api = ['not'];
|
||||
|
||||
// is current state online?
|
||||
is.online = function() {
|
||||
return !navigator || navigator.onLine === true;
|
||||
};
|
||||
// online method does not support 'all' and 'any' interfaces
|
||||
is.online.api = ['not'];
|
||||
|
||||
// is current browser opera?
|
||||
// parameter is optional
|
||||
is.opera = function(range) {
|
||||
var match = userAgent.match(/(?:^opera.+?version|opr)\/(\d+)/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// opera method does not support 'all' and 'any' interfaces
|
||||
is.opera.api = ['not'];
|
||||
|
||||
// is current browser phantomjs?
|
||||
// parameter is optional
|
||||
is.phantom = function(range) {
|
||||
var match = userAgent.match(/phantomjs\/(\d+)/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// phantom method does not support 'all' and 'any' interfaces
|
||||
is.phantom.api = ['not'];
|
||||
|
||||
// is current browser safari?
|
||||
// parameter is optional
|
||||
is.safari = function(range) {
|
||||
var match = userAgent.match(/version\/(\d+).+?safari/);
|
||||
return match !== null && compareVersion(match[1], range);
|
||||
};
|
||||
// safari method does not support 'all' and 'any' interfaces
|
||||
is.safari.api = ['not'];
|
||||
|
||||
// is current device tablet?
|
||||
is.tablet = function() {
|
||||
return is.ipad() || is.androidTablet() || is.windowsTablet();
|
||||
};
|
||||
// tablet method does not support 'all' and 'any' interfaces
|
||||
is.tablet.api = ['not'];
|
||||
|
||||
// is current device supports touch?
|
||||
is.touchDevice = function() {
|
||||
return !!document && ('ontouchstart' in freeSelf ||
|
||||
('DocumentTouch' in freeSelf && document instanceof DocumentTouch));
|
||||
};
|
||||
// touchDevice method does not support 'all' and 'any' interfaces
|
||||
is.touchDevice.api = ['not'];
|
||||
|
||||
// is current operating system windows?
|
||||
is.windows = function() {
|
||||
return /win/.test(appVersion);
|
||||
};
|
||||
// windows method does not support 'all' and 'any' interfaces
|
||||
is.windows.api = ['not'];
|
||||
|
||||
// is current device windows phone?
|
||||
is.windowsPhone = function() {
|
||||
return is.windows() && /phone/.test(userAgent);
|
||||
};
|
||||
// windowsPhone method does not support 'all' and 'any' interfaces
|
||||
is.windowsPhone.api = ['not'];
|
||||
|
||||
// is current device windows tablet?
|
||||
is.windowsTablet = function() {
|
||||
return is.windows() && is.not.windowsPhone() && /touch/.test(userAgent);
|
||||
};
|
||||
// windowsTablet method does not support 'all' and 'any' interfaces
|
||||
is.windowsTablet.api = ['not'];
|
||||
|
||||
// Object checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
// has a given object got parameterized count property?
|
||||
is.propertyCount = function(object, count) {
|
||||
if (is.not.object(object) || is.not.number(count)) {
|
||||
return false;
|
||||
}
|
||||
var n = 0;
|
||||
for (var property in object) {
|
||||
if (hasOwnProperty.call(object, property) && ++n > count) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return n === count;
|
||||
};
|
||||
// propertyCount method does not support 'all' and 'any' interfaces
|
||||
is.propertyCount.api = ['not'];
|
||||
|
||||
// is given object has parameterized property?
|
||||
is.propertyDefined = function(object, property) {
|
||||
return is.object(object) && is.string(property) && property in object;
|
||||
};
|
||||
// propertyDefined method does not support 'all' and 'any' interfaces
|
||||
is.propertyDefined.api = ['not'];
|
||||
|
||||
// Array checks
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
// is a given item in an array?
|
||||
is.inArray = function(value, array) {
|
||||
if (is.not.array(array)) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (array[i] === value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
// inArray method does not support 'all' and 'any' interfaces
|
||||
is.inArray.api = ['not'];
|
||||
|
||||
// is a given array sorted?
|
||||
is.sorted = function(array, sign) {
|
||||
if (is.not.array(array)) {
|
||||
return false;
|
||||
}
|
||||
var predicate = comparator[sign] || comparator['>='];
|
||||
for (var i = 1; i < array.length; i++) {
|
||||
if (!predicate(array[i], array[i - 1])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// API
|
||||
// Set 'not', 'all' and 'any' interfaces to methods based on their api property
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
function setInterfaces() {
|
||||
var options = is;
|
||||
for (var option in options) {
|
||||
if (hasOwnProperty.call(options, option) && is['function'](options[option])) {
|
||||
var interfaces = options[option].api || ['not', 'all', 'any'];
|
||||
for (var i = 0; i < interfaces.length; i++) {
|
||||
if (interfaces[i] === 'not') {
|
||||
is.not[option] = not(is[option]);
|
||||
}
|
||||
if (interfaces[i] === 'all') {
|
||||
is.all[option] = all(is[option]);
|
||||
}
|
||||
if (interfaces[i] === 'any') {
|
||||
is.any[option] = any(is[option]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
setInterfaces();
|
||||
|
||||
// Configuration methods
|
||||
// Intentionally added after setInterfaces function
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
// change namespace of library to prevent name collisions
|
||||
// var preferredName = is.setNamespace();
|
||||
// preferredName.odd(3);
|
||||
// => true
|
||||
is.setNamespace = function() {
|
||||
root.is = previousIs;
|
||||
return this;
|
||||
};
|
||||
|
||||
// set optional regexes to methods
|
||||
is.setRegexp = function(regexp, name) {
|
||||
for (var r in regexes) {
|
||||
if (hasOwnProperty.call(regexes, r) && (name === r)) {
|
||||
regexes[r] = regexp;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return is;
|
||||
}));
|
1257
gui/vendor/keycloak.js
vendored
Normal file
1257
gui/vendor/keycloak.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
5
gui/vendor/markdown-it.min.js
vendored
Normal file
5
gui/vendor/markdown-it.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
274
gui/vendor/md5.js
vendored
Normal file
274
gui/vendor/md5.js
vendored
Normal file
|
@ -0,0 +1,274 @@
|
|||
/*
|
||||
* JavaScript MD5 1.0.1
|
||||
* https://github.com/blueimp/JavaScript-MD5
|
||||
*
|
||||
* Copyright 2011, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/MIT
|
||||
*
|
||||
* Based on
|
||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
* Digest Algorithm, as defined in RFC 1321.
|
||||
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||
* Distributed under the BSD License
|
||||
* See http://pajhome.org.uk/crypt/md5 for more info.
|
||||
*/
|
||||
|
||||
/*jslint bitwise: true */
|
||||
/*global unescape, define */
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||
* to work around bugs in some JS interpreters.
|
||||
*/
|
||||
function safe_add(x, y) {
|
||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
|
||||
msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||
return (msw << 16) | (lsw & 0xFFFF);
|
||||
}
|
||||
|
||||
/*
|
||||
* Bitwise rotate a 32-bit number to the left.
|
||||
*/
|
||||
function bit_rol(num, cnt) {
|
||||
return (num << cnt) | (num >>> (32 - cnt));
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions implement the four basic operations the algorithm uses.
|
||||
*/
|
||||
function md5_cmn(q, a, b, x, s, t) {
|
||||
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
|
||||
}
|
||||
function md5_ff(a, b, c, d, x, s, t) {
|
||||
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
|
||||
}
|
||||
function md5_gg(a, b, c, d, x, s, t) {
|
||||
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
|
||||
}
|
||||
function md5_hh(a, b, c, d, x, s, t) {
|
||||
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
|
||||
}
|
||||
function md5_ii(a, b, c, d, x, s, t) {
|
||||
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
||||
*/
|
||||
function binl_md5(x, len) {
|
||||
/* append padding */
|
||||
x[len >> 5] |= 0x80 << (len % 32);
|
||||
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
||||
|
||||
var i, olda, oldb, oldc, oldd,
|
||||
a = 1732584193,
|
||||
b = -271733879,
|
||||
c = -1732584194,
|
||||
d = 271733878;
|
||||
|
||||
for (i = 0; i < x.length; i += 16) {
|
||||
olda = a;
|
||||
oldb = b;
|
||||
oldc = c;
|
||||
oldd = d;
|
||||
|
||||
a = md5_ff(a, b, c, d, x[i], 7, -680876936);
|
||||
d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
|
||||
c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
|
||||
b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
||||
a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
|
||||
d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
||||
c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
||||
b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
|
||||
a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
||||
d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
||||
c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
|
||||
b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
||||
a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
||||
d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
|
||||
c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
||||
b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
||||
|
||||
a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
|
||||
d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
||||
c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
|
||||
b = md5_gg(b, c, d, a, x[i], 20, -373897302);
|
||||
a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
|
||||
d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
|
||||
c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
|
||||
b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
|
||||
a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
|
||||
d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
||||
c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
|
||||
b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
||||
a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
||||
d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
|
||||
c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
||||
b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
||||
|
||||
a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
|
||||
d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
||||
c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
||||
b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
|
||||
a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
||||
d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
||||
c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
|
||||
b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
||||
a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
|
||||
d = md5_hh(d, a, b, c, x[i], 11, -358537222);
|
||||
c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
|
||||
b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
|
||||
a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
|
||||
d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
|
||||
c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
|
||||
b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
|
||||
|
||||
a = md5_ii(a, b, c, d, x[i], 6, -198630844);
|
||||
d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
||||
c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
||||
b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
|
||||
a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
||||
d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
||||
c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
|
||||
b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
||||
a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
||||
d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
|
||||
c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
||||
b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
||||
a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
|
||||
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
||||
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
|
||||
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
|
||||
|
||||
a = safe_add(a, olda);
|
||||
b = safe_add(b, oldb);
|
||||
c = safe_add(c, oldc);
|
||||
d = safe_add(d, oldd);
|
||||
}
|
||||
return [a, b, c, d];
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of little-endian words to a string
|
||||
*/
|
||||
function binl2rstr(input) {
|
||||
var i,
|
||||
output = '';
|
||||
for (i = 0; i < input.length * 32; i += 8) {
|
||||
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a raw string to an array of little-endian words
|
||||
* Characters >255 have their high-byte silently ignored.
|
||||
*/
|
||||
function rstr2binl(input) {
|
||||
var i,
|
||||
output = [];
|
||||
output[(input.length >> 2) - 1] = undefined;
|
||||
for (i = 0; i < output.length; i += 1) {
|
||||
output[i] = 0;
|
||||
}
|
||||
for (i = 0; i < input.length * 8; i += 8) {
|
||||
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the MD5 of a raw string
|
||||
*/
|
||||
function rstr_md5(s) {
|
||||
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the HMAC-MD5, of a key and some data (raw strings)
|
||||
*/
|
||||
function rstr_hmac_md5(key, data) {
|
||||
var i,
|
||||
bkey = rstr2binl(key),
|
||||
ipad = [],
|
||||
opad = [],
|
||||
hash;
|
||||
ipad[15] = opad[15] = undefined;
|
||||
if (bkey.length > 16) {
|
||||
bkey = binl_md5(bkey, key.length * 8);
|
||||
}
|
||||
for (i = 0; i < 16; i += 1) {
|
||||
ipad[i] = bkey[i] ^ 0x36363636;
|
||||
opad[i] = bkey[i] ^ 0x5C5C5C5C;
|
||||
}
|
||||
hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
|
||||
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a raw string to a hex string
|
||||
*/
|
||||
function rstr2hex(input) {
|
||||
var hex_tab = '0123456789abcdef',
|
||||
output = '',
|
||||
x,
|
||||
i;
|
||||
for (i = 0; i < input.length; i += 1) {
|
||||
x = input.charCodeAt(i);
|
||||
output += hex_tab.charAt((x >>> 4) & 0x0F) +
|
||||
hex_tab.charAt(x & 0x0F);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
/*
|
||||
* Encode a string as utf-8
|
||||
*/
|
||||
function str2rstr_utf8(input) {
|
||||
return unescape(encodeURIComponent(input));
|
||||
}
|
||||
|
||||
/*
|
||||
* Take string arguments and return either raw or hex encoded strings
|
||||
*/
|
||||
function raw_md5(s) {
|
||||
return rstr_md5(str2rstr_utf8(s));
|
||||
}
|
||||
function hex_md5(s) {
|
||||
return rstr2hex(raw_md5(s));
|
||||
}
|
||||
function raw_hmac_md5(k, d) {
|
||||
return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));
|
||||
}
|
||||
function hex_hmac_md5(k, d) {
|
||||
return rstr2hex(raw_hmac_md5(k, d));
|
||||
}
|
||||
|
||||
function md5(string, key, raw) {
|
||||
if (!key) {
|
||||
if (!raw) {
|
||||
return hex_md5(string);
|
||||
}
|
||||
return raw_md5(string);
|
||||
}
|
||||
if (!raw) {
|
||||
return hex_hmac_md5(key, string);
|
||||
}
|
||||
return raw_hmac_md5(key, string);
|
||||
}
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function () {
|
||||
return md5;
|
||||
});
|
||||
} else {
|
||||
$.md5 = md5;
|
||||
}
|
||||
}(this));
|
4301
gui/vendor/moment.js
vendored
Normal file
4301
gui/vendor/moment.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1044
gui/vendor/mousetrap.js
vendored
Normal file
1044
gui/vendor/mousetrap.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
218
gui/vendor/slug.js
vendored
Normal file
218
gui/vendor/slug.js
vendored
Normal file
|
@ -0,0 +1,218 @@
|
|||
// Copyright (c) 2014 ▟ ▖▟ ▖(dodo)
|
||||
// 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.
|
||||
// https://github.com/dodo/node-slug
|
||||
|
||||
(function (root) {
|
||||
// lazy require symbols table
|
||||
var _symbols, removelist;
|
||||
function symbols(code) {
|
||||
if (_symbols) return _symbols[code];
|
||||
_symbols = require('unicode/category/So');
|
||||
removelist = ['sign','cross','of','symbol','staff','hand','black','white']
|
||||
.map(function (word) {return new RegExp(word, 'gi')});
|
||||
return _symbols[code];
|
||||
}
|
||||
|
||||
function slug(string, opts) {
|
||||
string = string.toString();
|
||||
if ('string' === typeof opts)
|
||||
opts = {replacement:opts};
|
||||
opts = opts || {};
|
||||
opts.mode = opts.mode || slug.defaults.mode;
|
||||
var defaults = slug.defaults.modes[opts.mode];
|
||||
var keys = ['replacement','multicharmap','charmap','remove','lower'];
|
||||
for (var key, i = 0, l = keys.length; i < l; i++) { key = keys[i];
|
||||
opts[key] = (key in opts) ? opts[key] : defaults[key];
|
||||
}
|
||||
if ('undefined' === typeof opts.symbols)
|
||||
opts.symbols = defaults.symbols;
|
||||
|
||||
var lengths = [];
|
||||
for (var key in opts.multicharmap) {
|
||||
if (!opts.multicharmap.hasOwnProperty(key))
|
||||
continue;
|
||||
|
||||
var len = key.length;
|
||||
if (lengths.indexOf(len) === -1)
|
||||
lengths.push(len);
|
||||
}
|
||||
|
||||
var code, unicode, result = "";
|
||||
for (var char, i = 0, l = string.length; i < l; i++) { char = string[i];
|
||||
if (!lengths.some(function (len) {
|
||||
var str = string.substr(i, len);
|
||||
if (opts.multicharmap[str]) {
|
||||
i += len - 1;
|
||||
char = opts.multicharmap[str];
|
||||
return true;
|
||||
} else return false;
|
||||
})) {
|
||||
if (opts.charmap[char]) {
|
||||
char = opts.charmap[char];
|
||||
code = char.charCodeAt(0);
|
||||
} else {
|
||||
code = string.charCodeAt(i);
|
||||
}
|
||||
if (opts.symbols && (unicode = symbols(code))) {
|
||||
char = unicode.name.toLowerCase();
|
||||
for(var j = 0, rl = removelist.length; j < rl; j++) {
|
||||
char = char.replace(removelist[j], '');
|
||||
}
|
||||
char = char.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
}
|
||||
char = char.replace(/[^\w\s\-\.\_~]/g, ''); // allowed
|
||||
if (opts.remove) char = char.replace(opts.remove, ''); // add flavour
|
||||
result += char;
|
||||
}
|
||||
result = result.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
|
||||
result = result.replace(/[-\s]+/g, opts.replacement); // convert spaces
|
||||
result = result.replace(opts.replacement+"$",''); // remove trailing separator
|
||||
if (opts.lower)
|
||||
result = result.toLowerCase();
|
||||
return result;
|
||||
};
|
||||
|
||||
slug.defaults = {
|
||||
mode: 'pretty',
|
||||
};
|
||||
|
||||
slug.multicharmap = slug.defaults.multicharmap = {
|
||||
'<3': 'love', '&&': 'and', '||': 'or', 'w/': 'with',
|
||||
};
|
||||
|
||||
// https://code.djangoproject.com/browser/django/trunk/django/contrib/admin/media/js/urlify.js
|
||||
slug.charmap = slug.defaults.charmap = {
|
||||
// latin
|
||||
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE',
|
||||
'Ç': 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I',
|
||||
'Î': 'I', 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O',
|
||||
'Õ': 'O', 'Ö': 'O', 'Ő': 'O', 'Ø': 'O', 'Ù': 'U', 'Ú': 'U', 'Û': 'U',
|
||||
'Ü': 'U', 'Ű': 'U', 'Ý': 'Y', 'Þ': 'TH', 'ß': 'ss', 'à':'a', 'á':'a',
|
||||
'â': 'a', 'ã': 'a', 'ä': 'a', 'å': 'a', 'æ': 'ae', 'ç': 'c', 'è': 'e',
|
||||
'é': 'e', 'ê': 'e', 'ë': 'e', 'ì': 'i', 'í': 'i', 'î': 'i', 'ï': 'i',
|
||||
'ð': 'd', 'ñ': 'n', 'ò': 'o', 'ó': 'o', 'ô': 'o', 'õ': 'o', 'ö': 'o',
|
||||
'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ű': 'u',
|
||||
'ý': 'y', 'þ': 'th', 'ÿ': 'y', 'ẞ': 'SS',
|
||||
// greek
|
||||
'α':'a', 'β':'b', 'γ':'g', 'δ':'d', 'ε':'e', 'ζ':'z', 'η':'h', 'θ':'8',
|
||||
'ι':'i', 'κ':'k', 'λ':'l', 'μ':'m', 'ν':'n', 'ξ':'3', 'ο':'o', 'π':'p',
|
||||
'ρ':'r', 'σ':'s', 'τ':'t', 'υ':'y', 'φ':'f', 'χ':'x', 'ψ':'ps', 'ω':'w',
|
||||
'ά':'a', 'έ':'e', 'ί':'i', 'ό':'o', 'ύ':'y', 'ή':'h', 'ώ':'w', 'ς':'s',
|
||||
'ϊ':'i', 'ΰ':'y', 'ϋ':'y', 'ΐ':'i',
|
||||
'Α':'A', 'Β':'B', 'Γ':'G', 'Δ':'D', 'Ε':'E', 'Ζ':'Z', 'Η':'H', 'Θ':'8',
|
||||
'Ι':'I', 'Κ':'K', 'Λ':'L', 'Μ':'M', 'Ν':'N', 'Ξ':'3', 'Ο':'O', 'Π':'P',
|
||||
'Ρ':'R', 'Σ':'S', 'Τ':'T', 'Υ':'Y', 'Φ':'F', 'Χ':'X', 'Ψ':'PS', 'Ω':'W',
|
||||
'Ά':'A', 'Έ':'E', 'Ί':'I', 'Ό':'O', 'Ύ':'Y', 'Ή':'H', 'Ώ':'W', 'Ϊ':'I',
|
||||
'Ϋ':'Y',
|
||||
// turkish
|
||||
'ş':'s', 'Ş':'S', 'ı':'i', 'İ':'I',
|
||||
'ğ':'g', 'Ğ':'G',
|
||||
// russian
|
||||
'а':'a', 'б':'b', 'в':'v', 'г':'g', 'д':'d', 'е':'e', 'ё':'yo', 'ж':'zh',
|
||||
'з':'z', 'и':'i', 'й':'j', 'к':'k', 'л':'l', 'м':'m', 'н':'n', 'о':'o',
|
||||
'п':'p', 'р':'r', 'с':'s', 'т':'t', 'у':'u', 'ф':'f', 'х':'h', 'ц':'c',
|
||||
'ч':'ch', 'ш':'sh', 'щ':'sh', 'ъ':'u', 'ы':'y', 'ь':'', 'э':'e', 'ю':'yu',
|
||||
'я':'ya',
|
||||
'А':'A', 'Б':'B', 'В':'V', 'Г':'G', 'Д':'D', 'Е':'E', 'Ё':'Yo', 'Ж':'Zh',
|
||||
'З':'Z', 'И':'I', 'Й':'J', 'К':'K', 'Л':'L', 'М':'M', 'Н':'N', 'О':'O',
|
||||
'П':'P', 'Р':'R', 'С':'S', 'Т':'T', 'У':'U', 'Ф':'F', 'Х':'H', 'Ц':'C',
|
||||
'Ч':'Ch', 'Ш':'Sh', 'Щ':'Sh', 'Ъ':'U', 'Ы':'Y', 'Ь':'', 'Э':'E', 'Ю':'Yu',
|
||||
'Я':'Ya',
|
||||
// ukranian
|
||||
'Є':'Ye', 'І':'I', 'Ї':'Yi', 'Ґ':'G', 'є':'ye', 'і':'i', 'ї':'yi', 'ґ':'g',
|
||||
// czech
|
||||
'č':'c', 'ď':'d', 'ě':'e', 'ň': 'n', 'ř':'r', 'š':'s', 'ť':'t', 'ů':'u',
|
||||
'ž':'z', 'Č':'C', 'Ď':'D', 'Ě':'E', 'Ň': 'N', 'Ř':'R', 'Š':'S', 'Ť':'T',
|
||||
'Ů':'U', 'Ž':'Z',
|
||||
// polish
|
||||
'ą':'a', 'ć':'c', 'ę':'e', 'ł':'l', 'ń':'n', 'ś':'s', 'ź':'z',
|
||||
'ż':'z', 'Ą':'A', 'Ć':'C', 'Ę':'E', 'Ł':'L', 'Ń':'N', 'Ś':'S',
|
||||
'Ź':'Z', 'Ż':'Z',
|
||||
// latvian
|
||||
'ā':'a', 'ē':'e', 'ģ':'g', 'ī':'i', 'ķ':'k', 'ļ':'l', 'ņ':'n',
|
||||
'ū':'u', 'Ā':'A', 'Ē':'E', 'Ģ':'G', 'Ī':'I',
|
||||
'Ķ':'K', 'Ļ':'L', 'Ņ':'N', 'Ū':'U',
|
||||
// lithuanian
|
||||
'ė':'e', 'į':'i', 'ų':'u', 'Ė': 'E', 'Į': 'I', 'Ų':'U',
|
||||
// romanian
|
||||
'ț':'t', 'Ț':'T', 'ţ':'t', 'Ţ':'T', 'ș':'s', 'Ș':'S', 'ă':'a', 'Ă':'A',
|
||||
// vietnamese
|
||||
'Ạ': 'A', 'Ả': 'A', 'Ầ': 'A', 'Ấ': 'A', 'Ậ': 'A', 'Ẩ': 'A', 'Ẫ': 'A',
|
||||
'Ằ': 'A', 'Ắ': 'A', 'Ặ': 'A', 'Ẳ': 'A', 'Ẵ': 'A', 'Ẹ': 'E', 'Ẻ': 'E',
|
||||
'Ẽ': 'E', 'Ề': 'E', 'Ế': 'E', 'Ệ': 'E', 'Ể': 'E', 'Ễ': 'E', 'Ị': 'I',
|
||||
'Ỉ': 'I', 'Ĩ': 'I', 'Ọ': 'O', 'Ỏ': 'O', 'Ồ': 'O', 'Ố': 'O', 'Ộ': 'O',
|
||||
'Ổ': 'O', 'Ỗ': 'O', 'Ơ': 'O', 'Ờ': 'O', 'Ớ': 'O', 'Ợ': 'O', 'Ở': 'O',
|
||||
'Ỡ': 'O', 'Ụ': 'U', 'Ủ': 'U', 'Ũ': 'U', 'Ư': 'U', 'Ừ': 'U', 'Ứ': 'U',
|
||||
'Ự': 'U', 'Ử': 'U', 'Ữ': 'U', 'Ỳ': 'Y', 'Ỵ': 'Y', 'Ỷ': 'Y', 'Ỹ': 'Y',
|
||||
'Đ': 'D', 'ạ': 'a', 'ả': 'a', 'ầ': 'a', 'ấ': 'a', 'ậ': 'a', 'ẩ': 'a',
|
||||
'ẫ': 'a', 'ằ': 'a', 'ắ': 'a', 'ặ': 'a', 'ẳ': 'a', 'ẵ': 'a', 'ẹ': 'e',
|
||||
'ẻ': 'e', 'ẽ': 'e', 'ề': 'e', 'ế': 'e', 'ệ': 'e', 'ể': 'e', 'ễ': 'e',
|
||||
'ị': 'i', 'ỉ': 'i', 'ĩ': 'i', 'ọ': 'o', 'ỏ': 'o', 'ồ': 'o', 'ố': 'o',
|
||||
'ộ': 'o', 'ổ': 'o', 'ỗ': 'o', 'ơ': 'o', 'ờ': 'o', 'ớ': 'o', 'ợ': 'o',
|
||||
'ở': 'o', 'ỡ': 'o', 'ụ': 'u', 'ủ': 'u', 'ũ': 'u', 'ư': 'u', 'ừ': 'u',
|
||||
'ứ': 'u', 'ự': 'u', 'ử': 'u', 'ữ': 'u', 'ỳ': 'y', 'ỵ': 'y', 'ỷ': 'y',
|
||||
'ỹ': 'y', 'đ': 'd',
|
||||
// currency
|
||||
'€': 'euro', '₢': 'cruzeiro', '₣': 'french franc', '£': 'pound',
|
||||
'₤': 'lira', '₥': 'mill', '₦': 'naira', '₧': 'peseta', '₨': 'rupee',
|
||||
'₩': 'won', '₪': 'new shequel', '₫': 'dong', '₭': 'kip', '₮': 'tugrik',
|
||||
'₯': 'drachma', '₰': 'penny', '₱': 'peso', '₲': 'guarani', '₳': 'austral',
|
||||
'₴': 'hryvnia', '₵': 'cedi', '¢': 'cent', '¥': 'yen', '元': 'yuan',
|
||||
'円': 'yen', '﷼': 'rial', '₠': 'ecu', '¤': 'currency', '฿': 'baht',
|
||||
"$": 'dollar', '₹': 'indian rupee',
|
||||
// symbols
|
||||
'©':'(c)', 'œ': 'oe', 'Œ': 'OE', '∑': 'sum', '®': '(r)', '†': '+',
|
||||
'“': '"', '”': '"', '‘': "'", '’': "'", '∂': 'd', 'ƒ': 'f', '™': 'tm',
|
||||
'℠': 'sm', '…': '...', '˚': 'o', 'º': 'o', 'ª': 'a', '•': '*',
|
||||
'∆': 'delta', '∞': 'infinity', '♥': 'love', '&': 'and', '|': 'or',
|
||||
'<': 'less', '>': 'greater',
|
||||
};
|
||||
|
||||
slug.defaults.modes = {
|
||||
rfc3986: {
|
||||
replacement: '-',
|
||||
symbols: true,
|
||||
remove: null,
|
||||
lower: true,
|
||||
charmap: slug.defaults.charmap,
|
||||
multicharmap: slug.defaults.multicharmap,
|
||||
},
|
||||
pretty: {
|
||||
replacement: '-',
|
||||
symbols: true,
|
||||
remove: /[.]/g,
|
||||
lower: false,
|
||||
charmap: slug.defaults.charmap,
|
||||
multicharmap: slug.defaults.multicharmap,
|
||||
},
|
||||
};
|
||||
|
||||
// Be compatible with different module systems
|
||||
|
||||
if (typeof define !== 'undefined' && define.amd) { // AMD
|
||||
// dont load symbols table in the browser
|
||||
for (var key in slug.defaults.modes) {
|
||||
if (!slug.defaults.modes.hasOwnProperty(key))
|
||||
continue;
|
||||
|
||||
slug.defaults.modes[key].symbols = false;
|
||||
}
|
||||
define([], function () {return slug});
|
||||
} else if (typeof module !== 'undefined' && module.exports) { // CommonJS
|
||||
symbols(); // preload symbols table
|
||||
module.exports = slug;
|
||||
} else { // Script tag
|
||||
// dont load symbols table in the browser
|
||||
for (var key in slug.defaults.modes) {
|
||||
if (!slug.defaults.modes.hasOwnProperty(key))
|
||||
continue;
|
||||
|
||||
slug.defaults.modes[key].symbols = false;
|
||||
}
|
||||
root.slug = slug;
|
||||
}
|
||||
|
||||
}(this));
|
1491
gui/vendor/sortable.js
vendored
Normal file
1491
gui/vendor/sortable.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
8
gui/vendor/table-editor.min.js
vendored
Normal file
8
gui/vendor/table-editor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1811
gui/vendor/tether.js
vendored
Normal file
1811
gui/vendor/tether.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
140
gui/vendor/tooltip.js
vendored
Normal file
140
gui/vendor/tooltip.js
vendored
Normal file
|
@ -0,0 +1,140 @@
|
|||
// https://github.com/HubSpot/tooltip
|
||||
|
||||
/*! tether-tooltip 1.1.0 */
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(["tether-drop","tether"], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
module.exports = factory(require('tether-drop'), require('tether'));
|
||||
} else {
|
||||
root.Tooltip = factory(root.Drop, root.Tether);
|
||||
}
|
||||
}(this, function(Drop, Tether) {
|
||||
|
||||
/* global Tether Drop */
|
||||
|
||||
'use strict';
|
||||
|
||||
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; }; })();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
var extend = Tether.Utils.extend;
|
||||
|
||||
var _Drop = Drop.createContext({
|
||||
classPrefix: 'tooltip'
|
||||
});
|
||||
|
||||
var defaults = {
|
||||
position: 'top center',
|
||||
openOn: 'hover',
|
||||
classes: 'tooltip-theme-arrows',
|
||||
constrainToWindow: true,
|
||||
constrainToScrollParent: false
|
||||
};
|
||||
|
||||
var tooltipCount = 0;
|
||||
|
||||
var Tooltip = (function () {
|
||||
function Tooltip(options) {
|
||||
_classCallCheck(this, Tooltip);
|
||||
|
||||
this.options = options;
|
||||
|
||||
if (!this.options.target) {
|
||||
throw new Error('Tooltip Error: You must provide a target for Tooltip to attach to');
|
||||
}
|
||||
|
||||
var position = this.options.target.getAttribute('data-tooltip-position');
|
||||
if (position) {
|
||||
if (typeof this.options.position === 'undefined') {
|
||||
this.options.position = position;
|
||||
}
|
||||
}
|
||||
|
||||
var content = this.options.target.getAttribute('data-tooltip');
|
||||
|
||||
if (content) {
|
||||
if (typeof this.options.content === 'undefined') {
|
||||
var contentEl = document.createElement('div');
|
||||
contentEl.innerHTML = content;
|
||||
|
||||
// Add ARIA attributes (see #50)
|
||||
contentEl.setAttribute('role', 'tooltip');
|
||||
contentEl.id = 'drop-tooltip-' + tooltipCount;
|
||||
this.options.target.setAttribute('aria-describedby', contentEl.id);
|
||||
tooltipCount += 1;
|
||||
|
||||
this.options.content = contentEl;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.options.content) {
|
||||
throw new Error('Tooltip Error: You must provide content for Tooltip to display');
|
||||
}
|
||||
|
||||
this.options = extend({}, defaults, this.options);
|
||||
|
||||
this.drop = new _Drop(this.options);
|
||||
}
|
||||
|
||||
_createClass(Tooltip, [{
|
||||
key: 'close',
|
||||
value: function close() {
|
||||
this.drop.close();
|
||||
}
|
||||
}, {
|
||||
key: 'open',
|
||||
value: function open() {
|
||||
this.drop.open();
|
||||
}
|
||||
}, {
|
||||
key: 'toggle',
|
||||
value: function toggle() {
|
||||
this.drop.toggle();
|
||||
}
|
||||
}, {
|
||||
key: 'remove',
|
||||
value: function remove() {
|
||||
this.drop.remove();
|
||||
}
|
||||
}, {
|
||||
key: 'destroy',
|
||||
value: function destroy() {
|
||||
this.drop.destroy();
|
||||
}
|
||||
}, {
|
||||
key: 'position',
|
||||
value: function position() {
|
||||
this.drop.position();
|
||||
}
|
||||
}]);
|
||||
|
||||
return Tooltip;
|
||||
})();
|
||||
|
||||
var initialized = [];
|
||||
|
||||
Tooltip.init = function () {
|
||||
var tooltipElements = document.querySelectorAll('[data-tooltip]');
|
||||
var len = tooltipElements.length;
|
||||
for (var i = 0; i < len; ++i) {
|
||||
var el = tooltipElements[i];
|
||||
if (initialized.indexOf(el) === -1) {
|
||||
new Tooltip({
|
||||
target: el
|
||||
});
|
||||
initialized.push(el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
if (Tooltip.autoinit !== false) {
|
||||
Tooltip.init();
|
||||
}
|
||||
});
|
||||
return Tooltip;
|
||||
|
||||
}));
|
1548
gui/vendor/underscore.js
vendored
Normal file
1548
gui/vendor/underscore.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
4706
gui/vendor/velocity.js
vendored
Executable file
4706
gui/vendor/velocity.js
vendored
Executable file
File diff suppressed because it is too large
Load diff
804
gui/vendor/velocity.ui.js
vendored
Executable file
804
gui/vendor/velocity.ui.js
vendored
Executable file
|
@ -0,0 +1,804 @@
|
|||
/**********************
|
||||
Velocity UI Pack
|
||||
**********************/
|
||||
|
||||
/* VelocityJS.org UI Pack (5.2.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License. Portions copyright Daniel Eden, Christian Pucci. */
|
||||
|
||||
(function(factory) {
|
||||
"use strict";
|
||||
/* CommonJS module. */
|
||||
if (typeof require === "function" && typeof exports === "object") {
|
||||
module.exports = factory();
|
||||
/* AMD module. */
|
||||
} else if (typeof define === "function" && define.amd) {
|
||||
define(["velocity"], factory);
|
||||
/* Browser globals. */
|
||||
} else {
|
||||
factory();
|
||||
}
|
||||
}(function() {
|
||||
"use strict";
|
||||
return function(global, window, document, undefined) {
|
||||
|
||||
/*************
|
||||
Checks
|
||||
*************/
|
||||
var Velocity = global.Velocity;
|
||||
|
||||
if (!Velocity || !Velocity.Utilities) {
|
||||
if (window.console) {
|
||||
console.log("Velocity UI Pack: Velocity must be loaded first. Aborting.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
var $ = Velocity.Utilities;
|
||||
|
||||
var velocityVersion = Velocity.version,
|
||||
requiredVersion = {major: 1, minor: 1, patch: 0};
|
||||
|
||||
function greaterSemver(primary, secondary) {
|
||||
var versionInts = [];
|
||||
|
||||
if (!primary || !secondary) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each([primary, secondary], function(i, versionObject) {
|
||||
var versionIntsComponents = [];
|
||||
|
||||
$.each(versionObject, function(component, value) {
|
||||
while (value.toString().length < 5) {
|
||||
value = "0" + value;
|
||||
}
|
||||
versionIntsComponents.push(value);
|
||||
});
|
||||
|
||||
versionInts.push(versionIntsComponents.join(""));
|
||||
});
|
||||
|
||||
return (parseFloat(versionInts[0]) > parseFloat(versionInts[1]));
|
||||
}
|
||||
|
||||
if (greaterSemver(requiredVersion, velocityVersion)) {
|
||||
var abortError = "Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";
|
||||
alert(abortError);
|
||||
throw new Error(abortError);
|
||||
}
|
||||
|
||||
/************************
|
||||
Effect Registration
|
||||
************************/
|
||||
|
||||
/* Note: RegisterUI is a legacy name. */
|
||||
Velocity.RegisterEffect = Velocity.RegisterUI = function(effectName, properties) {
|
||||
/* Animate the expansion/contraction of the elements' parent's height for In/Out effects. */
|
||||
function animateParentHeight(elements, direction, totalDuration, stagger) {
|
||||
var totalHeightDelta = 0,
|
||||
parentNode;
|
||||
|
||||
/* Sum the total height (including padding and margin) of all targeted elements. */
|
||||
$.each(elements.nodeType ? [elements] : elements, function(i, element) {
|
||||
if (stagger) {
|
||||
/* Increase the totalDuration by the successive delay amounts produced by the stagger option. */
|
||||
totalDuration += i * stagger;
|
||||
}
|
||||
|
||||
parentNode = element.parentNode;
|
||||
|
||||
var propertiesToSum = ["height", "paddingTop", "paddingBottom", "marginTop", "marginBottom"];
|
||||
|
||||
/* If box-sizing is border-box, the height already includes padding and margin */
|
||||
if (Velocity.CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() === "border-box") {
|
||||
propertiesToSum = ["height"];
|
||||
}
|
||||
|
||||
$.each(propertiesToSum, function(i, property) {
|
||||
totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property));
|
||||
});
|
||||
});
|
||||
|
||||
/* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */
|
||||
Velocity.animate(
|
||||
parentNode,
|
||||
{height: (direction === "In" ? "+" : "-") + "=" + totalHeightDelta},
|
||||
{queue: false, easing: "ease-in-out", duration: totalDuration * (direction === "In" ? 0.6 : 1)}
|
||||
);
|
||||
}
|
||||
|
||||
/* Register a custom redirect for each effect. */
|
||||
Velocity.Redirects[effectName] = function(element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop) {
|
||||
var finalElement = (elementsIndex === elementsSize - 1),
|
||||
totalDuration = 0;
|
||||
|
||||
loop = loop || properties.loop;
|
||||
if (typeof properties.defaultDuration === "function") {
|
||||
properties.defaultDuration = properties.defaultDuration.call(elements, elements);
|
||||
} else {
|
||||
properties.defaultDuration = parseFloat(properties.defaultDuration);
|
||||
}
|
||||
|
||||
/* Get the total duration used, so we can share it out with everything that doesn't have a duration */
|
||||
for (var callIndex = 0; callIndex < properties.calls.length; callIndex++) {
|
||||
durationPercentage = properties.calls[callIndex][1];
|
||||
if (typeof durationPercentage === "number") {
|
||||
totalDuration += durationPercentage;
|
||||
}
|
||||
}
|
||||
var shareDuration = totalDuration >= 1 ? 0 : properties.calls.length ? (1 - totalDuration) / properties.calls.length : 1;
|
||||
|
||||
/* Iterate through each effect's call array. */
|
||||
for (callIndex = 0; callIndex < properties.calls.length; callIndex++) {
|
||||
var call = properties.calls[callIndex],
|
||||
propertyMap = call[0],
|
||||
redirectDuration = 1000,
|
||||
durationPercentage = call[1],
|
||||
callOptions = call[2] || {},
|
||||
opts = {};
|
||||
|
||||
if (redirectOptions.duration !== undefined) {
|
||||
redirectDuration = redirectOptions.duration;
|
||||
} else if (properties.defaultDuration !== undefined) {
|
||||
redirectDuration = properties.defaultDuration;
|
||||
}
|
||||
|
||||
/* Assign the whitelisted per-call options. */
|
||||
opts.duration = redirectDuration * (typeof durationPercentage === "number" ? durationPercentage : shareDuration);
|
||||
opts.queue = redirectOptions.queue || "";
|
||||
opts.easing = callOptions.easing || "ease";
|
||||
opts.delay = parseFloat(callOptions.delay) || 0;
|
||||
opts.loop = !properties.loop && callOptions.loop;
|
||||
opts._cacheValues = callOptions._cacheValues || true;
|
||||
|
||||
/* Special processing for the first effect call. */
|
||||
if (callIndex === 0) {
|
||||
/* If a delay was passed into the redirect, combine it with the first call's delay. */
|
||||
opts.delay += (parseFloat(redirectOptions.delay) || 0);
|
||||
|
||||
if (elementsIndex === 0) {
|
||||
opts.begin = function() {
|
||||
/* Only trigger a begin callback on the first effect call with the first element in the set. */
|
||||
if (redirectOptions.begin) {
|
||||
redirectOptions.begin.call(elements, elements);
|
||||
}
|
||||
|
||||
var direction = effectName.match(/(In|Out)$/);
|
||||
|
||||
/* Make "in" transitioning elements invisible immediately so that there's no FOUC between now
|
||||
and the first RAF tick. */
|
||||
if ((direction && direction[0] === "In") && propertyMap.opacity !== undefined) {
|
||||
$.each(elements.nodeType ? [elements] : elements, function(i, element) {
|
||||
Velocity.CSS.setPropertyValue(element, "opacity", 0);
|
||||
});
|
||||
}
|
||||
|
||||
/* Only trigger animateParentHeight() if we're using an In/Out transition. */
|
||||
if (redirectOptions.animateParentHeight && direction) {
|
||||
animateParentHeight(elements, direction[0], redirectDuration + opts.delay, redirectOptions.stagger);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* If the user isn't overriding the display option, default to "auto" for "In"-suffixed transitions. */
|
||||
if (redirectOptions.display !== null) {
|
||||
if (redirectOptions.display !== undefined && redirectOptions.display !== "none") {
|
||||
opts.display = redirectOptions.display;
|
||||
} else if (/In$/.test(effectName)) {
|
||||
/* Inline elements cannot be subjected to transforms, so we switch them to inline-block. */
|
||||
var defaultDisplay = Velocity.CSS.Values.getDisplayType(element);
|
||||
opts.display = (defaultDisplay === "inline") ? "inline-block" : defaultDisplay;
|
||||
}
|
||||
}
|
||||
|
||||
if (redirectOptions.visibility && redirectOptions.visibility !== "hidden") {
|
||||
opts.visibility = redirectOptions.visibility;
|
||||
}
|
||||
}
|
||||
|
||||
/* Special processing for the last effect call. */
|
||||
if (callIndex === properties.calls.length - 1) {
|
||||
/* Append promise resolving onto the user's redirect callback. */
|
||||
var injectFinalCallbacks = function() {
|
||||
if ((redirectOptions.display === undefined || redirectOptions.display === "none") && /Out$/.test(effectName)) {
|
||||
$.each(elements.nodeType ? [elements] : elements, function(i, element) {
|
||||
Velocity.CSS.setPropertyValue(element, "display", "none");
|
||||
});
|
||||
}
|
||||
if (redirectOptions.complete) {
|
||||
redirectOptions.complete.call(elements, elements);
|
||||
}
|
||||
if (promiseData) {
|
||||
promiseData.resolver(elements || element);
|
||||
}
|
||||
};
|
||||
|
||||
opts.complete = function() {
|
||||
if (loop) {
|
||||
Velocity.Redirects[effectName](element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop === true ? true : Math.max(0, loop - 1));
|
||||
}
|
||||
if (properties.reset) {
|
||||
for (var resetProperty in properties.reset) {
|
||||
if (!properties.reset.hasOwnProperty(resetProperty)) {
|
||||
continue;
|
||||
}
|
||||
var resetValue = properties.reset[resetProperty];
|
||||
|
||||
/* Format each non-array value in the reset property map to [ value, value ] so that changes apply
|
||||
immediately and DOM querying is avoided (via forcefeeding). */
|
||||
/* Note: Don't forcefeed hooks, otherwise their hook roots will be defaulted to their null values. */
|
||||
if (Velocity.CSS.Hooks.registered[resetProperty] === undefined && (typeof resetValue === "string" || typeof resetValue === "number")) {
|
||||
properties.reset[resetProperty] = [properties.reset[resetProperty], properties.reset[resetProperty]];
|
||||
}
|
||||
}
|
||||
|
||||
/* So that the reset values are applied instantly upon the next rAF tick, use a zero duration and parallel queueing. */
|
||||
var resetOptions = {duration: 0, queue: false};
|
||||
|
||||
/* Since the reset option uses up the complete callback, we trigger the user's complete callback at the end of ours. */
|
||||
if (finalElement) {
|
||||
resetOptions.complete = injectFinalCallbacks;
|
||||
}
|
||||
|
||||
Velocity.animate(element, properties.reset, resetOptions);
|
||||
/* Only trigger the user's complete callback on the last effect call with the last element in the set. */
|
||||
} else if (finalElement) {
|
||||
injectFinalCallbacks();
|
||||
}
|
||||
};
|
||||
|
||||
if (redirectOptions.visibility === "hidden") {
|
||||
opts.visibility = redirectOptions.visibility;
|
||||
}
|
||||
}
|
||||
|
||||
Velocity.animate(element, propertyMap, opts);
|
||||
}
|
||||
};
|
||||
|
||||
/* Return the Velocity object so that RegisterUI calls can be chained. */
|
||||
return Velocity;
|
||||
};
|
||||
|
||||
/*********************
|
||||
Packaged Effects
|
||||
*********************/
|
||||
|
||||
/* Externalize the packagedEffects data so that they can optionally be modified and re-registered. */
|
||||
/* Support: <=IE8: Callouts will have no effect, and transitions will simply fade in/out. IE9/Android 2.3: Most effects are fully supported, the rest fade in/out. All other browsers: full support. */
|
||||
Velocity.RegisterEffect.packagedEffects =
|
||||
{
|
||||
/* Animate.css */
|
||||
"callout.bounce": {
|
||||
defaultDuration: 550,
|
||||
calls: [
|
||||
[{translateY: -30}, 0.25],
|
||||
[{translateY: 0}, 0.125],
|
||||
[{translateY: -15}, 0.125],
|
||||
[{translateY: 0}, 0.25]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.shake": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{translateX: -11}],
|
||||
[{translateX: 11}],
|
||||
[{translateX: -11}],
|
||||
[{translateX: 11}],
|
||||
[{translateX: -11}],
|
||||
[{translateX: 11}],
|
||||
[{translateX: -11}],
|
||||
[{translateX: 0}]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.flash": {
|
||||
defaultDuration: 1100,
|
||||
calls: [
|
||||
[{opacity: [0, "easeInOutQuad", 1]}],
|
||||
[{opacity: [1, "easeInOutQuad"]}],
|
||||
[{opacity: [0, "easeInOutQuad"]}],
|
||||
[{opacity: [1, "easeInOutQuad"]}]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.pulse": {
|
||||
defaultDuration: 825,
|
||||
calls: [
|
||||
[{scaleX: 1.1, scaleY: 1.1}, 0.50, {easing: "easeInExpo"}],
|
||||
[{scaleX: 1, scaleY: 1}, 0.50]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.swing": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{rotateZ: 15}],
|
||||
[{rotateZ: -10}],
|
||||
[{rotateZ: 5}],
|
||||
[{rotateZ: -5}],
|
||||
[{rotateZ: 0}]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.tada": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{scaleX: 0.9, scaleY: 0.9, rotateZ: -3}, 0.10],
|
||||
[{scaleX: 1.1, scaleY: 1.1, rotateZ: 3}, 0.10],
|
||||
[{scaleX: 1.1, scaleY: 1.1, rotateZ: -3}, 0.10],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
[{scaleX: 1, scaleY: 1, rotateZ: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
"transition.fadeIn": {
|
||||
defaultDuration: 500,
|
||||
calls: [
|
||||
[{opacity: [1, 0]}]
|
||||
]
|
||||
},
|
||||
"transition.fadeOut": {
|
||||
defaultDuration: 500,
|
||||
calls: [
|
||||
[{opacity: [0, 1]}]
|
||||
]
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipXIn": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], rotateY: [0, -55]}]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipXOut": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], rotateY: 55}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateY: 0}
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipYIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], rotateX: [0, -45]}]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipYOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], rotateX: 25}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateX: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceXIn": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [0.725, 0], transformPerspective: [400, 400], rotateY: [-10, 90]}, 0.50],
|
||||
[{opacity: 0.80, rotateY: 10}, 0.25],
|
||||
[{opacity: 1, rotateY: 0}, 0.25]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceXOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0.9, 1], transformPerspective: [400, 400], rotateY: -10}],
|
||||
[{opacity: 0, rotateY: 90}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateY: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceYIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0.725, 0], transformPerspective: [400, 400], rotateX: [-10, 90]}, 0.50],
|
||||
[{opacity: 0.80, rotateX: 10}, 0.25],
|
||||
[{opacity: 1, rotateX: 0}, 0.25]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceYOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0.9, 1], transformPerspective: [400, 400], rotateX: -15}],
|
||||
[{opacity: 0, rotateX: 90}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
"transition.swoopIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["100%", "50%"], transformOriginY: ["100%", "100%"], scaleX: [1, 0], scaleY: [1, 0], translateX: [0, -700], translateZ: 0}]
|
||||
],
|
||||
reset: {transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
"transition.swoopOut": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformOriginX: ["50%", "100%"], transformOriginY: ["100%", "100%"], scaleX: 0, scaleY: 0, translateX: -700, translateZ: 0}]
|
||||
],
|
||||
reset: {transformOriginX: "50%", transformOriginY: "50%", scaleX: 1, scaleY: 1, translateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */
|
||||
"transition.whirlIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0], scaleY: [1, 0], rotateY: [0, 160]}, 1, {easing: "easeInOutSine"}]
|
||||
]
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */
|
||||
"transition.whirlOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [0, "easeInOutQuint", 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0, scaleY: 0, rotateY: 160}, 1, {easing: "swing"}]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1, rotateY: 0}
|
||||
},
|
||||
"transition.shrinkIn": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 1.5], scaleY: [1, 1.5], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.shrinkOut": {
|
||||
defaultDuration: 600,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 1.3, scaleY: 1.3, translateZ: 0}]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1}
|
||||
},
|
||||
"transition.expandIn": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0.625], scaleY: [1, 0.625], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.expandOut": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0.5, scaleY: 0.5, translateZ: 0}]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], scaleX: [1.05, 0.3], scaleY: [1.05, 0.3]}, 0.35],
|
||||
[{scaleX: 0.9, scaleY: 0.9, translateZ: 0}, 0.20],
|
||||
[{scaleX: 1, scaleY: 1}, 0.45]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{scaleX: 0.95, scaleY: 0.95}, 0.35],
|
||||
[{scaleX: 1.1, scaleY: 1.1, translateZ: 0}, 0.35],
|
||||
[{opacity: [0, 1], scaleX: 0.3, scaleY: 0.3}, 0.30]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceUpIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [-30, 1000]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateY: 10}, 0.20],
|
||||
[{translateY: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceUpOut": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{translateY: 20}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateY: -1000}, 0.80]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceDownIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [30, -1000]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateY: -10}, 0.20],
|
||||
[{translateY: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceDownOut": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{translateY: -20}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateY: 1000}, 0.80]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceLeftIn": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [30, -1250]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateX: -10}, 0.20],
|
||||
[{translateX: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceLeftOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{translateX: 30}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateX: -1250}, 0.80]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceRightIn": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [-30, 1250]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateX: 10}, 0.20],
|
||||
[{translateX: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceRightOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{translateX: -30}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateX: 1250}, 0.80]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideUpIn": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, 20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideUpOut": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: -20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideDownIn": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, -20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideDownOut": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: 20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideLeftIn": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, -20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideLeftOut": {
|
||||
defaultDuration: 1050,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: -20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideRightIn": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, 20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideRightOut": {
|
||||
defaultDuration: 1050,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: 20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideUpBigIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, 75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideUpBigOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: -75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideDownBigIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, -75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideDownBigOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: 75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideLeftBigIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, -75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideLeftBigOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: -75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideRightBigIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, 75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideRightBigOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: 75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
"transition.perspectiveUpIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: [0, -180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveUpOut": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: -180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveDownIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: [0, 180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveDownOut": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: 180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveLeftIn": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: [0, -180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveLeftOut": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: -180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveRightIn": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: [0, 180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveRightOut": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: 180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0}
|
||||
}
|
||||
};
|
||||
|
||||
/* Register the packaged effects. */
|
||||
for (var effectName in Velocity.RegisterEffect.packagedEffects) {
|
||||
if (Velocity.RegisterEffect.packagedEffects.hasOwnProperty(effectName)) {
|
||||
Velocity.RegisterEffect(effectName, Velocity.RegisterEffect.packagedEffects[effectName]);
|
||||
}
|
||||
}
|
||||
|
||||
/*********************
|
||||
Sequence Running
|
||||
**********************/
|
||||
|
||||
/* Note: Sequence calls must use Velocity's single-object arguments syntax. */
|
||||
Velocity.RunSequence = function(originalSequence) {
|
||||
var sequence = $.extend(true, [], originalSequence);
|
||||
|
||||
if (sequence.length > 1) {
|
||||
$.each(sequence.reverse(), function(i, currentCall) {
|
||||
var nextCall = sequence[i + 1];
|
||||
|
||||
if (nextCall) {
|
||||
/* Parallel sequence calls (indicated via sequenceQueue:false) are triggered
|
||||
in the previous call's begin callback. Otherwise, chained calls are normally triggered
|
||||
in the previous call's complete callback. */
|
||||
var currentCallOptions = currentCall.o || currentCall.options,
|
||||
nextCallOptions = nextCall.o || nextCall.options;
|
||||
|
||||
var timing = (currentCallOptions && currentCallOptions.sequenceQueue === false) ? "begin" : "complete",
|
||||
callbackOriginal = nextCallOptions && nextCallOptions[timing],
|
||||
options = {};
|
||||
|
||||
options[timing] = function() {
|
||||
var nextCallElements = nextCall.e || nextCall.elements;
|
||||
var elements = nextCallElements.nodeType ? [nextCallElements] : nextCallElements;
|
||||
|
||||
if (callbackOriginal) {
|
||||
callbackOriginal.call(elements, elements);
|
||||
}
|
||||
Velocity(currentCall);
|
||||
};
|
||||
|
||||
if (nextCall.o) {
|
||||
nextCall.o = $.extend({}, nextCallOptions, options);
|
||||
} else {
|
||||
nextCall.options = $.extend({}, nextCallOptions, options);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sequence.reverse();
|
||||
}
|
||||
|
||||
Velocity(sequence[0]);
|
||||
};
|
||||
}((window.jQuery || window.Zepto || window), window, (window ? window.document : undefined));
|
||||
}));
|
939
gui/vendor/waypoints.js
vendored
Normal file
939
gui/vendor/waypoints.js
vendored
Normal file
|
@ -0,0 +1,939 @@
|
|||
/*!
|
||||
Waypoints - 4.0.1
|
||||
Copyright © 2011-2016 Caleb Troughton
|
||||
Licensed under the MIT license.
|
||||
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
|
||||
*/
|
||||
(function() {
|
||||
'use strict'
|
||||
|
||||
var keyCounter = 0
|
||||
var allWaypoints = {}
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/waypoint */
|
||||
function Waypoint(options) {
|
||||
if (!options) {
|
||||
throw new Error('No options passed to Waypoint constructor')
|
||||
}
|
||||
if (!options.element) {
|
||||
throw new Error('No element option passed to Waypoint constructor')
|
||||
}
|
||||
if (!options.handler) {
|
||||
throw new Error('No handler option passed to Waypoint constructor')
|
||||
}
|
||||
|
||||
this.key = 'waypoint-' + keyCounter
|
||||
this.options = Waypoint.Adapter.extend({}, Waypoint.defaults, options)
|
||||
this.element = this.options.element
|
||||
this.adapter = new Waypoint.Adapter(this.element)
|
||||
this.callback = options.handler
|
||||
this.axis = this.options.horizontal ? 'horizontal' : 'vertical'
|
||||
this.enabled = this.options.enabled
|
||||
this.triggerPoint = null
|
||||
this.group = Waypoint.Group.findOrCreate({
|
||||
name: this.options.group,
|
||||
axis: this.axis
|
||||
})
|
||||
this.context = Waypoint.Context.findOrCreateByElement(this.options.context)
|
||||
|
||||
if (Waypoint.offsetAliases[this.options.offset]) {
|
||||
this.options.offset = Waypoint.offsetAliases[this.options.offset]
|
||||
}
|
||||
this.group.add(this)
|
||||
this.context.add(this)
|
||||
allWaypoints[this.key] = this
|
||||
keyCounter += 1
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.prototype.queueTrigger = function(direction) {
|
||||
this.group.queueTrigger(this, direction)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.prototype.trigger = function(args) {
|
||||
if (!this.enabled) {
|
||||
return
|
||||
}
|
||||
if (this.callback) {
|
||||
this.callback.apply(this, args)
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/destroy */
|
||||
Waypoint.prototype.destroy = function() {
|
||||
this.context.remove(this)
|
||||
this.group.remove(this)
|
||||
delete allWaypoints[this.key]
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/disable */
|
||||
Waypoint.prototype.disable = function() {
|
||||
this.enabled = false
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/enable */
|
||||
Waypoint.prototype.enable = function() {
|
||||
this.context.refresh()
|
||||
this.enabled = true
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/next */
|
||||
Waypoint.prototype.next = function() {
|
||||
return this.group.next(this)
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/previous */
|
||||
Waypoint.prototype.previous = function() {
|
||||
return this.group.previous(this)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Waypoint.invokeAll = function(method) {
|
||||
var allWaypointsArray = []
|
||||
for (var waypointKey in allWaypoints) {
|
||||
allWaypointsArray.push(allWaypoints[waypointKey])
|
||||
}
|
||||
for (var i = 0, end = allWaypointsArray.length; i < end; i++) {
|
||||
allWaypointsArray[i][method]()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/destroy-all */
|
||||
Waypoint.destroyAll = function() {
|
||||
Waypoint.invokeAll('destroy')
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/disable-all */
|
||||
Waypoint.disableAll = function() {
|
||||
Waypoint.invokeAll('disable')
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/enable-all */
|
||||
Waypoint.enableAll = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
for (var waypointKey in allWaypoints) {
|
||||
allWaypoints[waypointKey].enabled = true
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/refresh-all */
|
||||
Waypoint.refreshAll = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/viewport-height */
|
||||
Waypoint.viewportHeight = function() {
|
||||
return window.innerHeight || document.documentElement.clientHeight
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/viewport-width */
|
||||
Waypoint.viewportWidth = function() {
|
||||
return document.documentElement.clientWidth
|
||||
}
|
||||
|
||||
Waypoint.adapters = []
|
||||
|
||||
Waypoint.defaults = {
|
||||
context: window,
|
||||
continuous: true,
|
||||
enabled: true,
|
||||
group: 'default',
|
||||
horizontal: false,
|
||||
offset: 0
|
||||
}
|
||||
|
||||
Waypoint.offsetAliases = {
|
||||
'bottom-in-view': function() {
|
||||
return this.context.innerHeight() - this.adapter.outerHeight()
|
||||
},
|
||||
'right-in-view': function() {
|
||||
return this.context.innerWidth() - this.adapter.outerWidth()
|
||||
}
|
||||
}
|
||||
|
||||
window.Waypoint = Waypoint
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
function requestAnimationFrameShim(callback) {
|
||||
window.setTimeout(callback, 1000 / 60)
|
||||
}
|
||||
|
||||
var keyCounter = 0
|
||||
var contexts = {}
|
||||
var Waypoint = window.Waypoint
|
||||
var oldWindowLoad = window.onload
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/context */
|
||||
function Context(element) {
|
||||
this.element = element
|
||||
this.Adapter = Waypoint.Adapter
|
||||
this.adapter = new this.Adapter(element)
|
||||
this.key = 'waypoint-context-' + keyCounter
|
||||
this.didScroll = false
|
||||
this.didResize = false
|
||||
this.oldScroll = {
|
||||
x: this.adapter.scrollLeft(),
|
||||
y: this.adapter.scrollTop()
|
||||
}
|
||||
this.waypoints = {
|
||||
vertical: {},
|
||||
horizontal: {}
|
||||
}
|
||||
|
||||
element.waypointContextKey = this.key
|
||||
contexts[element.waypointContextKey] = this
|
||||
keyCounter += 1
|
||||
if (!Waypoint.windowContext) {
|
||||
Waypoint.windowContext = true
|
||||
Waypoint.windowContext = new Context(window)
|
||||
}
|
||||
|
||||
this.createThrottledScrollHandler()
|
||||
this.createThrottledResizeHandler()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.add = function(waypoint) {
|
||||
var axis = waypoint.options.horizontal ? 'horizontal' : 'vertical'
|
||||
this.waypoints[axis][waypoint.key] = waypoint
|
||||
this.refresh()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.checkEmpty = function() {
|
||||
var horizontalEmpty = this.Adapter.isEmptyObject(this.waypoints.horizontal)
|
||||
var verticalEmpty = this.Adapter.isEmptyObject(this.waypoints.vertical)
|
||||
var isWindow = this.element == this.element.window
|
||||
if (horizontalEmpty && verticalEmpty && !isWindow) {
|
||||
this.adapter.off('.waypoints')
|
||||
delete contexts[this.key]
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.createThrottledResizeHandler = function() {
|
||||
var self = this
|
||||
|
||||
function resizeHandler() {
|
||||
self.handleResize()
|
||||
self.didResize = false
|
||||
}
|
||||
|
||||
this.adapter.on('resize.waypoints', function() {
|
||||
if (!self.didResize) {
|
||||
self.didResize = true
|
||||
Waypoint.requestAnimationFrame(resizeHandler)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.createThrottledScrollHandler = function() {
|
||||
var self = this
|
||||
function scrollHandler() {
|
||||
self.handleScroll()
|
||||
self.didScroll = false
|
||||
}
|
||||
|
||||
this.adapter.on('scroll.waypoints', function() {
|
||||
if (!self.didScroll || Waypoint.isTouch) {
|
||||
self.didScroll = true
|
||||
Waypoint.requestAnimationFrame(scrollHandler)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.handleResize = function() {
|
||||
Waypoint.Context.refreshAll()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.handleScroll = function() {
|
||||
var triggeredGroups = {}
|
||||
var axes = {
|
||||
horizontal: {
|
||||
newScroll: this.adapter.scrollLeft(),
|
||||
oldScroll: this.oldScroll.x,
|
||||
forward: 'right',
|
||||
backward: 'left'
|
||||
},
|
||||
vertical: {
|
||||
newScroll: this.adapter.scrollTop(),
|
||||
oldScroll: this.oldScroll.y,
|
||||
forward: 'down',
|
||||
backward: 'up'
|
||||
}
|
||||
}
|
||||
|
||||
for (var axisKey in axes) {
|
||||
var axis = axes[axisKey]
|
||||
var isForward = axis.newScroll > axis.oldScroll
|
||||
var direction = isForward ? axis.forward : axis.backward
|
||||
|
||||
for (var waypointKey in this.waypoints[axisKey]) {
|
||||
var waypoint = this.waypoints[axisKey][waypointKey]
|
||||
if (waypoint.triggerPoint === null) {
|
||||
continue
|
||||
}
|
||||
var wasBeforeTriggerPoint = axis.oldScroll < waypoint.triggerPoint
|
||||
var nowAfterTriggerPoint = axis.newScroll >= waypoint.triggerPoint
|
||||
var crossedForward = wasBeforeTriggerPoint && nowAfterTriggerPoint
|
||||
var crossedBackward = !wasBeforeTriggerPoint && !nowAfterTriggerPoint
|
||||
if (crossedForward || crossedBackward) {
|
||||
waypoint.queueTrigger(direction)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var groupKey in triggeredGroups) {
|
||||
triggeredGroups[groupKey].flushTriggers()
|
||||
}
|
||||
|
||||
this.oldScroll = {
|
||||
x: axes.horizontal.newScroll,
|
||||
y: axes.vertical.newScroll
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.innerHeight = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
if (this.element == this.element.window) {
|
||||
return Waypoint.viewportHeight()
|
||||
}
|
||||
/*eslint-enable eqeqeq */
|
||||
return this.adapter.innerHeight()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.remove = function(waypoint) {
|
||||
delete this.waypoints[waypoint.axis][waypoint.key]
|
||||
this.checkEmpty()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.prototype.innerWidth = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
if (this.element == this.element.window) {
|
||||
return Waypoint.viewportWidth()
|
||||
}
|
||||
/*eslint-enable eqeqeq */
|
||||
return this.adapter.innerWidth()
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-destroy */
|
||||
Context.prototype.destroy = function() {
|
||||
var allWaypoints = []
|
||||
for (var axis in this.waypoints) {
|
||||
for (var waypointKey in this.waypoints[axis]) {
|
||||
allWaypoints.push(this.waypoints[axis][waypointKey])
|
||||
}
|
||||
}
|
||||
for (var i = 0, end = allWaypoints.length; i < end; i++) {
|
||||
allWaypoints[i].destroy()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-refresh */
|
||||
Context.prototype.refresh = function() {
|
||||
/*eslint-disable eqeqeq */
|
||||
var isWindow = this.element == this.element.window
|
||||
/*eslint-enable eqeqeq */
|
||||
var contextOffset = isWindow ? undefined : this.adapter.offset()
|
||||
var triggeredGroups = {}
|
||||
var axes
|
||||
|
||||
this.handleScroll()
|
||||
axes = {
|
||||
horizontal: {
|
||||
contextOffset: isWindow ? 0 : contextOffset.left,
|
||||
contextScroll: isWindow ? 0 : this.oldScroll.x,
|
||||
contextDimension: this.innerWidth(),
|
||||
oldScroll: this.oldScroll.x,
|
||||
forward: 'right',
|
||||
backward: 'left',
|
||||
offsetProp: 'left'
|
||||
},
|
||||
vertical: {
|
||||
contextOffset: isWindow ? 0 : contextOffset.top,
|
||||
contextScroll: isWindow ? 0 : this.oldScroll.y,
|
||||
contextDimension: this.innerHeight(),
|
||||
oldScroll: this.oldScroll.y,
|
||||
forward: 'down',
|
||||
backward: 'up',
|
||||
offsetProp: 'top'
|
||||
}
|
||||
}
|
||||
|
||||
for (var axisKey in axes) {
|
||||
var axis = axes[axisKey]
|
||||
for (var waypointKey in this.waypoints[axisKey]) {
|
||||
var waypoint = this.waypoints[axisKey][waypointKey]
|
||||
var adjustment = waypoint.options.offset
|
||||
var oldTriggerPoint = waypoint.triggerPoint
|
||||
var elementOffset = 0
|
||||
var freshWaypoint = oldTriggerPoint == null
|
||||
var contextModifier, wasBeforeScroll, nowAfterScroll
|
||||
var triggeredBackward, triggeredForward
|
||||
|
||||
if (waypoint.element !== waypoint.element.window) {
|
||||
elementOffset = waypoint.adapter.offset()[axis.offsetProp]
|
||||
}
|
||||
|
||||
if (typeof adjustment === 'function') {
|
||||
adjustment = adjustment.apply(waypoint)
|
||||
}
|
||||
else if (typeof adjustment === 'string') {
|
||||
adjustment = parseFloat(adjustment)
|
||||
if (waypoint.options.offset.indexOf('%') > - 1) {
|
||||
adjustment = Math.ceil(axis.contextDimension * adjustment / 100)
|
||||
}
|
||||
}
|
||||
|
||||
contextModifier = axis.contextScroll - axis.contextOffset
|
||||
waypoint.triggerPoint = Math.floor(elementOffset + contextModifier - adjustment)
|
||||
wasBeforeScroll = oldTriggerPoint < axis.oldScroll
|
||||
nowAfterScroll = waypoint.triggerPoint >= axis.oldScroll
|
||||
triggeredBackward = wasBeforeScroll && nowAfterScroll
|
||||
triggeredForward = !wasBeforeScroll && !nowAfterScroll
|
||||
|
||||
if (!freshWaypoint && triggeredBackward) {
|
||||
waypoint.queueTrigger(axis.backward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
else if (!freshWaypoint && triggeredForward) {
|
||||
waypoint.queueTrigger(axis.forward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
else if (freshWaypoint && axis.oldScroll >= waypoint.triggerPoint) {
|
||||
waypoint.queueTrigger(axis.forward)
|
||||
triggeredGroups[waypoint.group.id] = waypoint.group
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Waypoint.requestAnimationFrame(function() {
|
||||
for (var groupKey in triggeredGroups) {
|
||||
triggeredGroups[groupKey].flushTriggers()
|
||||
}
|
||||
})
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.findOrCreateByElement = function(element) {
|
||||
return Context.findByElement(element) || new Context(element)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Context.refreshAll = function() {
|
||||
for (var contextId in contexts) {
|
||||
contexts[contextId].refresh()
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/context-find-by-element */
|
||||
Context.findByElement = function(element) {
|
||||
return contexts[element.waypointContextKey]
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
if (oldWindowLoad) {
|
||||
oldWindowLoad()
|
||||
}
|
||||
Context.refreshAll()
|
||||
}
|
||||
|
||||
|
||||
Waypoint.requestAnimationFrame = function(callback) {
|
||||
var requestFn = window.requestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
requestAnimationFrameShim
|
||||
requestFn.call(window, callback)
|
||||
}
|
||||
Waypoint.Context = Context
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
function byTriggerPoint(a, b) {
|
||||
return a.triggerPoint - b.triggerPoint
|
||||
}
|
||||
|
||||
function byReverseTriggerPoint(a, b) {
|
||||
return b.triggerPoint - a.triggerPoint
|
||||
}
|
||||
|
||||
var groups = {
|
||||
vertical: {},
|
||||
horizontal: {}
|
||||
}
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
/* http://imakewebthings.com/waypoints/api/group */
|
||||
function Group(options) {
|
||||
this.name = options.name
|
||||
this.axis = options.axis
|
||||
this.id = this.name + '-' + this.axis
|
||||
this.waypoints = []
|
||||
this.clearTriggerQueues()
|
||||
groups[this.axis][this.name] = this
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.add = function(waypoint) {
|
||||
this.waypoints.push(waypoint)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.clearTriggerQueues = function() {
|
||||
this.triggerQueues = {
|
||||
up: [],
|
||||
down: [],
|
||||
left: [],
|
||||
right: []
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.flushTriggers = function() {
|
||||
for (var direction in this.triggerQueues) {
|
||||
var waypoints = this.triggerQueues[direction]
|
||||
var reverse = direction === 'up' || direction === 'left'
|
||||
waypoints.sort(reverse ? byReverseTriggerPoint : byTriggerPoint)
|
||||
for (var i = 0, end = waypoints.length; i < end; i += 1) {
|
||||
var waypoint = waypoints[i]
|
||||
if (waypoint.options.continuous || i === waypoints.length - 1) {
|
||||
waypoint.trigger([direction])
|
||||
}
|
||||
}
|
||||
}
|
||||
this.clearTriggerQueues()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.next = function(waypoint) {
|
||||
this.waypoints.sort(byTriggerPoint)
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
var isLast = index === this.waypoints.length - 1
|
||||
return isLast ? null : this.waypoints[index + 1]
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.previous = function(waypoint) {
|
||||
this.waypoints.sort(byTriggerPoint)
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
return index ? this.waypoints[index - 1] : null
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.queueTrigger = function(waypoint, direction) {
|
||||
this.triggerQueues[direction].push(waypoint)
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.prototype.remove = function(waypoint) {
|
||||
var index = Waypoint.Adapter.inArray(waypoint, this.waypoints)
|
||||
if (index > -1) {
|
||||
this.waypoints.splice(index, 1)
|
||||
}
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/first */
|
||||
Group.prototype.first = function() {
|
||||
return this.waypoints[0]
|
||||
}
|
||||
|
||||
/* Public */
|
||||
/* http://imakewebthings.com/waypoints/api/last */
|
||||
Group.prototype.last = function() {
|
||||
return this.waypoints[this.waypoints.length - 1]
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Group.findOrCreate = function(options) {
|
||||
return groups[options.axis][options.name] || new Group(options)
|
||||
}
|
||||
|
||||
Waypoint.Group = Group
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
var $ = window.jQuery
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
function JQueryAdapter(element) {
|
||||
this.$element = $(element)
|
||||
}
|
||||
|
||||
$.each([
|
||||
'innerHeight',
|
||||
'innerWidth',
|
||||
'off',
|
||||
'offset',
|
||||
'on',
|
||||
'outerHeight',
|
||||
'outerWidth',
|
||||
'scrollLeft',
|
||||
'scrollTop'
|
||||
], function(i, method) {
|
||||
JQueryAdapter.prototype[method] = function() {
|
||||
var args = Array.prototype.slice.call(arguments)
|
||||
return this.$element[method].apply(this.$element, args)
|
||||
}
|
||||
})
|
||||
|
||||
$.each([
|
||||
'extend',
|
||||
'inArray',
|
||||
'isEmptyObject'
|
||||
], function(i, method) {
|
||||
JQueryAdapter[method] = $[method]
|
||||
})
|
||||
|
||||
Waypoint.adapters.push({
|
||||
name: 'jquery',
|
||||
Adapter: JQueryAdapter
|
||||
})
|
||||
Waypoint.Adapter = JQueryAdapter
|
||||
}())
|
||||
;(function() {
|
||||
'use strict'
|
||||
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
function createExtension(framework) {
|
||||
return function() {
|
||||
var waypoints = []
|
||||
var overrides = arguments[0]
|
||||
|
||||
if (framework.isFunction(arguments[0])) {
|
||||
overrides = framework.extend({}, arguments[1])
|
||||
overrides.handler = arguments[0]
|
||||
}
|
||||
|
||||
this.each(function() {
|
||||
var options = framework.extend({}, overrides, {
|
||||
element: this
|
||||
})
|
||||
if (typeof options.context === 'string') {
|
||||
options.context = framework(this).closest(options.context)[0]
|
||||
}
|
||||
waypoints.push(new Waypoint(options))
|
||||
})
|
||||
|
||||
return waypoints
|
||||
}
|
||||
}
|
||||
|
||||
if (window.jQuery) {
|
||||
window.jQuery.fn.waypoint = createExtension(window.jQuery)
|
||||
}
|
||||
if (window.Zepto) {
|
||||
window.Zepto.fn.waypoint = createExtension(window.Zepto)
|
||||
}
|
||||
}())
|
||||
;
|
||||
|
||||
/*!
|
||||
Waypoints Sticky Element Shortcut - 4.0.1
|
||||
Copyright © 2011-2016 Caleb Troughton
|
||||
Licensed under the MIT license.
|
||||
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
|
||||
*/
|
||||
(function() {
|
||||
'use strict'
|
||||
|
||||
var $ = window.jQuery
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
/* http://imakewebthings.com/waypoints/shortcuts/sticky-elements */
|
||||
function Sticky(options) {
|
||||
this.options = $.extend({}, Waypoint.defaults, Sticky.defaults, options)
|
||||
this.element = this.options.element
|
||||
this.$element = $(this.element)
|
||||
this.createWrapper()
|
||||
this.createWaypoint()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Sticky.prototype.createWaypoint = function() {
|
||||
var originalHandler = this.options.handler
|
||||
|
||||
this.waypoint = new Waypoint($.extend({}, this.options, {
|
||||
element: this.wrapper,
|
||||
handler: $.proxy(function(direction) {
|
||||
var shouldBeStuck = this.options.direction.indexOf(direction) > -1
|
||||
var wrapperHeight = shouldBeStuck ? this.$element.outerHeight(true) : ''
|
||||
|
||||
this.$wrapper.height(wrapperHeight)
|
||||
this.$element.toggleClass(this.options.stuckClass, shouldBeStuck)
|
||||
|
||||
if (originalHandler) {
|
||||
originalHandler.call(this, direction)
|
||||
}
|
||||
}, this)
|
||||
}))
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Sticky.prototype.createWrapper = function() {
|
||||
if (this.options.wrapper) {
|
||||
this.$element.wrap(this.options.wrapper)
|
||||
}
|
||||
this.$wrapper = this.$element.parent()
|
||||
this.wrapper = this.$wrapper[0]
|
||||
}
|
||||
|
||||
/* Public */
|
||||
Sticky.prototype.destroy = function() {
|
||||
if (this.$element.parent()[0] === this.wrapper) {
|
||||
this.waypoint.destroy()
|
||||
this.$element.removeClass(this.options.stuckClass)
|
||||
if (this.options.wrapper) {
|
||||
this.$element.unwrap()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Sticky.defaults = {
|
||||
wrapper: '<div class="sticky-wrapper" />',
|
||||
stuckClass: 'stuck',
|
||||
direction: 'down right'
|
||||
}
|
||||
|
||||
Waypoint.Sticky = Sticky
|
||||
}())
|
||||
;
|
||||
|
||||
/*!
|
||||
Waypoints Inview Shortcut - 4.0.1
|
||||
Copyright © 2011-2016 Caleb Troughton
|
||||
Licensed under the MIT license.
|
||||
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
|
||||
*/
|
||||
(function() {
|
||||
'use strict'
|
||||
|
||||
function noop() {}
|
||||
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
/* http://imakewebthings.com/waypoints/shortcuts/inview */
|
||||
function Inview(options) {
|
||||
this.options = Waypoint.Adapter.extend({}, Inview.defaults, options)
|
||||
this.axis = this.options.horizontal ? 'horizontal' : 'vertical'
|
||||
this.waypoints = []
|
||||
this.element = this.options.element
|
||||
this.createWaypoints()
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Inview.prototype.createWaypoints = function() {
|
||||
var configs = {
|
||||
vertical: [{
|
||||
down: 'enter',
|
||||
up: 'exited',
|
||||
offset: '100%'
|
||||
}, {
|
||||
down: 'entered',
|
||||
up: 'exit',
|
||||
offset: 'bottom-in-view'
|
||||
}, {
|
||||
down: 'exit',
|
||||
up: 'entered',
|
||||
offset: 0
|
||||
}, {
|
||||
down: 'exited',
|
||||
up: 'enter',
|
||||
offset: function() {
|
||||
return -this.adapter.outerHeight()
|
||||
}
|
||||
}],
|
||||
horizontal: [{
|
||||
right: 'enter',
|
||||
left: 'exited',
|
||||
offset: '100%'
|
||||
}, {
|
||||
right: 'entered',
|
||||
left: 'exit',
|
||||
offset: 'right-in-view'
|
||||
}, {
|
||||
right: 'exit',
|
||||
left: 'entered',
|
||||
offset: 0
|
||||
}, {
|
||||
right: 'exited',
|
||||
left: 'enter',
|
||||
offset: function() {
|
||||
return -this.adapter.outerWidth()
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
for (var i = 0, end = configs[this.axis].length; i < end; i++) {
|
||||
var config = configs[this.axis][i]
|
||||
this.createWaypoint(config)
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Inview.prototype.createWaypoint = function(config) {
|
||||
var self = this
|
||||
this.waypoints.push(new Waypoint({
|
||||
context: this.options.context,
|
||||
element: this.options.element,
|
||||
enabled: this.options.enabled,
|
||||
handler: (function(config) {
|
||||
return function(direction) {
|
||||
self.options[config[direction]].call(self, direction)
|
||||
}
|
||||
}(config)),
|
||||
offset: config.offset,
|
||||
horizontal: this.options.horizontal
|
||||
}))
|
||||
}
|
||||
|
||||
/* Public */
|
||||
Inview.prototype.destroy = function() {
|
||||
for (var i = 0, end = this.waypoints.length; i < end; i++) {
|
||||
this.waypoints[i].destroy()
|
||||
}
|
||||
this.waypoints = []
|
||||
}
|
||||
|
||||
Inview.prototype.disable = function() {
|
||||
for (var i = 0, end = this.waypoints.length; i < end; i++) {
|
||||
this.waypoints[i].disable()
|
||||
}
|
||||
}
|
||||
|
||||
Inview.prototype.enable = function() {
|
||||
for (var i = 0, end = this.waypoints.length; i < end; i++) {
|
||||
this.waypoints[i].enable()
|
||||
}
|
||||
}
|
||||
|
||||
Inview.defaults = {
|
||||
context: window,
|
||||
enabled: true,
|
||||
enter: noop,
|
||||
entered: noop,
|
||||
exit: noop,
|
||||
exited: noop
|
||||
}
|
||||
|
||||
Waypoint.Inview = Inview
|
||||
}())
|
||||
;
|
||||
|
||||
/*!
|
||||
Waypoints Infinite Scroll Shortcut - 4.0.1
|
||||
Copyright © 2011-2016 Caleb Troughton
|
||||
Licensed under the MIT license.
|
||||
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
|
||||
*/
|
||||
(function() {
|
||||
'use strict'
|
||||
|
||||
var $ = window.jQuery
|
||||
var Waypoint = window.Waypoint
|
||||
|
||||
/* http://imakewebthings.com/waypoints/shortcuts/infinite-scroll */
|
||||
function Infinite(options) {
|
||||
this.options = $.extend({}, Infinite.defaults, options)
|
||||
this.container = this.options.element
|
||||
if (this.options.container !== 'auto') {
|
||||
this.container = this.options.container
|
||||
}
|
||||
this.$container = $(this.container)
|
||||
this.$more = $(this.options.more)
|
||||
|
||||
if (this.$more.length) {
|
||||
this.setupHandler()
|
||||
this.waypoint = new Waypoint(this.options)
|
||||
}
|
||||
}
|
||||
|
||||
/* Private */
|
||||
Infinite.prototype.setupHandler = function() {
|
||||
this.options.handler = $.proxy(function() {
|
||||
this.options.onBeforePageLoad()
|
||||
this.destroy()
|
||||
this.$container.addClass(this.options.loadingClass)
|
||||
|
||||
$.get($(this.options.more).attr('href'), $.proxy(function(data) {
|
||||
var $data = $($.parseHTML(data))
|
||||
var $newMore = $data.find(this.options.more)
|
||||
|
||||
var $items = $data.find(this.options.items)
|
||||
if (!$items.length) {
|
||||
$items = $data.filter(this.options.items)
|
||||
}
|
||||
|
||||
this.$container.append($items)
|
||||
this.$container.removeClass(this.options.loadingClass)
|
||||
|
||||
if (!$newMore.length) {
|
||||
$newMore = $data.filter(this.options.more)
|
||||
}
|
||||
if ($newMore.length) {
|
||||
this.$more.replaceWith($newMore)
|
||||
this.$more = $newMore
|
||||
this.waypoint = new Waypoint(this.options)
|
||||
}
|
||||
else {
|
||||
this.$more.remove()
|
||||
}
|
||||
|
||||
this.options.onAfterPageLoad($items)
|
||||
}, this))
|
||||
}, this)
|
||||
}
|
||||
|
||||
/* Public */
|
||||
Infinite.prototype.destroy = function() {
|
||||
if (this.waypoint) {
|
||||
this.waypoint.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
Infinite.defaults = {
|
||||
container: 'auto',
|
||||
items: '.infinite-item',
|
||||
more: '.infinite-more-link',
|
||||
offset: 'bottom-in-view',
|
||||
loadingClass: 'infinite-loading',
|
||||
onBeforePageLoad: $.noop,
|
||||
onAfterPageLoad: $.noop
|
||||
}
|
||||
|
||||
Waypoint.Infinite = Infinite
|
||||
}())
|
||||
;
|
Loading…
Add table
Add a link
Reference in a new issue