New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

politico-assets

Package Overview
Dependencies
Maintainers
2
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

politico-assets - npm Package Compare versions

Comparing version 0.0.15 to 0.1.1

453

js/lc.min.js

@@ -1,443 +0,10 @@

/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
(function ( $ ) {
$.fn.autocomplete = function (config) {
// function initautocomplete(config = {}) {
/*
* jQuery accessible and keyboard-enhanced autocomplete list
* @version v1.5.1
* Website: http://a11y.nicolas-hoffmann.net/autocomplet-list/
* License MIT: https://github.com/nico3333fr/jquery-accessible-autocomplete-list-aria/blob/master/LICENSE
*/
// loading combobox ---------------------------------------------------------
// init
var $js_combobox = this,
$body = $('body'),
default_text_help = 'Use tabulation (or down) key to access and browse suggestions after input. Confirm your choice with enter key, or esc key to close suggestions box.',
default_class_for_invisible_text = 'invisible',
suggestion_single = 'There is ',
suggestion_plural = 'There are ',
suggestion_word = 'suggestion',
button_clear_title = 'clear this field',
button_clear_text = 'X',
case_sensitive = config.case_sensitive || 'yes',
min_length = config.min_length || 0,
limit_number_suggestions = config.limit_number_suggestions || 666,
search_option = 'beginning', // or 'containing'
see_more_text = 'See more results…',
tablo_suggestions = [];
if ( $js_combobox.length ) { // if there are at least one :)
// init
$js_combobox.each( function(index_combo) {
var $this = $(this),
$this_id = $this.attr('id'),
$label_this = $( 'label[for="' + $this_id + '"]' ),
index_lisible = index_combo+1,
options = $this.data()
$combobox_prefix_class = typeof options.comboboxPrefixClass !== 'undefined' ? options.comboboxPrefixClass + '-' : '',
$combobox_help_text = typeof options.comboboxHelpText !== 'undefined' ? options.comboboxHelpText : default_text_help,
$list_suggestions = $( '#' + $this.attr('list') ),
$combobox_button_title = typeof options.comboboxButtonTitle !== 'undefined' ? options.comboboxButtonTitle : button_clear_title,
$combobox_button_text = typeof options.comboboxButtonText !== 'undefined' ? options.comboboxButtonText : button_clear_text,
$combobox_case_sensitive = typeof options.comboboxCaseSensitive !== 'undefined' ? options.comboboxCaseSensitive : case_sensitive,
tablo_temp_suggestions = [] ;
// input
$this.attr({
'data-number' : index_lisible,
'autocorrect' : 'off',
'autocapitalize' : 'off',
'spellcheck' : 'off',
'autocomplete' : 'off',
'aria-describedby' : $combobox_prefix_class + 'help-text' + index_lisible,
'aria-autocomplete' : 'list',
'data-lastval' : '',
'aria-owns' : $combobox_prefix_class + 'suggest_' + index_lisible
});
// stock into tables
$list_suggestions.find('option').each( function(index_option, index_element) {
tablo_temp_suggestions.push(index_element.value);
});
if ($combobox_case_sensitive === 'no'){
// order case tablo_temp_suggestions
tablo_suggestions[index_lisible] = tablo_temp_suggestions.sort(function(a,b) {
a = a.toLowerCase();
b = b.toLowerCase();
if ( a == b) {
return 0;
}
if ( a > b) {
return 1;
}
return -1;
});
}
else { tablo_suggestions[index_lisible] = tablo_temp_suggestions.sort(); }
// wrap into a container
$this.wrap('<div class="' + $combobox_prefix_class + 'container js-container" data-combobox-prefix-class="' + $combobox_prefix_class + '"></div>');
var $combobox_container = $this.parent();
// custom datalist/listbox linked to input
$combobox_container.append( '<div id="'+ $combobox_prefix_class + 'suggest_' + index_lisible + '" class="js-suggest ' + $combobox_prefix_class + 'suggestions"><div role="listbox"></div></div>' );
$list_suggestions.remove();
// status zone
$combobox_container.prepend( '<div id="' + $combobox_prefix_class + 'suggestion-text' + index_lisible + '" class="js-suggestion-text ' + $combobox_prefix_class + 'suggestion-text ' + default_class_for_invisible_text + '" aria-live="assertive"></div>' );
// help text
$combobox_container.prepend( '<span id="' + $combobox_prefix_class + 'help-text' + index_lisible + '" class="' + $combobox_prefix_class + 'help-text ' + default_class_for_invisible_text + '">' + $combobox_help_text + '</span>' );
// label id
$label_this.attr('id', 'label-id-' + $this_id);
// button clear
$this.after('<button class="js-clear-button ' + $combobox_prefix_class + 'clear-button" aria-label="' + $combobox_button_title + '" title="' + $combobox_button_title + '" aria-describedby="label-id-' + $this_id + '" type="button">' + $combobox_button_text + '</button>');
});
function do_see_more_option ( ) {
var $output_content = $('#js-codeit');
$output_content.html('You have to code a function or a redirection to display more results ;)');
}
// listeners
// keydown on field
$body.on( 'keyup', '.js-combobox', function( event ) {
var $this = $(this),
options_combo = $this.data(),
$container = $this.parent(),
$form = $container.parents('form'),
options = $container.data(),
$combobox_prefix_class = typeof options.comboboxPrefixClass !== 'undefined' ? options.comboboxPrefixClass : '', // no "-"" because already generated
$suggestions = $container.find('.js-suggest div'),
$suggestion_list = $suggestions.find('.js-suggestion'),
$suggestions_text = $container.find('.js-suggestion-text'),
$combobox_suggestion_single = typeof options_combo.suggestionSingle !== 'undefined' ? options_combo.suggestionSingle : suggestion_single,
$combobox_suggestion_plural = typeof options_combo.suggestionPlural !== 'undefined' ? options_combo.suggestionPlural : suggestion_plural,
$combobox_suggestion_word = typeof options_combo.suggestionWord !== 'undefined' ? options_combo.suggestionWord : suggestion_word,
combobox_min_length = typeof options_combo.comboboxMinLength !== 'undefined' ? Math.abs(options_combo.comboboxMinLength) : min_length,
$combobox_case_sensitive = typeof options_combo.comboboxCaseSensitive !== 'undefined' ? options_combo.comboboxCaseSensitive : case_sensitive,
combobox_limit_number_suggestions = typeof options_combo.comboboxLimitNumberSuggestions !== 'undefined' ? Math.abs(options_combo.comboboxLimitNumberSuggestions) : limit_number_suggestions,
$combobox_search_option = typeof options_combo.comboboxSearchOption !== 'undefined' ? options_combo.comboboxSearchOption : search_option,
$combobox_see_more_text = typeof options_combo.comboboxSeeMoreText !== 'undefined' ? options_combo.comboboxSeeMoreText : see_more_text,
index_table = $this.attr('data-number'),
value_to_search = $this.val(),
text_number_suggestions = '';
if ( event.keyCode === 13 ) {
$form.submit();
}
else {
if ( event.keyCode !== 27 ) { // No Escape
$this.attr( 'data-lastval', value_to_search );
// search for text suggestion in the array tablo_suggestions[index_table]
var size_tablo = tablo_suggestions[index_table].length,
i = 0,
counter = 0;
$suggestions.empty();
if ( value_to_search != '' && value_to_search.length >= combobox_min_length ){
while ( i<size_tablo ) {
if ( counter < combobox_limit_number_suggestions ) {
if (
(
$combobox_search_option === 'containing' &&
( $combobox_case_sensitive==='yes' && (tablo_suggestions[index_table][i].indexOf(value_to_search) >= 0) )
||
( $combobox_case_sensitive==='no' && (tablo_suggestions[index_table][i].toUpperCase().indexOf(value_to_search.toUpperCase()) >= 0) )
)
||
(
$combobox_search_option === 'beginning' &&
( $combobox_case_sensitive==='yes' && tablo_suggestions[index_table][i].substring(0,value_to_search.length) === value_to_search )
||
( $combobox_case_sensitive==='no' && tablo_suggestions[index_table][i].substring(0,value_to_search.length).toUpperCase() === value_to_search.toUpperCase() )
)
) {
$suggestions.append( '<div id="suggestion-' + index_table + '-' + counter + '" class="js-suggestion ' + $combobox_prefix_class + 'suggestion" tabindex="-1" role="option">' + tablo_suggestions[index_table][i] + '</div>' );
counter++;
}
}
i++;
}
if ( counter >= combobox_limit_number_suggestions ) {
$suggestions.append( '<div id="suggestion-' + index_table + '-' + counter + '" class="js-suggestion js-seemore ' + $combobox_prefix_class + 'suggestion" tabindex="-1" role="option">' + $combobox_see_more_text + '</div>' );
counter++;
}
// update number of suggestions
if ( counter > 1 ){
text_number_suggestions = $combobox_suggestion_plural + counter + ' ' + $combobox_suggestion_word + 's.';
}
if ( counter === 1 ){
text_number_suggestions = $combobox_suggestion_single + counter + ' ' + $combobox_suggestion_word + '.';
}
if ( counter === 0 ){
text_number_suggestions = $combobox_suggestion_single + counter + ' ' + $combobox_suggestion_word + '.';
}
if ( counter >= 0 ){
var text_number_suggestions_default = $suggestions_text.text();
if (text_number_suggestions != text_number_suggestions_default) { // @Goestu trick to make it work on all AT
suggestions_to_add=$("<p>").text(text_number_suggestions);
$suggestions_text.attr('aria-live','polite');
$suggestions_text.empty();
$suggestions_text.append(suggestions_to_add);
}
}
}
}
}
})
.on('click', function(event) {
var $target = $(event.target),
$suggestions_text = $('.js-suggestion-text:not(:empty)'), // if a suggestion text is not empty => suggestion opened somewhere
$container = $suggestions_text.parents('.js-container'),
$input_text = $container.find('.js-combobox'),
$suggestions = $container.find('.js-suggest div');
// if click outside => close opened suggestions
if ( !$target.is('.js-suggestion') && !$target.is('.js-combobox') && $suggestions_text.length) {
$input_text.val( $input_text.attr('data-lastval') );
$suggestions.empty();
$suggestions_text.empty();
}
})
// tab + down management for autocomplete (when list of suggestion)
.on( 'keydown', '.js-combobox', function( event ) {
var $this = $(this),
$container = $this.parent(),
$input_text = $container.find('.js-combobox'),
$suggestions = $container.find('.js-suggest div'),
$suggestion_list = $suggestions.find('.js-suggestion'),
$suggestions_text = $container.find('.js-suggestion-text'),
$autorise_tab_options = typeof $this.attr('data-combobox-notab-options') !== 'undefined' ? false : true,
$first_suggestion = $suggestion_list.first();
if ( ( !event.shiftKey && event.keyCode == 9 && $autorise_tab_options ) || event.keyCode == 40 ) { // tab (if authorised) or bottom
// See if there are suggestions, and yes => focus on first one
if ($suggestion_list.length) {
$input_text.val($first_suggestion.html());
$suggestion_list.first().focus();
event.preventDefault();
}
}
if ( event.keyCode == 27 || ($autorise_tab_options === false && event.keyCode == 9 ) ) { // esc or (tab/shift tab + notab option) = close
$input_text.val( $input_text.attr('data-lastval') );
$suggestions.empty();
$suggestions_text.empty();
if ( event.keyCode == 27) { // Esc prevented only, tab can go :)
event.preventDefault();
setTimeout(function(){ $input_text.focus(); }, 300); // timeout to avoid problem in suggestions display
}
}
})
// tab + down management in list of suggestions
.on( 'keydown', '.js-suggestion', function( event ) {
var $this = $(this),
$container = $this.parents('.js-container'),
$input_text = $container.find('.js-combobox'),
$autorise_tab_options = typeof $input_text.attr('data-combobox-notab-options') !== 'undefined' ? false : true,
$suggestions = $container.find('.js-suggest div'),
$suggestions_text = $container.find('.js-suggestion-text'),
$next_suggestion = $this.next(),
$previous_suggestion = $this.prev();
if ( event.keyCode == 27 || ($autorise_tab_options === false && event.keyCode == 9 ) ) { // esc or (tab/shift tab + notab option) = close
if ( event.keyCode == 27) { // Esc prevented only, tab can go :)
$input_text.val( $input_text.attr('data-lastval') );
$suggestions.empty();
$suggestions_text.empty();
setTimeout(function(){ $input_text.focus(); }, 300); // timeout to avoid problem in suggestions display
event.preventDefault();
}
if ( $autorise_tab_options === false && event.keyCode == 9 ) {
$suggestions.empty();
$suggestions_text.empty();
$input_text.focus();
}
}
if ( event.keyCode == 13 || event.keyCode == 32 ) { // Enter or space
if ( $this.hasClass('js-seemore') ) {
$input_text.val($input_text.attr('data-lastval'));
$suggestions.empty();
$suggestions_text.empty();
setTimeout(function(){ $input_text.focus(); }, 300); // timeout to avoid problem in suggestions display
// go define the function you need when we click the see_more option
setTimeout(function(){ do_see_more_option(); }, 301); // timeout to avoid problem in suggestions display
event.preventDefault();
}
else {
$input_text.val( $this.html() );
$input_text.attr('data-lastval', $this.html() );
$suggestions.empty();
$suggestions_text.empty();
setTimeout(function(){ $input_text.focus(); }, 300); // timeout to avoid problem in suggestions display
event.preventDefault();
}
}
if ( ( !event.shiftKey && event.keyCode == 9 && $autorise_tab_options ) || event.keyCode == 40 ) { // tab (if authorised) or bottom
if ($next_suggestion.length) {
$input_text.val($next_suggestion.html());
$next_suggestion.focus();
}
else {
$input_text.val( $input_text.attr('data-lastval') );
if ( !event.shiftKey && event.keyCode == 9 ) { // tab closes the list
var e = jQuery.Event("keydown");
e.which = 27; // # Some key code value
e.keyCode = 27;
$this.trigger(e);
}
else { setTimeout(function(){ $input_text.focus(); }, 300); } // timeout to avoid problem in suggestions display
}
event.preventDefault();
}
if ( ( event.shiftKey && event.keyCode == 9 && $autorise_tab_options ) || event.keyCode == 38 ) { // top or Maj+tab (if authorised)
if ($previous_suggestion.length) {
$input_text.val($previous_suggestion.html());
$previous_suggestion.focus();
}
else {
$input_text.val( $input_text.attr('data-lastval') ).focus();
}
event.preventDefault();
}
})
// clear button
.on( 'click', '.js-clear-button', function( event ) {
var $this = $(this),
$container = $this.parent(),
$input_text = $container.find('.js-combobox'),
$suggestions = $container.find('.js-suggest div'),
$suggestions_text = $container.find('.js-suggestion-text');
$suggestions.empty();
$suggestions_text.empty();
$input_text.val('');
$input_text.attr( 'data-lastval', '');
})
.on( 'click', '.js-suggestion', function( event ) {
var $this = $(this),
value = $this.html(),
$container = $this.parents('.js-container'),
$input_text = $container.find('.js-combobox'),
$suggestions = $container.find('.js-suggest div'),
$suggestions_text = $container.find('.js-suggestion-text');
if ( $this.hasClass('js-seemore') ) {
$suggestions.empty();
$suggestions_text.empty();
$input_text.focus();
// go define the function you need when we click the see_more option
do_see_more_option( );
}
else {
$input_text.val(value).focus();
$suggestions.empty();
$suggestions_text.empty();
}
});
}
}
}(jQuery))
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__jquery_autocomplete_js__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__jquery_autocomplete_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__jquery_autocomplete_js__);
/***/ })
/******/ ]);
!function(t){function e(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return t[s].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}([function(t,e,i){var s,a,o;/*!
* Datepicker v@VERSION
* https://github.com/fengyuanchen/datepicker
*
* Copyright (c) 2014-@YEAR Fengyuan Chen
* Released under the MIT license
*
* Date: @DATE
*/
!function(n){a=[i(3)],s=n,void 0!==(o="function"==typeof s?s.apply(e,a):s)&&(t.exports=o)}(function(t){"use strict";function e(t){return D.call(t).slice(8,-1).toLowerCase()}function i(t){return"string"==typeof t}function s(t){return"number"==typeof t&&!isNaN(t)}function a(t){return void 0===t}function o(t){return"date"===e(t)}function n(t,e){var i=[];return Array.from?Array.from(t).slice(e||0):(s(e)&&i.push(e),i.slice.apply(t,i))}function r(t,e){var i=n(arguments,2);return function(){return t.apply(e,i.concat(n(arguments)))}}function h(t){return t%4==0&&t%100!=0||t%400==0}function l(t,e){return[31,h(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}function d(t){var e,i,s=String(t).toLowerCase(),a=s.match(y);if(!a||0===a.length)throw new Error("Invalid date format.");for(t={source:s,parts:a},e=a.length,i=0;i<e;i++)switch(a[i]){case"dd":case"d":t.hasDay=!0;break;case"mm":case"m":t.hasMonth=!0;break;case"yyyy":case"yy":t.hasYear=!0}return t}function c(e,i){i=t.isPlainObject(i)?i:{},i.language&&(i=t.extend({},c.LANGUAGES[i.language],i)),this.$element=t(e),this.options=t.extend({},c.DEFAULTS,i),this.isBuilt=!1,this.isShown=!1,this.isInput=!1,this.isInline=!1,this.initialValue="",this.initialDate=null,this.startDate=null,this.endDate=null,this.init()}var u=t(window),p=window.document,f=t(p),g=window.Number,m="datepicker",v="click.datepicker",y=/(y|m|d)+/g,b=/^\d{2,4}$/,w=["datepicker-top-left","datepicker-top-right","datepicker-bottom-left","datepicker-bottom-right"].join(" "),k="datepicker-hide",x=Math.min,D=Object.prototype.toString;c.prototype={constructor:c,init:function(){var e=this.options,i=this.$element,s=e.startDate,a=e.endDate,o=e.date;this.$trigger=t(e.trigger),this.isInput=i.is("input")||i.is("textarea"),this.isInline=e.inline&&(e.container||!this.isInput),this.format=d(e.format),this.oldValue=this.initialValue=this.getValue(),o=this.parseDate(o||this.initialValue),s&&(s=this.parseDate(s),o.getTime()<s.getTime()&&(o=new Date(s)),this.startDate=s),a&&(a=this.parseDate(a),s&&a.getTime()<s.getTime()&&(a=new Date(s)),o.getTime()>a.getTime()&&(o=new Date(a)),this.endDate=a),this.date=o,this.viewDate=new Date(o),this.initialDate=new Date(this.date),this.bind(),(e.autoShow||this.isInline)&&this.show(),e.autoPick&&this.pick()},build:function(){var e,i=this.options,s=this.$element;this.isBuilt||(this.isBuilt=!0,this.$picker=e=t(i.template),this.$week=e.find('[data-view="week"]'),this.$yearsPicker=e.find('[data-view="years picker"]'),this.$yearsPrev=e.find('[data-view="years prev"]'),this.$yearsNext=e.find('[data-view="years next"]'),this.$yearsCurrent=e.find('[data-view="years current"]'),this.$years=e.find('[data-view="years"]'),this.$monthsPicker=e.find('[data-view="months picker"]'),this.$yearPrev=e.find('[data-view="year prev"]'),this.$yearNext=e.find('[data-view="year next"]'),this.$yearCurrent=e.find('[data-view="year current"]'),this.$months=e.find('[data-view="months"]'),this.$daysPicker=e.find('[data-view="days picker"]'),this.$monthPrev=e.find('[data-view="month prev"]'),this.$monthNext=e.find('[data-view="month next"]'),this.$monthCurrent=e.find('[data-view="month current"]'),this.$days=e.find('[data-view="days"]'),this.isInline?t(i.container||s).append(e.addClass("datepicker-inline")):(t(p.body).append(e.addClass("datepicker-dropdown")),e.addClass(k)),this.fillWeek())},unbuild:function(){this.isBuilt&&(this.isBuilt=!1,this.$picker.remove())},bind:function(){var e=this.options,i=this.$element;t.isFunction(e.show)&&i.on("show.datepicker",e.show),t.isFunction(e.hide)&&i.on("hide.datepicker",e.hide),t.isFunction(e.pick)&&i.on("pick.datepicker",e.pick),this.isInput&&i.on("keyup.datepicker",t.proxy(this.keyup,this)),this.isInline||(e.trigger?this.$trigger.on(v,t.proxy(this.toggle,this)):this.isInput?i.on("focus.datepicker",t.proxy(this.show,this)):i.on(v,t.proxy(this.show,this)))},unbind:function(){var e=this.options,i=this.$element;t.isFunction(e.show)&&i.off("show.datepicker",e.show),t.isFunction(e.hide)&&i.off("hide.datepicker",e.hide),t.isFunction(e.pick)&&i.off("pick.datepicker",e.pick),this.isInput&&i.off("keyup.datepicker",this.keyup),this.isInline||(e.trigger?this.$trigger.off(v,this.toggle):this.isInput?i.off("focus.datepicker",this.show):i.off(v,this.show))},showView:function(t){var e=this.$yearsPicker,i=this.$monthsPicker,s=this.$daysPicker,a=this.format;if(a.hasYear||a.hasMonth||a.hasDay)switch(g(t)){case 2:case"years":i.addClass(k),s.addClass(k),a.hasYear?(this.fillYears(),e.removeClass(k),this.place()):this.showView(0);break;case 1:case"months":e.addClass(k),s.addClass(k),a.hasMonth?(this.fillMonths(),i.removeClass(k),this.place()):this.showView(2);break;default:e.addClass(k),i.addClass(k),a.hasDay?(this.fillDays(),s.removeClass(k),this.place()):this.showView(1)}},hideView:function(){!this.isInline&&this.options.autoHide&&this.hide()},place:function(){if(!this.isInline){var t=this.options,e=this.$element,i=this.$picker,s=f.outerWidth(),a=f.outerHeight(),o=e.outerWidth(),n=e.outerHeight(),r=i.width(),h=i.height(),l=e.offset(),d=l.left,c=l.top,u=parseFloat(t.offset)||10,p="datepicker-top-left";c>h&&c+n+h>a?(c-=h+u,p="datepicker-bottom-left"):c+=n+u,d+r>s&&(d=d+o-r,p=p.replace("left","right")),i.removeClass(w).addClass(p).css({top:c,left:d,zIndex:parseInt(t.zIndex,10)})}},trigger:function(e,i){var s=t.Event(e,i);return this.$element.trigger(s),s},createItem:function(e){var i=this.options,s=i.itemTag,a={text:"",view:"",muted:!1,picked:!1,disabled:!1,highlighted:!1},o=[];return t.extend(a,e),a.muted&&o.push(i.mutedClass),a.highlighted&&o.push(i.highlightedClass),a.picked&&o.push(i.pickedClass),a.disabled&&o.push(i.disabledClass),"<"+s+' class="'+o.join(" ")+'"'+(a.view?' data-view="'+a.view+'"':"")+">"+a.text+"</"+s+">"},fillAll:function(){this.fillYears(),this.fillMonths(),this.fillDays()},fillWeek:function(){var e,i=this.options,s=parseInt(i.weekStart,10)%7,a=i.daysMin,o="";for(a=t.merge(a.slice(s),a.slice(0,s)),e=0;e<=6;e++)o+=this.createItem({text:a[e]});this.$week.html(o)},fillYears:function(){var e,i=this.options,s=i.disabledClass||"",a=i.yearSuffix||"",o=t.isFunction(i.filter)&&i.filter,n=this.startDate,r=this.endDate,h=this.viewDate,l=h.getFullYear(),d=h.getMonth(),c=h.getDate(),u=this.date,p=u.getFullYear(),f=!1,g=!1,m=!1,v=!1,y=!1,b="";for(e=-5;e<=6;e++)u=new Date(l+e,d,c),y=e===-5||6===e,v=l+e===p,m=!1,n&&(m=u.getFullYear()<n.getFullYear(),e===-5&&(f=m)),!m&&r&&(m=u.getFullYear()>r.getFullYear(),6===e&&(g=m)),!m&&o&&(m=o.call(this.$element,u)===!1),b+=this.createItem({text:l+e,view:m?"year disabled":v?"year picked":"year",muted:y,picked:v,disabled:m});this.$yearsPrev.toggleClass(s,f),this.$yearsNext.toggleClass(s,g),this.$yearsCurrent.toggleClass(s,!0).html(l+-5+a+" - "+(l+6)+a),this.$years.html(b)},fillMonths:function(){var e,i=this.options,s=i.disabledClass||"",a=i.monthsShort,o=t.isFunction(i.filter)&&i.filter,n=this.startDate,r=this.endDate,h=this.viewDate,l=h.getFullYear(),d=h.getDate(),c=this.date,u=c.getFullYear(),p=c.getMonth(),f=!1,g=!1,m=!1,v=!1,y="";for(e=0;e<=11;e++)c=new Date(l,e,d),v=l===u&&e===p,m=!1,n&&(f=c.getFullYear()===n.getFullYear(),m=f&&c.getMonth()<n.getMonth()),!m&&r&&(g=c.getFullYear()===r.getFullYear(),m=g&&c.getMonth()>r.getMonth()),!m&&o&&(m=o.call(this.$element,c)===!1),y+=this.createItem({index:e,text:a[e],view:m?"month disabled":v?"month picked":"month",picked:v,disabled:m});this.$yearPrev.toggleClass(s,f),this.$yearNext.toggleClass(s,g),this.$yearCurrent.toggleClass(s,f&&g).html(l+i.yearSuffix||""),this.$months.html(y)},fillDays:function(){var e,i,s,a=this.options,o=a.disabledClass||"",n=a.yearSuffix||"",r=a.monthsShort,h=parseInt(a.weekStart,10)%7,d=t.isFunction(a.filter)&&a.filter,c=this.startDate,u=this.endDate,p=this.viewDate,f=p.getFullYear(),g=p.getMonth(),m=f,v=g,y=f,b=new Date,w=b.getFullYear(),k=b.getMonth(),x=b.getDate(),D=g,$=this.date,C=$.getFullYear(),_=$.getMonth(),S=$.getDate(),j=!1,T=!1,M=!1,F=!1,I=[],V=[],P=[];for(0===g?(m-=1,v=11):v-=1,e=l(m,v),$=new Date(f,g,1),s=$.getDay()-h,s<=0&&(s+=7),c&&(j=$.getTime()<=c.getTime()),i=e-(s-1);i<=e;i++)$=new Date(m,v,i),M=!1,c&&(M=$.getTime()<c.getTime()),!M&&d&&(M=d.call(this.$element,$)===!1),I.push(this.createItem({text:i,view:"day prev",muted:!0,disabled:M,highlighted:m===w&&v===k&&$.getDate()===x}));for(11===g?(y+=1,D=0):D+=1,e=l(f,g),s=42-(I.length+e),$=new Date(f,g,e),u&&(T=$.getTime()>=u.getTime()),i=1;i<=s;i++)$=new Date(y,D,i),M=!1,u&&(M=$.getTime()>u.getTime()),!M&&d&&(M=d.call(this.$element,$)===!1),V.push(this.createItem({text:i,view:"day next",muted:!0,disabled:M,highlighted:y===w&&D===k&&$.getDate()===x}));for(i=1;i<=e;i++)$=new Date(f,g,i),F=f===C&&g===_&&i===S,M=!1,c&&(M=$.getTime()<c.getTime()),!M&&u&&(M=$.getTime()>u.getTime()),!M&&d&&(M=d.call(this.$element,$)===!1),P.push(this.createItem({text:i,view:M?"day disabled":F?"day picked":"day",picked:F,disabled:M,highlighted:f===w&&g===k&&$.getDate()===x}));this.$monthPrev.toggleClass(o,j),this.$monthNext.toggleClass(o,T),this.$monthCurrent.toggleClass(o,j&&T).html(a.yearFirst?f+n+" "+r[g]:r[g]+" "+f+n),this.$days.html(I.join("")+P.join(" ")+V.join(""))},click:function(e){var i,s,a,o,n,r,h=t(e.target),l=this.viewDate;if(e.stopPropagation(),e.preventDefault(),!h.hasClass("disabled"))switch(i=l.getFullYear(),s=l.getMonth(),a=l.getDate(),r=h.data("view")){case"years prev":case"years next":i="years prev"===r?i-10:i+10,n=h.text(),o=b.test(n),o&&(i=parseInt(n,10),this.date=new Date(i,s,x(a,28))),this.viewDate=new Date(i,s,x(a,28)),this.fillYears(),o&&(this.showView(1),this.pick("year"));break;case"year prev":case"year next":i="year prev"===r?i-1:i+1,this.viewDate=new Date(i,s,x(a,28)),this.fillMonths();break;case"year current":this.format.hasYear&&this.showView(2);break;case"year picked":this.format.hasMonth?this.showView(1):this.hideView(),this.pick("year");break;case"year":i=parseInt(h.text(),10),this.date=new Date(i,s,x(a,28)),this.viewDate=new Date(i,s,x(a,28)),this.format.hasMonth?this.showView(1):this.hideView(),this.pick("year");break;case"month prev":case"month next":s="month prev"===r?s-1:"month next"===r?s+1:s,this.viewDate=new Date(i,s,x(a,28)),this.fillDays();break;case"month current":this.format.hasMonth&&this.showView(1);break;case"month picked":this.format.hasDay?this.showView(0):this.hideView(),this.pick("month");break;case"month":s=t.inArray(h.text(),this.options.monthsShort),this.date=new Date(i,s,x(a,28)),this.viewDate=new Date(i,s,x(a,28)),this.format.hasDay?this.showView(0):this.hideView(),this.pick("month");break;case"day prev":case"day next":case"day":s="day prev"===r?s-1:"day next"===r?s+1:s,a=parseInt(h.text(),10),this.date=new Date(i,s,a),this.viewDate=new Date(i,s,a),this.fillDays(),"day"===r&&this.hideView(),this.pick("day");break;case"day picked":this.hideView(),this.pick("day")}},clickDoc:function(t){for(var e,i=t.target,s=this.$element[0],a=this.$trigger[0];i!==p;){if(i===a||i===s){e=!0;break}i=i.parentNode}e||this.hide()},keyup:function(){this.update()},keyupDoc:function(t){this.isInput&&t.target!==this.$element[0]&&this.isShown&&("Tab"===t.key||9===t.keyCode)&&this.hide()},getValue:function(){var t=this.$element,e="";return this.isInput?e=t.val():this.isInline?this.options.container&&(e=t.text()):e=t.text(),e},setValue:function(t){var e=this.$element;t=i(t)?t:"",this.isInput?e.val(t):this.isInline?this.options.container&&e.text(t):e.text(t)},show:function(){this.isBuilt||this.build(),this.isShown||this.trigger("show.datepicker").isDefaultPrevented()||(this.isShown=!0,this.$picker.removeClass(k).on(v,t.proxy(this.click,this)),this.showView(this.options.startView),this.isInline||(u.on("resize.datepicker",this._place=r(this.place,this)),f.on(v,this._clickDoc=r(this.clickDoc,this)),f.on("keyup.datepicker",this._keyupDoc=r(this.keyupDoc,this)),this.place()))},hide:function(){this.isShown&&(this.trigger("hide.datepicker").isDefaultPrevented()||(this.isShown=!1,this.$picker.addClass(k).off(v,this.click),this.isInline||(u.off("resize.datepicker",this._place),f.off(v,this._clickDoc),f.off("keyup.datepicker",this._keyupDoc))))},toggle:function(){this.isShown?this.hide():this.show()},update:function(){var t=this.getValue();t!==this.oldValue&&(this.setDate(t,!0),this.oldValue=t)},pick:function(t){var e=this.$element,i=this.date;this.trigger("pick.datepicker",{view:t||"",date:i}).isDefaultPrevented()||(this.setValue(i=this.formatDate(this.date)),this.isInput&&e.trigger("change"))},reset:function(){this.setDate(this.initialDate,!0),this.setValue(this.initialValue),this.isShown&&this.showView(this.options.startView)},getMonthName:function(e,i){var o=this.options,n=o.months;return t.isNumeric(e)?e=g(e):a(i)&&(i=e),i===!0&&(n=o.monthsShort),n[s(e)?e:this.date.getMonth()]},getDayName:function(e,i,o){var n=this.options,r=n.days;return t.isNumeric(e)?e=g(e):(a(o)&&(o=i),a(i)&&(i=e)),r=o===!0?n.daysMin:i===!0?n.daysShort:r,r[s(e)?e:this.date.getDay()]},getDate:function(t){var e=this.date;return t?this.formatDate(e):new Date(e)},setDate:function(e,s){var a=this.options.filter;if(o(e)||i(e)){if(e=this.parseDate(e),t.isFunction(a)&&a.call(this.$element,e)===!1)return;this.date=e,this.viewDate=new Date(e),s||this.pick(),this.isBuilt&&this.fillAll()}},setStartDate:function(t){(o(t)||i(t))&&(this.startDate=this.parseDate(t),this.isBuilt&&this.fillAll())},setEndDate:function(t){(o(t)||i(t))&&(this.endDate=this.parseDate(t),this.isBuilt&&this.fillAll())},parseDate:function(t){var e,s,a,n,r,h,l=this.format,d=[];if(o(t))return new Date(t.getFullYear(),t.getMonth(),t.getDate());if(i(t)&&(d=t.match(/\d+/g)||[]),t=new Date,s=t.getFullYear(),a=t.getDate(),n=t.getMonth(),e=l.parts.length,d.length===e)for(h=0;h<e;h++)switch(r=parseInt(d[h],10)||1,l.parts[h]){case"dd":case"d":a=r;break;case"mm":case"m":n=r-1;break;case"yy":s=2e3+r;break;case"yyyy":s=r}return new Date(s,n,a)},formatDate:function(t){var e,i,s,a,n,r=this.format,h="";if(o(t))for(h=r.source,i=t.getFullYear(),a={d:t.getDate(),m:t.getMonth()+1,yy:i.toString().substring(2),yyyy:i},a.dd=(a.d<10?"0":"")+a.d,a.mm=(a.m<10?"0":"")+a.m,e=r.parts.length,n=0;n<e;n++)s=r.parts[n],h=h.replace(s,a[s]);return h},destroy:function(){this.unbind(),this.unbuild(),this.$element.removeData(m)}},c.LANGUAGES={},c.DEFAULTS={autoShow:!1,autoHide:!1,autoPick:!1,inline:!1,container:null,trigger:null,language:"",format:"mm/dd/yyyy",date:null,startDate:null,endDate:null,startView:0,weekStart:0,yearFirst:!1,yearSuffix:"",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],itemTag:"li",mutedClass:"muted",pickedClass:"picked",disabledClass:"disabled",highlightedClass:"highlighted",template:'<div class="datepicker-container"><div class="datepicker-panel" data-view="years picker"><ul><li data-view="years prev">&lsaquo;</li><li data-view="years current"></li><li data-view="years next">&rsaquo;</li></ul><ul data-view="years"></ul></div><div class="datepicker-panel" data-view="months picker"><ul><li data-view="year prev">&lsaquo;</li><li data-view="year current"></li><li data-view="year next">&rsaquo;</li></ul><ul data-view="months"></ul></div><div class="datepicker-panel" data-view="days picker"><ul><li data-view="month prev">&lsaquo;</li><li data-view="month current"></li><li data-view="month next">&rsaquo;</li></ul><ul data-view="week"></ul><ul data-view="days"></ul></div></div>',offset:10,zIndex:1e3,filter:null,show:null,hide:null,pick:null},c.setDefaults=function(e){e=t.isPlainObject(e)?e:{},e.language&&(e=t.extend({},c.LANGUAGES[e.language],e)),t.extend(c.DEFAULTS,e)},c.other=t.fn.datepicker,t.fn.datepicker=function(e){var s,o=n(arguments,1);return this.each(function(){var a,n,r=t(this),h=r.data(m);if(!h){if(/destroy/.test(e))return;a=t.extend({},r.data(),t.isPlainObject(e)&&e),r.data(m,h=new c(this,a))}i(e)&&t.isFunction(n=h[e])&&(s=n.apply(h,o))}),a(s)?this:s},t.fn.datepicker.Constructor=c,t.fn.datepicker.languages=c.LANGUAGES,t.fn.datepicker.setDefaults=c.setDefaults,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=c.other,this}})},function(t,e){!function(t){t.fn.autocomplete=function(e){function i(){t("#js-codeit").html("You have to code a function or a redirection to display more results ;)")}var s=this,a=t("body"),o=e.case_sensitive||"yes",n=e.min_length||0,r=e.limit_number_suggestions||666,h=[];s.length&&(s.each(function(e){var i=t(this),s=i.attr("id"),a=t('label[for="'+s+'"]'),n=e+1,r=i.data();$combobox_prefix_class=void 0!==r.comboboxPrefixClass?r.comboboxPrefixClass+"-":"",$combobox_help_text=void 0!==r.comboboxHelpText?r.comboboxHelpText:"Use tabulation (or down) key to access and browse suggestions after input. Confirm your choice with enter key, or esc key to close suggestions box.",$list_suggestions=t("#"+i.attr("list")),$combobox_button_title=void 0!==r.comboboxButtonTitle?r.comboboxButtonTitle:"clear this field",$combobox_button_text=void 0!==r.comboboxButtonText?r.comboboxButtonText:"X",$combobox_case_sensitive=void 0!==r.comboboxCaseSensitive?r.comboboxCaseSensitive:o,tablo_temp_suggestions=[],i.attr({"data-number":n,autocorrect:"off",autocapitalize:"off",spellcheck:"off",autocomplete:"off","aria-describedby":$combobox_prefix_class+"help-text"+n,"aria-autocomplete":"list","data-lastval":"","aria-owns":$combobox_prefix_class+"suggest_"+n}),$list_suggestions.find("option").each(function(t,e){tablo_temp_suggestions.push(e.value)}),"no"===$combobox_case_sensitive?h[n]=tablo_temp_suggestions.sort(function(t,e){return t=t.toLowerCase(),e=e.toLowerCase(),t==e?0:t>e?1:-1}):h[n]=tablo_temp_suggestions.sort(),i.wrap('<div class="'+$combobox_prefix_class+'container js-container" data-combobox-prefix-class="'+$combobox_prefix_class+'"></div>');var l=i.parent();l.append('<div id="'+$combobox_prefix_class+"suggest_"+n+'" class="js-suggest '+$combobox_prefix_class+'suggestions"><div role="listbox"></div></div>'),$list_suggestions.remove(),l.prepend('<div id="'+$combobox_prefix_class+"suggestion-text"+n+'" class="js-suggestion-text '+$combobox_prefix_class+'suggestion-text invisible" aria-live="assertive"></div>'),l.prepend('<span id="'+$combobox_prefix_class+"help-text"+n+'" class="'+$combobox_prefix_class+'help-text invisible">'+$combobox_help_text+"</span>"),a.attr("id","label-id-"+s),i.after('<button class="js-clear-button '+$combobox_prefix_class+'clear-button" aria-label="'+$combobox_button_title+'" title="'+$combobox_button_title+'" aria-describedby="label-id-'+s+'" type="button">'+$combobox_button_text+"</button>")}),a.on("keyup",".js-combobox",function(e){var i=t(this),s=i.data(),a=i.parent(),l=a.parents("form"),d=a.data(),c=void 0!==d.comboboxPrefixClass?d.comboboxPrefixClass:"",u=a.find(".js-suggest div"),p=(u.find(".js-suggestion"),a.find(".js-suggestion-text")),f=void 0!==s.suggestionSingle?s.suggestionSingle:"There is ",g=void 0!==s.suggestionPlural?s.suggestionPlural:"There are ",m=void 0!==s.suggestionWord?s.suggestionWord:"suggestion",v=void 0!==s.comboboxMinLength?Math.abs(s.comboboxMinLength):n,y=void 0!==s.comboboxCaseSensitive?s.comboboxCaseSensitive:o,b=void 0!==s.comboboxLimitNumberSuggestions?Math.abs(s.comboboxLimitNumberSuggestions):r,w=void 0!==s.comboboxSearchOption?s.comboboxSearchOption:"beginning",k=void 0!==s.comboboxSeeMoreText?s.comboboxSeeMoreText:"See more results…",x=i.attr("data-number"),D=i.val(),$="";if(13===e.keyCode)l.submit();else if(27!==e.keyCode){i.attr("data-lastval",D);var C=h[x].length,_=0,S=0;if(u.empty(),""!=D&&D.length>=v){for(;_<C;)S<b&&("containing"===w&&"yes"===y&&h[x][_].indexOf(D)>=0||"no"===y&&h[x][_].toUpperCase().indexOf(D.toUpperCase())>=0||"beginning"===w&&"yes"===y&&h[x][_].substring(0,D.length)===D||"no"===y&&h[x][_].substring(0,D.length).toUpperCase()===D.toUpperCase())&&(u.append('<div id="suggestion-'+x+"-"+S+'" class="js-suggestion '+c+'suggestion" tabindex="-1" role="option">'+h[x][_]+"</div>"),S++),_++;if(S>=b&&(u.append('<div id="suggestion-'+x+"-"+S+'" class="js-suggestion js-seemore '+c+'suggestion" tabindex="-1" role="option">'+k+"</div>"),S++),S>1&&($=g+S+" "+m+"s."),1===S&&($=f+S+" "+m+"."),0===S&&($=f+S+" "+m+"."),S>=0){var j=p.text();$!=j&&(suggestions_to_add=t("<p>").text($),p.attr("aria-live","polite"),p.empty(),p.append(suggestions_to_add))}}}}).on("click",function(e){var i=t(e.target),s=t(".js-suggestion-text:not(:empty)"),a=s.parents(".js-container"),o=a.find(".js-combobox"),n=a.find(".js-suggest div");i.is(".js-suggestion")||i.is(".js-combobox")||!s.length||(o.val(o.attr("data-lastval")),n.empty(),s.empty())}).on("keydown",".js-combobox",function(e){var i=t(this),s=i.parent(),a=s.find(".js-combobox"),o=s.find(".js-suggest div"),n=o.find(".js-suggestion"),r=s.find(".js-suggestion-text"),h=void 0===i.attr("data-combobox-notab-options"),l=n.first();(!e.shiftKey&&9==e.keyCode&&h||40==e.keyCode)&&n.length&&(a.val(l.html()),n.first().focus(),e.preventDefault()),(27==e.keyCode||h===!1&&9==e.keyCode)&&(a.val(a.attr("data-lastval")),o.empty(),r.empty(),27==e.keyCode&&(e.preventDefault(),setTimeout(function(){a.focus()},300)))}).on("keydown",".js-suggestion",function(e){var s=t(this),a=s.parents(".js-container"),o=a.find(".js-combobox"),n=void 0===o.attr("data-combobox-notab-options"),r=a.find(".js-suggest div"),h=a.find(".js-suggestion-text"),l=s.next(),d=s.prev();if((27==e.keyCode||n===!1&&9==e.keyCode)&&(27==e.keyCode&&(o.val(o.attr("data-lastval")),r.empty(),h.empty(),setTimeout(function(){o.focus()},300),e.preventDefault()),n===!1&&9==e.keyCode&&(r.empty(),h.empty(),o.focus())),13!=e.keyCode&&32!=e.keyCode||(s.hasClass("js-seemore")?(o.val(o.attr("data-lastval")),r.empty(),h.empty(),setTimeout(function(){o.focus()},300),setTimeout(function(){i()},301),e.preventDefault()):(o.val(s.html()),o.attr("data-lastval",s.html()),r.empty(),h.empty(),setTimeout(function(){o.focus()},300),e.preventDefault())),!e.shiftKey&&9==e.keyCode&&n||40==e.keyCode){if(l.length)o.val(l.html()),l.focus();else if(o.val(o.attr("data-lastval")),e.shiftKey||9!=e.keyCode)setTimeout(function(){o.focus()},300);else{var c=jQuery.Event("keydown");c.which=27,c.keyCode=27,s.trigger(c)}e.preventDefault()}(e.shiftKey&&9==e.keyCode&&n||38==e.keyCode)&&(d.length?(o.val(d.html()),d.focus()):o.val(o.attr("data-lastval")).focus(),e.preventDefault())}).on("click",".js-clear-button",function(e){var i=t(this),s=i.parent(),a=s.find(".js-combobox"),o=s.find(".js-suggest div"),n=s.find(".js-suggestion-text");o.empty(),n.empty(),a.val(""),a.attr("data-lastval","")}).on("click",".js-suggestion",function(e){var s=t(this),a=s.html(),o=s.parents(".js-container"),n=o.find(".js-combobox"),r=o.find(".js-suggest div"),h=o.find(".js-suggestion-text");s.hasClass("js-seemore")?(r.empty(),h.empty(),n.focus(),i()):(n.val(a).focus(),r.empty(),h.empty())}))}}(jQuery)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),a=(i.n(s),i(1));i.n(a)},function(t,e){t.exports=jQuery}]);

2

package.json
{
"name": "politico-assets",
"version": "0.0.15",
"version": "0.1.1",
"description": "Built CSS and JS files used by politico.com",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc