[Monitor Dashboard | Trunk]: Remove unused js and css file of theme. Fix dropdown when animation exists. Remove tooltip custom css. Add missing properties

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@59069 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2020-07-10 12:57:53 +00:00
parent cffb3c87ae
commit ffc2fb3d71
228 changed files with 35 additions and 83992 deletions

View File

@ -3,7 +3,7 @@ import {FormsModule} from '@angular/forms';
import {CommonModule} from '@angular/common';
import {HttpClientModule} from "@angular/common/http";
import {BrowserModule} from '@angular/platform-browser';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {AppComponent} from './app.component';
import {OpenaireErrorPageComponent} from './error/errorPage.component';
@ -23,7 +23,7 @@ import {SharedModule} from "./openaireLibrary/shared/shared.module";
imports: [
SharedModule,
NoopAnimationsModule,
BrowserAnimationsModule,
CommonModule,
HttpClientModule,
ErrorModule,

View File

@ -2,17 +2,19 @@
.dashboard {
@import "common-assets/library-css/library";
.uk-link {
color: #2d72d6;
/* Animation*/
[class*=uk-animation-] {
animation-fill-mode: none !important;
}
/* Link */
.uk-link:hover {
color: var(--portal-main-color);
text-decoration: none;
}
/* Paging */
.uk-pagination>*>* {
.uk-pagination > * > * {
display: block;
color: #666;
box-sizing: border-box;
@ -30,7 +32,7 @@
height: auto;
}
.uk-pagination>*>:focus, .uk-pagination>*>:hover {
.uk-pagination > * > :focus, .uk-pagination > * > :hover {
color: #4687e6;
text-decoration: none;
background-color: transparent !important;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,13 +17,6 @@
*/
/* 1. altair variables/mixins ======================== */
/* 2. UIkit custom styles ============================ */
/* animations */
[class*="uk-animation-"] {
-webkit-animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
-webkit-animation-duration: 560ms;
animation-duration: 560ms;
}
/* alerts */
.uk-alert {
border: none;
@ -2445,168 +2438,6 @@ html[dir="rtl"] .uk-slider > * {
.uk-slidenav-contrast:active {
color: rgba(255, 255, 255, 0.9);
}
/* tooltips */
/*! UIkit 2.27.5 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Component: Tooltip
========================================================================== */
/*
* 1. Hide by default
* 2. Set fixed position
* 3. Set dimensions
* 4. Set style
*/
.uk-tooltip {
/* 1 */
display: none;
/* 2 */
position: absolute;
z-index: 1030;
/* 3 */
-webkit-box-sizing: border-box;
box-sizing: border-box;
max-width: 200px;
padding: 5px 8px;
/* 4 */
background: #333;
color: rgba(255, 255, 255, 0.7);
font-size: 12px;
line-height: 18px;
border-radius: 3px;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
/* Triangle
========================================================================== */
/*
* 1. Dashed is less antialised than solid
*/
.uk-tooltip:after {
content: "";
display: block;
position: absolute;
width: 0;
height: 0;
/* 1 */
border: 5px dashed #333;
}
/* Direction modifiers
========================================================================== */
/*
* Top
*/
.uk-tooltip-top:after,
.uk-tooltip-top-left:after,
.uk-tooltip-top-right:after {
bottom: -5px;
border-top-style: solid;
border-bottom: none;
border-left-color: transparent;
border-right-color: transparent;
border-top-color: #333;
}
/*
* Bottom
*/
.uk-tooltip-bottom:after,
.uk-tooltip-bottom-left:after,
.uk-tooltip-bottom-right:after {
top: -5px;
border-bottom-style: solid;
border-top: none;
border-left-color: transparent;
border-right-color: transparent;
border-bottom-color: #333;
}
/*
* Top/Bottom center
*/
.uk-tooltip-top:after,
.uk-tooltip-bottom:after {
left: 50%;
margin-left: -5px;
}
/*
* Top/Bottom left
*/
.uk-tooltip-top-left:after,
.uk-tooltip-bottom-left:after {
left: 10px;
}
/*
* Top/Bottom right
*/
.uk-tooltip-top-right:after,
.uk-tooltip-bottom-right:after {
right: 10px;
}
/*
* Left
*/
.uk-tooltip-left:after {
right: -5px;
top: 50%;
margin-top: -5px;
border-left-style: solid;
border-right: none;
border-top-color: transparent;
border-bottom-color: transparent;
border-left-color: #333;
}
/*
* Right
*/
.uk-tooltip-right:after {
left: -5px;
top: 50%;
margin-top: -5px;
border-right-style: solid;
border-left: none;
border-top-color: transparent;
border-bottom-color: transparent;
border-right-color: #333;
}
.uk-tooltip {
background: #424242;
color: #fff;
font-size: 13px;
padding: 3px 16px;
line-height: 22px;
text-shadow: none;
min-width: 80px;
text-align: center;
z-index: 1304;
opacity: 0;
}
.uk-tooltip .uk-tooltip-inner {
text-overflow: ellipsis;
display: inline-block;
vertical-align: top;
white-space: nowrap;
overflow: hidden;
width: 100%;
}
.uk-tooltip:after {
display: none !important;
}
.uk-tooltip.long-text {
text-align: left;
}
.uk-tooltip.long-text .uk-tooltip-inner {
white-space: normal;
overflow: visible;
line-height: 18px;
padding: 4px 0;
}
.uk-tooltip-small {
-webkit-transform: scale(0.85);
transform: scale(0.85);
}
.uk-tooltip-top {
z-index: 9999;
}
.touch .uk-tooltip {
opacity: 1;
}
/* tabs */
.uk-tab {
border-bottom-color: rgba(0, 0, 0, 0.12);

View File

@ -953,7 +953,7 @@
}
} else {
$(this).attr({
'data-uk-tooltip': "{pos:'right'}"
'uk-tooltip': "{pos:'right'}"
});
}
});

View File

@ -1,45 +0,0 @@
/*
* Altair Admin
* Configuration file for ckeditor (wysiwyg editor)
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For complete reference see:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
config.skin = 'material_design,../../assets/skins/ckeditor/material_design/';
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard'] },
{ name: 'document', groups: [ 'undo', 'mode', 'document', 'doctools', 'tools', 'about' ] },
{ name: 'others', groups: [ 'others' ] },
'/',
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] },
{ name: 'insert', groups: [ 'insert' ] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'forms', groups: [ 'forms' ] }
];
config.removeButtons = 'Scayt';
config.extraPlugins = 'autogrow,colorbutton,colordialog';
// Set the most common block elements.
config.format_tags = 'p;h1;h2;h3;pre';
config.height = 300;
config.autoGrow_minHeight = 300;
config.autoGrow_maxHeight = 520;
config.removePlugins = 'resize';
config.filebrowserWindowWidth = 800;
config.filebrowserWindowHeight = 420;
config.filebrowserBrowseUrl = 'file_manager/fm_ckeditor.html';
};

View File

@ -1 +0,0 @@
CKEDITOR.editorConfig=function(o){o.skin="material_design,../../assets/skins/ckeditor/material_design/",o.toolbarGroups=[{name:"clipboard",groups:["clipboard"]},{name:"document",groups:["undo","mode","document","doctools","tools","about"]},{name:"others",groups:["others"]},"/",{name:"editing",groups:["find","selection","spellchecker","editing"]},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"styles",groups:["styles"]},{name:"colors",groups:["colors"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi","paragraph"]},{name:"insert",groups:["insert"]},{name:"links",groups:["links"]},{name:"forms",groups:["forms"]}],o.removeButtons="Scayt",o.extraPlugins="autogrow,colorbutton,colordialog",o.format_tags="p;h1;h2;h3;pre",o.height=300,o.autoGrow_minHeight=300,o.autoGrow_maxHeight=520,o.removePlugins="resize",o.filebrowserWindowWidth=800,o.filebrowserWindowHeight=420,o.filebrowserBrowseUrl="file_manager/fm_ckeditor.html"};

View File

@ -1,48 +0,0 @@
/*
* Altair Admin
* Codemirror addon (fullscreen)
*/
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineOption("fullScreen", false, function(cm, val, old) {
if (old == CodeMirror.Init) old = false;
if (!old == !val) return;
if (val) setFullscreen(cm);
else setNormal(cm);
});
function setFullscreen(cm) {
var wrap = cm.getWrapperElement();
cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,
width: wrap.style.width, height: wrap.style.height};
wrap.style.width = "";
wrap.style.height = "auto";
wrap.className += " CodeMirror-fullscreen";
document.body.className += " CodeMirror-fullscreen-active";
document.documentElement.style.overflow = "hidden";
cm.refresh();
}
function setNormal(cm) {
var wrap = cm.getWrapperElement();
wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, "");
document.documentElement.style.overflow = "";
document.body.className = document.body.className.replace(" CodeMirror-fullscreen-active","");
var info = cm.state.fullScreenRestore;
wrap.style.width = info.width; wrap.style.height = info.height;
window.scrollTo(info.scrollLeft, info.scrollTop);
cm.refresh();
}
});

View File

@ -1 +0,0 @@
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(s){"use strict";s.defineOption("fullScreen",!1,function(e,t,o){var r,l;(o==s.Init&&(o=!1),!o!=!t)&&(t?(l=(r=e).getWrapperElement(),r.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:l.style.width,height:l.style.height},l.style.width="",l.style.height="auto",l.className+=" CodeMirror-fullscreen",document.body.className+=" CodeMirror-fullscreen-active",document.documentElement.style.overflow="hidden",r.refresh()):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="",document.body.className=document.body.className.replace(" CodeMirror-fullscreen-active","");var o=e.state.fullScreenRestore;t.style.width=o.width,t.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop),e.refresh()}(e))})});

View File

@ -1,68 +0,0 @@
/*! UIKit integration for DataTables' Buttons
* ©2016 SpryMedia Ltd - datatables.net/license
*/
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net-bs', 'datatables.net-buttons'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
}
if ( ! $ || ! $.fn.dataTable ) {
$ = require('datatables.net-bs')(root, $).$;
}
if ( ! $.fn.dataTable.Buttons ) {
require('datatables.net-buttons')(root, $);
}
return factory( $, root, root.document );
};
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
$.extend( true, DataTable.Buttons.defaults, {
dom: {
container: {
className: 'dt-buttons btn-group'
},
button: {
className: 'md-btn'
},
collection: {
tag: 'ul',
className: 'dt-button-collection uk-dropdown uk-nav',
button: {
tag: 'li',
className: 'dt-button'
},
buttonLiner: {
tag: 'a',
className: ''
}
}
}
} );
DataTable.ext.buttons.collection.text = function ( dt ) {
return dt.i18n('buttons.collection', 'Collection <span class="caret"/>');
};
return DataTable.Buttons;
}));

View File

@ -1,198 +0,0 @@
/*!
* DataTables UIKit integration
* author: tzd
*/
(function(window, document, undefined){
var factory = function( $, DataTable ) {
"use strict";
/* Set the defaults for DataTables initialisation */
$.extend( true, DataTable.defaults, {
dom:
"<'dt-uikit-header'<'uk-grid'<'uk-width-medium-2-3'l><'uk-width-medium-1-3'f>>>" +
"<'uk-overflow-container'tr>" +
"<'dt-uikit-footer'<'uk-grid'<'uk-width-medium-3-10'i><'uk-width-medium-7-10'p>>>",
renderer: 'uikit',
"order": []
} );
/* Default class modification */
$.extend( DataTable.ext.classes, {
sWrapper: "dataTables_wrapper form-inline dt-uikit",
sFilterInput: "md-input",
sLengthSelect: "dt-selectize",
"sPaging": ""
} );
/* Bootstrap paging button renderer */
DataTable.ext.renderer.pageButton.uikit = function ( settings, host, idx, buttons, page, pages ) {
var api = new DataTable.Api( settings );
var classes = settings.oClasses;
var lang = settings.oLanguage.oPaginate;
var btnDisplay, btnClass, counter=0;
var attach = function( container, buttons ) {
var i, ien, node, button;
var clickHandler = function ( e ) {
e.preventDefault();
if ( !$(e.currentTarget).hasClass('disabled') ) {
api.page( e.data.action ).draw( false );
}
};
for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
button = buttons[i];
if ( $.isArray( button ) ) {
attach( container, button );
}
else {
btnDisplay = '';
btnClass = '';
switch ( button ) {
case 'ellipsis':
btnDisplay = '&hellip;';
btnClass = 'uk-disabled';
break;
case 'first':
btnDisplay = '<i class="uk-icon-angle-double-left"/>';
btnClass = button + (page > 0 ?
'' : ' uk-disabled');
break;
case 'previous':
btnDisplay = lang.sPrevious;
btnClass = button + (page > 0 ?
'' : ' uk-disabled');
break;
case 'next':
btnDisplay = lang.sNext;
btnClass = button + (page < pages-1 ?
'' : ' uk-disabled');
break;
case 'last':
btnDisplay = '<i class="uk-icon-angle-double-right"/>';
btnClass = button + (page < pages-1 ?
'' : ' uk-disabled');
break;
default:
btnDisplay = button + 1;
btnClass = page === button ?
'uk-active' : '';
break;
}
if ( btnDisplay ) {
node = $('<li>', {
'class': classes.sPageButton+' '+btnClass,
'id': idx === 0 && typeof button === 'string' ?
settings.sTableId +'_'+ button :
null
} )
.append( $('<a>', {
'href': '#',
'aria-controls': settings.sTableId,
'data-dt-idx': counter,
'tabindex': settings.iTabIndex
} )
.html( btnDisplay )
)
.appendTo( container );
settings.oApi._fnBindAction(
node, {action: button}, clickHandler
);
counter++;
}
}
}
};
var activeEl;
try {
activeEl = $(document.activeElement).data('dt-idx');
}
catch (e) {}
attach(
$(host).empty().html('<ul class="uk-pagination"/>').children('ul'),
buttons
);
if ( activeEl ) {
$(host).find( '[data-dt-idx='+activeEl+']' ).focus();
}
};
};
$('body').on( 'init.dt', '.dt-uikit', function () {
if(!$(this).hasClass('md-processed')) {
var dt_filter = $(this).find('.dataTables_filter'),
search_label = dt_filter.children('label').text();
dt_filter.find('.md-input').attr('placeholder',search_label).unwrap();
dt_filter.contents().filter(function(){
return (this.nodeType == 3);
}).remove();
// reinitialize md inputs
altair_md.inputs();
// initilaize selectize
$(this).find('.dt-selectize').selectize({
dropdownParent: 'body',
onDropdownOpen: function($dropdown) {
$dropdown
.hide()
.velocity('slideDown', {
duration: 200,
easing: easing_swiftOut
})
},
onDropdownClose: function($dropdown) {
$dropdown
.show()
.velocity('slideUp', {
duration: 200,
easing: easing_swiftOut
})
}
});
$(this).find('.ColVis_MasterButton').addClass('md-btn');
$(this).addClass('md-processed');
}
});
// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd ) {
define( ['jquery', 'datatables'], factory );
}
else if ( typeof exports === 'object' ) {
// Node/CommonJS
factory( require('jquery'), require('datatables') );
}
else if ( jQuery ) {
// Otherwise simply initialise as normal, stopping multiple evaluation
factory( jQuery, jQuery.fn.dataTable );
}
})(window, document);

View File

@ -1 +0,0 @@
!function(e,t,i){var a=function(e,i){"use strict";e.extend(!0,i.defaults,{dom:"<'dt-uikit-header'<'uk-grid'<'uk-width-medium-2-3'l><'uk-width-medium-1-3'f>>><'uk-overflow-container'tr><'dt-uikit-footer'<'uk-grid'<'uk-width-medium-3-10'i><'uk-width-medium-7-10'p>>>",renderer:"uikit",order:[]}),e.extend(i.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-uikit",sFilterInput:"md-input",sLengthSelect:"dt-selectize",sPaging:""}),i.ext.renderer.pageButton.uikit=function(a,n,d,s,o,l){var r,u,c,f=new i.Api(a),p=a.oClasses,b=a.oLanguage.oPaginate,T=0,h=function(t,i){var n,s,c,k,m=function(t){t.preventDefault(),e(t.currentTarget).hasClass("disabled")||f.page(t.data.action).draw(!1)};for(n=0,s=i.length;n<s;n++)if(k=i[n],e.isArray(k))h(t,k);else{switch(r="",u="",k){case"ellipsis":r="&hellip;",u="uk-disabled";break;case"first":r='<i class="uk-icon-angle-double-left"/>',u=k+(o>0?"":" uk-disabled");break;case"previous":r=b.sPrevious,u=k+(o>0?"":" uk-disabled");break;case"next":r=b.sNext,u=k+(o<l-1?"":" uk-disabled");break;case"last":r='<i class="uk-icon-angle-double-right"/>',u=k+(o<l-1?"":" uk-disabled");break;default:r=k+1,u=o===k?"uk-active":""}r&&(c=e("<li>",{"class":p.sPageButton+" "+u,id:0===d&&"string"==typeof k?a.sTableId+"_"+k:null}).append(e("<a>",{href:"#","aria-controls":a.sTableId,"data-dt-idx":T,tabindex:a.iTabIndex}).html(r)).appendTo(t),a.oApi._fnBindAction(c,{action:k},m),T++)}};try{c=e(t.activeElement).data("dt-idx")}catch(k){}h(e(n).empty().html('<ul class="uk-pagination"/>').children("ul"),s),c&&e(n).find("[data-dt-idx="+c+"]").focus()},i.TableTools&&(e.extend(!0,i.TableTools.classes,{container:"DTTT uk-text-right",buttons:{normal:"md-btn DTTT_btn",disabled:"md-btn-disabled"},collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),e.extend(!0,i.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};$("body").on("init.dt",".dt-uikit",function(){if(!$(this).hasClass("md-processed")){var e=$(this).find(".dataTables_filter"),t=e.children("label").text();e.find(".md-input").attr("placeholder",t).unwrap(),e.contents().filter(function(){return 3==this.nodeType}).remove(),altair_md.inputs(),$(this).find(".dt-selectize").selectize({dropdownParent:"body",onDropdownOpen:function(e){e.hide().velocity("slideDown",{duration:200,easing:easing_swiftOut})},onDropdownClose:function(e){e.show().velocity("slideUp",{duration:200,easing:easing_swiftOut})}}),$(this).find(".ColVis_MasterButton").addClass("md-btn"),$(this).addClass("md-processed")}}),"function"==typeof define&&define.amd?define(["jquery","datatables"],a):"object"==typeof exports?a(require("jquery"),require("datatables")):jQuery&&a(jQuery,jQuery.fn.dataTable)}(window,document);

View File

@ -1,399 +0,0 @@
/**
* Dense - Device pixel ratio aware images
*
* @link http://dense.rah.pw
* @license MIT
*/
/*
* Copyright (C) 2013 Jukka Svahn
*
* 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.
*/
/**
* @name jQuery
* @class
*/
/**
* @name fn
* @class
* @memberOf jQuery
*/
(function (factory)
{
'use strict';
if (typeof define === 'function' && define.amd)
{
define(['jquery'], factory);
}
else
{
factory(window.jQuery || window.Zepto);
}
}(function ($)
{
'use strict';
/**
* An array of checked image URLs.
*/
var pathStack = [],
/**
* Methods.
*/
methods = {},
/**
* Regular expression to check whether the URL has a protocol.
*
* Is used to check whether the image URL is external.
*/
regexHasProtocol = /^([a-z]:)?\/\//i,
/**
* Regular expression that split extensions from the file.
*
* Is used to inject the DPR suffix to the name.
*/
regexSuffix = /\.\w+$/,
/**
* Device pixel ratio.
*/
devicePixelRatio;
/**
* Init is the default method responsible for rendering
* a pixel-ratio-aware images.
*
* This method is used to select the images that
* should display retina-size images on high pixel ratio
* devices. Dense defaults to the init method if no
* method is specified.
*
* When attached to an image, the correct image variation is
* selected based on the device's pixel ratio. If the image element
* defines <code>data-{ratio}x</code> attributes (e.g. data-1x, data-2x, data-3x),
* the most appropriate of those is selected.
*
* If no data-ratio attributes are defined, the retina image is
* constructed from the <code>src</code> attribute.
* The searched high pixel ratio images follows
* a <code>{imageName}_{ratio}x.{ext}</code> naming convention.
* For an image found in /path/to/images/image.jpg, the 2x retina
* image would be looked from /path/to/images/image_2x.jpg.
*
* When image is constructed from the src, the image existance is
* verified using HTTP HEAD request, if <code>ping</code> option is
* <code>true</code>. The check makes sure no HTTP error code is returned,
* and that the received content-type is of an image. Vector image formats,
* like svg, are skipped based on the file extension.
*
* This method can also be used to load image in semi-lazy fashion,
* and avoid larger extra HTTP requests due to retina replacements.
* The data-1x attribute can be used to supstitute the src, making
* sure the browser doesn't try to download the normal image variation
* before the JavaScript driven behaviour kicks in.
*
* Some classes are added to the selected elements while Dense is processing
* the document. These classes include <code>dense-image</code>, <code>dense-loading</code>
* and <code>dense-ready</code>. These classes can be used to style the images,
* or hide them while they are being loaded.
*
* @param {Object} [options={}] Options
* @param {Boolean} [options.ping=null] Check image existence. If the default <code>NULL</code> checks local images, <code>FALSE</code> disables checking and <code>TRUE</code> checks even external images cross-domain
* @param {String} [options.dimensions=preserve] What to do with the image's <code>width</code> and <code>height</code> attributes. Either <code>update</code>, <code>remove</code> or <code>preserve</code>
* @param {String} [options.glue=_] String that glues the retina "nx" suffix to the image. This option can be used to change the naming convention between the two commonly used practices, <code>image@2x.jpg</code> and <code>image_2x.jpg</code>
* @param {Array} [options.skipExtensions=['svg']] Skipped image file extensions. There might be situations where you might want to exclude vector image formats
* @return {Object} this
* @method init
* @memberof jQuery.fn.dense
* @fires jQuery.fn.dense#denseRetinaReady.dense
* @example
* $('img').dense({
* ping: false,
* dimension: 'update'
* });
*/
methods.init = function (options)
{
options = $.extend({
ping: null,
dimensions: 'preserve',
glue: '_',
skipExtensions: ['svg']
}, options);
this.each(function ()
{
var $this = $(this);
if (!$this.is('img') || $this.hasClass('dense-image'))
{
return;
}
$this.addClass('dense-image dense-loading');
var image = methods.getImageAttribute.call(this),
originalImage = $this.attr('src'),
ping = false,
updateImage;
if (!image)
{
if (!originalImage || devicePixelRatio === 1 || $.inArray(originalImage.split('.').pop().split(/[\?\#]/).shift(), options.skipExtensions) !== -1)
{
$this.removeClass('dense-image dense-loading');
return;
}
image = originalImage.replace(regexSuffix, function (extension)
{
var pixelRatio = $this.attr('data-dense-cap') ? $this.attr('data-dense-cap') : devicePixelRatio;
return options.glue + pixelRatio + 'x' + extension;
});
ping = options.ping !== false && $.inArray(image, pathStack) === -1 && (options.ping === true || !regexHasProtocol.test(image) || image.indexOf('//'+document.domain) === 0 || image.indexOf(document.location.protocol+'//'+document.domain) === 0);
}
updateImage = function ()
{
var readyImage = function ()
{
$this.removeClass('dense-loading').addClass('dense-ready').trigger('denseRetinaReady.dense');
};
$this.attr('src', image);
if (options.dimensions === 'update')
{
$this.dense('updateDimensions').one('denseDimensionChanged', readyImage);
}
else
{
if (options.dimensions === 'remove')
{
$this.removeAttr('width height');
}
readyImage();
}
};
if (ping)
{
$.ajax({
url : image,
type : 'HEAD'
})
.done(function (data, textStatus, jqXHR)
{
var type = jqXHR.getResponseHeader('Content-type');
if (!type || type.indexOf('image/') === 0)
{
pathStack.push(image);
updateImage();
}
});
}
else
{
updateImage();
}
});
return this;
};
/**
* Sets an image's width and height attributes to its native values.
*
* Updates an img element's dimensions to the source image's
* real values. This method is asynchronous, so you can not directly
* return its values. Instead, use the 'dense-dimensions-updated'
* event to detect when the action is done.
*
* @return {Object} this
* @method updateDimensions
* @memberof jQuery.fn.dense
* @fires jQuery.fn.dense#denseDimensionChanged.dense
* @example
* var image = $('img').dense('updateDimensions');
*/
methods.updateDimensions = function ()
{
return this.each(function ()
{
var img, $this = $(this), src = $this.attr('src');
if (src)
{
img = new Image();
img.src = src;
$(img).on('load.dense', function ()
{
$this.attr({
width: img.width,
height: img.height
}).trigger('denseDimensionChanged.dense');
});
}
});
};
/**
* Gets device pixel ratio rounded up to the closest integer.
*
* @return {Integer} The pixel ratio
* @method devicePixelRatio
* @memberof jQuery.fn.dense
* @example
* var ratio = $(window).dense('devicePixelRatio');
* alert(ratio);
*/
methods.devicePixelRatio = function ()
{
var pixelRatio = 1;
if ($.type(window.devicePixelRatio) !== 'undefined')
{
pixelRatio = window.devicePixelRatio;
}
else if ($.type(window.matchMedia) !== 'undefined')
{
$.each([1.3, 2, 3, 4, 5, 6], function (key, ratio)
{
var mediaQuery = [
'(-webkit-min-device-pixel-ratio: '+ratio+')',
'(min-resolution: '+Math.floor(ratio*96)+'dpi)',
'(min-resolution: '+ratio+'dppx)'
].join(',');
if (!window.matchMedia(mediaQuery).matches)
{
return false;
}
pixelRatio = ratio;
});
}
return Math.ceil(pixelRatio);
};
/**
* Gets an appropriate URL for the pixel ratio from the data attribute list.
*
* Selects the most appropriate <code>data-{ratio}x</code> attribute from
* the given element's attributes. If the devices pixel ratio is greater
* than the largest specified image, the largest one of the available is used.
*
* @return {String|Boolean} The attribute value
* @method getImageAttribute
* @memberof jQuery.fn.dense
* @example
* var image = $('<div data-1x="image.jpg" data-2x="image_2x.jpg" />').dense('getImageAttribute');
* $('body').css('background-image', 'url(' + image + ')');
*/
methods.getImageAttribute = function ()
{
var $this = $(this).eq(0), image = false, url;
for (var i = 1; i <= devicePixelRatio; i++)
{
url = $this.attr('data-' + i + 'x');
if (url)
{
image = url;
}
}
return image;
};
devicePixelRatio = methods.devicePixelRatio();
/**
* Dense offers few methods and options that can be used to both customize the
* plugin's functionality and return resulting values. All interaction is done through
* the <code>$.fn.dense()</code> method, that accepts a called method and its options
* object as its arguments. Both arguments are optional, and either one can be omitted.
*
* @param {String} [method=init] The called method
* @param {Object} [options={}] Options passed to the method
* @class dense
* @memberof jQuery.fn
*/
$.fn.dense = function (method, options)
{
if ($.type(method) !== 'string' || $.type(methods[method]) !== 'function')
{
options = method;
method = 'init';
}
return methods[method].call(this, options);
};
/**
* Initialize automatically when document is ready.
*
* Dense is initialized automatically if the body element
* has a <code>dense-retina</code> class.
*/
$(function ()
{
$('body.dense-retina img').dense();
});
/**
* This event is invoked when a retina image has finished loading.
*
* @event jQuery.fn.dense#denseRetinaReady.dense
* @type {Object}
*/
/**
* This event is invoked when an image's dimension values
* have been updated by the <code>updateDimensions</code>
* method.
*
* @event jQuery.fn.dense#denseDimensionChanged.dense
* @type {Object}
*/
}));

View File

@ -1 +0,0 @@
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(window.jQuery||window.Zepto)}(function(s){"use strict";var o,r=[],u={},c=/^([a-z]:)?\/\//i,f=/\.\w+$/;u.init=function(t){return t=s.extend({ping:null,dimensions:"preserve",glue:"_",skipExtensions:["svg"]},t),this.each(function(){var i=s(this);if(i.is("img")&&!i.hasClass("dense-image")){i.addClass("dense-image dense-loading");var a,d=u.getImageAttribute.call(this),e=i.attr("src"),n=!1;if(!d){if(!e||1===o||-1!==s.inArray(e.split(".").pop().split(/[\?\#]/).shift(),t.skipExtensions))return void i.removeClass("dense-image dense-loading");d=e.replace(f,function(e){var n=i.attr("data-dense-cap")?i.attr("data-dense-cap"):o;return t.glue+n+"x"+e}),n=!1!==t.ping&&-1===s.inArray(d,r)&&(!0===t.ping||!c.test(d)||0===d.indexOf("//"+document.domain)||0===d.indexOf(document.location.protocol+"//"+document.domain))}a=function(){var e=function(){i.removeClass("dense-loading").addClass("dense-ready").trigger("denseRetinaReady.dense")};i.attr("src",d),"update"===t.dimensions?i.dense("updateDimensions").one("denseDimensionChanged",e):("remove"===t.dimensions&&i.removeAttr("width height"),e())},n?s.ajax({url:d,type:"HEAD"}).done(function(e,n,i){var t=i.getResponseHeader("Content-type");t&&0!==t.indexOf("image/")||(r.push(d),a())}):a()}}),this},u.updateDimensions=function(){return this.each(function(){var e,n=s(this),i=n.attr("src");i&&((e=new Image).src=i,s(e).on("load.dense",function(){n.attr({width:e.width,height:e.height}).trigger("denseDimensionChanged.dense")}))})},u.devicePixelRatio=function(){var t=1;return"undefined"!==s.type(window.devicePixelRatio)?t=window.devicePixelRatio:"undefined"!==s.type(window.matchMedia)&&s.each([1.3,2,3,4,5,6],function(e,n){var i=["(-webkit-min-device-pixel-ratio: "+n+")","(min-resolution: "+Math.floor(96*n)+"dpi)","(min-resolution: "+n+"dppx)"].join(",");if(!window.matchMedia(i).matches)return!1;t=n}),Math.ceil(t)},u.getImageAttribute=function(){for(var e,n=s(this).eq(0),i=!1,t=1;t<=o;t++)(e=n.attr("data-"+t+"x"))&&(i=e);return i},o=u.devicePixelRatio(),s.fn.dense=function(e,n){return"string"===s.type(e)&&"function"===s.type(u[e])||(n=e,e="init"),u[e].call(this,n)},s(function(){s("body.dense-retina img").dense()})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,50 +0,0 @@
/* handlebars helpers */
// moment syntax example: moment(Date("2011-07-18T15:50:52")).format("MMMM YYYY")
// usage: {{dateFormat creation_date format="MMMM YYYY"}}
Handlebars.registerHelper('dateFormat', function(context, block) {
if (window.moment) {
var f = block.hash.format || "MMM DD, YYYY hh:mm:ss A";
return moment(context).format(f); //had to remove Date(context)
} else {
return context; // moment plugin not available. return data as is.
}
});
// extended "if" block helper
// usage {{#ifCond var1 '==' var2}}
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
switch (operator) {
case '==':
return (v1 == v2) ? options.fn(this) : options.inverse(this);
case '===':
return (v1 === v2) ? options.fn(this) : options.inverse(this);
case '!==':
return (v1 !== v2) ? options.fn(this) : options.inverse(this);
case '<':
return (v1 < v2) ? options.fn(this) : options.inverse(this);
case '<=':
return (v1 <= v2) ? options.fn(this) : options.inverse(this);
case '>':
return (v1 > v2) ? options.fn(this) : options.inverse(this);
case '>=':
return (v1 >= v2) ? options.fn(this) : options.inverse(this);
case '&&':
return (v1 && v2) ? options.fn(this) : options.inverse(this);
case '||':
return (v1 || v2) ? options.fn(this) : options.inverse(this);
default:
return options.inverse(this);
}
});
/**
* The {{#exists}} helper checks if a variable is defined.
*/
Handlebars.registerHelper('exists', function(variable, options) {
if (typeof variable !== 'undefined') {
return options.fn(this);
} else {
return options.inverse(this);
}
});

View File

@ -1 +0,0 @@
Handlebars.registerHelper("dateFormat",function(e,r){if(window.moment){var s=r.hash.format||"MMM DD, YYYY hh:mm:ss A";return moment(e).format(s)}return e}),Handlebars.registerHelper("ifCond",function(e,r,s,t){switch(r){case"==":return e==s?t.fn(this):t.inverse(this);case"===":return e===s?t.fn(this):t.inverse(this);case"!==":return e!==s?t.fn(this):t.inverse(this);case"<":return e<s?t.fn(this):t.inverse(this);case"<=":return e<=s?t.fn(this):t.inverse(this);case">":return s<e?t.fn(this):t.inverse(this);case">=":return s<=e?t.fn(this):t.inverse(this);case"&&":return e&&s?t.fn(this):t.inverse(this);case"||":return e||s?t.fn(this):t.inverse(this);default:return t.inverse(this)}}),Handlebars.registerHelper("exists",function(e,r){return void 0!==e?r.fn(this):r.inverse(this)});

View File

@ -1,9 +0,0 @@
/*!
* instaFilta
* Version: 1.4.4
* Description: jQuery plugin for performing in-page filtering
* Homepage and documentation: https://github.com/chromawoods/instaFilta
* Author: Andreas Larsson <andreas@chromawoods.com> (http://chromawoods.com)
* Contributions: Jaap-Jan Frans
*/
!function(t){t.fn.instaFilta=function(e){var i=null,s=null,a=t.extend({scope:null,targets:".instafilta-target",sections:".instafilta-section",categoryDataAttr:"instafilta-category",matchCssClass:"instafilta-match",itemsHideEffect:"hide",itemsHideDuration:0,itemsShowEffect:"show",itemsShowDuration:0,sectionsHideEffect:"hide",sectionsHideDuration:0,sectionsShowEffect:"show",sectionsShowDuration:0,onFilterComplete:null,markMatches:!1,hideEmptySections:!0,beginsWith:!1,caseSensitive:!1,typeDelay:0,useSynonyms:!0,synonyms:[{src:"à,á,å,ä,â,ã",dst:"a"},{src:"À,Á,Å,Ä,Â,Ã",dst:"A"},{src:"è,é,ë,ê",dst:"e"},{src:"È,É,Ë,Ê",dst:"E"},{src:"ì,í,ï,î",dst:"i"},{src:"Ì,Í,Ï,Î",dst:"I"},{src:"ò,ó,ö,ô,õ",dst:"o"},{src:"Ò,Ó,Ö,Ô,Õ",dst:"O"},{src:"ù,ú,ü,û",dst:"u"},{src:"Ù,Ú,Ü,Û",dst:"U"},{src:"ç",dst:"c"},{src:"Ç",dst:"C"},{src:"æ",dst:"ae"}]},e);if(a.useSynonyms)for(var n=0,r=a.synonyms.length;r>n;n++)a.synonyms[n].src=a.synonyms[n].src.split(",");return this.each(function(){var e,n,r,o,c="";a.scope?(o=t(this).closest(a.scope),n=o.find(a.targets),r=o.find(a.sections)):(n=t(a.targets),r=t(a.sections)),n.each(function(){$target=t(this),original=$target.text(),$target.data("values",function(t){var e=[original],i=original;if(!a.useSynonyms)return e;for(var s=0,n=t.length;n>s;s++)for(var r=0;r<t[s].src.length;r++)i=i.replace(t[s].src[r],t[s].dst);return!(i!==original)||e.push(i),e}(a.synonyms))});var l=function(){r.each(function(){var e=t(this);e.find('[data-instafilta-hide="false"]').length?e[a.sectionsShowEffect](a.sectionsShowDuration):e[a.sectionsHideEffect](a.sectionsHideDuration)})},f=function(t){var e=function(){return t?n.attr("data-instafilta-hide","false"):n}().filter('[data-instafilta-hide="false"]')[a.itemsShowEffect](a.itemsShowDuration);return t||n.filter('[data-instafilta-hide="true"]')[a.itemsHideEffect](a.itemsHideDuration),a.hideEmptySections&&l(),"function"==typeof a.onFilterComplete&&a.onFilterComplete.apply(this,[e]),e},u=function(){return f(!0)};i=function(e){return e=a.caseSensitive?e:e.toLowerCase(),c===e?!1:(c=e,e||u(),n.each(function(){var i=t(this);i.data("originalText")||(i.data("originalHtml",i.html()),i.data("originalText",i.data("values")[0]));var s=function(t,e){for(var i=-1,s=0;s<t.length&&(i=(a.caseSensitive?t[s]:t[s].toLowerCase()).indexOf(e),!(i>=0));s++);return i}(i.data("values"),e),n=i.data("originalText"),r=(a.caseSensitive?n:n.toLowerCase(),null),o=null;s>=0&&a.markMatches&&(r=n.substring(s,s+e.length),o=n.replace(r,'<span class="'+a.matchCssClass+'">'+r+"</span>"),i.html(i.data("originalHtml").replace(n,o))),i.attr("data-instafilta-hide",a.beginsWith&&0!==s||0>s?"true":"false")}),f())},s=function(e,i){return e&&e.length?("string"==typeof e&&(e=e.split(",")),n.each(function(){var s=!0,n=0,r=t(this),o=r.data(a.categoryDataAttr);if(o){o=o.split(",");for(var c=0;c<o.length;c++)for(var l=0;l<e.length;l++)if(o[c]===e[l]){if(!i){s=!1;break}n++}i&&n===e.length&&(s=!1),r.html(r.data("originalText")).attr("data-instafilta-hide",s)}}),f()):u()},t(this).on("keyup",function(){var s=t(this);clearTimeout(e),e=setTimeout(function(){i(s.val())},a.typeDelay)})}),{filterTerm:i,filterCategory:s}}}(jQuery);

View File

@ -1,229 +0,0 @@
/*! waitForImages jQuery Plugin - v2.2.0 - 2017-02-20
* https://github.com/alexanderdickson/waitForImages
* Copyright (c) 2017 Alex Dickson; Licensed MIT */
;(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS / nodejs module
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
// Namespace all events.
var eventNamespace = 'waitForImages';
// Is srcset supported by this browser?
var hasSrcset = (function(img) {
return img.srcset && img.sizes;
})(new Image());
// CSS properties which contain references to images.
$.waitForImages = {
hasImageProperties: [
'backgroundImage',
'listStyleImage',
'borderImage',
'borderCornerImage',
'cursor'
],
hasImageAttributes: ['srcset']
};
// Custom selector to find all `img` elements with a valid `src` attribute.
$.expr[':']['has-src'] = function (obj) {
// Ensure we are dealing with an `img` element with a valid
// `src` attribute.
return $(obj).is('img[src][src!=""]');
};
// Custom selector to find images which are not already cached by the
// browser.
$.expr[':'].uncached = function (obj) {
// Ensure we are dealing with an `img` element with a valid
// `src` attribute.
if (!$(obj).is(':has-src')) {
return false;
}
return !obj.complete;
};
$.fn.waitForImages = function () {
var allImgsLength = 0;
var allImgsLoaded = 0;
var deferred = $.Deferred();
var originalCollection = this;
var allImgs = [];
// CSS properties which may contain an image.
var hasImgProperties = $.waitForImages.hasImageProperties || [];
// Element attributes which may contain an image.
var hasImageAttributes = $.waitForImages.hasImageAttributes || [];
// To match `url()` references.
// Spec: http://www.w3.org/TR/CSS2/syndata.html#value-def-uri
var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g;
var finishedCallback;
var eachCallback;
var waitForAll;
// Handle options object (if passed).
if ($.isPlainObject(arguments[0])) {
waitForAll = arguments[0].waitForAll;
eachCallback = arguments[0].each;
finishedCallback = arguments[0].finished;
} else {
// Handle if using deferred object and only one param was passed in.
if (arguments.length === 1 && $.type(arguments[0]) === 'boolean') {
waitForAll = arguments[0];
} else {
finishedCallback = arguments[0];
eachCallback = arguments[1];
waitForAll = arguments[2];
}
}
// Handle missing callbacks.
finishedCallback = finishedCallback || $.noop;
eachCallback = eachCallback || $.noop;
// Convert waitForAll to Boolean.
waitForAll = !! waitForAll;
// Ensure callbacks are functions.
if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) {
throw new TypeError('An invalid callback was supplied.');
}
this.each(function () {
// Build a list of all imgs, dependent on what images will
// be considered.
var obj = $(this);
if (waitForAll) {
// Get all elements (including the original), as any one of
// them could have a background image.
obj.find('*').addBack().each(function () {
var element = $(this);
// If an `img` element, add it. But keep iterating in
// case it has a background image too.
if (element.is('img:has-src') &&
!element.is('[srcset]')) {
allImgs.push({
src: element.attr('src'),
element: element[0]
});
}
$.each(hasImgProperties, function (i, property) {
var propertyValue = element.css(property);
var match;
// If it doesn't contain this property, skip.
if (!propertyValue) {
return true;
}
// Get all url() of this element.
while (match = matchUrl.exec(propertyValue)) {
allImgs.push({
src: match[2],
element: element[0]
});
}
});
$.each(hasImageAttributes, function (i, attribute) {
var attributeValue = element.attr(attribute);
var attributeValues;
// If it doesn't contain this property, skip.
if (!attributeValue) {
return true;
}
allImgs.push({
src: element.attr('src'),
srcset: element.attr('srcset'),
element: element[0]
});
});
});
} else {
// For images only, the task is simpler.
obj.find('img:has-src')
.each(function () {
allImgs.push({
src: this.src,
element: this
});
});
}
});
allImgsLength = allImgs.length;
allImgsLoaded = 0;
// If no images found, don't bother.
if (allImgsLength === 0) {
finishedCallback.call(originalCollection);
deferred.resolveWith(originalCollection);
}
// Now that we've found all imgs in all elements in this,
// load them and attach callbacks.
$.each(allImgs, function (i, img) {
var image = new Image();
var events =
'load.' + eventNamespace + ' error.' + eventNamespace;
// Handle the image loading and error with the same callback.
$(image).one(events, function me (event) {
// If an error occurred with loading the image, set the
// third argument accordingly.
var eachArguments = [
allImgsLoaded,
allImgsLength,
event.type == 'load'
];
allImgsLoaded++;
eachCallback.apply(img.element, eachArguments);
deferred.notifyWith(img.element, eachArguments);
// Unbind the event listeners. I use this in addition to
// `one` as one of those events won't be called (either
// 'load' or 'error' will be called).
$(this).off(events, me);
if (allImgsLoaded == allImgsLength) {
finishedCallback.call(originalCollection[0]);
deferred.resolveWith(originalCollection[0]);
return false;
}
});
if (hasSrcset && img.srcset) {
image.srcset = img.srcset;
image.sizes = img.sizes;
}
image.src = img.src;
});
return deferred.promise();
};
}));

View File

@ -1 +0,0 @@
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(m){var e,p="waitForImages",g=(e=new Image).srcset&&e.sizes;m.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage","cursor"],hasImageAttributes:["srcset"]},m.expr[":"]["has-src"]=function(e){return m(e).is('img[src][src!=""]')},m.expr[":"].uncached=function(e){return!!m(e).is(":has-src")&&!e.complete},m.fn.waitForImages=function(){var n,a,c,r,o=0,u=m.Deferred(),h=this,f=[],s=m.waitForImages.hasImageProperties||[],t=m.waitForImages.hasImageAttributes||[],l=/url\(\s*(['"]?)(.*?)\1\s*\)/g;if(m.isPlainObject(arguments[0])?(r=arguments[0].waitForAll,c=arguments[0].each,a=arguments[0].finished):r=1===arguments.length&&"boolean"===m.type(arguments[0])?arguments[0]:(a=arguments[0],c=arguments[1],arguments[2]),a=a||m.noop,c=c||m.noop,r=!!r,!m.isFunction(a)||!m.isFunction(c))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var e=m(this);r?e.find("*").addBack().each(function(){var i=m(this);i.is("img:has-src")&&!i.is("[srcset]")&&f.push({src:i.attr("src"),element:i[0]}),m.each(s,function(e,r){var s,t=i.css(r);if(!t)return!0;for(;s=l.exec(t);)f.push({src:s[2],element:i[0]})}),m.each(t,function(e,r){if(!i.attr(r))return!0;f.push({src:i.attr("src"),srcset:i.attr("srcset"),element:i[0]})})}):e.find("img:has-src").each(function(){f.push({src:this.src,element:this})})}),n=f.length,(o=0)===n&&(a.call(h),u.resolveWith(h)),m.each(f,function(e,t){var r=new Image,i="load."+p+" error."+p;m(r).one(i,function e(r){var s=[o,n,"load"==r.type];if(o++,c.apply(t.element,s),u.notifyWith(t.element,s),m(this).off(i,e),o==n)return a.call(h[0]),u.resolveWith(h[0]),!1}),g&&t.srcset&&(r.srcset=t.srcset,r.sizes=t.sizes),r.src=t.src}),u.promise()}});

View File

@ -1,744 +0,0 @@
/*!
* SlickQuiz jQuery Plugin
* http://github.com/jewlofthelotus/SlickQuiz
*
* @updated October 25, 2014
* @version 1.5.20
*
* @author Julie Cameron - http://www.juliecameron.com
* @copyright (c) 2013 Quicken Loans - http://www.quickenloans.com
* @license MIT
*/
(function($){
$.slickQuiz = function(element, options) {
var plugin = this,
$element = $(element),
_element = '#' + $element.attr('id'),
defaults = {
checkAnswerText: 'Check My Answer!',
nextQuestionText: 'Next <i class="material-icons">&#xE5CC;</i>',
backButtonText: '',
completeQuizText: '',
tryAgainText: '',
questionCountText: 'Question %current of %total',
preventUnansweredText: 'You must select at least one answer.',
questionTemplateText: '%count. %text',
scoreTemplateText: '%score / %total',
nameTemplateText: '<span>Quiz: </span>%name',
skipStartButton: false,
numberOfQuestions: null,
randomSortQuestions: false,
randomSortAnswers: false,
preventUnanswered: false,
disableScore: false,
disableRanking: false,
scoreAsPercentage: false,
perQuestionResponseMessaging: true,
perQuestionResponseAnswers: false,
completionResponseMessaging: false,
displayQuestionCount: true, // Deprecate?
displayQuestionNumber: true, // Deprecate?
animationCallbacks: { // only for the methods that have jQuery animations offering callback
setupQuiz: function () {},
startQuiz: function () {},
resetQuiz: function () {},
checkAnswer: function () {},
nextQuestion: function () {},
backToQuestion: function () {},
completeQuiz: function () {}
},
events: {
onStartQuiz: function (options) {},
onCompleteQuiz: function (options) {} // reserved: options.questionCount, options.score
}
},
// Class Name Strings (Used for building quiz and for selectors)
questionCountClass = 'questionCount',
questionGroupClass = 'questions',
questionClass = 'question',
answersClass = 'answers',
responsesClass = 'responses',
completeClass = 'complete',
correctClass = 'correctResponse',
incorrectClass = 'incorrectResponse',
correctResponseClass = 'correct',
incorrectResponseClass = 'incorrect',
checkAnswerClass = 'checkAnswer',
nextQuestionClass = 'nextQuestion',
lastQuestionClass = 'lastQuestion',
backToQuestionClass = 'backToQuestion',
tryAgainClass = 'tryAgain',
// Sub-Quiz / Sub-Question Class Selectors
_questionCount = '.' + questionCountClass,
_questions = '.' + questionGroupClass,
_question = '.' + questionClass,
_answers = '.' + answersClass,
_answer = '.' + answersClass + ' li',
_responses = '.' + responsesClass,
_response = '.' + responsesClass + ' li',
_correct = '.' + correctClass,
_correctResponse = '.' + correctResponseClass,
_incorrectResponse = '.' + incorrectResponseClass,
_checkAnswerBtn = '.' + checkAnswerClass,
_nextQuestionBtn = '.' + nextQuestionClass,
_prevQuestionBtn = '.' + backToQuestionClass,
_tryAgainBtn = '.' + tryAgainClass,
// Top Level Quiz Element Class Selectors
_quizStarter = _element + ' .startQuiz',
_quizName = _element + ' .quizName',
_quizArea = _element + ' .quizArea',
_quizResults = _element + ' .quizResults',
_quizResultsCopy = _element + ' .quizResultsCopy',
_quizHeader = _element + ' .quizHeader',
_quizScore = _element + ' .quizScore',
_quizLevel = _element + ' .quizLevel',
// Top Level Quiz Element Objects
$quizStarter = $(_quizStarter),
$quizName = $(_quizName),
$quizArea = $(_quizArea),
$quizResults = $(_quizResults),
$quizResultsCopy = $(_quizResultsCopy),
$quizHeader = $(_quizHeader),
$quizScore = $(_quizScore),
$quizLevel = $(_quizLevel)
;
// Reassign user-submitted deprecated options
var depMsg = '';
if (options && typeof options.disableNext != 'undefined') {
if (typeof options.preventUnanswered == 'undefined') {
options.preventUnanswered = options.disableNext;
}
depMsg += 'The \'disableNext\' option has been deprecated, please use \'preventUnanswered\' in it\'s place.\n\n';
}
if (options && typeof options.disableResponseMessaging != 'undefined') {
if (typeof options.preventUnanswered == 'undefined') {
options.perQuestionResponseMessaging = options.disableResponseMessaging;
}
depMsg += 'The \'disableResponseMessaging\' option has been deprecated, please use' +
' \'perQuestionResponseMessaging\' and \'completionResponseMessaging\' in it\'s place.\n\n';
}
if (options && typeof options.randomSort != 'undefined') {
if (typeof options.randomSortQuestions == 'undefined') {
options.randomSortQuestions = options.randomSort;
}
if (typeof options.randomSortAnswers == 'undefined') {
options.randomSortAnswers = options.randomSort;
}
depMsg += 'The \'randomSort\' option has been deprecated, please use' +
' \'randomSortQuestions\' and \'randomSortAnswers\' in it\'s place.\n\n';
}
if (depMsg !== '') {
if (typeof console != 'undefined') {
console.warn(depMsg);
} else {
alert(depMsg);
}
}
// End of deprecation reassignment
plugin.config = $.extend(defaults, options);
// Set via json option or quizJSON variable (see slickQuiz-config.js)
var quizValues = (plugin.config.json ? plugin.config.json : typeof quizJSON != 'undefined' ? quizJSON : null);
// Get questions, possibly sorted randomly
var questions = plugin.config.randomSortQuestions ?
quizValues.questions.sort(function() { return (Math.round(Math.random())-0.5); }) :
quizValues.questions;
// Count the number of questions
var questionCount = questions.length;
// Select X number of questions to load if options is set
if (plugin.config.numberOfQuestions && questionCount >= plugin.config.numberOfQuestions) {
questions = questions.slice(0, plugin.config.numberOfQuestions);
questionCount = questions.length;
}
// some special private/internal methods
var internal = {method: {
// get a key whose notches are "resolved jQ deferred" objects; one per notch on the key
// think of the key as a house key with notches on it
getKey: function (notches) { // returns [], notches >= 1
var key = [];
for (i=0; i<notches; i++) key[i] = $.Deferred ();
return key;
},
// put the key in the door, if all the notches pass then you can turn the key and "go"
turnKeyAndGo: function (key, go) { // key = [], go = function ()
// when all the notches of the key are accepted (resolved) then the key turns and the engine (callback/go) starts
$.when.apply (null, key). then (function () {
go ();
});
},
// get one jQ
getKeyNotch: function (key, notch) { // notch >= 1, key = []
// key has several notches, numbered as 1, 2, 3, ... (no zero notch)
// we resolve and return the "jQ deferred" object at specified notch
return function () {
key[notch-1].resolve (); // it is ASSUMED that you initiated the key with enough notches
};
}
}};
plugin.method = {
// Sets up the questions and answers based on above array
setupQuiz: function(options) { // use 'options' object to pass args
var key, keyNotch, kN;
key = internal.method.getKey (3); // how many notches == how many jQ animations you will run
keyNotch = internal.method.getKeyNotch; // a function that returns a jQ animation callback function
kN = keyNotch; // you specify the notch, you get a callback function for your animation
$quizName.hide().html(plugin.config.nameTemplateText
.replace('%name', quizValues.info.name) ).fadeIn(1000, kN(key,1));
$quizHeader.hide().prepend($('<div class="quizDescription">' + quizValues.info.main + '</div>')).fadeIn(1000, kN(key,2));
$quizResultsCopy.append(quizValues.info.results);
// add retry button to results view, if enabled
if (plugin.config.tryAgainText && plugin.config.tryAgainText !== '') {
$quizResultsCopy.append('<p><a class="button ' + tryAgainClass + '" href="#">' + plugin.config.tryAgainText + '</a></p>');
}
// Setup questions
var quiz = $('<ol class="' + questionGroupClass + '"></ol>'),
count = 1;
// Loop through questions object
for (i in questions) {
if (questions.hasOwnProperty(i)) {
var question = questions[i];
var questionHTML = $('<li class="' + questionClass +'" id="question' + (count - 1) + '"></li>');
if (plugin.config.displayQuestionCount) {
questionHTML.append('<div class="' + questionCountClass + '">' +
plugin.config.questionCountText
.replace('%current', '<span class="current">' + count + '</span>')
.replace('%total', '<span class="total">' +
questionCount + '</span>') + '</div>');
}
var formatQuestion = '';
if (plugin.config.displayQuestionNumber) {
formatQuestion = plugin.config.questionTemplateText
.replace('%count', count).replace('%text', question.q);
} else {
formatQuestion = question.q;
}
questionHTML.append('<h3>' + formatQuestion + '</h3>');
// Count the number of true values
var truths = 0;
for (i in question.a) {
if (question.a.hasOwnProperty(i)) {
answer = question.a[i];
if (answer.correct) {
truths++;
}
}
}
// Now let's append the answers with checkboxes or radios depending on truth count
var answerHTML = $('<ul class="' + answersClass + '"></ul>');
// Get the answers
var answers = plugin.config.randomSortAnswers ?
question.a.sort(function() { return (Math.round(Math.random())-0.5); }) :
question.a;
// prepare a name for the answer inputs based on the question
var selectAny = question.select_any ? question.select_any : false,
forceCheckbox = question.force_checkbox ? question.force_checkbox : false,
checkbox = (truths > 1 && !selectAny) || forceCheckbox,
inputName = $element.attr('id') + '_question' + (count - 1),
inputType = checkbox ? 'checkbox' : 'radio';
if( count == quizValues.questions.length ) {
nextQuestionClass = nextQuestionClass + ' ' + lastQuestionClass;
}
for (i in answers) {
if (answers.hasOwnProperty(i)) {
answer = answers[i],
optionId = inputName + '_' + i.toString();
// If question has >1 true answers and is not a select any, use checkboxes; otherwise, radios
var input = '<input id="' + optionId + '" name="' + inputName +
'" type="' + inputType + '" /> ';
var optionLabel = '<label for="' + optionId + '">' + answer.option + '</label>';
var answerContent = $('<li></li>')
.append(input)
.append(optionLabel);
answerHTML.append(answerContent);
}
}
// Append answers to question
questionHTML.append(answerHTML);
// If response messaging is NOT disabled, add it
if (plugin.config.perQuestionResponseMessaging || plugin.config.completionResponseMessaging) {
// Now let's append the correct / incorrect response messages
var responseHTML = $('<ul class="' + responsesClass + '"></ul>');
responseHTML.append('<li class="' + correctResponseClass + '">' + question.correct + '</li>');
responseHTML.append('<li class="' + incorrectResponseClass + '">' + question.incorrect + '</li>');
// Append responses to question
questionHTML.append(responseHTML);
}
// Appends check answer / back / next question buttons
if (plugin.config.backButtonText && plugin.config.backButtonText !== '') {
questionHTML.append('<a href="#" class="md-btn md-btn-large ' + backToQuestionClass + '">' + plugin.config.backButtonText + '</a>');
}
var nextText = plugin.config.nextQuestionText;
if (plugin.config.completeQuizText && count == questionCount) {
nextText = plugin.config.completeQuizText;
}
// If we're not showing responses per question, show next question button and make it check the answer too
if (!plugin.config.perQuestionResponseMessaging) {
questionHTML.append('<a href="#" class="md-btn md-btn-large ' + nextQuestionClass + ' ' + checkAnswerClass + '">' + nextText + '</a>');
} else {
questionHTML.append('<a href="#" class="md-btn md-btn-large ' + nextQuestionClass + '">' + nextText + '</a>');
questionHTML.append('<a href="#" class="md-btn md-btn-large ' + checkAnswerClass + '">' + plugin.config.checkAnswerText + '</a>');
}
// Append question & answers to quiz
quiz.append(questionHTML);
count++;
}
}
// Add the quiz content to the page
$quizArea.append(quiz);
// Toggle the start button OR start the quiz if start button is disabled
if (plugin.config.skipStartButton || $quizStarter.length == 0) {
$quizStarter.hide();
plugin.method.startQuiz.apply (this, [{callback: plugin.config.animationCallbacks.startQuiz}]); // TODO: determine why 'this' is being passed as arg to startQuiz method
kN(key,3).apply (null, []);
} else {
$quizStarter.fadeIn(500, kN(key,3)).css('display', 'inline-block'); // 3d notch on key must be on both sides of if/else, otherwise key won't turn
}
internal.method.turnKeyAndGo (key, options && options.callback ? options.callback : function () {});
},
// Starts the quiz (hides start button and displays first question)
startQuiz: function(options) {
var key, keyNotch, kN;
key = internal.method.getKey (1); // how many notches == how many jQ animations you will run
keyNotch = internal.method.getKeyNotch; // a function that returns a jQ animation callback function
kN = keyNotch; // you specify the notch, you get a callback function for your animation
function start(options) {
var firstQuestion = $(_element + ' ' + _questions + ' li').first();
if (firstQuestion.length) {
firstQuestion.fadeIn(500, function () {
if (options && options.callback) options.callback ();
});
}
}
if (plugin.config.skipStartButton || $quizStarter.length == 0) {
start({callback: kN(key,1)});
} else {
$quizStarter.fadeOut(300, function(){
start({callback: kN(key,1)}); // 1st notch on key must be on both sides of if/else, otherwise key won't turn
});
}
internal.method.turnKeyAndGo (key, options && options.callback ? options.callback : function () {});
if (plugin.config.events &&
plugin.config.events.onStartQuiz) {
plugin.config.events.onStartQuiz.apply (null, []);
}
},
// Resets (restarts) the quiz (hides results, resets inputs, and displays first question)
resetQuiz: function(startButton, options) {
var key, keyNotch, kN;
key = internal.method.getKey (1); // how many notches == how many jQ animations you will run
keyNotch = internal.method.getKeyNotch; // a function that returns a jQ animation callback function
kN = keyNotch; // you specify the notch, you get a callback function for your animation
$quizResults.fadeOut(300, function() {
$(_element + ' input').prop('checked', false).prop('disabled', false);
$quizLevel.attr('class', 'quizLevel');
$(_element + ' ' + _question).removeClass(correctClass).removeClass(incorrectClass).remove(completeClass);
$(_element + ' ' + _answer).removeClass(correctResponseClass).removeClass(incorrectResponseClass);
$(_element + ' ' + _question + ',' +
_element + ' ' + _responses + ',' +
_element + ' ' + _response + ',' +
_element + ' ' + _nextQuestionBtn + ',' +
_element + ' ' + _prevQuestionBtn
).hide();
$(_element + ' ' + _questionCount + ',' +
_element + ' ' + _answers + ',' +
_element + ' ' + _checkAnswerBtn
).show();
$quizArea.append($(_element + ' ' + _questions)).show();
kN(key,1).apply (null, []);
plugin.method.startQuiz({callback: plugin.config.animationCallbacks.startQuiz},$quizResults); // TODO: determine why $quizResults is being passed
});
internal.method.turnKeyAndGo (key, options && options.callback ? options.callback : function () {});
},
// Validates the response selection(s), displays explanations & next question button
checkAnswer: function(checkButton, options) {
var key, keyNotch, kN;
key = internal.method.getKey (2); // how many notches == how many jQ animations you will run
keyNotch = internal.method.getKeyNotch; // a function that returns a jQ animation callback function
kN = keyNotch; // you specify the notch, you get a callback function for your animation
var questionLI = $($(checkButton).parents(_question)[0]),
answerLIs = questionLI.find(_answers + ' li'),
answerSelects = answerLIs.find('input:checked'),
questionIndex = parseInt(questionLI.attr('id').replace(/(question)/, ''), 10),
answers = questions[questionIndex].a,
selectAny = questions[questionIndex].select_any ? questions[questionIndex].select_any : false;
answerLIs.addClass(incorrectResponseClass);
// Collect the true answers needed for a correct response
var trueAnswers = [];
for (i in answers) {
if (answers.hasOwnProperty(i)) {
var answer = answers[i],
index = parseInt(i, 10);
if (answer.correct) {
trueAnswers.push(index);
answerLIs.eq(index).removeClass(incorrectResponseClass).addClass(correctResponseClass);
}
}
}
// TODO: Now that we're marking answer LIs as correct / incorrect, we might be able
// to do all our answer checking at the same time
// NOTE: Collecting answer index for comparison aims to ensure that HTML entities
// and HTML elements that may be modified by the browser / other scrips match up
// Collect the answers submitted
var selectedAnswers = [];
answerSelects.each( function() {
var id = $(this).attr('id');
selectedAnswers.push(parseInt(id.replace(/(.*\_question\d{1,}_)/, ''), 10));
});
if (plugin.config.preventUnanswered && selectedAnswers.length === 0) {
alert(plugin.config.preventUnansweredText);
return false;
}
// Verify all/any true answers (and no false ones) were submitted
var correctResponse = plugin.method.compareAnswers(trueAnswers, selectedAnswers, selectAny);
if (correctResponse) {
questionLI.addClass(correctClass);
} else {
questionLI.addClass(incorrectClass);
}
// Toggle appropriate response (either for display now and / or on completion)
questionLI.find(correctResponse ? _correctResponse : _incorrectResponse).show();
// If perQuestionResponseMessaging is enabled, toggle response and navigation now
if (plugin.config.perQuestionResponseMessaging) {
$(checkButton).hide();
if (!plugin.config.perQuestionResponseAnswers) {
// Make sure answers don't highlight for a split second before they hide
questionLI.find(_answers).hide({
duration: 0,
complete: function() {
questionLI.addClass(completeClass);
}
});
} else {
questionLI.addClass(completeClass);
}
questionLI.find('input').prop('disabled', true);
questionLI.find(_responses).show();
questionLI.find(_nextQuestionBtn).fadeIn(300, kN(key,1)).css('display','inline-block');
questionLI.find(_prevQuestionBtn).fadeIn(300, kN(key,2)).css('display','inline-block');
if (!questionLI.find(_prevQuestionBtn).length) kN(key,2).apply (null, []); // 2nd notch on key must be passed even if there's no "back" button
} else {
kN(key,1).apply (null, []); // 1st notch on key must be on both sides of if/else, otherwise key won't turn
kN(key,2).apply (null, []); // 2nd notch on key must be on both sides of if/else, otherwise key won't turn
}
internal.method.turnKeyAndGo (key, options && options.callback ? options.callback : function () {});
},
// Moves to the next question OR completes the quiz if on last question
nextQuestion: function(nextButton, options) {
var key, keyNotch, kN;
key = internal.method.getKey (1); // how many notches == how many jQ animations you will run
keyNotch = internal.method.getKeyNotch; // a function that returns a jQ animation callback function
kN = keyNotch; // you specify the notch, you get a callback function for your animation
var currentQuestion = $($(nextButton).parents(_question)[0]),
nextQuestion = currentQuestion.next(_question),
answerInputs = currentQuestion.find('input:checked');
// If response messaging has been disabled or moved to completion,
// make sure we have an answer if we require it, let checkAnswer handle the alert messaging
if (plugin.config.preventUnanswered && answerInputs.length === 0) {
return false;
}
if (nextQuestion.length) {
currentQuestion.fadeOut(300, function(){
nextQuestion.find(_prevQuestionBtn).show().end().fadeIn(500, kN(key,1));
if (!nextQuestion.find(_prevQuestionBtn).show().end().length) kN(key,1).apply (null, []); // 1st notch on key must be passed even if there's no "back" button
});
} else {
kN(key,1).apply (null, []); // 1st notch on key must be on both sides of if/else, otherwise key won't turn
plugin.method.completeQuiz({callback: plugin.config.animationCallbacks.completeQuiz});
}
internal.method.turnKeyAndGo (key, options && options.callback ? options.callback : function () {});
},
// Go back to the last question
backToQuestion: function(backButton, options) {
var key, keyNotch, kN;
key = internal.method.getKey (2); // how many notches == how many jQ animations you will run
keyNotch = internal.method.getKeyNotch; // a function that returns a jQ animation callback function
kN = keyNotch; // you specify the notch, you get a callback function for your animation
var questionLI = $($(backButton).parents(_question)[0]),
responses = questionLI.find(_responses);
// Back to question from responses
if (responses.css('display') === 'block' ) {
questionLI.find(_responses).fadeOut(300, function(){
questionLI.removeClass(correctClass).removeClass(incorrectClass).removeClass(completeClass);
questionLI.find(_responses + ', ' + _response).hide();
questionLI.find(_answers).show();
questionLI.find(_answer).removeClass(correctResponseClass).removeClass(incorrectResponseClass);
questionLI.find('input').prop('disabled', false);
questionLI.find(_answers).fadeIn(500, kN(key,1)); // 1st notch on key must be on both sides of if/else, otherwise key won't turn
questionLI.find(_checkAnswerBtn).fadeIn(500, kN(key,2));
questionLI.find(_nextQuestionBtn).hide();
// if question is first, don't show back button on question
if (questionLI.attr('id') != 'question0') {
questionLI.find(_prevQuestionBtn).show();
} else {
questionLI.find(_prevQuestionBtn).hide();
}
});
// Back to previous question
} else {
var prevQuestion = questionLI.prev(_question);
questionLI.fadeOut(300, function() {
prevQuestion.removeClass(correctClass).removeClass(incorrectClass).removeClass(completeClass);
prevQuestion.find(_responses + ', ' + _response).hide();
prevQuestion.find(_answers).show();
prevQuestion.find(_answer).removeClass(correctResponseClass).removeClass(incorrectResponseClass);
prevQuestion.find('input').prop('disabled', false);
prevQuestion.find(_nextQuestionBtn).hide();
prevQuestion.find(_checkAnswerBtn).show();
if (prevQuestion.attr('id') != 'question0') {
prevQuestion.find(_prevQuestionBtn).show();
} else {
prevQuestion.find(_prevQuestionBtn).hide();
}
prevQuestion.fadeIn(500, kN(key,1));
kN(key,2).apply (null, []); // 2nd notch on key must be on both sides of if/else, otherwise key won't turn
});
}
internal.method.turnKeyAndGo (key, options && options.callback ? options.callback : function () {});
},
// Hides all questions, displays the final score and some conclusive information
completeQuiz: function(options) {
var key, keyNotch, kN;
key = internal.method.getKey (1); // how many notches == how many jQ animations you will run
keyNotch = internal.method.getKeyNotch; // a function that returns a jQ animation callback function
kN = keyNotch; // you specify the notch, you get a callback function for your animation
var score = $(_element + ' ' + _correct).length,
displayScore = score;
if (plugin.config.scoreAsPercentage) {
displayScore = (score / questionCount).toFixed(2)*100 + "%";
}
if (plugin.config.disableScore) {
$(_quizScore).remove()
} else {
$(_quizScore + ' span').html(plugin.config.scoreTemplateText
.replace('%score', displayScore).replace('%total', questionCount));
}
if (plugin.config.disableRanking) {
$(_quizLevel).remove()
} else {
var levels = [
quizValues.info.level1, // 80-100%
quizValues.info.level2, // 60-79%
quizValues.info.level3, // 40-59%
quizValues.info.level4, // 20-39%
quizValues.info.level5 // 0-19%
],
levelRank = plugin.method.calculateLevel(score),
levelText = $.isNumeric(levelRank) ? levels[levelRank] : '';
$(_quizLevel + ' span').html(levelText);
$(_quizLevel).addClass('level' + levelRank);
}
$quizArea.fadeOut(300, function() {
// If response messaging is set to show upon quiz completion, show it now
if (plugin.config.completionResponseMessaging) {
$(_element + ' .button:not(' + _tryAgainBtn + '), ' + _element + ' ' + _questionCount).hide();
$(_element + ' ' + _question + ', ' + _element + ' ' + _answers + ', ' + _element + ' ' + _responses).show();
$quizResults.append($(_element + ' ' + _questions)).fadeIn(500, kN(key,1));
} else {
$quizResults.fadeIn(500, kN(key,1)); // 1st notch on key must be on both sides of if/else, otherwise key won't turn
}
});
internal.method.turnKeyAndGo (key, options && options.callback ? options.callback : function () {});
if (plugin.config.events &&
plugin.config.events.onCompleteQuiz) {
plugin.config.events.onCompleteQuiz.apply (null, [{
questionCount: questionCount,
score: score
}]);
}
},
// Compares selected responses with true answers, returns true if they match exactly
compareAnswers: function(trueAnswers, selectedAnswers, selectAny) {
if ( selectAny ) {
return $.inArray(selectedAnswers[0], trueAnswers) > -1;
} else {
// crafty array comparison (http://stackoverflow.com/a/7726509)
return ($(trueAnswers).not(selectedAnswers).length === 0 && $(selectedAnswers).not(trueAnswers).length === 0);
}
},
// Calculates knowledge level based on number of correct answers
calculateLevel: function(correctAnswers) {
var percent = (correctAnswers / questionCount).toFixed(2),
level = null;
if (plugin.method.inRange(0, 0.20, percent)) {
level = 4;
} else if (plugin.method.inRange(0.21, 0.40, percent)) {
level = 3;
} else if (plugin.method.inRange(0.41, 0.60, percent)) {
level = 2;
} else if (plugin.method.inRange(0.61, 0.80, percent)) {
level = 1;
} else if (plugin.method.inRange(0.81, 1.00, percent)) {
level = 0;
}
return level;
},
// Determines if percentage of correct values is within a level range
inRange: function(start, end, value) {
return (value >= start && value <= end);
}
};
plugin.init = function() {
// Setup quiz
plugin.method.setupQuiz.apply (null, [{callback: plugin.config.animationCallbacks.setupQuiz}]);
// Bind "start" button
$quizStarter.on('click', function(e) {
e.preventDefault();
if (!this.disabled && !$(this).hasClass('disabled')) {
plugin.method.startQuiz.apply (null, [{callback: plugin.config.animationCallbacks.startQuiz}]);
}
});
// Bind "try again" button
$(_element + ' ' + _tryAgainBtn).on('click', function(e) {
e.preventDefault();
plugin.method.resetQuiz(this, {callback: plugin.config.animationCallbacks.resetQuiz});
});
// Bind "check answer" buttons
$(_element + ' ' + _checkAnswerBtn).on('click', function(e) {
e.preventDefault();
plugin.method.checkAnswer(this, {callback: plugin.config.animationCallbacks.checkAnswer});
});
// Bind "back" buttons
$(_element + ' ' + _prevQuestionBtn).on('click', function(e) {
e.preventDefault();
plugin.method.backToQuestion(this, {callback: plugin.config.animationCallbacks.backToQuestion});
});
// Bind "next" buttons
$(_element + ' ' + _nextQuestionBtn).on('click', function(e) {
e.preventDefault();
plugin.method.nextQuestion(this, {callback: plugin.config.animationCallbacks.nextQuestion});
});
// Accessibility (WAI-ARIA).
var _qnid = $element.attr('id') + '-name';
$quizName.attr('id', _qnid);
$element.attr({
'aria-labelledby': _qnid,
'aria-live': 'polite',
'aria-relevant': 'additions',
'role': 'form'
});
$(_quizStarter + ', [href = "#"]').attr('role', 'button');
};
plugin.init();
};
$.fn.slickQuiz = function(options) {
return this.each(function() {
if (undefined === $(this).data('slickQuiz')) {
var plugin = new $.slickQuiz(this, options);
$(this).data('slickQuiz', plugin);
}
});
};
})(jQuery);

View File

@ -1,35 +0,0 @@
/*
SlickQuiz jQuery Plugin
http://github.com/jewlofthelotus/SlickQuiz
@updated October 25, 2014
@version 1.5.20
@author Julie Cameron - http://www.juliecameron.com
@copyright (c) 2013 Quicken Loans - http://www.quickenloans.com
@license MIT
*/
(function(b){b.slickQuiz=function(C,c){var a=this,y=b(C),e="#"+y.attr("id"),z="nextQuestion",v="."+z,F=e+" .startQuiz",h=e+" .quizName",I=e+" .quizArea",J=e+" .quizResults",K=e+" .quizResultsCopy",L=e+" .quizHeader",D=e+" .quizScore",A=e+" .quizLevel",q=b(F),G=b(h),E=b(I),B=b(J),H=b(K),M=b(L);b(D);var N=b(A),h="";c&&"undefined"!=typeof c.disableNext&&("undefined"==typeof c.preventUnanswered&&(c.preventUnanswered=c.disableNext),h+="The 'disableNext' option has been deprecated, please use 'preventUnanswered' in it's place.\n\n");
c&&"undefined"!=typeof c.disableResponseMessaging&&("undefined"==typeof c.preventUnanswered&&(c.perQuestionResponseMessaging=c.disableResponseMessaging),h+="The 'disableResponseMessaging' option has been deprecated, please use 'perQuestionResponseMessaging' and 'completionResponseMessaging' in it's place.\n\n");c&&"undefined"!=typeof c.randomSort&&("undefined"==typeof c.randomSortQuestions&&(c.randomSortQuestions=c.randomSort),"undefined"==typeof c.randomSortAnswers&&(c.randomSortAnswers=c.randomSort),
h+="The 'randomSort' option has been deprecated, please use 'randomSortQuestions' and 'randomSortAnswers' in it's place.\n\n");""!==h&&("undefined"!=typeof console?console.warn(h):alert(h));a.config=b.extend({checkAnswerText:"Check My Answer!",nextQuestionText:'Next <i class="material-icons">&#xE5CC;</i>',backButtonText:"",completeQuizText:"",tryAgainText:"",questionCountText:"Question %current of %total",preventUnansweredText:"You must select at least one answer.",questionTemplateText:"%count. %text",
scoreTemplateText:"%score / %total",nameTemplateText:"<span>Quiz: </span>%name",skipStartButton:!1,numberOfQuestions:null,randomSortQuestions:!1,randomSortAnswers:!1,preventUnanswered:!1,disableScore:!1,disableRanking:!1,scoreAsPercentage:!1,perQuestionResponseMessaging:!0,perQuestionResponseAnswers:!1,completionResponseMessaging:!1,displayQuestionCount:!0,displayQuestionNumber:!0,animationCallbacks:{setupQuiz:function(){},startQuiz:function(){},resetQuiz:function(){},checkAnswer:function(){},nextQuestion:function(){},
backToQuestion:function(){},completeQuiz:function(){}},events:{onStartQuiz:function(a){},onCompleteQuiz:function(a){}}},c);var p=a.config.json?a.config.json:"undefined"!=typeof quizJSON?quizJSON:null,r=a.config.randomSortQuestions?p.questions.sort(function(){return Math.round(Math.random())-.5}):p.questions,t=r.length;a.config.numberOfQuestions&&t>=a.config.numberOfQuestions&&(r=r.slice(0,a.config.numberOfQuestions),t=r.length);var k={getKey:function(a){var d=[];for(i=0;i<a;i++)d[i]=b.Deferred();
return d},turnKeyAndGo:function(a,d){b.when.apply(null,a).then(function(){d()})},getKeyNotch:function(a,d){return function(){a[d-1].resolve()}}};a.method={setupQuiz:function(m){var d=k.getKey(3);var l=k.getKeyNotch;G.hide().html(a.config.nameTemplateText.replace("%name",p.info.name)).fadeIn(1E3,l(d,1));M.hide().prepend(b('<div class="quizDescription">'+p.info.main+"</div>")).fadeIn(1E3,l(d,2));H.append(p.info.results);a.config.tryAgainText&&""!==a.config.tryAgainText&&H.append('<p><a class="button tryAgain" href="#">'+
a.config.tryAgainText+"</a></p>");var e=b('<ol class="questions"></ol>'),f=1;for(i in r)if(r.hasOwnProperty(i)){var g=r[i],c=b('<li class="question" id="question'+(f-1)+'"></li>');a.config.displayQuestionCount&&c.append('<div class="questionCount">'+a.config.questionCountText.replace("%current",'<span class="current">'+f+"</span>").replace("%total",'<span class="total">'+t+"</span>")+"</div>");var n="",n=a.config.displayQuestionNumber?a.config.questionTemplateText.replace("%count",f).replace("%text",
g.q):g.q;c.append("<h3>"+n+"</h3>");var w=0;for(i in g.a)g.a.hasOwnProperty(i)&&(answer=g.a[i],answer.correct&&w++);var n=b('<ul class="answers"></ul>'),h=a.config.randomSortAnswers?g.a.sort(function(){return Math.round(Math.random())-.5}):g.a,x=g.select_any?g.select_any:!1,u=g.force_checkbox?g.force_checkbox:!1,x=1<w&&!x||u,w=y.attr("id")+"_question"+(f-1),x=x?"checkbox":"radio";f==p.questions.length&&(z+=" lastQuestion");for(i in h)if(h.hasOwnProperty(i)){answer=h[i];optionId=w+"_"+i.toString();
var u='<input id="'+optionId+'" name="'+w+'" type="'+x+'" /> ',v='<label for="'+optionId+'">'+answer.option+"</label>",u=b("<li></li>").append(u).append(v);n.append(u)}c.append(n);if(a.config.perQuestionResponseMessaging||a.config.completionResponseMessaging)n=b('<ul class="responses"></ul>'),n.append('<li class="correct">'+g.correct+"</li>"),n.append('<li class="incorrect">'+g.incorrect+"</li>"),c.append(n);a.config.backButtonText&&""!==a.config.backButtonText&&c.append('<a href="#" class="md-btn md-btn-large backToQuestion">'+
a.config.backButtonText+"</a>");g=a.config.nextQuestionText;a.config.completeQuizText&&f==t&&(g=a.config.completeQuizText);a.config.perQuestionResponseMessaging?(c.append('<a href="#" class="md-btn md-btn-large '+z+'">'+g+"</a>"),c.append('<a href="#" class="md-btn md-btn-large checkAnswer">'+a.config.checkAnswerText+"</a>")):c.append('<a href="#" class="md-btn md-btn-large '+z+' checkAnswer">'+g+"</a>");e.append(c);f++}E.append(e);a.config.skipStartButton||0==q.length?(q.hide(),a.method.startQuiz.apply(this,
[{callback:a.config.animationCallbacks.startQuiz}]),l(d,3).apply(null,[])):q.fadeIn(500,l(d,3)).css("display","inline-block");k.turnKeyAndGo(d,m&&m.callback?m.callback:function(){})},startQuiz:function(m){function d(a){var d=b(e+" .questions li").first();d.length&&d.fadeIn(500,function(){a&&a.callback&&a.callback()})}var l=k.getKey(1);var c=k.getKeyNotch;a.config.skipStartButton||0==q.length?d({callback:c(l,1)}):q.fadeOut(300,function(){d({callback:c(l,1)})});k.turnKeyAndGo(l,m&&m.callback?m.callback:
function(){});a.config.events&&a.config.events.onStartQuiz&&a.config.events.onStartQuiz.apply(null,[])},resetQuiz:function(m,d){var l=k.getKey(1);var c=k.getKeyNotch;B.fadeOut(300,function(){b(e+" input").prop("checked",!1).prop("disabled",!1);N.attr("class","quizLevel");b(e+" .question").removeClass("correctResponse").removeClass("incorrectResponse").remove("complete");b(e+" .answers li").removeClass("correct").removeClass("incorrect");b(e+" .question,"+e+" .responses,"+e+" .responses li,"+e+" "+
v+","+e+" .backToQuestion").hide();b(e+" .questionCount,"+e+" .answers,"+e+" .checkAnswer").show();E.append(b(e+" .questions")).show();c(l,1).apply(null,[]);a.method.startQuiz({callback:a.config.animationCallbacks.startQuiz},B)});k.turnKeyAndGo(l,d&&d.callback?d.callback:function(){})},checkAnswer:function(c,d){var l=k.getKey(2);var e=k.getKeyNotch;var f=b(b(c).parents(".question")[0]),g=f.find(".answers li"),m=g.find("input:checked"),n=parseInt(f.attr("id").replace(/(question)/,""),10),h=r[n].a,
n=r[n].select_any?r[n].select_any:!1;g.addClass("incorrect");var p=[];for(i in h)if(h.hasOwnProperty(i)){var t=h[i],u=parseInt(i,10);t.correct&&(p.push(u),g.eq(u).removeClass("incorrect").addClass("correct"))}var q=[];m.each(function(){var a=b(this).attr("id");q.push(parseInt(a.replace(/(.*\_question\d{1,}_)/,""),10))});if(a.config.preventUnanswered&&0===q.length)return alert(a.config.preventUnansweredText),!1;(g=a.method.compareAnswers(p,q,n))?f.addClass("correctResponse"):f.addClass("incorrectResponse");
f.find(g?".correct":".incorrect").show();a.config.perQuestionResponseMessaging?(b(c).hide(),a.config.perQuestionResponseAnswers?f.addClass("complete"):f.find(".answers").hide({duration:0,complete:function(){f.addClass("complete")}}),f.find("input").prop("disabled",!0),f.find(".responses").show(),f.find(v).fadeIn(300,e(l,1)).css("display","inline-block"),f.find(".backToQuestion").fadeIn(300,e(l,2)).css("display","inline-block"),f.find(".backToQuestion").length||e(l,2).apply(null,[])):(e(l,1).apply(null,
[]),e(l,2).apply(null,[]));k.turnKeyAndGo(l,d&&d.callback?d.callback:function(){})},nextQuestion:function(e,d){var c=k.getKey(1);var m=k.getKeyNotch;var f=b(b(e).parents(".question")[0]),g=f.next(".question"),h=f.find("input:checked");if(a.config.preventUnanswered&&0===h.length)return!1;g.length?f.fadeOut(300,function(){g.find(".backToQuestion").show().end().fadeIn(500,m(c,1));g.find(".backToQuestion").show().end().length||m(c,1).apply(null,[])}):(m(c,1).apply(null,[]),a.method.completeQuiz({callback:a.config.animationCallbacks.completeQuiz}));
k.turnKeyAndGo(c,d&&d.callback?d.callback:function(){})},backToQuestion:function(a,d){var c=k.getKey(2);var e=k.getKeyNotch;var f=b(b(a).parents(".question")[0]);if("block"===f.find(".responses").css("display"))f.find(".responses").fadeOut(300,function(){f.removeClass("correctResponse").removeClass("incorrectResponse").removeClass("complete");f.find(".responses, .responses li").hide();f.find(".answers").show();f.find(".answers li").removeClass("correct").removeClass("incorrect");f.find("input").prop("disabled",
!1);f.find(".answers").fadeIn(500,e(c,1));f.find(".checkAnswer").fadeIn(500,e(c,2));f.find(v).hide();"question0"!=f.attr("id")?f.find(".backToQuestion").show():f.find(".backToQuestion").hide()});else{var g=f.prev(".question");f.fadeOut(300,function(){g.removeClass("correctResponse").removeClass("incorrectResponse").removeClass("complete");g.find(".responses, .responses li").hide();g.find(".answers").show();g.find(".answers li").removeClass("correct").removeClass("incorrect");g.find("input").prop("disabled",
!1);g.find(v).hide();g.find(".checkAnswer").show();"question0"!=g.attr("id")?g.find(".backToQuestion").show():g.find(".backToQuestion").hide();g.fadeIn(500,e(c,1));e(c,2).apply(null,[])})}k.turnKeyAndGo(c,d&&d.callback?d.callback:function(){})},completeQuiz:function(c){var d=k.getKey(1);var m=k.getKeyNotch;var h=b(e+" .correctResponse").length,f=h;a.config.scoreAsPercentage&&(f=100*(h/t).toFixed(2)+"%");a.config.disableScore?b(D).remove():b(D+" span").html(a.config.scoreTemplateText.replace("%score",
f).replace("%total",t));if(a.config.disableRanking)b(A).remove();else{var g=[p.info.level1,p.info.level2,p.info.level3,p.info.level4,p.info.level5],f=a.method.calculateLevel(h),g=b.isNumeric(f)?g[f]:"";b(A+" span").html(g);b(A).addClass("level"+f)}E.fadeOut(300,function(){a.config.completionResponseMessaging?(b(e+" .button:not(.tryAgain), "+e+" .questionCount").hide(),b(e+" .question, "+e+" .answers, "+e+" .responses").show(),B.append(b(e+" .questions")).fadeIn(500,m(d,1))):B.fadeIn(500,m(d,1))});
k.turnKeyAndGo(d,c&&c.callback?c.callback:function(){});a.config.events&&a.config.events.onCompleteQuiz&&a.config.events.onCompleteQuiz.apply(null,[{questionCount:t,score:h}])},compareAnswers:function(a,d,c){return c?-1<b.inArray(d[0],a):0===b(a).not(d).length&&0===b(d).not(a).length},calculateLevel:function(b){b=(b/t).toFixed(2);var d=null;a.method.inRange(0,.2,b)?d=4:a.method.inRange(.21,.4,b)?d=3:a.method.inRange(.41,.6,b)?d=2:a.method.inRange(.61,.8,b)?d=1:a.method.inRange(.81,1,b)&&(d=0);return d},
inRange:function(a,b,c){return c>=a&&c<=b}};a.init=function(){a.method.setupQuiz.apply(null,[{callback:a.config.animationCallbacks.setupQuiz}]);q.on("click",function(c){c.preventDefault();this.disabled||b(this).hasClass("disabled")||a.method.startQuiz.apply(null,[{callback:a.config.animationCallbacks.startQuiz}])});b(e+" .tryAgain").on("click",function(b){b.preventDefault();a.method.resetQuiz(this,{callback:a.config.animationCallbacks.resetQuiz})});b(e+" .checkAnswer").on("click",function(b){b.preventDefault();
a.method.checkAnswer(this,{callback:a.config.animationCallbacks.checkAnswer})});b(e+" .backToQuestion").on("click",function(b){b.preventDefault();a.method.backToQuestion(this,{callback:a.config.animationCallbacks.backToQuestion})});b(e+" "+v).on("click",function(b){b.preventDefault();a.method.nextQuestion(this,{callback:a.config.animationCallbacks.nextQuestion})});var c=y.attr("id")+"-name";G.attr("id",c);y.attr({"aria-labelledby":c,"aria-live":"polite","aria-relevant":"additions",role:"form"});b(F+
', [href = "#"]').attr("role","button")};a.init()};b.fn.slickQuiz=function(C){return this.each(function(){if(void 0===b(this).data("slickQuiz")){var c=new b.slickQuiz(this,C);b(this).data("slickQuiz",c)}})}})(jQuery);

View File

@ -1,119 +0,0 @@
// http://getuikit.com/docs/documentation_javascript.html#js-override
if (typeof UIkit !== 'undefined') {
var $body = $('body');
UIkit.on('beforeready.uk.dom', function () {
// accrodion
if (typeof UIkit.components.accordion !== "undefined") { // check if accordion component is defined
$.extend(UIkit.components.accordion.prototype.defaults, {
easing: $.bez([ 0.35,0,0.25,1 ]),
duration: 200
});
}
// dropdown
if (typeof UIkit.components.dropdown.prototype !== "undefined") { // check if dropdown component is defined
$.extend(UIkit.components.dropdown.prototype.defaults, {
remaintime: 150,
delay: 50
});
(function() {
var old_show_function = UIkit.components.dropdown.prototype.show;
UIkit.components.dropdown.prototype.show = function() {
this.dropdown
.css({
'min-width': this.dropdown.outerWidth()
})
.addClass('uk-dropdown-active uk-dropdown-shown');
return old_show_function.apply(this, arguments);
}
})();
(function() {
var old_hide_function = UIkit.components.dropdown.prototype.hide;
UIkit.components.dropdown.prototype.hide = function() {
var this_dropdown = this.dropdown;
this_dropdown.removeClass('uk-dropdown-shown');
var dropdown_timeout = setTimeout(function() {
this_dropdown.removeClass('uk-dropdown-active')
},280);
return old_hide_function.apply(this, arguments);
}
})();
}
// modal
if (typeof UIkit.components.modal !== "undefined") { // check if modal component is defined
$.extend(UIkit.components.modal.prototype.defaults, {
center: true
});
UIkit.modal.dialog.template = '<div class="uk-modal uk-modal-dialog-replace"><div class="uk-modal-dialog" style="min-height:0;"></div></div>';
$body
.on('show.uk.modal', '.uk-modal-dialog-replace', function () {
// customize uikit dialog
setTimeout(function () {
var dialogReplace = $('.uk-modal-dialog-replace');
if (dialogReplace.find('.uk-button-primary').length) {
var actionBtn = dialogReplace.find('.uk-button-primary').toggleClass('uk-button-primary md-btn-flat-primary');
if (actionBtn.next('button')) {
actionBtn.next('button').after(actionBtn);
}
}
if (dialogReplace.find('.uk-button').length) {
dialogReplace.find('.uk-button').toggleClass('uk-button md-btn md-btn-flat');
}
if (dialogReplace.find('.uk-margin-small-top').length) {
dialogReplace.find('.uk-margin-small-top').toggleClass('uk-margin-small-top uk-margin-top');
}
if (dialogReplace.find('input.uk-width-1-1').length) {
dialogReplace.find('input.uk-width-1-1').toggleClass('uk-width-1-1 md-input');
// reinitialize md inputs
altair_md.inputs();
}
if (dialogReplace.find('.uk-form').length) {
dialogReplace.find('.uk-form').removeClass('uk-form');
}
}, 50)
});
}
// tabs
if (typeof UIkit.components.tab !== "undefined") { // check if tab component is defined
$.extend(UIkit.components.tab.prototype.defaults, {
swiping: false
});
}
// tooltip
if (typeof UIkit.components.tooltip !== "undefined") { // check if tooltip component is defined
$.extend(UIkit.components.tooltip.prototype.defaults, {
animation: UIkit.support.touch ? false : 280,
offset: 8
});
}
// sortable
if (typeof UIkit.components.sortable !== "undefined") { // check if sortable component is defined
if(Modernizr.touch) {
$('[data-uk-sortable]').children().addClass('needsclick');
}
}
});
}

View File

@ -1 +0,0 @@
if("undefined"!=typeof UIkit){var $body=$("body");UIkit.on("beforeready.uk.dom",function(){var t,o;void 0!==UIkit.components.accordion&&$.extend(UIkit.components.accordion.prototype.defaults,{easing:$.bez([.35,0,.25,1]),duration:200}),void 0!==UIkit.components.dropdown.prototype&&($.extend(UIkit.components.dropdown.prototype.defaults,{remaintime:150,delay:50}),o=UIkit.components.dropdown.prototype.show,UIkit.components.dropdown.prototype.show=function(){return this.dropdown.css({"min-width":this.dropdown.outerWidth()}).addClass("uk-dropdown-active uk-dropdown-shown"),o.apply(this,arguments)},t=UIkit.components.dropdown.prototype.hide,UIkit.components.dropdown.prototype.hide=function(){var o=this.dropdown;return o.removeClass("uk-dropdown-shown"),setTimeout(function(){o.removeClass("uk-dropdown-active")},280),t.apply(this,arguments)}),void 0!==UIkit.components.modal&&($.extend(UIkit.components.modal.prototype.defaults,{center:!0}),UIkit.modal.dialog.template='<div class="uk-modal uk-modal-dialog-replace"><div class="uk-modal-dialog" style="min-height:0;"></div></div>',$body.on("show.uk.modal",".uk-modal-dialog-replace",function(){setTimeout(function(){var o=$(".uk-modal-dialog-replace");if(o.find(".uk-button-primary").length){var t=o.find(".uk-button-primary").toggleClass("uk-button-primary md-btn-flat-primary");t.next("button")&&t.next("button").after(t)}o.find(".uk-button").length&&o.find(".uk-button").toggleClass("uk-button md-btn md-btn-flat"),o.find(".uk-margin-small-top").length&&o.find(".uk-margin-small-top").toggleClass("uk-margin-small-top uk-margin-top"),o.find("input.uk-width-1-1").length&&(o.find("input.uk-width-1-1").toggleClass("uk-width-1-1 md-input"),altair_md.inputs()),o.find(".uk-form").length&&o.find(".uk-form").removeClass("uk-form")},50)})),void 0!==UIkit.components.tab&&$.extend(UIkit.components.tab.prototype.defaults,{swiping:!1}),void 0!==UIkit.components.tooltip&&$.extend(UIkit.components.tooltip.prototype.defaults,{animation:!UIkit.support.touch&&280,offset:8}),void 0!==UIkit.components.sortable&&Modernizr.touch&&$("[data-uk-sortable]").children().addClass("needsclick")})}

View File

@ -1,373 +0,0 @@
/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
// removed moment_js from core
// customized by tzd
(function(addon) {
var component;
if (window.UIkit) {
component = addon(UIkit);
}
if (typeof define == "function" && define.amd) {
define("uikit-datepicker", ["uikit"], function(){
return component || addon(UIkit);
});
}
})(function(UI){
"use strict";
// Datepicker
var active = false, dropdown;
UI.component('datepicker', {
defaults: {
mobile: false,
weekstart: 1,
i18n: {
months : ['January','February','March','April','May','June','July','August','September','October','November','December'],
weekdays : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
},
format: "DD.MM.YYYY",
offsettop: 5,
maxDate: false,
minDate: false,
pos: 'auto',
addClass: '',
template: function(data, opts) {
var content = '', i;
content += '<div class="uk-datepicker-nav uk-clearfix">';
content += '<a href="" class="uk-datepicker-previous"></a>';
content += '<a href="" class="uk-datepicker-next"></a>';
if (UI.formSelect) {
var currentyear = (new Date()).getFullYear(), options = [], months, years, minYear, maxYear;
for (i=0;i<opts.i18n.months.length;i++) {
if(i==data.month) {
options.push('<option value="'+i+'" selected>'+opts.i18n.months[i]+'</option>');
} else {
options.push('<option value="'+i+'">'+opts.i18n.months[i]+'</option>');
}
}
months = '<span class="uk-form-select">'+ opts.i18n.months[data.month] + '<select class="update-picker-month">'+options.join('')+'</select></span>';
// --
options = [];
minYear = data.minDate ? data.minDate.year() : currentyear - 50;
maxYear = data.maxDate ? data.maxDate.year() : currentyear + 20;
for (i=minYear;i<=maxYear;i++) {
if (i == data.year) {
options.push('<option value="'+i+'" selected>'+i+'</option>');
} else {
options.push('<option value="'+i+'">'+i+'</option>');
}
}
years = '<span class="uk-form-select">'+ data.year + '<select class="update-picker-year">'+options.join('')+'</select></span>';
content += '<div class="uk-datepicker-heading">'+ months + ' ' + years +'</div>';
} else {
content += '<div class="uk-datepicker-heading">'+ opts.i18n.months[data.month] +' '+ data.year+'</div>';
}
content += '</div>';
content += '<table class="uk-datepicker-table">';
content += '<thead>';
for(i = 0; i < data.weekdays.length; i++) {
if (data.weekdays[i]) {
content += '<th>'+data.weekdays[i]+'</th>';
}
}
content += '</thead>';
content += '<tbody>';
for(i = 0; i < data.days.length; i++) {
if (data.days[i] && data.days[i].length){
content += '<tr>';
for(var d = 0; d < data.days[i].length; d++) {
if (data.days[i][d]) {
var day = data.days[i][d],
cls = [];
if(!day.inmonth) cls.push("uk-datepicker-table-muted");
if(day.selected) cls.push("uk-active");
if(day.disabled) cls.push('uk-datepicker-date-disabled uk-datepicker-table-muted');
content += '<td><a href="" class="'+cls.join(" ")+'" data-date="'+day.day.format()+'">'+day.day.format("D")+'</a></td>';
}
}
content += '</tr>';
}
}
content += '</tbody>';
content += '</table>';
return content;
}
},
boot: function() {
UI.$win.on("resize orientationchange", function() {
if (active) {
active.hide();
}
});
// init code
UI.$html.on("focus.datepicker.uikit", "[data-uk-datepicker]", function(e) {
var ele = UI.$(this);
if (!ele.data("datepicker")) {
e.preventDefault();
UI.datepicker(ele, UI.Utils.options(ele.attr("data-uk-datepicker")));
ele.trigger("focus");
}
});
UI.$html.on("click focus", '*', function(e) {
var target = UI.$(e.target);
if (active && target[0] != dropdown[0] && !target.data("datepicker") && !target.parents(".uk-datepicker:first").length) {
active.hide();
}
});
},
init: function() {
// use native datepicker on touch devices
if (UI.support.touch && this.element.attr('type')=='date' && !this.options.mobile) {
return;
}
var $this = this;
this.current = this.element.val() ? moment(this.element.val(), this.options.format) : moment();
this.on("click focus", function(){
if (active!==$this) $this.pick(this.value ? this.value:($this.options.minDate ? $this.options.minDate :''));
}).on("change", function(){
if ($this.element.val() && !moment($this.element.val(), $this.options.format).isValid()) {
$this.element.val(moment().format($this.options.format));
}
});
// init dropdown
if (!dropdown) {
dropdown = UI.$('<div class="uk-dropdown uk-datepicker '+$this.options.addClass+'"></div>');
dropdown.on("click", ".uk-datepicker-next, .uk-datepicker-previous, [data-date]", function(e){
e.stopPropagation();
e.preventDefault();
var ele = UI.$(this);
if (ele.hasClass('uk-datepicker-date-disabled')) return false;
if (ele.is('[data-date]')) {
active.current = moment(ele.data("date"));
active.element.val(active.current.isValid() ? active.current.format(active.options.format) : null).trigger("change");
dropdown.removeClass('uk-dropdown-shown');
setTimeout(function() {
dropdown.removeClass('uk-dropdown-active')
},280);
active.hide();
} else {
active.add((ele.hasClass("uk-datepicker-next") ? 1:-1), "months");
}
});
dropdown.on('change', '.update-picker-month, .update-picker-year', function(){
var select = UI.$(this);
active[select.is('.update-picker-year') ? 'setYear':'setMonth'](Number(select.val()));
});
dropdown.appendTo("body");
}
},
pick: function(initdate) {
var offset = this.element.offset(),
offset_left = parseInt(offset.left),
offset_top = parseInt(offset.top),
css = {
'left': offset_left,
'right': ""
};
this.current = isNaN(initdate) ? moment(initdate, this.options.format):moment();
this.initdate = this.current.format("YYYY-MM-DD");
this.update();
// check if datepicker input is in modal
if(($(this.element[0]).closest('.ui-dialog').length || $(this.element[0]).closest('.uk-modal').length) && !dropdown.hasClass('dropdown-modal')) {
dropdown.addClass('dropdown-modal');
}
if (UI.langdirection == 'right' || ( window.innerWidth - offset_left - dropdown.outerWidth() < 0 ) ) {
css.right = (window.innerWidth - (window.innerWidth - $('body').width())) - (css.left + this.element.outerWidth());
css.left = "";
}
var posTop = (offset_top - this.element.outerHeight() + this.element.height()) - this.options.offsettop - dropdown.outerHeight(),
posBottom = offset_top + this.element.outerHeight() + this.options.offsettop;
css.top = posBottom;
if (this.options.pos == 'top') {
css.top = posTop;
dropdown.addClass('dp-top');
} else if(this.options.pos == 'auto' && (window.innerHeight - posBottom - dropdown.outerHeight() + UI.$win.scrollTop() < 0 && posTop >= 0) ) {
css.top = posTop;
dropdown.addClass('dp-top');
}
css.minWidth = dropdown.actual('outerWidth');
dropdown.css(css).addClass('uk-dropdown-active uk-dropdown-shown');
this.trigger('show.uk.datepicker');
active = this;
},
add: function(unit, value) {
this.current.add(unit, value);
this.update();
},
setMonth: function(month) {
this.current.month(month);
this.update();
},
setYear: function(year) {
this.current.year(year);
this.update();
},
update: function() {
var data = this.getRows(this.current.year(), this.current.month()),
tpl = this.options.template(data, this.options);
dropdown.html(tpl);
this.trigger('update.uk.datepicker');
},
getRows: function(year, month) {
var opts = this.options,
now = moment().format('YYYY-MM-DD'),
days = [31, (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month],
before = new Date(year, month, 1, 12).getDay(),
data = {"month":month, "year":year,"weekdays":[],"days":[], "maxDate": false, "minDate": false},
row = [];
// We need these to be midday to avoid issues from DST transition protection.
if (opts.maxDate!==false){
data.maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format).startOf('day').hours(12) : moment().add(opts.maxDate, 'days').startOf('day').hours(12);
}
if (opts.minDate!==false){
data.minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format).startOf('day').hours(12) : moment().add(opts.minDate-1, 'days').startOf('day').hours(12);
}
data.weekdays = (function(){
for (var i=0, arr=[]; i < 7; i++) {
var day = i + (opts.weekstart || 0);
while (day >= 7) {
day -= 7;
}
arr.push(opts.i18n.weekdays[day]);
}
return arr;
})();
if (opts.weekstart && opts.weekstart > 0) {
before -= opts.weekstart;
if (before < 0) {
before += 7;
}
}
var cells = days + before, after = cells;
while(after > 7) { after -= 7; }
cells += 7 - after;
var day, isDisabled, isSelected, isToday, isInMonth;
for (var i = 0, r = 0; i < cells; i++) {
day = new Date(year, month, 1 + (i - before), 12);
isDisabled = (data.minDate && data.minDate > day) || (data.maxDate && day > data.maxDate);
isInMonth = !(i < before || i >= (days + before));
day = moment(day);
isSelected = this.initdate == day.format("YYYY-MM-DD");
isToday = now == day.format("YYYY-MM-DD");
row.push({"selected": isSelected, "today": isToday, "disabled": isDisabled, "day":day, "inmonth":isInMonth});
if (++r === 7) {
data.days.push(row);
row = [];
r = 0;
}
}
return data;
},
hide: function() {
if (active && active === this) {
dropdown.removeClass('uk-dropdown-shown');
setTimeout(function() {
dropdown.removeClass('uk-dropdown-active dp-top')
},280);
active = false;
this.trigger('hide.uk.datepicker');
}
}
});
UI.Utils.moment = moment();
return UI.datepicker;
});

File diff suppressed because one or more lines are too long

View File

@ -1,204 +0,0 @@
/* ===========================================================
* Bootstrap: fileinput.js v3.1.3
* http://jasny.github.com/bootstrap/javascript/#fileinput
* ===========================================================
* Copyright 2012-2014 Arnold Daniels
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
/*
* uikit version
* author tzd
*/
+function ($) { "use strict";
var isIE = window.navigator.appName == 'Microsoft Internet Explorer';
// FILEUPLOAD PUBLIC CLASS DEFINITION
// =================================
var Fileinput = function (element, options) {
this.$element = $(element);
this.$input = this.$element.find(':file');
if (this.$input.length === 0) return;
this.name = this.$input.attr('name') || options.name;
this.$hidden = this.$element.find('input[type=hidden][name="' + this.name + '"]');
if (this.$hidden.length === 0) {
this.$hidden = $('<input type="hidden">').insertBefore(this.$input)
}
this.$preview = this.$element.find('.fileinput-preview');
var height = this.$preview.css('height');
if (this.$preview.css('display') !== 'inline' && height !== '0px' && height !== 'none') {
this.$preview.css('line-height', height)
}
this.original = {
exists: this.$element.hasClass('fileinput-exists'),
preview: this.$preview.html(),
hiddenVal: this.$hidden.val()
};
this.listen()
};
Fileinput.prototype.listen = function() {
this.$input.on('change.uk.fileinput', $.proxy(this.change, this));
$(this.$input[0].form).on('reset.uk.fileinput', $.proxy(this.reset, this));
this.$element.find('[data-trigger="fileinput"]').on('click.uk.fileinput', $.proxy(this.trigger, this));
this.$element.find('[data-dismiss="fileinput"]').on('click.uk.fileinput', $.proxy(this.clear, this))
};
Fileinput.prototype.change = function(e) {
var files = e.target.files === undefined ? (e.target && e.target.value ? [{ name: e.target.value.replace(/^.+\\/, '')}] : []) : e.target.files;
e.stopPropagation();
if (files.length === 0) {
this.clear();
this.$element.trigger('clear.uk.fileinput');
return
}
this.$hidden.val('');
this.$hidden.attr('name', '');
this.$input.attr('name', this.name);
var file = files[0];
if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match(/^image\/(gif|png|jpeg)$/) : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") {
var reader = new FileReader();
var preview = this.$preview;
var element = this.$element;
reader.onload = function(re) {
var $img = $('<img>');
$img[0].src = re.target.result;
files[0].result = re.target.result;
element.find('.fileinput-filename').text(file.name);
// if parent has max-height, using `(max-)height: 100%` on child doesn't take padding and border into account
if (preview.css('max-height') != 'none') $img.css('max-height', parseInt(preview.css('max-height'), 10) - parseInt(preview.css('padding-top'), 10) - parseInt(preview.css('padding-bottom'), 10) - parseInt(preview.css('border-top'), 10) - parseInt(preview.css('border-bottom'), 10));
preview.html($img);
element.addClass('fileinput-exists').removeClass('fileinput-new');
element.trigger('change.uk.fileinput', files)
};
reader.readAsDataURL(file)
} else {
this.$element.find('.fileinput-filename').text(file.name);
this.$preview.text(file.name);
this.$element.addClass('fileinput-exists').removeClass('fileinput-new');
this.$element.trigger('change.uk.fileinput')
}
};
Fileinput.prototype.clear = function(e) {
if (e) e.preventDefault();
this.$hidden.val('');
this.$hidden.attr('name', this.name);
this.$input.attr('name', '');
//ie8+ doesn't support changing the value of input with type=file so clone instead
if (isIE) {
var inputClone = this.$input.clone(true);
this.$input.after(inputClone);
this.$input.remove();
this.$input = inputClone;
} else {
this.$input.val('');
}
this.$preview.html('');
this.$element.find('.fileinput-filename').text('');
this.$element.addClass('fileinput-new').removeClass('fileinput-exists');
if (e !== undefined) {
this.$input.trigger('change');
this.$element.trigger('clear.uk.fileinput');
}
};
Fileinput.prototype.reset = function() {
this.clear();
this.$hidden.val(this.original.hiddenVal);
this.$preview.html(this.original.preview);
this.$element.find('.fileinput-filename').text('');
if (this.original.exists) {
this.$element.addClass('fileinput-exists').removeClass('fileinput-new')
} else {
this.$element.addClass('fileinput-new').removeClass('fileinput-exists')
}
this.$element.trigger('reset.uk.fileinput')
};
Fileinput.prototype.trigger = function(e) {
this.$input.trigger('click');
e.preventDefault()
};
// FILEUPLOAD PLUGIN DEFINITION
// ===========================
var old = $.fn.fileinput;
$.fn.fileinput = function (options) {
return this.each(function () {
var $this = $(this),
data = $this.data('uk.fileinput');
if (!data) $this.data('uk.fileinput', (data = new Fileinput(this, options)));
if (typeof options == 'string') data[options]()
})
};
$.fn.fileinput.Constructor = Fileinput;
// FILEINPUT NO CONFLICT
// ====================
$.fn.fileinput.noConflict = function () {
$.fn.fileinput = old;
return this
};
// FILEUPLOAD DATA-API
// ==================
$(document).on('click.fileinput.data-api', '[data-provides="fileinput"]', function (e) {
var $this = $(this);
if ($this.data('uk.fileinput')) return;
$this.fileinput($this.data());
var $target = $(e.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]');
if ($target.length > 0) {
e.preventDefault();
$target.trigger('click.uk.fileinput');
}
})
}(window.jQuery);

View File

@ -1 +0,0 @@
!function(l){"use strict";var i="Microsoft Internet Explorer"==window.navigator.appName,n=function(e,t){if(this.$element=l(e),this.$input=this.$element.find(":file"),0!==this.$input.length){this.name=this.$input.attr("name")||t.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),0===this.$hidden.length&&(this.$hidden=l('<input type="hidden">').insertBefore(this.$input)),this.$preview=this.$element.find(".fileinput-preview");var i=this.$preview.css("height");"inline"!==this.$preview.css("display")&&"0px"!==i&&"none"!==i&&this.$preview.css("line-height",i),this.original={exists:this.$element.hasClass("fileinput-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.listen()}};n.prototype.listen=function(){this.$input.on("change.uk.fileinput",l.proxy(this.change,this)),l(this.$input[0].form).on("reset.uk.fileinput",l.proxy(this.reset,this)),this.$element.find('[data-trigger="fileinput"]').on("click.uk.fileinput",l.proxy(this.trigger,this)),this.$element.find('[data-dismiss="fileinput"]').on("click.uk.fileinput",l.proxy(this.clear,this))},n.prototype.change=function(e){var i=void 0===e.target.files?e.target&&e.target.value?[{name:e.target.value.replace(/^.+\\/,"")}]:[]:e.target.files;if(e.stopPropagation(),0===i.length)return this.clear(),void this.$element.trigger("clear.uk.fileinput");this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name);var n=i[0];if(0<this.$preview.length&&(void 0!==n.type?n.type.match(/^image\/(gif|png|jpeg)$/):n.name.match(/\.(gif|png|jpe?g)$/i))&&"undefined"!=typeof FileReader){var t=new FileReader,s=this.$preview,a=this.$element;t.onload=function(e){var t=l("<img>");t[0].src=e.target.result,i[0].result=e.target.result,a.find(".fileinput-filename").text(n.name),"none"!=s.css("max-height")&&t.css("max-height",parseInt(s.css("max-height"),10)-parseInt(s.css("padding-top"),10)-parseInt(s.css("padding-bottom"),10)-parseInt(s.css("border-top"),10)-parseInt(s.css("border-bottom"),10)),s.html(t),a.addClass("fileinput-exists").removeClass("fileinput-new"),a.trigger("change.uk.fileinput",i)},t.readAsDataURL(n)}else this.$element.find(".fileinput-filename").text(n.name),this.$preview.text(n.name),this.$element.addClass("fileinput-exists").removeClass("fileinput-new"),this.$element.trigger("change.uk.fileinput")},n.prototype.clear=function(e){if(e&&e.preventDefault(),this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name",""),i){var t=this.$input.clone(!0);this.$input.after(t),this.$input.remove(),this.$input=t}else this.$input.val("");this.$preview.html(""),this.$element.find(".fileinput-filename").text(""),this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),void 0!==e&&(this.$input.trigger("change"),this.$element.trigger("clear.uk.fileinput"))},n.prototype.reset=function(){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.$element.find(".fileinput-filename").text(""),this.original.exists?this.$element.addClass("fileinput-exists").removeClass("fileinput-new"):this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),this.$element.trigger("reset.uk.fileinput")},n.prototype.trigger=function(e){this.$input.trigger("click"),e.preventDefault()};var e=l.fn.fileinput;l.fn.fileinput=function(i){return this.each(function(){var e=l(this),t=e.data("uk.fileinput");t||e.data("uk.fileinput",t=new n(this,i)),"string"==typeof i&&t[i]()})},l.fn.fileinput.Constructor=n,l.fn.fileinput.noConflict=function(){return l.fn.fileinput=e,this},l(document).on("click.fileinput.data-api",'[data-provides="fileinput"]',function(e){var t=l(this);if(!t.data("uk.fileinput")){t.fileinput(t.data());var i=l(e.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]');0<i.length&&(e.preventDefault(),i.trigger("click.uk.fileinput"))}})}(window.jQuery);

View File

@ -1,683 +0,0 @@
/*
* Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable
*/
(function(addon) {
var component;
if (window.UIkit) {
component = addon(UIkit);
}
if (typeof define == "function" && define.amd) {
define("uikit-sortable", ["uikit"], function(){
return component || addon(UIkit);
});
}
})(function(UI){
"use strict";
//var supportsTouch = ('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch);
var draggingPlaceholder, currentlyDraggingElement, currentlyDraggingTarget, dragging, moving, clickedlink, delayIdle, touchedlists, moved, overElement;
var dragEvents = ['touchmove', 'mousemove', 'mouseout'];
var dragMoveEvents = ['touchmove', 'mousemove'];
var dragStartEvents = ['touchstart', 'mousedown'];
function closestSortable(ele) {
ele = UI.$(ele);
do {
if (ele.data('sortable')) {
return ele;
}
ele = UI.$(ele).parent();
} while(ele.length);
return ele;
}
UI.component('sortable', {
defaults: {
animation : 150,
threshold : 10,
childClass : 'uk-sortable-item',
placeholderClass : 'uk-sortable-placeholder',
overClass : 'uk-sortable-over',
draggingClass : 'uk-sortable-dragged',
dragMovingClass : 'uk-sortable-moving',
baseClass : 'uk-sortable',
noDragClass : 'uk-sortable-nodrag',
emptyClass : 'uk-sortable-empty',
dragCustomClass : '',
handleClass : false,
group : false,
stop : function() {},
start : function() {},
change : function() {}
},
boot: function() {
// auto init
UI.ready(function(context) {
UI.$("[data-uk-sortable]", context).each(function(){
var ele = UI.$(this);
if(!ele.data("sortable")) {
UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable")));
}
});
});
UI.$html.on('mousemove touchmove', function(e) {
if (delayIdle) {
var src = e.originalEvent.targetTouches ? e.originalEvent.targetTouches[0] : e;
if (Math.abs(src.pageX - delayIdle.pos.x) > delayIdle.threshold || Math.abs(src.pageY - delayIdle.pos.y) > delayIdle.threshold) {
delayIdle.apply(src);
}
}
if (draggingPlaceholder) {
if (!moving) {
moving = true;
draggingPlaceholder.show();
draggingPlaceholder.$current.addClass(draggingPlaceholder.$sortable.options.placeholderClass);
draggingPlaceholder.$sortable.element.children().addClass(draggingPlaceholder.$sortable.options.childClass);
UI.$html.addClass(draggingPlaceholder.$sortable.options.dragMovingClass);
}
var offset = draggingPlaceholder.data('mouse-offset');
var left = parseInt((e.originalEvent.touches && e.originalEvent.touches[0] ? e.originalEvent.touches[0].pageX : e.originalEvent.pageX), 10) + offset.left;
var top = parseInt((e.originalEvent.touches && e.originalEvent.touches[0] ? e.originalEvent.touches[0].pageY : e.originalEvent.pageY), 10) + offset.top;
draggingPlaceholder.css({'left': left, 'top': top });
// adjust document scrolling
if (top + (draggingPlaceholder.height()/3) > document.body.offsetHeight) {
return;
}
if (top < UI.$win.scrollTop()) {
UI.$win.scrollTop(UI.$win.scrollTop() - Math.ceil(draggingPlaceholder.height()/3));
} else if ( (top + (draggingPlaceholder.height()/3)) > (window.innerHeight + UI.$win.scrollTop()) ) {
UI.$win.scrollTop(UI.$win.scrollTop() + Math.ceil(draggingPlaceholder.height()/3));
}
}
});
UI.$html.on('mouseup touchend', function(e) {
delayIdle = clickedlink = false;
// dragging?
if (!currentlyDraggingElement || !draggingPlaceholder) {
// completely reset dragging attempt. will cause weird delay behavior elsewise
currentlyDraggingElement = draggingPlaceholder = null;
return;
}
// inside or outside of sortable?
var sortable = closestSortable(currentlyDraggingElement),
component = draggingPlaceholder.$sortable,
ev = { type: e.type };
if (sortable[0]) {
component.dragDrop(ev, component.element);
}
component.dragEnd(ev, component.element);
});
},
init: function() {
var $this = this,
element = this.element[0];
touchedlists = [];
this.checkEmptyList();
this.element.data('sortable-group', this.options.group ? this.options.group : UI.Utils.uid('sortable-group'));
var handleDragStart = delegate(function(e) {
if (e.data && e.data.sortable) {
return;
}
var $target = UI.$(e.target),
$link = $target.is('a[href]') ? $target:$target.parents('a[href]');
if ($target.is(':input')) {
return;
}
e.preventDefault();
if (!e.touches && $link.length) {
$link.one('click', function(e){
e.preventDefault();
}).one('mouseup', function(){
if(!moved) $link.trigger('click');
});
}
e.data = e.data || {};
e.data.sortable = element;
return $this.dragStart(e, this);
});
var handleDragEnter = delegate(UI.Utils.debounce(function(e) {
return $this.dragEnter(e, this);
}), 40);
var handleDragLeave = delegate(function(e) {
// Prevent dragenter on a child from allowing a dragleave on the container
var previousCounter = $this.dragenterData(this);
$this.dragenterData(this, previousCounter - 1);
// This is a fix for child elements firing dragenter before the parent fires dragleave
if (!$this.dragenterData(this)) {
UI.$(this).removeClass($this.options.overClass);
$this.dragenterData(this, false);
}
});
var handleTouchMove = delegate(function(e) {
if (!currentlyDraggingElement ||
currentlyDraggingElement === this ||
currentlyDraggingTarget === this) {
return true;
}
$this.element.children().removeClass($this.options.overClass);
currentlyDraggingTarget = this;
$this.moveElementNextTo(currentlyDraggingElement, this);
return prevent(e);
});
// Bind/unbind standard mouse/touch events as a polyfill.
function addDragHandlers() {
//useCapture false is default
dragEvents.forEach(function (eDrag) {
element.addEventListener(eDrag, handleTouchMove, false);
});
}
function removeDragHandlers() {
//useCapture false is default
dragEvents.forEach(function (eDrag) {
element.removeEventListener(eDrag, handleTouchMove, false);
});
}
this.addDragHandlers = addDragHandlers;
this.removeDragHandlers = removeDragHandlers;
function handleDragMove(e) {
if (!currentlyDraggingElement) {
return;
}
$this.dragMove(e, $this);
}
function delegate(fn) {
return function(e) {
var touch, target, context;
if (e) {
touch = (e.touches && e.touches[0]) || { };
target = touch.target || e.target;
// Fix event.target for a touch event
if ((e.touches && e.touches[0]) && document.elementFromPoint) {
target = document.elementFromPoint(touch.pageX - document.body.scrollLeft, touch.pageY - document.body.scrollTop);
}
overElement = UI.$(target);
}
if (UI.$(target).hasClass($this.options.childClass)) {
fn.apply(target, [e]);
} else if (target !== element) {
// If a child is initiating the event or ending it, then use the container as context for the callback.
context = moveUpToChildNode(element, target);
if (context) {
fn.apply(context, [e]);
}
}
};
}
dragMoveEvents.forEach(function (eDrag) {
window.addEventListener(eDrag, handleDragMove, false);
});
dragStartEvents.forEach(function (eDrag) {
element.addEventListener(eDrag, handleDragStart, false);
});
},
dragStart: function(e, elem) {
moved = false;
moving = false;
dragging = false;
var $this = this,
target = UI.$(e.target);
if (!e.touches && e.button==2) {
return;
}
if ($this.options.handleClass) {
var handle = target.hasClass($this.options.handleClass) ? target : target.closest('.'+$this.options.handleClass, $this.element);
if (!handle.length) {
//e.preventDefault();
return;
}
}
if (target.is('.'+$this.options.noDragClass) || target.closest('.'+$this.options.noDragClass).length) {
return;
}
// prevent dragging if taget is a form field
if (target.is(':input')) {
return;
}
currentlyDraggingElement = elem;
// init drag placeholder
if (draggingPlaceholder) {
draggingPlaceholder.remove();
}
var $current = UI.$(currentlyDraggingElement);
var offset = $current.offset();
delayIdle = {
pos : { x: (e.touches && e.touches[0] ? e.touches[0].pageX : e.pageX), y: (e.touches && e.touches[0] ? e.touches[0].pageY : e.pageY) },
threshold : $this.options.threshold,
apply : function(evt) {
draggingPlaceholder = UI.$('<div class="'+([$this.options.draggingClass, $this.options.dragCustomClass].join(' '))+'"></div>').css({
display : 'none',
top : offset.top,
left : offset.left,
width : $current.width(),
height : $current.height(),
padding : $current.css('padding')
}).data({
'mouse-offset': {
'left' : offset.left - parseInt(evt.pageX, 10),
'top' : offset.top - parseInt(evt.pageY, 10)
},
'origin' : $this.element,
'index' : $current.index()
}).append($current.html()).appendTo('body');
draggingPlaceholder.$current = $current;
draggingPlaceholder.$sortable = $this;
$current.data({
'start-list': $current.parent(),
'start-index': $current.index(),
'sortable-group': $this.options.group
});
$this.addDragHandlers();
$this.options.start(this, currentlyDraggingElement);
$this.trigger('start.uk.sortable', [$this, currentlyDraggingElement]);
moved = true;
delayIdle = false;
}
};
},
dragMove: function(e, elem) {
var pageX = e.touches && e.touches[0] ? e.touches[0].pageX : e.pageX;
var pageY = e.touches && e.touches[0] ? e.touches[0].pageY : e.pageY;
overElement = UI.$(document.elementFromPoint
(
pageX - (document.body.scrollLeft || document.scrollLeft || 0),
pageY - (document.body.scrollTop || document.documentElement.scrollTop || 0)
));
var overRoot = overElement.closest('.'+this.options.baseClass);
var groupOver = overRoot.data("sortable-group");
var $current = UI.$(currentlyDraggingElement);
var currentRoot = $current.parent();
var groupCurrent = $current.data("sortable-group");
var overChild;
if (overRoot[0] !== currentRoot[0] && groupCurrent !== undefined && groupOver === groupCurrent) {
overRoot.data('sortable').addDragHandlers();
touchedlists.push(overRoot);
overRoot.children().addClass(this.options.childClass);
// swap root
if (overRoot.children().length > 0) {
overChild = overElement.closest('.'+this.options.childClass);
if (overChild.length) {
overChild.before($current);
} else {
overRoot.append($current);
}
} else { // empty list
overElement.append($current);
}
UIkit.$doc.trigger('mouseover');
}
this.checkEmptyList();
this.checkEmptyList(currentRoot);
},
dragEnter: function(e, elem) {
if (!currentlyDraggingElement || currentlyDraggingElement === elem) {
return true;
}
var previousCounter = this.dragenterData(elem);
this.dragenterData(elem, previousCounter + 1);
// Prevent dragenter on a child from allowing a dragleave on the container
if (previousCounter === 0) {
var currentlist = UI.$(elem).parent(),
startlist = UI.$(currentlyDraggingElement).data("start-list");
if (currentlist[0] !== startlist[0]) {
var groupOver = currentlist.data('sortable-group'),
groupCurrent = UI.$(currentlyDraggingElement).data("sortable-group");
if ((groupOver || groupCurrent) && (groupOver != groupCurrent)) {
return false;
}
}
UI.$(elem).addClass(this.options.overClass);
this.moveElementNextTo(currentlyDraggingElement, elem);
}
return false;
},
dragEnd: function(e, elem) {
var $this = this;
// avoid triggering event twice
if (currentlyDraggingElement) {
// TODO: trigger on right element?
this.options.stop(elem);
this.trigger('stop.uk.sortable', [this]);
}
currentlyDraggingElement = null;
currentlyDraggingTarget = null;
touchedlists.push(this.element);
touchedlists.forEach(function(el, i) {
UI.$(el).children().each(function() {
if (this.nodeType === 1) {
UI.$(this).removeClass($this.options.overClass)
.removeClass($this.options.placeholderClass)
.removeClass($this.options.childClass);
$this.dragenterData(this, false);
}
});
});
touchedlists = [];
UI.$html.removeClass(this.options.dragMovingClass);
this.removeDragHandlers();
if (draggingPlaceholder) {
draggingPlaceholder.remove();
draggingPlaceholder = null;
}
},
dragDrop: function(e, elem) {
if (e.type === 'drop') {
if (e.stopPropagation) {
e.stopPropagation();
}
if (e.preventDefault) {
e.preventDefault();
}
}
this.triggerChangeEvents();
},
triggerChangeEvents: function() {
// trigger events once
if (!currentlyDraggingElement) return;
var $current = UI.$(currentlyDraggingElement),
oldRoot = draggingPlaceholder.data("origin"),
newRoot = $current.closest('.'+this.options.baseClass),
triggers = [],
el = UI.$(currentlyDraggingElement);
// events depending on move inside lists or across lists
if (oldRoot[0] === newRoot[0] && draggingPlaceholder.data('index') != $current.index() ) {
triggers.push({sortable: this, mode: 'moved'});
} else if (oldRoot[0] != newRoot[0]) {
triggers.push({sortable: UI.$(newRoot).data('sortable'), mode: 'added'}, {sortable: UI.$(oldRoot).data('sortable'), mode: 'removed'});
}
triggers.forEach(function (trigger, i) {
if (trigger.sortable) {
trigger.sortable.element.trigger('change.uk.sortable', [trigger.sortable, el, trigger.mode]);
}
});
},
dragenterData: function(element, val) {
element = UI.$(element);
if (arguments.length == 1) {
return parseInt(element.data('child-dragenter'), 10) || 0;
} else if (!val) {
element.removeData('child-dragenter');
} else {
element.data('child-dragenter', Math.max(0, val));
}
},
moveElementNextTo: function(element, elementToMoveNextTo) {
dragging = true;
var $this = this,
list = UI.$(element).parent().css('min-height', ''),
next = isBelow(element, elementToMoveNextTo) ? elementToMoveNextTo : elementToMoveNextTo.nextSibling,
children = list.children(),
count = children.length;
if (!$this.options.animation) {
elementToMoveNextTo.parentNode.insertBefore(element, next);
UI.Utils.checkDisplay($this.element.parent());
return;
}
list.css('min-height', list.height());
children.stop().each(function(){
var ele = UI.$(this),
offset = ele.position();
offset.width = ele.width();
ele.data('offset-before', offset);
});
elementToMoveNextTo.parentNode.insertBefore(element, next);
UI.Utils.checkDisplay($this.element.parent());
children = list.children().each(function() {
var ele = UI.$(this);
ele.data('offset-after', ele.position());
}).each(function() {
var ele = UI.$(this),
before = ele.data('offset-before');
ele.css({'position':'absolute', 'top':before.top, 'left':before.left, 'min-width':before.width });
});
children.each(function(){
var ele = UI.$(this),
before = ele.data('offset-before'),
offset = ele.data('offset-after');
ele.css('pointer-events', 'none').width();
setTimeout(function(){
ele.animate({'top':offset.top, 'left':offset.left}, $this.options.animation, function() {
ele.css({'position':'','top':'', 'left':'', 'min-width': '', 'pointer-events':''}).removeClass($this.options.overClass).removeData('child-dragenter');
count--;
if (!count) {
list.css('min-height', '');
UI.Utils.checkDisplay($this.element.parent());
}
});
}, 0);
});
},
serialize: function() {
var data = [], item, attribute;
this.element.children().each(function(j, child) {
item = {};
for (var i = 0; i < child.attributes.length; i++) {
attribute = child.attributes[i];
if (attribute.name.indexOf('data-') === 0) {
item[attribute.name.substr(5)] = UI.Utils.str2json(attribute.value);
}
}
data.push(item);
});
return data;
},
checkEmptyList: function(list) {
list = list ? UI.$(list) : this.element;
if (this.options.emptyClass) {
list[!list.children().length ? 'addClass':'removeClass'](this.options.emptyClass);
}
}
});
// helpers
function isBelow(el1, el2) {
var parent = el1.parentNode;
if (el2.parentNode != parent) {
return false;
}
var cur = el1.previousSibling;
while (cur && cur.nodeType !== 9) {
if (cur === el2) {
return true;
}
cur = cur.previousSibling;
}
return false;
}
function moveUpToChildNode(parent, child) {
var cur = child;
if (cur == parent) { return null; }
while (cur) {
if (cur.parentNode === parent) {
return cur;
}
cur = cur.parentNode;
if ( !cur || !cur.ownerDocument || cur.nodeType === 11 ) {
break;
}
}
return null;
}
function prevent(e) {
if (e.stopPropagation) {
e.stopPropagation();
}
if (e.preventDefault) {
e.preventDefault();
}
e.returnValue = false;
}
return UI.sortable;
});

File diff suppressed because one or more lines are too long

View File

@ -1,192 +0,0 @@
/*! UIkit 2.26.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
var component;
if (window.UIkit) {
component = addon(UIkit);
}
if (typeof define == "function" && define.amd) {
define("uikit-timepicker", ["uikit"], function(){
return component || addon(UIkit);
});
}
})(function(UI){
"use strict";
UI.component('timepicker', {
defaults: {
format : '24h',
delay : 0,
start : 0,
end : 24
},
boot: function() {
// init code
UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
var ele = UI.$(this);
if (!ele.data("timepicker")) {
var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
setTimeout(function(){
obj.autocomplete.input.focus();
}, 40);
}
});
},
init: function() {
var $this = this, times = getTimeRange(this.options.start, this.options.end), container;
this.options.minLength = 0;
this.options.template = '<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a class="needsclick">{{$item.value}}</a></li>{{/items}}</ul>';
this.options.source = function(release) {
release(times[$this.options.format] || times['12h']);
};
if (this.element.is('input')) {
this.element.wrap('<div class="uk-autocomplete"></div>');
container = this.element.parent();
} else {
container = this.element.addClass('uk-autocomplete');
}
this.autocomplete = UI.autocomplete(container, this.options);
this.autocomplete.dropdown.addClass('uk-dropdown-small uk-dropdown-scrollable');
this.autocomplete.on('show.uk.autocomplete', function() {
var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.autocomplete.input.val()+'"]');
setTimeout(function(){
$this.autocomplete.pick(selected, true);
}, 10);
});
this.autocomplete.input.on('focus', function(){
$this.autocomplete.value = Math.random();
$this.autocomplete.triggercomplete();
}).on('blur', UI.Utils.debounce(function() {
$this.checkTime();
}, 100));
this.element.data("timepicker", this);
},
checkTime: function() {
var arr, timeArray, meridian = 'AM', hour, minute, time = this.autocomplete.input.val();
if (this.options.format == '12h') {
arr = time.split(' ');
timeArray = arr[0].split(':');
meridian = arr[1];
} else {
timeArray = time.split(':');
}
hour = parseInt(timeArray[0], 10);
minute = parseInt(timeArray[1], 10);
if (isNaN(hour)) hour = 0;
if (isNaN(minute)) minute = 0;
if (this.options.format == '12h') {
if (hour > 12) {
hour = 12;
} else if (hour < 0) {
hour = 12;
}
if (meridian === 'am' || meridian === 'a') {
meridian = 'AM';
} else if (meridian === 'pm' || meridian === 'p') {
meridian = 'PM';
}
if (meridian !== 'AM' && meridian !== 'PM') {
meridian = 'AM';
}
} else {
if (hour >= 24) {
hour = 23;
} else if (hour < 0) {
hour = 0;
}
}
if (minute < 0) {
minute = 0;
} else if (minute >= 60) {
minute = 0;
}
this.autocomplete.input.val(this.formatTime(hour, minute, meridian)).trigger('change');
},
formatTime: function(hour, minute, meridian) {
hour = hour < 10 ? '0' + hour : hour;
minute = minute < 10 ? '0' + minute : minute;
return hour + ':' + minute + (this.options.format == '12h' ? ' ' + meridian : '');
}
});
// helper
function getTimeRange(start, end) {
start = start || 0;
end = end || 24;
var times = {'12h':[], '24h':[]}, i, h;
for (i = start, h=''; i<end; i++) {
h = ''+i;
if (i<10) h = '0'+h;
times['24h'].push({value: (h+':00')});
times['24h'].push({value: (h+':30')});
if (i === 0) {
h = 12;
times['12h'].push({value: (h+':00 AM')});
times['12h'].push({value: (h+':30 AM')});
}
if (i > 0 && i<13 && i!==12) {
times['12h'].push({value: (h+':00 AM')});
times['12h'].push({value: (h+':30 AM')});
}
if (i >= 12) {
h = h-12;
if (h === 0) h = 12;
if (h < 10) h = '0'+String(h);
times['12h'].push({value: (h+':00 PM')});
times['12h'].push({value: (h+':30 PM')});
}
}
return times;
}
});

View File

@ -1 +0,0 @@
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-timepicker",["uikit"],function(){return e||t(UIkit)})}(function(o){"use strict";o.component("timepicker",{defaults:{format:"24h",delay:0,start:0,end:24},boot:function(){o.$html.on("focus.timepicker.uikit","[data-uk-timepicker]",function(t){var e=o.$(this);if(!e.data("timepicker")){var i=o.timepicker(e,o.Utils.options(e.attr("data-uk-timepicker")));setTimeout(function(){i.autocomplete.input.focus()},40)}})},init:function(){var t,e=this,i=function(t,e){e=e||24;var i,o,a={"12h":[],"24h":[]};for(i=t=t||0,o="";i<e;i++)o=""+i,i<10&&(o="0"+o),a["24h"].push({value:o+":00"}),a["24h"].push({value:o+":30"}),0===i&&(o=12,a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),0<i&&i<13&&12!==i&&(a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),12<=i&&(0===(o-=12)&&(o=12),o<10&&(o="0"+String(o)),a["12h"].push({value:o+":00 PM"}),a["12h"].push({value:o+":30 PM"}));return a}(this.options.start,this.options.end);this.options.minLength=0,this.options.template='<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a class="needsclick">{{$item.value}}</a></li>{{/items}}</ul>',this.options.source=function(t){t(i[e.options.format]||i["12h"])},t=this.element.is("input")?(this.element.wrap('<div class="uk-autocomplete"></div>'),this.element.parent()):this.element.addClass("uk-autocomplete"),this.autocomplete=o.autocomplete(t,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-small uk-dropdown-scrollable"),this.autocomplete.on("show.uk.autocomplete",function(){var t=e.autocomplete.dropdown.find('[data-value="'+e.autocomplete.input.val()+'"]');setTimeout(function(){e.autocomplete.pick(t,!0)},10)}),this.autocomplete.input.on("focus",function(){e.autocomplete.value=Math.random(),e.autocomplete.triggercomplete()}).on("blur",o.Utils.debounce(function(){e.checkTime()},100)),this.element.data("timepicker",this)},checkTime:function(){var t,e,i,o,a="AM",u=this.autocomplete.input.val();"12h"==this.options.format?(e=(t=u.split(" "))[0].split(":"),a=t[1]):e=u.split(":"),i=parseInt(e[0],10),o=parseInt(e[1],10),isNaN(i)&&(i=0),isNaN(o)&&(o=0),"12h"==this.options.format?(12<i?i=12:i<0&&(i=12),"am"===a||"a"===a?a="AM":"pm"!==a&&"p"!==a||(a="PM"),"AM"!==a&&"PM"!==a&&(a="AM")):24<=i?i=23:i<0&&(i=0),o<0?o=0:60<=o&&(o=0),this.autocomplete.input.val(this.formatTime(i,o,a)).trigger("change")},formatTime:function(t,e,i){return(t=t<10?"0"+t:t)+":"+(e=e<10?"0"+e:e)+("12h"==this.options.format?" "+i:"")}})});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,484 +0,0 @@
/*
* Poshy Tip jQuery plugin v1.1+
* http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/
* Copyright 2010-2011, Vasil Dinkov, http://vadikom.com/
*/
(function($) {
var tips = [],
reBgImage = /^url\(["']?([^"'\)]*)["']?\);?$/i,
rePNG = /\.png$/i,
ie6 = !!window.createPopup && document.documentElement.currentStyle.minWidth == 'undefined';
// make sure the tips' position is updated on resize
function handleWindowResize() {
$.each(tips, function() {
this.refresh(true);
});
}
$(window).resize(handleWindowResize);
$.Poshytip = function(elm, options) {
this.$elm = $(elm);
this.opts = $.extend({}, $.fn.poshytip.defaults, options);
this.$tip = $(['<div class="',this.opts.className,'">',
'<div class="tip-inner tip-bg-image"></div>',
'<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',
'</div>'].join('')).appendTo(document.body);
this.$arrow = this.$tip.find('div.tip-arrow');
this.$inner = this.$tip.find('div.tip-inner');
this.disabled = false;
this.content = null;
this.init();
};
$.Poshytip.prototype = {
init: function() {
tips.push(this);
// save the original title and a reference to the Poshytip object
var title = this.$elm.attr('title');
this.$elm.data('title.poshytip', title !== undefined ? title : null)
.data('poshytip', this);
// hook element events
if (this.opts.showOn != 'none') {
this.$elm.bind({
'mouseenter.poshytip': $.proxy(this.mouseenter, this),
'mouseleave.poshytip': $.proxy(this.mouseleave, this)
});
switch (this.opts.showOn) {
case 'hover':
if (this.opts.alignTo == 'cursor')
this.$elm.bind('mousemove.poshytip', $.proxy(this.mousemove, this));
if (this.opts.allowTipHover)
this.$tip.hover($.proxy(this.clearTimeouts, this), $.proxy(this.mouseleave, this));
break;
case 'focus':
this.$elm.bind({
'focus.poshytip': $.proxy(this.show, this),
'blur.poshytip': $.proxy(this.hide, this)
});
break;
}
}
},
mouseenter: function(e) {
if (this.disabled)
return true;
this.$elm.attr('title', '');
if (this.opts.showOn == 'focus')
return true;
this.clearTimeouts();
this.showTimeout = setTimeout($.proxy(this.show, this), this.opts.showTimeout);
},
mouseleave: function(e) {
if (this.disabled || this.asyncAnimating && (this.$tip[0] === e.relatedTarget || jQuery.contains(this.$tip[0], e.relatedTarget)))
return true;
var title = this.$elm.data('title.poshytip');
if (title !== null)
this.$elm.attr('title', title);
if (this.opts.showOn == 'focus')
return true;
this.clearTimeouts();
this.hideTimeout = setTimeout($.proxy(this.hide, this), this.opts.hideTimeout);
},
mousemove: function(e) {
if (this.disabled)
return true;
this.eventX = e.pageX;
this.eventY = e.pageY;
if (this.opts.followCursor && this.$tip.data('active')) {
this.calcPos();
this.$tip.css({left: this.pos.l, top: this.pos.t});
if (this.pos.arrow)
this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
}
},
show: function() {
if (this.disabled || this.$tip.data('active'))
return;
this.reset();
this.update();
this.display();
if (this.opts.timeOnScreen) {
this.clearTimeouts();
this.hideTimeout = setTimeout($.proxy(this.hide, this), this.opts.timeOnScreen);
}
},
hide: function() {
if (this.disabled || !this.$tip.data('active'))
return;
this.display(true);
},
reset: function() {
this.$tip.queue([]).detach().css('visibility', 'hidden').data('active', false);
this.$inner.find('*').poshytip('hide');
if (this.opts.fade)
this.$tip.css('opacity', this.opacity);
this.$arrow[0].className = 'tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left';
this.asyncAnimating = false;
},
update: function(content, dontOverwriteOption) {
if (this.disabled)
return;
var async = content !== undefined;
if (async) {
if (!dontOverwriteOption)
this.opts.content = content;
if (!this.$tip.data('active'))
return;
} else {
content = this.opts.content;
}
// update content only if it has been changed since last time
var self = this,
newContent = typeof content == 'function' ?
content.call(this.$elm[0], function(newContent) {
self.update(newContent);
}) :
content == '[title]' ? this.$elm.data('title.poshytip') : content;
if (this.content !== newContent) {
this.$inner.empty().append(newContent);
this.content = newContent;
}
this.refresh(async);
},
refresh: function(async) {
if (this.disabled)
return;
if (async) {
if (!this.$tip.data('active'))
return;
// save current position as we will need to animate
var currPos = {left: this.$tip.css('left'), top: this.$tip.css('top')};
}
// reset position to avoid text wrapping, etc.
this.$tip.css({left: 0, top: 0}).appendTo(document.body);
// save default opacity
if (this.opacity === undefined)
this.opacity = this.$tip.css('opacity');
// check for images - this code is here (i.e. executed each time we show the tip and not on init) due to some browser inconsistencies
var bgImage = this.$tip.css('background-image').match(reBgImage),
arrow = this.$arrow.css('background-image').match(reBgImage);
if (bgImage) {
var bgImagePNG = rePNG.test(bgImage[1]);
// fallback to background-color/padding/border in IE6 if a PNG is used
if (ie6 && bgImagePNG) {
this.$tip.css('background-image', 'none');
this.$inner.css({margin: 0, border: 0, padding: 0});
bgImage = bgImagePNG = false;
} else {
this.$tip.prepend('<table class="tip-table" border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>')
.css({border: 0, padding: 0, 'background-image': 'none', 'background-color': 'transparent'})
.find('.tip-bg-image').css('background-image', 'url("' + bgImage[1] +'")').end()
.find('td').eq(3).append(this.$inner);
}
// disable fade effect in IE due to Alpha filter + translucent PNG issue
if (bgImagePNG && !$.support.opacity)
this.opts.fade = false;
}
// IE arrow fixes
if (arrow && !$.support.opacity) {
// disable arrow in IE6 if using a PNG
if (ie6 && rePNG.test(arrow[1])) {
arrow = false;
this.$arrow.css('background-image', 'none');
}
// disable fade effect in IE due to Alpha filter + translucent PNG issue
this.opts.fade = false;
}
var $table = this.$tip.find('> table.tip-table');
if (ie6) {
// fix min/max-width in IE6
this.$tip[0].style.width = '';
$table.width('auto').find('td').eq(3).width('auto');
var tipW = this.$tip.width(),
minW = parseInt(this.$tip.css('min-width')),
maxW = parseInt(this.$tip.css('max-width'));
if (!isNaN(minW) && tipW < minW)
tipW = minW;
else if (!isNaN(maxW) && tipW > maxW)
tipW = maxW;
this.$tip.add($table).width(tipW).eq(0).find('td').eq(3).width('100%');
} else if ($table[0]) {
// fix the table width if we are using a background image
// IE9, FF4 use float numbers for width/height so use getComputedStyle for them to avoid text wrapping
// for details look at: http://vadikom.com/dailies/offsetwidth-offsetheight-useless-in-ie9-firefox4/
$table.width('auto').find('td').eq(3).width('auto').end().end().width(document.defaultView && document.defaultView.getComputedStyle && parseFloat(document.defaultView.getComputedStyle(this.$tip[0], null).width) || this.$tip.width()).find('td').eq(3).width('100%');
}
this.tipOuterW = this.$tip.outerWidth();
this.tipOuterH = this.$tip.outerHeight();
this.calcPos();
// position and show the arrow image
if (arrow && this.pos.arrow) {
this.$arrow[0].className = 'tip-arrow tip-arrow-' + this.pos.arrow;
this.$arrow.css('visibility', 'inherit');
}
if (async && this.opts.refreshAniDuration) {
this.asyncAnimating = true;
var self = this;
this.$tip.css(currPos).animate({left: this.pos.l, top: this.pos.t}, this.opts.refreshAniDuration, function() { self.asyncAnimating = false; });
} else {
this.$tip.css({left: this.pos.l, top: this.pos.t});
}
},
display: function(hide) {
var active = this.$tip.data('active');
if (active && !hide || !active && hide)
return;
this.$tip.stop();
if ((this.opts.slide && this.pos.arrow || this.opts.fade) && (hide && this.opts.hideAniDuration || !hide && this.opts.showAniDuration)) {
var from = {}, to = {};
// this.pos.arrow is only undefined when alignX == alignY == 'center' and we don't need to slide in that rare case
if (this.opts.slide && this.pos.arrow) {
var prop, arr;
if (this.pos.arrow == 'bottom' || this.pos.arrow == 'top') {
prop = 'top';
arr = 'bottom';
} else {
prop = 'left';
arr = 'right';
}
var val = parseInt(this.$tip.css(prop));
from[prop] = val + (hide ? 0 : (this.pos.arrow == arr ? -this.opts.slideOffset : this.opts.slideOffset));
to[prop] = val + (hide ? (this.pos.arrow == arr ? this.opts.slideOffset : -this.opts.slideOffset) : 0) + 'px';
}
if (this.opts.fade) {
from.opacity = hide ? this.$tip.css('opacity') : 0;
to.opacity = hide ? 0 : this.opacity;
}
this.$tip.css(from).animate(to, this.opts[hide ? 'hideAniDuration' : 'showAniDuration']);
}
hide ? this.$tip.queue($.proxy(this.reset, this)) : this.$tip.css('visibility', 'inherit');
this.$tip.data('active', !active);
},
disable: function() {
this.reset();
this.disabled = true;
},
enable: function() {
this.disabled = false;
},
destroy: function() {
this.reset();
this.$tip.remove();
delete this.$tip;
this.content = null;
this.$elm.unbind('.poshytip').removeData('title.poshytip').removeData('poshytip');
tips.splice($.inArray(this, tips), 1);
},
clearTimeouts: function() {
if (this.showTimeout) {
clearTimeout(this.showTimeout);
this.showTimeout = 0;
}
if (this.hideTimeout) {
clearTimeout(this.hideTimeout);
this.hideTimeout = 0;
}
},
calcPos: function() {
var pos = {l: 0, t: 0, arrow: ''},
$win = $(window),
win = {
l: $win.scrollLeft(),
t: $win.scrollTop(),
w: $win.width(),
h: $win.height()
}, xL, xC, xR, yT, yC, yB;
if (this.opts.alignTo == 'cursor') {
xL = xC = xR = this.eventX;
yT = yC = yB = this.eventY;
} else { // this.opts.alignTo == 'target'
var elmOffset = this.$elm.offset(),
elm = {
l: elmOffset.left,
t: elmOffset.top,
w: this.$elm.outerWidth(),
h: this.$elm.outerHeight()
};
xL = elm.l + (this.opts.alignX != 'inner-right' ? 0 : elm.w); // left edge
xC = xL + Math.floor(elm.w / 2); // h center
xR = xL + (this.opts.alignX != 'inner-left' ? elm.w : 0); // right edge
yT = elm.t + (this.opts.alignY != 'inner-bottom' ? 0 : elm.h); // top edge
yC = yT + Math.floor(elm.h / 2); // v center
yB = yT + (this.opts.alignY != 'inner-top' ? elm.h : 0); // bottom edge
}
// keep in viewport and calc arrow position
switch (this.opts.alignX) {
case 'right':
case 'inner-left':
pos.l = xR + this.opts.offsetX;
if (pos.l + this.tipOuterW > win.l + win.w)
pos.l = win.l + win.w - this.tipOuterW;
if (this.opts.alignX == 'right' || this.opts.alignY == 'center')
pos.arrow = 'left';
break;
case 'center':
pos.l = xC - Math.floor(this.tipOuterW / 2);
if (pos.l + this.tipOuterW > win.l + win.w)
pos.l = win.l + win.w - this.tipOuterW;
else if (pos.l < win.l)
pos.l = win.l;
break;
default: // 'left' || 'inner-right'
pos.l = xL - this.tipOuterW - this.opts.offsetX;
if (pos.l < win.l)
pos.l = win.l;
if (this.opts.alignX == 'left' || this.opts.alignY == 'center')
pos.arrow = 'right';
}
switch (this.opts.alignY) {
case 'bottom':
case 'inner-top':
pos.t = yB + this.opts.offsetY;
// 'left' and 'right' need priority for 'target'
if (!pos.arrow || this.opts.alignTo == 'cursor')
pos.arrow = 'top';
if (pos.t + this.tipOuterH > win.t + win.h) {
pos.t = yT - this.tipOuterH - this.opts.offsetY;
if (pos.arrow == 'top')
pos.arrow = 'bottom';
}
break;
case 'center':
pos.t = yC - Math.floor(this.tipOuterH / 2);
if (pos.t + this.tipOuterH > win.t + win.h)
pos.t = win.t + win.h - this.tipOuterH;
else if (pos.t < win.t)
pos.t = win.t;
break;
default: // 'top' || 'inner-bottom'
pos.t = yT - this.tipOuterH - this.opts.offsetY;
// 'left' and 'right' need priority for 'target'
if (!pos.arrow || this.opts.alignTo == 'cursor')
pos.arrow = 'bottom';
if (pos.t < win.t) {
pos.t = yB + this.opts.offsetY;
if (pos.arrow == 'bottom')
pos.arrow = 'top';
}
}
this.pos = pos;
}
};
$.fn.poshytip = function(options) {
if (typeof options == 'string') {
var args = arguments,
method = options;
Array.prototype.shift.call(args);
// unhook live events if 'destroy' is called
if (method == 'destroy') {
this.die ?
this.die('mouseenter.poshytip').die('focus.poshytip') :
$(document).undelegate(this.selector, 'mouseenter.poshytip').undelegate(this.selector, 'focus.poshytip');
}
return this.each(function() {
var poshytip = $(this).data('poshytip');
if (poshytip && poshytip[method])
poshytip[method].apply(poshytip, args);
});
}
var opts = $.extend({}, $.fn.poshytip.defaults, options);
// generate CSS for this tip class if not already generated
if (!$('#poshytip-css-' + opts.className)[0])
$(['<style id="poshytip-css-',opts.className,'" type="text/css">',
'div.',opts.className,'{visibility:hidden;position:absolute;top:0;left:0;}',
'div.',opts.className,' table.tip-table, div.',opts.className,' table.tip-table td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;}',
'div.',opts.className,' td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:',opts.bgImageFrameSize,'px;width:',opts.bgImageFrameSize,'px;overflow:hidden;}',
'div.',opts.className,' td.tip-right{background-position:100% 0;}',
'div.',opts.className,' td.tip-bottom{background-position:100% 100%;}',
'div.',opts.className,' td.tip-left{background-position:0 100%;}',
'div.',opts.className,' div.tip-inner{background-position:-',opts.bgImageFrameSize,'px -',opts.bgImageFrameSize,'px;}',
'div.',opts.className,' div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}',
'</style>'].join('')).appendTo('head');
// check if we need to hook live events
if (opts.liveEvents && opts.showOn != 'none') {
var handler,
deadOpts = $.extend({}, opts, { liveEvents: false });
switch (opts.showOn) {
case 'hover':
handler = function() {
var $this = $(this);
if (!$this.data('poshytip'))
$this.poshytip(deadOpts).poshytip('mouseenter');
};
// support 1.4.2+ & 1.9+
this.live ?
this.live('mouseenter.poshytip', handler) :
$(document).delegate(this.selector, 'mouseenter.poshytip', handler);
break;
case 'focus':
handler = function() {
var $this = $(this);
if (!$this.data('poshytip'))
$this.poshytip(deadOpts).poshytip('show');
};
this.live ?
this.live('focus.poshytip', handler) :
$(document).delegate(this.selector, 'focus.poshytip', handler);
break;
}
return this;
}
return this.each(function() {
new $.Poshytip(this, opts);
});
}
// default settings
$.fn.poshytip.defaults = {
content: '[title]', // content to display ('[title]', 'string', element, function(updateCallback){...}, jQuery)
className: 'tip-yellow', // class for the tips
bgImageFrameSize: 10, // size in pixels for the background-image (if set in CSS) frame around the inner content of the tip
showTimeout: 500, // timeout before showing the tip (in milliseconds 1000 == 1 second)
hideTimeout: 100, // timeout before hiding the tip
timeOnScreen: 0, // timeout before automatically hiding the tip after showing it (set to > 0 in order to activate)
showOn: 'hover', // handler for showing the tip ('hover', 'focus', 'none') - use 'none' to trigger it manually
liveEvents: false, // use live events
alignTo: 'cursor', // align/position the tip relative to ('cursor', 'target')
alignX: 'right', // horizontal alignment for the tip relative to the mouse cursor or the target element
// ('right', 'center', 'left', 'inner-left', 'inner-right') - 'inner-*' matter if alignTo:'target'
alignY: 'top', // vertical alignment for the tip relative to the mouse cursor or the target element
// ('bottom', 'center', 'top', 'inner-bottom', 'inner-top') - 'inner-*' matter if alignTo:'target'
offsetX: -22, // offset X pixels from the default position - doesn't matter if alignX:'center'
offsetY: 18, // offset Y pixels from the default position - doesn't matter if alignY:'center'
allowTipHover: true, // allow hovering the tip without hiding it onmouseout of the target - matters only if showOn:'hover'
followCursor: false, // if the tip should follow the cursor - matters only if showOn:'hover' and alignTo:'cursor'
fade: true, // use fade animation
slide: true, // use slide animation
slideOffset: 8, // slide animation offset
showAniDuration: 300, // show animation duration - set to 0 if you don't want show animation
hideAniDuration: 300, // hide animation duration - set to 0 if you don't want hide animation
refreshAniDuration: 200 // refresh animation duration - set to 0 if you don't want animation when updating the tooltip asynchronously
};
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -1,107 +0,0 @@
Contributing to Select2
=======================
Looking to contribute something to Select2? **Here's how you can help.**
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
Using the issue tracker
-----------------------
When [reporting bugs][reporting-bugs] or
[requesting features][requesting-features], the
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
The issue tracker **is not** a place for support requests. The
[mailing list][mailing-list] or [IRC channel][irc-channel] are better places to
get help.
Reporting bugs with Select2
---------------------------
We really appreciate clear bug reports that _consistently_ show an issue
_within Select2_.
The ideal bug report follows these guidelines:
1. **Use the [GitHub issue search][issue-search]** &mdash; Check if the issue
has already been reported.
2. **Check if the issue has been fixed** &mdash; Try to reproduce the problem
using the code in the `master` branch.
3. **Isolate the problem** &mdash; Try to create an
[isolated test case][isolated-case] that consistently reproduces the problem.
Please try to be as detailed as possible in your bug report, especially if an
isolated test case cannot be made. Some useful questions to include the answer
to are:
- What steps can be used to reproduce the issue?
- What is the bug and what is the expected outcome?
- What browser(s) and Operating System have you tested with?
- Does the bug happen consistently across all tested browsers?
- What version of jQuery are you using? And what version of Select2?
- Are you using Select2 with other plugins?
All of these questions will help people fix and identify any potential bugs.
Requesting features in Select2
------------------------------
Select2 is a large library that carries with it a lot of functionality. Because
of this, many feature requests will not be implemented in the core library.
Before starting work on a major feature for Select2, **contact the
[community][community] first** or you may risk spending a considerable amount of
time on something which the project developers are not interested in bringing
into the project.
### Select2 4.0
Many feature requests will be closed off until 4.0, where Select2 plans to adopt
a more flexible API. If you are interested in helping with the development of
the next major Select2 release, please send a message to the
[mailing list][mailing-list] or [irc channel][irc-channel] for more information.
Triaging issues and pull requests
---------------------------------
Anyone can help the project maintainers triage issues and review pull requests.
### Handling new issues
Select2 regularly receives new issues which need to be tested and organized.
When a new issue that comes in that is similar to another existing issue, it
should be checked to make sure it is not a duplicate. Duplicates issues should
be marked by replying to the issue with "Duplicate of #[issue number]" where
`[issue number]` is the url or issue number for the existing issue. This will
allow the project maintainers to quickly close off additional issues and keep
the discussion focused within a single issue.
If you can test issues that are reported to Select2 that contain test cases and
confirm under what conditions bugs happen, that will allow others to identify
what causes a bug quicker.
### Reviewing pull requests
It is very common for pull requests to be opened for issues that contain a clear
solution to the problem. These pull requests should be rigorously reviewed by
the community before being accepted. If you are not sure about a piece of
submitted code, or know of a better way to do something, do not hesitate to make
a comment on the pull request.
It should also be made clear that **all code contributed to Select** must be
licensable under the [Apache 2 or GPL 2 licenses][licensing]. Code that cannot
be released under either of these licenses **cannot be accepted** into the
project.
[community]: https://github.com/ivaynberg/select2#community
[reporting-bugs]: #reporting-bugs-with-select2
[requesting-features]: #requesting-features-in-select2
[issue-tracker]: https://github.com/ivaynberg/select2/issues
[mailing-list]: https://github.com/ivaynberg/select2#mailing-list
[irc-channel]: https://github.com/ivaynberg/select2#irc-channel
[issue-search]: https://github.com/ivaynberg/select2/search?q=&type=Issues
[isolated-case]: http://css-tricks.com/6263-reduced-test-cases/
[licensing]: https://github.com/ivaynberg/select2#copyright-and-license

View File

@ -1,18 +0,0 @@
Copyright 2014 Igor Vaynberg
Version: @@ver@@ Timestamp: @@timestamp@@
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.
You may obtain a copy of the Apache License and the GPL License at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.

View File

@ -1,115 +0,0 @@
Select2
=======
Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
To get started, checkout examples and documentation at http://select2.github.io/select2/
Use cases
---------
* Enhancing native selects with search.
* Enhancing native selects with a better multi-select interface.
* Loading data from JavaScript: easily load items via ajax and have them searchable.
* Nesting optgroups: native selects only support one level of nested. Select2 does not have this restriction.
* Tagging: ability to add new items on the fly.
* Working with large, remote datasets: ability to partially load a dataset based on the search term.
* Paging of large datasets: easy support for loading more pages when the results are scrolled to the end.
* Templating: support for custom rendering of results and selections.
Browser compatibility
---------------------
* IE 8+
* Chrome 8+
* Firefox 10+
* Safari 3+
* Opera 10.6+
Usage
-----
You can source Select2 directly from a CDN like [jsDelivr](http://www.jsdelivr.com/#!select2) or [CDNJS](http://www.cdnjs.com/libraries/select2), [download it from this GitHub repo](https://github.com/select2/select2/tags), or use one of the integrations below.
Integrations
------------
* [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org))
* [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails)
* [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](https://angularjs.org/))
* [Django](https://github.com/applegrew/django-select2)
* [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin)
* [Symfony2](https://github.com/avocode/FormExtensions)
* [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins)
* [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/))
* [Meteor](https://jquery-select2.meteor.com)
* [Yii 2.x](http://demos.krajee.com/widgets#select2)
* [Yii 1.x](https://github.com/tonybolzan/yii-select2)
* [AtmosphereJS](https://atmospherejs.com/package/jquery-select2)
* [EmberJS](https://github.com/iStefo/ember-select-2)
### Example Integrations
* [Knockout.js](https://github.com/ivaynberg/select2/wiki/Knockout.js-Integration)
* [Socket.IO](https://github.com/ivaynberg/select2/wiki/Socket.IO-Integration)
* [PHP](https://github.com/ivaynberg/select2/wiki/PHP-Example)
* [.Net MVC] (https://github.com/ivaynberg/select2/wiki/.Net-MVC-Example)
Internationalization (i18n)
---------------------------
Select2 supports multiple languages by simply including the right language JS
file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`.
Missing a language? Just copy `select2_locale_en.js.template`, translate
it, and make a pull request back to Select2 here on GitHub.
Documentation
-------------
The documentation for Select2 is available [through GitHub Pages](http://select2.github.io/select2/) and is located within this repository in the [`gh-pages` branch](https://github.com/ivaynberg/select2/tree/gh-pages).
Community
---------
### Bug tracker
Have a bug? Please create an issue here on GitHub!
https://github.com/ivaynberg/select2/issues
### Mailing list
Have a question? Ask on our mailing list!
select2@googlegroups.com
https://groups.google.com/d/forum/select2
### IRC channel
Need help implementing Select2 in your project? Ask in our IRC channel!
**Network:** [Freenode](https://freenode.net/) (`chat.freenode.net`)
**Channel:** `#select2`
**Web access:** https://webchat.freenode.net/?channels=select2
Copyright and license
---------------------
Copyright 2015 Igor Vaynberg
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.
You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.

View File

@ -1,8 +0,0 @@
{
"name": "select2",
"version": "3.5.4",
"main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
"dependencies": {
"jquery": ">= 1.7.1"
}
}

View File

@ -1,66 +0,0 @@
{
"name": "select2",
"repo": "ivaynberg/select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"version": "3.5.4",
"demo": "http://ivaynberg.github.io/select2/",
"keywords": [
"jquery"
],
"main": "select2.js",
"styles": [
"select2.css",
"select2-bootstrap.css"
],
"scripts": [
"select2.js",
"select2_locale_ar.js",
"select2_locale_bg.js",
"select2_locale_ca.js",
"select2_locale_cs.js",
"select2_locale_da.js",
"select2_locale_de.js",
"select2_locale_el.js",
"select2_locale_es.js",
"select2_locale_et.js",
"select2_locale_eu.js",
"select2_locale_fa.js",
"select2_locale_fi.js",
"select2_locale_fr.js",
"select2_locale_gl.js",
"select2_locale_he.js",
"select2_locale_hr.js",
"select2_locale_hu.js",
"select2_locale_id.js",
"select2_locale_is.js",
"select2_locale_it.js",
"select2_locale_ja.js",
"select2_locale_ka.js",
"select2_locale_ko.js",
"select2_locale_lt.js",
"select2_locale_lv.js",
"select2_locale_mk.js",
"select2_locale_ms.js",
"select2_locale_nl.js",
"select2_locale_no.js",
"select2_locale_pl.js",
"select2_locale_pt-BR.js",
"select2_locale_pt-PT.js",
"select2_locale_ro.js",
"select2_locale_ru.js",
"select2_locale_sk.js",
"select2_locale_sv.js",
"select2_locale_th.js",
"select2_locale_tr.js",
"select2_locale_uk.js",
"select2_locale_vi.js",
"select2_locale_zh-CN.js",
"select2_locale_zh-TW.js"
],
"images": [
"select2-spinner.gif",
"select2.png",
"select2x2.png"
],
"license": "MIT"
}

View File

@ -1,29 +0,0 @@
{
"name":
"ivaynberg/select2",
"description": "Select2 is a jQuery based replacement for select boxes.",
"version": "3.5.4",
"type": "component",
"homepage": "http://ivaynberg.github.io/select2/",
"license": "Apache-2.0",
"require": {
"robloach/component-installer": "*",
"components/jquery": ">=1.7.1"
},
"extra": {
"component": {
"scripts": [
"select2.js"
],
"files": [
"select2.js",
"select2_locale_*.js",
"select2.css",
"select2-bootstrap.css",
"select2-spinner.gif",
"select2.png",
"select2x2.png"
]
}
}
}

View File

@ -1,20 +0,0 @@
{
"name" : "Select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"homepage": "http://ivaynberg.github.io/select2",
"author": "Igor Vaynberg",
"repository": {"type": "git", "url": "git://github.com/ivaynberg/select2.git"},
"main": "select2.js",
"version": "3.5.4",
"jspm": {
"main": "select2",
"files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"],
"shim": {
"select2": {
"imports": ["jquery", "./select2.css!"],
"exports": "$"
}
},
"buildConfig": { "uglify": true }
}
}

View File

@ -1,79 +0,0 @@
#!/bin/bash
set -e
echo -n "Enter the version for this release: "
read ver
if [ ! $ver ]; then
echo "Invalid version."
exit
fi
name="select2"
js="$name.js"
mini="$name.min.js"
css="$name.css"
release="$name-$ver"
tag="$ver"
branch="build-$ver"
curbranch=`git branch | grep "*" | sed "s/* //"`
timestamp=$(date)
tokens="s/@@ver@@/$ver/g;s/\@@timestamp@@/$timestamp/g"
remote="origin"
echo "Pulling from origin"
git pull
echo "Updating Version Identifiers"
sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i -- bower.json select2.jquery.json component.json composer.json package.json
git add bower.json
git add select2.jquery.json
git add component.json
git add composer.json
git add package.json
git commit -m "modified version identifiers in descriptors for release $ver"
git push
git branch "$branch"
git checkout "$branch"
echo "Tokenizing..."
find . -name "$js" | xargs -I{} sed -e "$tokens" -i -- {}
find . -name "$css" | xargs -I{} sed -e "$tokens" -i -- {}
sed -e "s/latest/$ver/g" -i -- bower.json
git add "$js"
git add "$css"
echo "Minifying..."
echo "/*" > "$mini"
cat LICENSE | sed "$tokens" >> "$mini"
echo "*/" >> "$mini"
curl -s \
--data-urlencode "js_code@$js" \
http://marijnhaverbeke.nl/uglifyjs \
>> "$mini"
git add "$mini"
git commit -m "release $ver"
echo "Tagging..."
git tag -a "$tag" -m "tagged version $ver"
git push "$remote" --tags
echo "Cleaning Up..."
git checkout "$curbranch"
git branch -D "$branch"
echo "Done"

View File

@ -1,87 +0,0 @@
.form-control .select2-choice {
border: 0;
border-radius: 2px;
}
.form-control .select2-choice .select2-arrow {
border-radius: 0 2px 2px 0;
}
.form-control.select2-container {
height: auto !important;
padding: 0;
}
.form-control.select2-container.select2-dropdown-open {
border-color: #5897FB;
border-radius: 3px 3px 0 0;
}
.form-control .select2-container.select2-dropdown-open .select2-choices {
border-radius: 3px 3px 0 0;
}
.form-control.select2-container .select2-choices {
border: 0 !important;
border-radius: 3px;
}
.control-group.warning .select2-container .select2-choice,
.control-group.warning .select2-container .select2-choices,
.control-group.warning .select2-container-active .select2-choice,
.control-group.warning .select2-container-active .select2-choices,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.warning .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #C09853 !important;
}
.control-group.warning .select2-container .select2-choice div {
border-left: 1px solid #C09853 !important;
background: #FCF8E3 !important;
}
.control-group.error .select2-container .select2-choice,
.control-group.error .select2-container .select2-choices,
.control-group.error .select2-container-active .select2-choice,
.control-group.error .select2-container-active .select2-choices,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.error .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #B94A48 !important;
}
.control-group.error .select2-container .select2-choice div {
border-left: 1px solid #B94A48 !important;
background: #F2DEDE !important;
}
.control-group.info .select2-container .select2-choice,
.control-group.info .select2-container .select2-choices,
.control-group.info .select2-container-active .select2-choice,
.control-group.info .select2-container-active .select2-choices,
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.info .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #3A87AD !important;
}
.control-group.info .select2-container .select2-choice div {
border-left: 1px solid #3A87AD !important;
background: #D9EDF7 !important;
}
.control-group.success .select2-container .select2-choice,
.control-group.success .select2-container .select2-choices,
.control-group.success .select2-container-active .select2-choice,
.control-group.success .select2-container-active .select2-choices,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.success .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #468847 !important;
}
.control-group.success .select2-container .select2-choice div {
border-left: 1px solid #468847 !important;
background: #DFF0D8 !important;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,692 +0,0 @@
/*
Version: 3.5.4 Timestamp: Sun Aug 30 13:30:32 EDT 2015
*/
.select2-container {
margin: 0;
position: relative;
display: inline-block;
vertical-align: middle;
}
.select2-container,
.select2-drop,
.select2-search,
.select2-search input {
/*
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html
*/
-webkit-box-sizing: border-box; /* webkit */
-moz-box-sizing: border-box; /* firefox */
box-sizing: border-box; /* css3 */
}
.select2-container .select2-choice {
display: block;
height: 26px;
padding: 0 0 0 8px;
overflow: hidden;
position: relative;
border: 1px solid #aaa;
white-space: nowrap;
line-height: 26px;
color: #444;
text-decoration: none;
border-radius: 4px;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(to top, #eee 0%, #fff 50%);
}
html[dir="rtl"] .select2-container .select2-choice {
padding: 0 8px 0 0;
}
.select2-container.select2-drop-above .select2-choice {
border-bottom-color: #aaa;
border-radius: 0 0 4px 4px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
}
.select2-container.select2-allowclear .select2-choice .select2-chosen {
margin-right: 42px;
}
.select2-container .select2-choice > .select2-chosen {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
float: none;
width: auto;
}
html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
margin-left: 26px;
margin-right: 0;
}
.select2-container .select2-choice abbr {
display: none;
width: 12px;
height: 12px;
position: absolute;
right: 24px;
top: 8px;
font-size: 1px;
text-decoration: none;
border: 0;
background: url('select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
}
.select2-container.select2-allowclear .select2-choice abbr {
display: inline-block;
}
.select2-container .select2-choice abbr:hover {
background-position: right -11px;
cursor: pointer;
}
.select2-drop-mask {
border: 0;
margin: 0;
padding: 0;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 9998;
/* styles required for IE to work */
background-color: #fff;
filter: alpha(opacity=0);
}
.select2-drop {
width: 100%;
margin-top: -1px;
position: absolute;
z-index: 9999;
top: 100%;
background: #fff;
color: #000;
border: 1px solid #aaa;
border-top: 0;
border-radius: 0 0 4px 4px;
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
}
.select2-drop.select2-drop-above {
margin-top: 1px;
border-top: 1px solid #aaa;
border-bottom: 0;
border-radius: 4px 4px 0 0;
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
}
.select2-drop-active {
border: 1px solid #5897fb;
border-top: none;
}
.select2-drop.select2-drop-above.select2-drop-active {
border-top: 1px solid #5897fb;
}
.select2-drop-auto-width {
border-top: 1px solid #aaa;
width: auto;
}
.select2-container .select2-choice .select2-arrow {
display: inline-block;
width: 18px;
height: 100%;
position: absolute;
right: 0;
top: 0;
border-left: 1px solid #aaa;
border-radius: 0 4px 4px 0;
background-clip: padding-box;
background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
}
html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
left: 0;
right: auto;
border-left: none;
border-right: 1px solid #aaa;
border-radius: 4px 0 0 4px;
}
.select2-container .select2-choice .select2-arrow b {
display: block;
width: 100%;
height: 100%;
background: url('select2.png') no-repeat 0 1px;
}
html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
background-position: 2px 1px;
}
.select2-search {
display: inline-block;
width: 100%;
min-height: 26px;
margin: 0;
padding: 4px 4px 0 4px;
position: relative;
z-index: 10000;
white-space: nowrap;
}
.select2-search input {
width: 100%;
height: auto !important;
min-height: 26px;
padding: 4px 20px 4px 5px;
margin: 0;
outline: 0;
font-family: sans-serif;
font-size: 1em;
border: 1px solid #aaa;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
background: #fff url('select2.png') no-repeat 100% -22px;
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
html[dir="rtl"] .select2-search input {
padding: 4px 5px 4px 20px;
background: #fff url('select2.png') no-repeat -37px -22px;
background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
.select2-search input.select2-active {
background: #fff url('select2-spinner.gif') no-repeat 100%;
background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
}
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
}
.select2-dropdown-open .select2-choice {
border-bottom-color: transparent;
-webkit-box-shadow: 0 1px 0 #fff inset;
box-shadow: 0 1px 0 #fff inset;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-color: #eee;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
background-image: linear-gradient(to top, #fff 0%, #eee 50%);
}
.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices {
border: 1px solid #5897fb;
border-top-color: transparent;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
}
.select2-dropdown-open .select2-choice .select2-arrow {
background: transparent;
border-left: none;
filter: none;
}
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
border-right: none;
}
.select2-dropdown-open .select2-choice .select2-arrow b {
background-position: -18px 1px;
}
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
background-position: -16px 1px;
}
.select2-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/* results */
.select2-results {
max-height: 200px;
padding: 0 0 0 4px;
margin: 4px 4px 4px 0;
position: relative;
overflow-x: hidden;
overflow-y: auto;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html[dir="rtl"] .select2-results {
padding: 0 4px 0 0;
margin: 4px 0 4px 4px;
}
.select2-results ul.select2-result-sub {
margin: 0;
padding-left: 0;
}
.select2-results li {
list-style: none;
display: list-item;
background-image: none;
}
.select2-results li.select2-result-with-children > .select2-result-label {
font-weight: bold;
}
.select2-results .select2-result-label {
padding: 3px 7px 4px;
margin: 0;
cursor: pointer;
min-height: 1em;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.select2-results-dept-1 .select2-result-label { padding-left: 20px }
.select2-results-dept-2 .select2-result-label { padding-left: 40px }
.select2-results-dept-3 .select2-result-label { padding-left: 60px }
.select2-results-dept-4 .select2-result-label { padding-left: 80px }
.select2-results-dept-5 .select2-result-label { padding-left: 100px }
.select2-results-dept-6 .select2-result-label { padding-left: 110px }
.select2-results-dept-7 .select2-result-label { padding-left: 120px }
.select2-results .select2-highlighted {
background: #3875d7;
color: #fff;
}
.select2-results li em {
background: #feffde;
font-style: normal;
}
.select2-results .select2-highlighted em {
background: transparent;
}
.select2-results .select2-highlighted ul {
background: #fff;
color: #000;
}
.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-ajax-error,
.select2-results .select2-selection-limit {
background: #f4f4f4;
display: list-item;
padding-left: 5px;
}
/*
disabled look for disabled choices in the results dropdown
*/
.select2-results .select2-disabled.select2-highlighted {
color: #666;
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-disabled {
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-selected {
display: none;
}
.select2-more-results.select2-active {
background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
}
.select2-results .select2-ajax-error {
background: rgba(255, 50, 50, .2);
}
.select2-more-results {
background: #f4f4f4;
display: list-item;
}
/* disabled styles */
.select2-container.select2-container-disabled .select2-choice {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container.select2-container-disabled .select2-choice .select2-arrow {
background-color: #f4f4f4;
background-image: none;
border-left: 0;
}
.select2-container.select2-container-disabled .select2-choice abbr {
display: none;
}
/* multiselect */
.select2-container-multi .select2-choices {
height: auto !important;
height: 1%;
margin: 0;
padding: 0 5px 0 0;
position: relative;
border: 1px solid #aaa;
cursor: text;
overflow: hidden;
background-color: #fff;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
}
html[dir="rtl"] .select2-container-multi .select2-choices {
padding: 0 0 0 5px;
}
.select2-locked {
padding: 3px 5px 3px 5px !important;
}
.select2-container-multi .select2-choices {
min-height: 26px;
}
.select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #5897fb;
outline: none;
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
}
.select2-container-multi .select2-choices li {
float: left;
list-style: none;
}
html[dir="rtl"] .select2-container-multi .select2-choices li
{
float: right;
}
.select2-container-multi .select2-choices .select2-search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.select2-container-multi .select2-choices .select2-search-field input {
padding: 5px;
margin: 1px 0;
font-family: sans-serif;
font-size: 100%;
color: #666;
outline: 0;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
background: transparent !important;
}
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('select2-spinner.gif') no-repeat 100% !important;
}
.select2-default {
color: #999 !important;
}
.select2-container-multi .select2-choices .select2-search-choice {
padding: 3px 5px 3px 18px;
margin: 3px 0 3px 5px;
position: relative;
line-height: 13px;
color: #333;
cursor: default;
border: 1px solid #aaaaaa;
border-radius: 3px;
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
}
html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
{
margin: 3px 5px 3px 0;
padding: 3px 18px 3px 5px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice-focus {
background: #d4d4d4;
}
.select2-search-choice-close {
display: block;
width: 12px;
height: 13px;
position: absolute;
right: 3px;
top: 4px;
font-size: 1px;
outline: none;
background: url('select2.png') right top no-repeat;
}
html[dir="rtl"] .select2-search-choice-close {
right: auto;
left: 3px;
}
.select2-container-multi .select2-search-choice-close {
left: 3px;
}
html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
left: auto;
right: 2px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -11px;
}
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -11px;
}
/* disabled styles */
.select2-container-multi.select2-container-disabled .select2-choices {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
padding: 3px 5px 3px 5px;
border: 1px solid #ddd;
background-image: none;
background-color: #f4f4f4;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
background: none;
}
/* end multiselect */
.select2-result-selectable .select2-match,
.select2-result-unselectable .select2-match {
text-decoration: underline;
}
.select2-offscreen, .select2-offscreen:focus {
clip: rect(0 0 0 0) !important;
width: 1px !important;
height: 1px !important;
border: 0 !important;
margin: 0 !important;
padding: 0 !important;
overflow: hidden !important;
position: absolute !important;
outline: 0 !important;
left: 0px !important;
top: 0px !important;
}
.select2-display-none {
display: none;
}
.select2-measure-scrollbar {
position: absolute;
top: -10000px;
left: -10000px;
width: 100px;
height: 100px;
overflow: scroll;
}
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
.select2-search input,
.select2-search-choice-close,
.select2-container .select2-choice abbr,
.select2-container .select2-choice .select2-arrow b {
background-image: url('select2x2.png') !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
.select2-search input {
background-position: 100% -21px !important;
}
}

View File

@ -1,36 +0,0 @@
{
"name": "select2",
"title": "Select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"keywords": [
"select",
"autocomplete",
"typeahead",
"dropdown",
"multiselect",
"tag",
"tagging"
],
"version": "3.5.4",
"author": {
"name": "Igor Vaynberg",
"url": "https://github.com/ivaynberg"
},
"licenses": [
{
"type": "Apache",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
},
{
"type": "GPL v2",
"url": "http://www.gnu.org/licenses/gpl-2.0.html"
}
],
"bugs": "https://github.com/ivaynberg/select2/issues",
"homepage": "http://ivaynberg.github.com/select2",
"docs": "http://ivaynberg.github.com/select2/",
"download": "https://github.com/ivaynberg/select2/tags",
"dependencies": {
"jquery": ">=1.7.1"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

View File

@ -1,19 +0,0 @@
/**
* Select2 Arabic translation.
*
* Author: Adel KEDJOUR <adel@kedjour.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['ar'] = {
formatNoMatches: function () { return "لم يتم العثور على مطابقات"; },
formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; },
formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; },
formatSelectionTooBig: function (limit) { if (limit == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return limit == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + limit + " إختيارات فقط"; },
formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; },
formatSearching: function () { return "البحث…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ar']);
})(jQuery);

View File

@ -1,20 +0,0 @@
/**
* Select2 Azerbaijani translation.
*
* Author: Farhad Safarov <farhad.safarov@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['az'] = {
formatMatches: function (matches) { return matches + " nəticə mövcuddur, hərəkət etdirmək üçün yuxarı və aşağı düymələrindən istifadə edin."; },
formatNoMatches: function () { return "Nəticə tapılmadı"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return n + " simvol daxil edin"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " simvol silin"; },
formatSelectionTooBig: function (limit) { return "Sadəcə " + limit + " element seçə bilərsiniz"; },
formatLoadMore: function (pageNumber) { return "Daha çox nəticə yüklənir…"; },
formatSearching: function () { return "Axtarılır…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['az']);
})(jQuery);

View File

@ -1,20 +0,0 @@
/**
* Select2 Bulgarian translation.
*
* @author Lubomir Vikev <lubomirvikev@gmail.com>
* @author Uriy Efremochkin <efremochkin@uriy.me>
*/
(function ($) {
"use strict";
$.fn.select2.locales['bg'] = {
formatNoMatches: function () { return "Няма намерени съвпадения"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n > 1 ? "а" : ""); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n > 1 ? "а" : ""); },
formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit > 1 ? " избора" : " избор"); },
formatLoadMore: function (pageNumber) { return "Зареждат се още…"; },
formatSearching: function () { return "Търсене…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['bg']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Catalan translation.
*
* Author: David Planella <david.planella@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['ca'] = {
formatNoMatches: function () { return "No s'ha trobat cap coincidència"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; },
formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats…"; },
formatSearching: function () { return "S'està cercant…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ca']);
})(jQuery);

View File

@ -1,51 +0,0 @@
/**
* Select2 Czech translation.
*
* Author: Michal Marek <ahoj@michal-marek.cz>
* Author - sklonovani: David Vallner <david@vallner.net>
*/
(function ($) {
"use strict";
// use text for the numbers 2 through 4
var smallNumbers = {
2: function(masc) { return (masc ? "dva" : "dvě"); },
3: function() { return "tři"; },
4: function() { return "čtyři"; }
}
$.fn.select2.locales['cs'] = {
formatNoMatches: function () { return "Nenalezeny žádné položky"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n == 1) {
return "Prosím zadejte ještě jeden znak";
} else if (n <= 4) {
return "Prosím zadejte ještě další "+smallNumbers[n](true)+" znaky";
} else {
return "Prosím zadejte ještě dalších "+n+" znaků";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n == 1) {
return "Prosím zadejte o jeden znak méně";
} else if (n <= 4) {
return "Prosím zadejte o "+smallNumbers[n](true)+" znaky méně";
} else {
return "Prosím zadejte o "+n+" znaků méně";
}
},
formatSelectionTooBig: function (limit) {
if (limit == 1) {
return "Můžete zvolit jen jednu položku";
} else if (limit <= 4) {
return "Můžete zvolit maximálně "+smallNumbers[limit](false)+" položky";
} else {
return "Můžete zvolit maximálně "+limit+" položek";
}
},
formatLoadMore: function (pageNumber) { return "Načítají se další výsledky…"; },
formatSearching: function () { return "Vyhledávání…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['cs']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Danish translation.
*
* Author: Anders Jenbo <anders@jenbo.dk>
*/
(function ($) {
"use strict";
$.fn.select2.locales['da'] = {
formatNoMatches: function () { return "Ingen resultater fundet"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; },
formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); },
formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; },
formatSearching: function () { return "Søger…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['da']);
})(jQuery);

View File

@ -1,18 +0,0 @@
/**
* Select2 German translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['de'] = {
formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; },
formatSelectionTooBig: function (limit) { return "Sie können nur " + limit + " Eintr" + (limit === 1 ? "ag" : "äge") + " auswählen"; },
formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse…"; },
formatSearching: function () { return "Suche…"; },
formatMatches: function (matches) { return matches + " Ergebnis " + (matches > 1 ? "se" : "") + " verfügbar, zum Navigieren die Hoch-/Runter-Pfeiltasten verwenden."; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['de']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Greek translation.
*
* @author Uriy Efremochkin <efremochkin@uriy.me>
*/
(function ($) {
"use strict";
$.fn.select2.locales['el'] = {
formatNoMatches: function () { return "Δεν βρέθηκαν αποτελέσματα"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Παρακαλούμε διαγράψτε " + n + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
formatSelectionTooBig: function (limit) { return "Μπορείτε να επιλέξετε μόνο " + limit + " αντικείμεν" + (limit > 1 ? "α" : "ο"); },
formatLoadMore: function (pageNumber) { return "Φόρτωση περισσότερων…"; },
formatSearching: function () { return "Αναζήτηση…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['el']);
})(jQuery);

View File

@ -1,20 +0,0 @@
/**
* Select2 <Language> translation.
*
* Author: Your Name <your@email>
*/
(function ($) {
"use strict";
$.fn.select2.locales['en'] = {
formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; },
formatNoMatches: function () { return "No matches found"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Loading more results…"; },
formatSearching: function () { return "Searching…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Spanish translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['es'] = {
formatMatches: function (matches) { if (matches === 1) { return "Un resultado disponible, presione enter para seleccionarlo."; } return matches + " resultados disponibles, use las teclas de dirección para navegar."; },
formatNoMatches: function () { return "No se encontraron resultados"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); },
formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; },
formatSearching: function () { return "Buscando…"; },
formatAjaxError: function() { return "La carga falló"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['es']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Estonian translation.
*
* Author: Kuldar Kalvik <kuldar@kalvik.ee>
*/
(function ($) {
"use strict";
$.fn.select2.locales['et'] = {
formatNoMatches: function () { return "Tulemused puuduvad"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; },
formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; },
formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; },
formatSearching: function () { return "Otsin.."; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['et']);
})(jQuery);

View File

@ -1,45 +0,0 @@
/**
* Select2 Basque translation.
*
* Author: Julen Ruiz Aizpuru <julenx at gmail dot com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['eu'] = {
formatNoMatches: function () {
return "Ez da bat datorrenik aurkitu";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n === 1) {
return "Idatzi karaktere bat gehiago";
} else {
return "Idatzi " + n + " karaktere gehiago";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n === 1) {
return "Idatzi karaktere bat gutxiago";
} else {
return "Idatzi " + n + " karaktere gutxiago";
}
},
formatSelectionTooBig: function (limit) {
if (limit === 1 ) {
return "Elementu bakarra hauta dezakezu";
} else {
return limit + " elementu hauta ditzakezu soilik";
}
},
formatLoadMore: function (pageNumber) {
return "Emaitza gehiago kargatzen…";
},
formatSearching: function () {
return "Bilatzen…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['eu']);
})(jQuery);

View File

@ -1,21 +0,0 @@
/**
* Select2 Persian translation.
*
* Author: Ali Choopan <choopan@arsh.co>
* Author: Ebrahim Byagowi <ebrahim@gnu.org>
*/
(function ($) {
"use strict";
$.fn.select2.locales['fa'] = {
formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; },
formatNoMatches: function () { return "نتیجه‌ای یافت نشد."; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "لطفاً " + n + " نویسه را حذف کنید."; },
formatSelectionTooBig: function (limit) { return "شما فقط می‌توانید " + limit + " مورد را انتخاب کنید"; },
formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; },
formatSearching: function () { return "در حال جستجو…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['fa']);
})(jQuery);

View File

@ -1,30 +0,0 @@
/**
* Select2 Finnish translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['fi'] = {
formatNoMatches: function () {
return "Ei tuloksia";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
return "Ole hyvä ja anna " + n + " merkkiä lisää";
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
return "Ole hyvä ja anna " + n + " merkkiä vähemmän";
},
formatSelectionTooBig: function (limit) {
return "Voit valita ainoastaan " + limit + " kpl";
},
formatLoadMore: function (pageNumber) {
return "Ladataan lisää tuloksia…";
},
formatSearching: function () {
return "Etsitään…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['fi']);
})(jQuery);

View File

@ -1,18 +0,0 @@
/**
* Select2 French translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['fr'] = {
formatMatches: function (matches) { return matches + " résultats sont disponibles, utilisez les flèches haut et bas pour naviguer."; },
formatNoMatches: function () { return "Aucun résultat trouvé"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Saisissez " + n + " caractère" + (n == 1? "" : "s") + " supplémentaire" + (n == 1? "" : "s") ; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Supprimez " + n + " caractère" + (n == 1? "" : "s"); },
formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires…"; },
formatSearching: function () { return "Recherche en cours…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['fr']);
})(jQuery);

View File

@ -1,45 +0,0 @@
/**
* Select2 Galician translation
*
* Author: Leandro Regueiro <leandro.regueiro@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['gl'] = {
formatNoMatches: function () {
return "Non se atoparon resultados";
},
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n === 1) {
return "Engada un carácter";
} else {
return "Engada " + n + " caracteres";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n === 1) {
return "Elimine un carácter";
} else {
return "Elimine " + n + " caracteres";
}
},
formatSelectionTooBig: function (limit) {
if (limit === 1 ) {
return "Só pode seleccionar un elemento";
} else {
return "Só pode seleccionar " + limit + " elementos";
}
},
formatLoadMore: function (pageNumber) {
return "Cargando máis resultados…";
},
formatSearching: function () {
return "Buscando…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['gl']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Hebrew translation.
*
* Author: Yakir Sitbon <http://www.yakirs.net/>
*/
(function ($) {
"use strict";
$.fn.select2.locales['he'] = {
formatNoMatches: function () { return "לא נמצאו התאמות"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; },
formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; },
formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות…"; },
formatSearching: function () { return "מחפש…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['he']);
})(jQuery);

View File

@ -1,24 +0,0 @@
/**
* Select2 Croatian translation.
*
* @author Edi Modrić <edi.modric@gmail.com>
* @author Uriy Efremochkin <efremochkin@uriy.me>
*/
(function ($) {
"use strict";
$.fn.select2.locales['hr'] = {
formatNoMatches: function () { return "Nema rezultata"; },
formatInputTooShort: function (input, min) { return "Unesite još" + character(min - input.length); },
formatInputTooLong: function (input, max) { return "Unesite" + character(input.length - max) + " manje"; },
formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; },
formatLoadMore: function (pageNumber) { return "Učitavanje rezultata…"; },
formatSearching: function () { return "Pretraga…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['hr']);
function character (n) {
return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova");
}
})(jQuery);

View File

@ -1,17 +0,0 @@
/**
* Select2 Hungarian translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['hu'] = {
formatNoMatches: function () { return "Nincs találat."; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " karakterrel több, mint kellene."; },
formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; },
formatLoadMore: function (pageNumber) { return "Töltés…"; },
formatSearching: function () { return "Keresés…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['hu']);
})(jQuery);

View File

@ -1,21 +0,0 @@
/**
* Select2 Indonesian translation.
*
* Author: Ibrahim Yusuf <ibrahim7usuf@gmail.com>
* Author: Salahuddin Hairai <mr.od3n@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['id'] = {
formatMatches: function (matches) { if (matches === 1) { return "Satu keputusan ditemui, tekan enter untuk memilih."; } return matches + " keputusan ditemui, gunakan kekunci anak panah ke atas dan ke bawah untuk menavigasi."; },
formatNoMatches: function () { return "Tidak ada data yang sesuai"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapuskan " + n + " huruf" ; },
formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan"; },
formatLoadMore: function (pageNumber) { return "Mengambil data…"; },
formatSearching: function () { return "Mencari…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['id']);
})(jQuery);

View File

@ -1,17 +0,0 @@
/**
* Select2 Icelandic translation.
*/
(function ($) {
"use strict";
$.fn.select2.locales['is'] = {
formatNoMatches: function () { return "Ekkert fannst"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n > 1 ? "i" : "") + " í viðbót"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n > 1 ? "i" : ""); },
formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; },
formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður…"; },
formatSearching: function () { return "Leita…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['is']);
})(jQuery);

View File

@ -1,17 +0,0 @@
/**
* Select2 Italian translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['it'] = {
formatNoMatches: function () { return "Nessuna corrispondenza trovata"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; },
formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); },
formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; },
formatSearching: function () { return "Ricerca…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['it']);
})(jQuery);

View File

@ -1,17 +0,0 @@
/**
* Select2 Japanese translation.
*/
(function ($) {
"use strict";
$.fn.select2.locales['ja'] = {
formatNoMatches: function () { return "該当なし"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; },
formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; },
formatLoadMore: function (pageNumber) { return "読込中・・・"; },
formatSearching: function () { return "検索中・・・"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ja']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Georgian (Kartuli) translation.
*
* Author: Dimitri Kurashvili dimakura@gmail.com
*/
(function ($) {
"use strict";
$.fn.select2.locales['ka'] = {
formatNoMatches: function () { return "ვერ მოიძებნა"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; },
formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; },
formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; },
formatSearching: function () { return "ძებნა…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ka']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Korean translation.
*
* @author Swen Mun <longfinfunnel@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['ko'] = {
formatNoMatches: function () { return "결과 없음"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "너무 짧습니다. "+n+"글자 더 입력해주세요."; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "너무 깁니다. "+n+"글자 지워주세요."; },
formatSelectionTooBig: function (limit) { return "최대 "+limit+"개까지만 선택하실 수 있습니다."; },
formatLoadMore: function (pageNumber) { return "불러오는 중…"; },
formatSearching: function () { return "검색 중…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ko']);
})(jQuery);

View File

@ -1,26 +0,0 @@
/**
* Select2 Lithuanian translation.
*
* @author CRONUS Karmalakas <cronus dot karmalakas at gmail dot com>
* @author Uriy Efremochkin <efremochkin@uriy.me>
*/
(function ($) {
"use strict";
$.fn.select2.locales['lt'] = {
formatNoMatches: function () { return "Atitikmenų nerasta"; },
formatInputTooShort: function (input, min) { return "Įrašykite dar" + character(min - input.length); },
formatInputTooLong: function (input, max) { return "Pašalinkite" + character(input.length - max); },
formatSelectionTooBig: function (limit) {
return "Jūs galite pasirinkti tik " + limit + " element" + ((limit%100 > 9 && limit%100 < 21) || limit%10 == 0 ? "ų" : limit%10 > 1 ? "us" : "ą");
},
formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų…"; },
formatSearching: function () { return "Ieškoma…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['lt']);
function character (n) {
return " " + n + " simbol" + ((n%100 > 9 && n%100 < 21) || n%10 == 0 ? "ių" : n%10 > 1 ? "ius" : "į");
}
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Latvian translation.
*
* @author Uriy Efremochkin <efremochkin@uriy.me>
*/
(function ($) {
"use strict";
$.fn.select2.locales['lv'] = {
formatNoMatches: function () { return "Sakritību nav"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : n%10 == 1 ? "u" : "us"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : n%10 == 1 ? "u" : "iem") + " mazāk"; },
formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : limit%10 == 1 ? "u" : "us"); },
formatLoadMore: function (pageNumber) { return "Datu ielāde…"; },
formatSearching: function () { return "Meklēšana…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['lv']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Macedonian translation.
*
* Author: Marko Aleksic <psybaron@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['mk'] = {
formatNoMatches: function () { return "Нема пронајдено совпаѓања"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); },
formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); },
formatLoadMore: function (pageNumber) { return "Вчитување резултати…"; },
formatSearching: function () { return "Пребарување…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['mk']);
})(jQuery);

View File

@ -1,21 +0,0 @@
/**
* Select2 Malay translation.
*
* Author: Kepoweran <kepoweran@gmail.com>
* Author: Salahuddin Hairai <mr.od3n@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['ms'] = {
formatMatches: function (matches) { if (matches === 1) { return "Satu keputusan ditemui, tekan enter untuk memilih."; } return matches + " keputusan ditemui, gunakan kekunci anak panah ke atas dan ke bawah untuk menavigasi."; },
formatNoMatches: function () { return "Tiada padanan yang ditemui"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; },
formatSelectionTooBig: function (limit) { return "Anda hanya boleh memilih " + limit + " pilihan"; },
formatLoadMore: function (pageNumber) { return "Sedang memuatkan keputusan…"; },
formatSearching: function () { return "Mencari…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ms']);
})(jQuery);

View File

@ -1,22 +0,0 @@
/**
* Select2 Norwegian Bokmål translation.
*
* Author: Torgeir Veimo <torgeir.veimo@gmail.com>
* Author: Bjørn Johansen <post@bjornjohansen.no>
*/
(function ($) {
"use strict";
$.fn.select2.locales['nb'] = {
formatMatches: function (matches) { if (matches === 1) { return "Ett resultat er tilgjengelig, trykk enter for å velge det."; } return matches + " resultater er tilgjengelig. Bruk piltastene opp og ned for å navigere."; },
formatNoMatches: function () { return "Ingen treff"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; },
formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; },
formatLoadMore: function (pageNumber) { return "Laster flere resultater …"; },
formatSearching: function () { return "Søker …"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['no']);
})(jQuery);

View File

@ -1,17 +0,0 @@
/**
* Select2 Dutch translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['nl'] = {
formatNoMatches: function () { return "Geen resultaten gevonden"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vul nog " + n + " karakter" + (n == 1? "" : "s") + " in"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Haal " + n + " karakter" + (n == 1? "" : "s") + " weg"; },
formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; },
formatLoadMore: function (pageNumber) { return "Meer resultaten laden…"; },
formatSearching: function () { return "Zoeken…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['nl']);
})(jQuery);

View File

@ -1,54 +0,0 @@
/**
* Select2 Polish translation.
*
* @author Jan Kondratowicz <jan@kondratowicz.pl>
* @author Uriy Efremochkin <efremochkin@uriy.me>
* @author Michał Połtyn <mike@poltyn.com>
* @author Damian Zajkowski <damian.zajkowski@gmail.com>
*/
(function($) {
"use strict";
$.fn.select2.locales['pl'] = {
formatNoMatches: function() {
return "Brak wyników";
},
formatInputTooShort: function(input, min) {
return "Wpisz co najmniej" + character(min - input.length, "znak", "i");
},
formatInputTooLong: function(input, max) {
return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i");
},
formatSelectionTooBig: function(limit) {
return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y");
},
formatLoadMore: function(pageNumber) {
return "Ładowanie wyników…";
},
formatSearching: function() {
return "Szukanie…";
}
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['pl']);
function character(n, word, pluralSuffix) {
//Liczba pojedyncza - brak suffiksu
//jeden znak
//jeden element
var suffix = '';
if (n > 1 && n < 5) {
//Liczaba mnoga ilość od 2 do 4 - własny suffiks
//Dwa znaki, trzy znaki, cztery znaki.
//Dwa elementy, trzy elementy, cztery elementy
suffix = pluralSuffix;
} else if (n == 0 || n >= 5) {
//Ilość 0 suffiks ów
//Liczaba mnoga w ilości 5 i więcej - suffiks ów (nie poprawny dla wszystkich wyrazów, np. 100 wiadomości)
//Zero znaków, Pięć znaków, sześć znaków, siedem znaków, osiem znaków.
//Zero elementów Pięć elementów, sześć elementów, siedem elementów, osiem elementów.
suffix = 'ów';
}
return " " + n + " " + word + suffix;
}
})(jQuery);

View File

@ -1,18 +0,0 @@
/**
* Select2 Brazilian Portuguese translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['pt-BR'] = {
formatNoMatches: function () { return "Nenhum resultado encontrado"; },
formatAjaxError: function () { return "Erro na busca"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite " + (min == 1 ? "" : "mais") + " " + n + " caracter" + (n == 1? "" : "es"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); },
formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "Carregando mais resultados…"; },
formatSearching: function () { return "Buscando…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['pt-BR']);
})(jQuery);

View File

@ -1,17 +0,0 @@
/**
* Select2 Portuguese (Portugal) translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['pt-PT'] = {
formatNoMatches: function () { return "Nenhum resultado encontrado"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " car" + (n == 1 ? "ácter" : "acteres"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " car" + (n == 1 ? "ácter" : "acteres"); },
formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
formatLoadMore: function (pageNumber) { return "A carregar mais resultados…"; },
formatSearching: function () { return "A pesquisar…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['pt-PT']);
})(jQuery);

View File

@ -1,17 +0,0 @@
/**
* Select2 Romanian translation.
*/
(function ($) {
"use strict";
$.fn.select2.locales['ro'] = {
formatNoMatches: function () { return "Nu a fost găsit nimic"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Vă rugăm să introduceți incă " + n + " caracter" + (n == 1 ? "" : "e"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Vă rugăm să introduceți mai puțin de " + n + " caracter" + (n == 1? "" : "e"); },
formatSelectionTooBig: function (limit) { return "Aveți voie să selectați cel mult " + limit + " element" + (limit == 1 ? "" : "e"); },
formatLoadMore: function (pageNumber) { return "Se încarcă…"; },
formatSearching: function () { return "Căutare…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ro']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Serbian translation.
*
* @author Limon Monte <limon.monte@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['rs'] = {
formatNoMatches: function () { return "Ništa nije pronađeno"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Ukucajte bar još " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Obrišite " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); },
formatSelectionTooBig: function (limit) { return "Možete izabrati samo " + limit + " stavk" + (limit % 10 == 1 && limit % 100 != 11 ? "u" : (limit % 10 >= 2 && limit % 10 <= 4 && (limit % 100 < 12 || limit % 100 > 14)? "e" : "i")); },
formatLoadMore: function (pageNumber) { return "Preuzimanje još rezultata…"; },
formatSearching: function () { return "Pretraga…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['rs']);
})(jQuery);

View File

@ -1,23 +0,0 @@
/**
* Select2 Russian translation.
*
* @author Uriy Efremochkin <efremochkin@uriy.me>
*/
(function ($) {
"use strict";
$.fn.select2.locales['ru'] = {
formatNoMatches: function () { return "Совпадений не найдено"; },
formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще хотя бы" + character(min - input.length); },
formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; },
formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); },
formatLoadMore: function (pageNumber) { return "Загрузка данных…"; },
formatSearching: function () { return "Поиск…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ru']);
function character (n) {
return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов");
}
})(jQuery);

View File

@ -1,50 +0,0 @@
/**
* Select2 Slovak translation.
*
* Author: David Vallner <david@vallner.net>
*/
(function ($) {
"use strict";
// use text for the numbers 2 through 4
var smallNumbers = {
2: function(masc) { return (masc ? "dva" : "dve"); },
3: function() { return "tri"; },
4: function() { return "štyri"; }
};
$.fn.select2.locales['sk'] = {
formatNoMatches: function () { return "Nenašli sa žiadne položky"; },
formatInputTooShort: function (input, min) {
var n = min - input.length;
if (n == 1) {
return "Prosím, zadajte ešte jeden znak";
} else if (n <= 4) {
return "Prosím, zadajte ešte ďalšie "+smallNumbers[n](true)+" znaky";
} else {
return "Prosím, zadajte ešte ďalších "+n+" znakov";
}
},
formatInputTooLong: function (input, max) {
var n = input.length - max;
if (n == 1) {
return "Prosím, zadajte o jeden znak menej";
} else if (n >= 2 && n <= 4) {
return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej";
} else {
return "Prosím, zadajte o "+n+" znakov menej";
}
},
formatSelectionTooBig: function (limit) {
if (limit == 1) {
return "Môžete zvoliť len jednu položku";
} else if (limit >= 2 && limit <= 4) {
return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky";
} else {
return "Môžete zvoliť najviac "+limit+" položiek";
}
},
formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky…"; },
formatSearching: function () { return "Vyhľadávanie…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['sk']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Swedish translation.
*
* Author: Jens Rantil <jens.rantil@telavox.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['sv'] = {
formatNoMatches: function () { return "Inga träffar"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; },
formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; },
formatLoadMore: function (pageNumber) { return "Laddar fler resultat…"; },
formatSearching: function () { return "Söker…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['sv']);
})(jQuery);

View File

@ -1,19 +0,0 @@
/**
* Select2 Thai translation.
*
* Author: Atsawin Chaowanakritsanakul <joke@nakhon.net>
*/
(function ($) {
"use strict";
$.fn.select2.locales['th'] = {
formatNoMatches: function () { return "ไม่พบข้อมูล"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; },
formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; },
formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม…"; },
formatSearching: function () { return "กำลังค้นข้อมูล…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['th']);
})(jQuery);

View File

@ -1,20 +0,0 @@
/**
* Select2 Turkish translation.
*
* Author: Salim KAYABAŞI <salim.kayabasi@gmail.com>
*/
(function ($) {
"use strict";
$.fn.select2.locales['tr'] = {
formatMatches: function (matches) { if (matches === 1) { return "Sadece bir sonuç bulundu, seçmek için enter tuşuna basabilirsiniz."; } return matches + " sonuç bulundu, yukarı ve aşağı tuşları ile seçebilirsiniz."; },
formatNoMatches: function () { return "Sonuç bulunamadı"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; },
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; },
formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; },
formatLoadMore: function (pageNumber) { return "Daha fazla…"; },
formatSearching: function () { return "Aranıyor…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['tr']);
})(jQuery);

View File

@ -1,16 +0,0 @@
/**
* Select2 Uyghur translation
*/
(function ($) {
"use strict";
$.fn.select2.locales['ug-CN'] = {
formatNoMatches: function () { return "ماس كېلىدىغان ئۇچۇر تېپىلمىدى"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "يەنە " + n + " ھەرپ كىرگۈزۈڭ";},
formatInputTooLong: function (input, max) { var n = input.length - max; return "" + n + "ھەرپ ئۆچۈرۈڭ";},
formatSelectionTooBig: function (limit) { return "ئەڭ كۆپ بولغاندا" + limit + " تال ئۇچۇر تاللىيالايسىز"; },
formatLoadMore: function (pageNumber) { return "ئۇچۇرلار ئوقۇلىۋاتىدۇ…"; },
formatSearching: function () { return "ئىزدەۋاتىدۇ…"; }
};
$.extend($.fn.select2.defaults, $.fn.select2.locales['ug-CN']);
})(jQuery);

Some files were not shown because too many files have changed in this diff Show More