This commit is contained in:
2024-12-20 06:04:35 +03:00
parent 0f779b7ebf
commit d630370039
267 changed files with 34950 additions and 11 deletions
+29 -4
View File
@@ -668,7 +668,10 @@ kit.config = kit.config || {};
}; };
var __proto = PluginManager.prototype; var __proto = PluginManager.prototype;
/** /**
* @typedef PluginManager.registerPlugins
*
* @param plugins * @param plugins
* @return {PluginManager} * @return {PluginManager}
*/ */
@@ -681,6 +684,11 @@ kit.config = kit.config || {};
return this; return this;
}; };
/**
* @typedef PluginManager.register
* @param pluginId
* @param config
*/
PluginManager.prototype.register = function (pluginId, config = {}) { PluginManager.prototype.register = function (pluginId, config = {}) {
if(typeof pluginId !== 'string' || pluginId === ''){ if(typeof pluginId !== 'string' || pluginId === ''){
console.warn(`Invalid pluginId!`, pluginId); console.warn(`Invalid pluginId!`, pluginId);
@@ -804,7 +812,13 @@ kit.config = kit.config || {};
} }
}; };
__proto.exec2 = function (deps, callback) { /**
* @typedef PluginManager.define
* @see https://requirejs.org/
* @param deps
* @param callback
*/
__proto.define = function (deps, callback) {
var self = this; var self = this;
var context = this; var context = this;
@@ -962,15 +976,26 @@ kit.config = kit.config || {};
* @memberOf kit * @memberOf kit
*/ */
global.require = manager.require.bind(manager); global.require = manager.require.bind(manager);
/**
* @type {PluginManager}
* @memberOf kit
*/
var pm;
/**
* @type {PluginManager.define}
* @memberOf kit
*/
global.define = manager.define.bind(manager);
global.PluginManager = PluginManager;
manager.register('pluginManager', { manager.register('pluginManager', {
alias: 'pm', alias: ['pm'],
type: MD_TYPE.HMD, type: MD_TYPE.HMD,
handler: function(require, exports, module, global) { handler: function(require, exports, module, global) {
global.PluginManagerClass = PluginManager;
if(typeof window === 'object'){ if(typeof window === 'object'){
window.__PluginManager__ = manager; window.__PluginManager__ = manager;
/** /**
* @var __pmGlobal__ * @type {kit}
* @global
*/ */
window.__pmGlobal__ = global; window.__pmGlobal__ = global;
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+147 -5
View File
@@ -331,10 +331,39 @@ var __PluginManagerConfigHandler__ = function() {
type: 'HMD', type: 'HMD',
deps: ['support', 'Collection', 'lib'] deps: ['support', 'Collection', 'lib']
}, },
fancybox: { fancybox2: {
path: root + '/fancybox', path: root + '/fancybox/v2',
css: '/fancybox.css', module: '',
js: '/fancybox.umd.js', js: ['/jquery.fancybox.pack.js'],
css: ['/jquery.fancybox.css'],
type: 'default',
alias: ['jQuery.Fancybox2'],
deps: ['jQuery'],
},
fancybox3: {
path: root + '/fancybox/v3',
module: '',
js: ['/jquery.fancybox.min.js'],
css: ['/jquery.fancybox.min.css'],
type: 'default',
alias: ['jQuery.Fancybox3'],
deps: ['jQuery'],
},
fancybox4: {
path: root + '/fancybox/v4',
module: '/fancybox.umd.js',
js: [],
css: ['/fancybox.css'],
type: 'UMD',
alias: [],
},
fancybox5: {
path: root + '/fancybox/v5',
module: '/fancybox.umd.js',
js: [],
css: ['/fancybox.css'],
type: 'UMD',
alias: ['fancybox'],
}, },
lightGallery: { lightGallery: {
path: root + '/lightGallery', path: root + '/lightGallery',
@@ -459,7 +488,120 @@ var __PluginManagerConfigHandler__ = function() {
css: [ css: [
'/flexslider.css', '/flexslider.css',
], ],
alias: ['FlexSlider', 'flexslider'], alias: ['jquery.flexslider', 'FlexSlider', 'flexslider'],
type: 'default',
deps: ['jQuery'],
},
/**
* Получите фактическую ширину / высоту невидимых элементов DOM с помощью jQuery.
* @see https://github.com/dreamerslab/jquery.actual
*/
'jQuery.Actual': {
path: root + '/jquery/actual',
module: '',
js: [
'/jquery.actual.js',
],
css: [],
alias: ['jquery.actual'],
type: 'default',
deps: ['jQuery'],
},
'jQuery.jqModal': {
path: root + '/jquery/jqModal',
module: '/jqModal.js',
js: [],
css: [],
alias: ['jqmodal', 'jqModal'],
type: 'UMD',
deps: ['jQuery'],
},
'jQuery.History': {
path: root + '/jquery/history',
module: '',
js: ['/jquery.history.min.js'],
css: [],
alias: ['jquery.history'],
type: 'default',
deps: ['jQuery'],
},
'jQuery.Validation': {
path: root + '/jquery/validation',
module: '/jquery.validate.min.js',
js: [
'/localization/messages_ru.js'
],
css: [],
loadJsAfterModule: true,
alias: ['jquery-validation', 'jquery.validation', 'jquery.validate'],
type: 'UMD',
deps: ['jQuery'],
},
'jQuery.Inputmask': {
path: root + '/jquery/inputmask',
module: '/min/jquery.inputmask.bundle.min.js',
js: [],
css: [],
alias: ['jquery.inputmask'],
type: 'default',
deps: ['jQuery'],
},
'jQuery.Easing': {
path: root + '/jquery/easing',
module: '/jquery.easing.min.js',
js: [],
css: [],
alias: ['jquery.easing'],
type: 'default',
deps: ['jQuery'],
},
'jQuery.Sly': {
path: root + '/jquery/sly',
module: '/sly.min.js',
js: [],
css: [],
alias: ['jquery.sly', 'sly'],
type: 'default',
deps: ['jQuery'],
},
/**
* выравнивает высоту элементов с классом equalize в группах или на всей странице
* @see https://github.com/eustasy-archive/jQuery.equalize
* @deprecated
*/
'jQuery.Equalize': {
path: root + '/jquery/equalize.js',
module: '/js/equalize.min.js',
js: [],
css: [],
alias: ['equalize', 'equalize.js', 'jquery.equalize'],
type: 'default',
deps: ['jQuery'],
},
'jQuery.Alphanumeric': {
path: root + '/jquery/alphanumeric',
module: '/jquery.alphanumeric.pack.js',
js: [],
css: [],
alias: ['jquery.alphanumeric'],
type: 'default',
deps: ['jQuery'],
},
'jQuery.Cookie': {
path: root + '/jquery/cookie',
module: '/src/jquery.cookie.js',
js: [],
css: [],
alias: ['jquery.cookie'],
type: 'UMD',
deps: ['jQuery'],
},
'jQuery.Plugin': {
path: root + '/jquery/plugin',
module: '/jquery.plugin.min.js',
js: [],
css: [],
alias: ['jquery.plugin', 'kbw-plugin'],
type: 'default', type: 'default',
deps: ['jQuery'], deps: ['jQuery'],
}, },
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

+275
View File
@@ -0,0 +1,275 @@
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
.fancybox-wrap,
.fancybox-skin,
.fancybox-outer,
.fancybox-inner,
.fancybox-image,
.fancybox-wrap iframe,
.fancybox-wrap object,
.fancybox-nav,
.fancybox-nav span,
.fancybox-tmp
{
padding: 0;
margin: 0;
border: 0;
outline: none;
vertical-align: top;
}
.fancybox-wrap {
position: absolute;
top: 0;
left: 0;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
z-index: 8020;
}
.fancybox-skin {
position: relative;
background: #f9f9f9;
color: #444;
text-shadow: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.fancybox-opened {
z-index: 8030;
}
.fancybox-opened .fancybox-skin {
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.fancybox-outer, .fancybox-inner {
position: relative;
}
.fancybox-inner {
overflow: hidden;
}
.fancybox-type-iframe .fancybox-inner {
-webkit-overflow-scrolling: touch;
}
.fancybox-error {
color: #444;
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
margin: 0;
padding: 15px;
white-space: nowrap;
}
.fancybox-image, .fancybox-iframe {
display: block;
width: 100%;
height: 100%;
}
.fancybox-image {
max-width: 100%;
max-height: 100%;
}
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
background-image: url(fancybox_sprite.png);
}
#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
margin-top: -22px;
margin-left: -22px;
background-position: 0 -108px;
opacity: 0.8;
cursor: pointer;
z-index: 8060;
}
#fancybox-loading div {
width: 44px;
height: 44px;
background: url(fancybox_loading.gif) center center no-repeat;
}
.fancybox-close {
position: absolute;
top: -18px;
right: -18px;
width: 36px;
height: 36px;
cursor: pointer;
z-index: 8040;
}
.fancybox-nav {
position: absolute;
top: 0;
width: 40%;
height: 100%;
cursor: pointer;
text-decoration: none;
background: transparent url(blank.gif); /* helps IE */
-webkit-tap-highlight-color: rgba(0,0,0,0);
z-index: 8040;
}
.fancybox-prev {
left: 0;
}
.fancybox-next {
right: 0;
}
.fancybox-nav span {
position: absolute;
top: 50%;
width: 36px;
height: 34px;
margin-top: -18px;
cursor: pointer;
z-index: 8040;
visibility: hidden;
}
.fancybox-prev span {
left: 10px;
background-position: 0 -36px;
}
.fancybox-next span {
right: 10px;
background-position: 0 -72px;
}
.fancybox-nav:hover span {
visibility: visible;
}
.fancybox-tmp {
position: absolute;
top: -99999px;
left: -99999px;
max-width: 99999px;
max-height: 99999px;
overflow: visible !important;
}
/* Overlay helper */
.fancybox-lock {
overflow: visible !important;
width: auto;
}
.fancybox-lock body {
overflow: hidden !important;
}
.fancybox-lock-test {
overflow-y: hidden !important;
}
.fancybox-overlay {
position: absolute;
top: 0;
left: 0;
overflow: hidden;
display: none;
z-index: 8010;
background: url(fancybox_overlay.png);
}
.fancybox-overlay-fixed {
position: fixed;
bottom: 0;
right: 0;
}
.fancybox-lock .fancybox-overlay {
overflow: auto;
overflow-y: scroll;
}
/* Title helper */
.fancybox-title {
visibility: hidden;
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
position: relative;
text-shadow: none;
z-index: 8050;
}
.fancybox-opened .fancybox-title {
visibility: visible;
}
.fancybox-title-float-wrap {
position: absolute;
bottom: 0;
right: 50%;
margin-bottom: -35px;
z-index: 8050;
text-align: center;
}
.fancybox-title-float-wrap .child {
display: inline-block;
margin-right: -100%;
padding: 2px 20px;
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
text-shadow: 0 1px 2px #222;
color: #FFF;
font-weight: bold;
line-height: 24px;
white-space: nowrap;
}
.fancybox-title-outside-wrap {
position: relative;
margin-top: 10px;
color: #fff;
}
.fancybox-title-inside-wrap {
padding-top: 10px;
}
.fancybox-title-over-wrap {
position: absolute;
bottom: 0;
left: 0;
color: #fff;
padding: 10px;
background: #000;
background: rgba(0, 0, 0, .8);
}
/*Retina graphics!*/
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5){
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
background-image: url(fancybox_sprite@2x.png);
background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
}
#fancybox-loading div {
background-image: url(fancybox_loading@2x.gif);
background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,46 @@
/*! fancyBox v2.1.7 fancyapps.com | fancyapps.com/fancybox/#license */
(function(t,J,f,x){var L=f("html"),q=f(t),p=f(J),b=f.fancybox=function(){b.open.apply(this,arguments)},K=navigator.userAgent.match(/msie/i),D=null,u=J.createTouch!==x,v=function(a){return a&&a.hasOwnProperty&&a instanceof f},r=function(a){return a&&"string"===f.type(a)},G=function(a){return r(a)&&0<a.indexOf("%")},m=function(a,c){var d=parseInt(a,10)||0;c&&G(a)&&(d*=b.getViewport()[c]/100);return Math.ceil(d)},y=function(a,b){return m(a,b)+"px"};f.extend(b,{version:"2.1.7",defaults:{padding:15,margin:20,
width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!u,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
(K?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>',loading:'<div id="fancybox-loading"><div></div></div>'},openEffect:"fade",
openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},
previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,c){if(a&&(f.isPlainObject(c)||(c={}),!1!==b.close(!0)))return f.isArray(a)||(a=v(a)?f(a).get():[a]),f.each(a,function(d,e){var k={},g,l,h,n,m;"object"===f.type(e)&&(e.nodeType&&(e=f(e)),v(e)?(k={href:e.data("fancybox-href")||e.attr("href"),title:f("<div/>").text(e.data("fancybox-title")||
e.attr("title")||"").html(),isDom:!0,element:e},f.metadata&&f.extend(!0,k,e.metadata())):k=e);g=c.href||k.href||(r(e)?e:null);l=c.title!==x?c.title:k.title||"";n=(h=c.content||k.content)?"html":c.type||k.type;!n&&k.isDom&&(n=e.data("fancybox-type"),n||(n=(n=e.prop("class").match(/fancybox\.(\w+)/))?n[1]:null));r(g)&&(n||(b.isImage(g)?n="image":b.isSWF(g)?n="swf":"#"===g.charAt(0)?n="inline":r(e)&&(n="html",h=e)),"ajax"===n&&(m=g.split(/\s+/,2),g=m.shift(),m=m.shift()));h||("inline"===n?g?h=f(r(g)?
g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(h=e):"html"===n?h=g:n||g||!k.isDom||(n="inline",h=e));f.extend(k,{href:g,type:n,content:h,title:l,selector:m});a[d]=k}),b.opts=f.extend(!0,{},b.defaults,c),c.keys!==x&&(b.opts.keys=c.keys?f.extend({},b.defaults.keys,c.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1===b.trigger("onCancel")||(b.hideLoading(),a&&(b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&
a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||b._afterZoomOut(a)))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var c=function(){clearTimeout(b.player.timer)},
d=function(){c();b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},e=function(){c();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index<b.group.length-1)&&(b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":e,"onUpdate.player":d,"beforeLoad.player":c}),d(),b.trigger("onPlayStart")):e()},next:function(a){var c=b.current;c&&(r(a)||(a=c.direction.next),b.jumpto(c.index+
1,a,"next"))},prev:function(a){var c=b.current;c&&(r(a)||(a=c.direction.prev),b.jumpto(c.index-1,a,"prev"))},jumpto:function(a,c,d){var e=b.current;e&&(a=m(a),b.direction=c||e.direction[a>=e.index?"next":"prev"],b.router=d||"jumpto",e.loop&&(0>a&&(a=e.group.length+a%e.group.length),a%=e.group.length),e.group[a]!==x&&(b.cancel(),b._start(a)))},reposition:function(a,c){var d=b.current,e=d?d.wrap:null,k;e&&(k=b._getPosition(c),a&&"scroll"===a.type?(delete k.position,e.stop(!0,!0).animate(k,200)):(e.css(k),
d.pos=f.extend({},d.dim,k)))},update:function(a){var c=a&&a.originalEvent&&a.originalEvent.type,d=!c||"orientationchange"===c;d&&(clearTimeout(D),D=null);b.isOpen&&!D&&(D=setTimeout(function(){var e=b.current;e&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(d||"load"===c||"resize"===c&&e.autoResize)&&b._setDimension(),"scroll"===c&&e.canShrink||b.reposition(a),b.trigger("onUpdate"),D=null)},d&&!u?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,
u&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,c;b.hideLoading();a=f(b.opts.tpl.loading).click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())});b.defaults.fixed||(c=b.getViewport(),a.css({position:"absolute",top:.5*c.h+c.y,left:.5*c.w+c.x}));b.trigger("onLoading")},getViewport:function(){var a=
b.current&&b.current.locked||!1,c={x:q.scrollLeft(),y:q.scrollTop()};a&&a.length?(c.w=a[0].clientWidth,c.h=a[0].clientHeight):(c.w=u&&t.innerWidth?t.innerWidth:q.width(),c.h=u&&t.innerHeight?t.innerHeight:q.height());return c},unbindEvents:function(){b.wrap&&v(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,c;a&&(q.bind("orientationchange.fb"+(u?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(c=a.keys)&&p.bind("keydown.fb",
function(d){var e=d.which||d.keyCode,k=d.target||d.srcElement;if(27===e&&b.coming)return!1;d.ctrlKey||d.altKey||d.shiftKey||d.metaKey||k&&(k.type||f(k).is("[contenteditable]"))||f.each(c,function(c,k){if(1<a.group.length&&k[e]!==x)return b[c](k[e]),d.preventDefault(),!1;if(-1<f.inArray(e,k))return b[c](),d.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(c,e,k,g){for(var d=f(c.target||null),h=!1;d.length&&!(h||d.is(".fancybox-skin")||d.is(".fancybox-wrap"));)h=
(h=d[0])&&!(h.style.overflow&&"hidden"===h.style.overflow)&&(h.clientWidth&&h.scrollWidth>h.clientWidth||h.clientHeight&&h.scrollHeight>h.clientHeight),d=f(d).parent();0!==e&&!h&&1<b.group.length&&!a.canShrink&&(0<g||0<k?b.prev(0<g?"down":"left"):(0>g||0>k)&&b.next(0>g?"up":"right"),c.preventDefault())}))},trigger:function(a,c){var d,e=c||b.coming||b.current;if(e){f.isFunction(e[a])&&(d=e[a].apply(e,Array.prototype.slice.call(arguments,1)));if(!1===d)return!1;e.helpers&&f.each(e.helpers,function(c,
d){if(d&&b.helpers[c]&&f.isFunction(b.helpers[c][a]))b.helpers[c][a](f.extend(!0,{},b.helpers[c].defaults,d),e)})}p.trigger(a)},isImage:function(a){return r(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return r(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var c={},d,e;a=m(a);d=b.group[a]||null;if(!d)return!1;c=f.extend(!0,{},b.opts,d);d=c.margin;e=c.padding;"number"===f.type(d)&&(c.margin=[d,d,d,d]);"number"===f.type(e)&&(c.padding=
[e,e,e,e]);c.modal&&f.extend(!0,c,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});c.autoSize&&(c.autoWidth=c.autoHeight=!0);"auto"===c.width&&(c.autoWidth=!0);"auto"===c.height&&(c.autoHeight=!0);c.group=b.group;c.index=a;b.coming=c;if(!1===b.trigger("beforeLoad"))b.coming=null;else{e=c.type;d=c.href;if(!e)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===
e||"swf"===e)c.autoHeight=c.autoWidth=!1,c.scrolling="visible";"image"===e&&(c.aspectRatio=!0);"iframe"===e&&u&&(c.scrolling="scroll");c.wrap=f(c.tpl.wrap).addClass("fancybox-"+(u?"mobile":"desktop")+" fancybox-type-"+e+" fancybox-tmp "+c.wrapCSS).appendTo(c.parent||"body");f.extend(c,{skin:f(".fancybox-skin",c.wrap),outer:f(".fancybox-outer",c.wrap),inner:f(".fancybox-inner",c.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){c.skin.css("padding"+b,y(c.padding[a]))});b.trigger("onReady");
if("inline"===e||"html"===e){if(!c.content||!c.content.length)return b._error("content")}else if(!d)return b._error("href");"image"===e?b._loadImage():"ajax"===e?b._loadAjax():"iframe"===e?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=
this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,d){b.coming&&"abort"!==d?b._error("ajax",a):b.hideLoading()},success:function(c,d){"success"===d&&(a.content=c,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,
c=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",u?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(d){}});a.iframe.preload&&(b.showLoading(),c.one("load",function(){f(this).data("ready",1);u||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=c.appendTo(a.inner);a.iframe.preload||
b._afterLoad()},_preloadImages:function(){var a=b.group,c=b.current,d=a.length,e=c.preload?Math.min(c.preload,d-1):0,f,g;for(g=1;g<=e;g+=1)f=a[(c.index+g)%d],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,c=b.current,d,e,k,g,l;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,c))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{c&&(b.trigger("beforeChange",c),c.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());
b.unbindEvents();d=a.content;e=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:c});g=a.href;switch(e){case "inline":case "ajax":case "html":a.selector?d=f("<div>").html(d).find(a.selector):v(d)&&(d.data("fancybox-placeholder")||d.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(d).hide()),d=d.show().detach(),a.wrap.bind("onReset",function(){f(this).find(d).length&&d.hide().replaceAll(d.data("fancybox-placeholder")).data("fancybox-placeholder",
!1)}));break;case "image":d=a.tpl.image.replace(/\{href\}/g,g);break;case "swf":d='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',l="",f.each(a.swf,function(a,b){d+='<param name="'+a+'" value="'+b+'"></param>';l+=" "+a+'="'+b+'"'}),d+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+l+"></embed></object>"}v(d)&&d.parent().is(a.inner)||a.inner.append(d);b.trigger("beforeShow");
a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(!b.isOpened)f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();else if(c.prevMethod)b.transitions[c.prevMethod]();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),c=0,d,e=b.wrap,k=b.skin,g=b.inner,l=b.current;d=l.width;var h=l.height,n=l.minWidth,w=l.minHeight,p=l.maxWidth,
q=l.maxHeight,u=l.scrolling,r=l.scrollOutside?l.scrollbarWidth:0,z=l.margin,A=m(z[1]+z[3]),t=m(z[0]+z[2]),x,B,v,E,C,H,D,F,I;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");z=m(k.outerWidth(!0)-k.width());x=m(k.outerHeight(!0)-k.height());B=A+z;v=t+x;E=G(d)?(a.w-B)*m(d)/100:d;C=G(h)?(a.h-v)*m(h)/100:h;if("iframe"===l.type){if(I=l.content,l.autoHeight&&I&&1===I.data("ready"))try{I[0].contentWindow.document.location&&(g.width(E).height(9999),H=I.contents().find("body"),r&&H.css("overflow-x",
"hidden"),C=H.outerHeight(!0))}catch(M){}}else if(l.autoWidth||l.autoHeight)g.addClass("fancybox-tmp"),l.autoWidth||g.width(E),l.autoHeight||g.height(C),l.autoWidth&&(E=g.width()),l.autoHeight&&(C=g.height()),g.removeClass("fancybox-tmp");d=m(E);h=m(C);F=E/C;n=m(G(n)?m(n,"w")-B:n);p=m(G(p)?m(p,"w")-B:p);w=m(G(w)?m(w,"h")-v:w);q=m(G(q)?m(q,"h")-v:q);H=p;D=q;l.fitToView&&(p=Math.min(a.w-B,p),q=Math.min(a.h-v,q));B=a.w-A;t=a.h-t;l.aspectRatio?(d>p&&(d=p,h=m(d/F)),h>q&&(h=q,d=m(h*F)),d<n&&(d=n,h=m(d/
F)),h<w&&(h=w,d=m(h*F))):(d=Math.max(n,Math.min(d,p)),l.autoHeight&&"iframe"!==l.type&&(g.width(d),h=g.height()),h=Math.max(w,Math.min(h,q)));if(l.fitToView)if(g.width(d).height(h),e.width(d+z),a=e.width(),A=e.height(),l.aspectRatio)for(;(a>B||A>t)&&d>n&&h>w&&!(19<c++);)h=Math.max(w,Math.min(q,h-10)),d=m(h*F),d<n&&(d=n,h=m(d/F)),d>p&&(d=p,h=m(d/F)),g.width(d).height(h),e.width(d+z),a=e.width(),A=e.height();else d=Math.max(n,Math.min(d,d-(a-B))),h=Math.max(w,Math.min(h,h-(A-t)));r&&"auto"===u&&h<C&&
d+z+r<B&&(d+=r);g.width(d).height(h);e.width(d+z);a=e.width();A=e.height();c=(a>B||A>t)&&d>n&&h>w;d=l.aspectRatio?d<H&&h<D&&d<E&&h<C:(d<H||h<D)&&(d<E||h<C);f.extend(l,{dim:{width:y(a),height:y(A)},origWidth:E,origHeight:C,canShrink:c,canExpand:d,wPadding:z,hPadding:x,wrapSpace:A-k.outerHeight(!0),skinSpace:k.height()-h});!I&&l.autoHeight&&h>w&&h<q&&!d&&g.height("auto")},_getPosition:function(a){var c=b.current,d=b.getViewport(),e=c.margin,f=b.wrap.width()+e[1]+e[3],g=b.wrap.height()+e[0]+e[2],e={position:"absolute",
top:e[0],left:e[3]};c.autoCenter&&c.fixed&&!a&&g<=d.h&&f<=d.w?e.position="fixed":c.locked||(e.top+=d.y,e.left+=d.x);e.top=y(Math.max(e.top,e.top+(d.h-g)*c.topRatio));e.left=y(Math.max(e.left,e.left+(d.w-f)*c.leftRatio));return e},_afterZoomIn:function(){var a=b.current;a&&((b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened").hide().show(0),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(c){f(c.target).is("a")||
f(c.target).parent().is("a")||(c.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),a.loop||a.index!==a.group.length-1)?b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=
!1,b.play(!0)):b.play(!1))},_afterZoomOut:function(a){a=a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,c=a.element,d=a.orig,e={},f=50,g=50,l=a.hPadding,h=a.wPadding,n=b.getViewport();!d&&a.isDom&&c.is(":visible")&&(d=c.find("img:first"),d.length||(d=c));v(d)?
(e=d.offset(),d.is("img")&&(f=d.outerWidth(),g=d.outerHeight())):(e.top=n.y+(n.h-g)*a.topRatio,e.left=n.x+(n.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)e.top-=n.y,e.left-=n.x;return e={top:y(e.top-l*a.topRatio),left:y(e.left-h*a.leftRatio),width:y(f+h),height:y(g+l)}},step:function(a,c){var d,e,f=c.prop;e=b.current;var g=e.wrapSpace,l=e.skinSpace;if("width"===f||"height"===f)d=c.end===c.start?1:(a-c.start)/(c.end-c.start),b.isClosing&&(d=1-d),e="width"===f?e.wPadding:e.hPadding,
e=a-e,b.skin[f](m("width"===f?e:e-g*d)),b.inner[f](m("width"===f?e:e-g*d-l*d))},zoomIn:function(){var a=b.current,c=a.pos,d=a.openEffect,e="elastic"===d,k=f.extend({opacity:1},c);delete k.position;e?(c=this.getOrigPosition(),a.openOpacity&&(c.opacity=.1)):"fade"===d&&(c.opacity=.1);b.wrap.css(c).animate(k,{duration:"none"===d?0:a.openSpeed,easing:a.openEasing,step:e?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,c=a.closeEffect,d="elastic"===c,e={opacity:.1};d&&(e=this.getOrigPosition(),
a.closeOpacity&&(e.opacity=.1));b.wrap.animate(e,{duration:"none"===c?0:a.closeSpeed,easing:a.closeEasing,step:d?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,c=a.nextEffect,d=a.pos,e={opacity:1},f=b.direction,g;d.opacity=.1;"elastic"===c&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(d[g]=y(m(d[g])-200),e[g]="+=200px"):(d[g]=y(m(d[g])+200),e[g]="-=200px"));"none"===c?b._afterZoomIn():b.wrap.css(d).animate(e,{duration:a.nextSpeed,easing:a.nextEasing,
complete:b._afterZoomIn})},changeOut:function(){var a=b.previous,c=a.prevEffect,d={opacity:.1},e=b.direction;"elastic"===c&&(d["down"===e||"up"===e?"top":"left"]=("up"===e||"left"===e?"-":"+")+"=200px");a.wrap.animate(d,{duration:"none"===c?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!u,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){var c;a=f.extend({},
this.defaults,a);this.overlay&&this.close();c=b.coming?b.coming.parent:a.parent;this.overlay=f('<div class="fancybox-overlay"></div>').appendTo(c&&c.length?c:"body");this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var c=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&
this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?b.close():c.close(),!1});this.overlay.css(a.css).show()},close:function(){q.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");
K?(b=Math.max(J.documentElement.offsetWidth,J.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>q.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var d=this.overlay;f(".fancybox-overlay").stop(!0,!0);d||this.create(a);a.locked&&this.fixed&&b.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&f("*:not(object)").filter(function(){return"fixed"===
f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=q.scrollTop(),this.scrollH=q.scrollLeft(),this.el.addClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",
position:"bottom"},beforeShow:function(a){var c=b.current,d=c.title,e=a.type;f.isFunction(d)&&(d=d.call(c.element,c));if(r(d)&&""!==f.trim(d)){c=f('<div class="fancybox-title fancybox-title-'+e+'-wrap">'+d+"</div>");switch(e){case "inside":e=b.skin;break;case "outside":e=b.wrap;break;case "over":e=b.inner;break;default:e=b.skin,c.appendTo("body"),K&&c.width(c.width()),c.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(m(c.css("margin-bottom")))}c["top"===a.position?"prependTo":
"appendTo"](e)}}};f.fn.fancybox=function(a){var c,d=f(this),e=this.selector||"",k=function(g){var l=f(this).blur(),h=c,k,m;g.ctrlKey||g.altKey||g.shiftKey||g.metaKey||l.is(".fancybox-wrap")||(k=a.groupAttr||"data-fancybox-group",m=l.attr(k),m||(k="rel",m=l.get(0)[k]),m&&""!==m&&"nofollow"!==m&&(l=e.length?f(e):d,l=l.filter("["+k+'="'+m+'"]'),h=l.index(this)),a.index=h,!1!==b.open(l,a)&&g.preventDefault())};a=a||{};c=a.index||0;e&&!1!==a.live?p.undelegate(e,"click.fb-start").delegate(e+":not('.fancybox-item, .fancybox-nav')",
"click.fb-start",k):d.unbind("click.fb-start").bind("click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,c;f.scrollbarWidth===x&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});f.support.fixedPosition===x&&(f.support.fixedPosition=function(){var a=f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),
b=20===a[0].offsetTop||15===a[0].offsetTop;a.remove();return b}());f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(t).width();L.addClass("fancybox-lock-test");c=f(t).width();L.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(c-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
+895
View File
@@ -0,0 +1,895 @@
body.compensate-for-scrollbar {
overflow: hidden;
}
.fancybox-active {
height: auto;
}
.fancybox-is-hidden {
left: -9999px;
margin: 0;
position: absolute !important;
top: -9999px;
visibility: hidden;
}
.fancybox-container {
-webkit-backface-visibility: hidden;
height: 100%;
left: 0;
outline: none;
position: fixed;
-webkit-tap-highlight-color: transparent;
top: 0;
-ms-touch-action: manipulation;
touch-action: manipulation;
transform: translateZ(0);
width: 100%;
z-index: 99992;
}
.fancybox-container * {
box-sizing: border-box;
}
.fancybox-outer,
.fancybox-inner,
.fancybox-bg,
.fancybox-stage {
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.fancybox-outer {
-webkit-overflow-scrolling: touch;
overflow-y: auto;
}
.fancybox-bg {
background: rgb(30, 30, 30);
opacity: 0;
transition-duration: inherit;
transition-property: opacity;
transition-timing-function: cubic-bezier(.47, 0, .74, .71);
}
.fancybox-is-open .fancybox-bg {
opacity: .9;
transition-timing-function: cubic-bezier(.22, .61, .36, 1);
}
.fancybox-infobar,
.fancybox-toolbar,
.fancybox-caption,
.fancybox-navigation .fancybox-button {
direction: ltr;
opacity: 0;
position: absolute;
transition: opacity .25s ease, visibility 0s ease .25s;
visibility: hidden;
z-index: 99997;
}
.fancybox-show-infobar .fancybox-infobar,
.fancybox-show-toolbar .fancybox-toolbar,
.fancybox-show-caption .fancybox-caption,
.fancybox-show-nav .fancybox-navigation .fancybox-button {
opacity: 1;
transition: opacity .25s ease 0s, visibility 0s ease 0s;
visibility: visible;
}
.fancybox-infobar {
color: #ccc;
font-size: 13px;
-webkit-font-smoothing: subpixel-antialiased;
height: 44px;
left: 0;
line-height: 44px;
min-width: 44px;
mix-blend-mode: difference;
padding: 0 10px;
pointer-events: none;
top: 0;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.fancybox-toolbar {
right: 0;
top: 0;
}
.fancybox-stage {
direction: ltr;
overflow: visible;
transform: translateZ(0);
z-index: 99994;
}
.fancybox-is-open .fancybox-stage {
overflow: hidden;
}
.fancybox-slide {
-webkit-backface-visibility: hidden;
/* Using without prefix would break IE11 */
display: none;
height: 100%;
left: 0;
outline: none;
overflow: auto;
-webkit-overflow-scrolling: touch;
padding: 44px;
position: absolute;
text-align: center;
top: 0;
transition-property: transform, opacity;
white-space: normal;
width: 100%;
z-index: 99994;
}
.fancybox-slide::before {
content: '';
display: inline-block;
font-size: 0;
height: 100%;
vertical-align: middle;
width: 0;
}
.fancybox-is-sliding .fancybox-slide,
.fancybox-slide--previous,
.fancybox-slide--current,
.fancybox-slide--next {
display: block;
}
.fancybox-slide--image {
overflow: hidden;
padding: 44px 0;
}
.fancybox-slide--image::before {
display: none;
}
.fancybox-slide--html {
padding: 6px;
}
.fancybox-content {
background: #fff;
display: inline-block;
margin: 0;
max-width: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
padding: 44px;
position: relative;
text-align: left;
vertical-align: middle;
}
.fancybox-slide--image .fancybox-content {
animation-timing-function: cubic-bezier(.5, 0, .14, 1);
-webkit-backface-visibility: hidden;
background: transparent;
background-repeat: no-repeat;
background-size: 100% 100%;
left: 0;
max-width: none;
overflow: visible;
padding: 0;
position: absolute;
top: 0;
-ms-transform-origin: top left;
transform-origin: top left;
transition-property: transform, opacity;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 99995;
}
.fancybox-can-zoomOut .fancybox-content {
cursor: zoom-out;
}
.fancybox-can-zoomIn .fancybox-content {
cursor: zoom-in;
}
.fancybox-can-swipe .fancybox-content,
.fancybox-can-pan .fancybox-content {
cursor: -webkit-grab;
cursor: grab;
}
.fancybox-is-grabbing .fancybox-content {
cursor: -webkit-grabbing;
cursor: grabbing;
}
.fancybox-container [data-selectable='true'] {
cursor: text;
}
.fancybox-image,
.fancybox-spaceball {
background: transparent;
border: 0;
height: 100%;
left: 0;
margin: 0;
max-height: none;
max-width: none;
padding: 0;
position: absolute;
top: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 100%;
}
.fancybox-spaceball {
z-index: 1;
}
.fancybox-slide--video .fancybox-content,
.fancybox-slide--map .fancybox-content,
.fancybox-slide--pdf .fancybox-content,
.fancybox-slide--iframe .fancybox-content {
height: 100%;
overflow: visible;
padding: 0;
width: 100%;
}
.fancybox-slide--video .fancybox-content {
background: #000;
}
.fancybox-slide--map .fancybox-content {
background: #e5e3df;
}
.fancybox-slide--iframe .fancybox-content {
background: #fff;
}
.fancybox-video,
.fancybox-iframe {
background: transparent;
border: 0;
display: block;
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
width: 100%;
}
/* Fix iOS */
.fancybox-iframe {
left: 0;
position: absolute;
top: 0;
}
.fancybox-error {
background: #fff;
cursor: default;
max-width: 400px;
padding: 40px;
width: 100%;
}
.fancybox-error p {
color: #444;
font-size: 16px;
line-height: 20px;
margin: 0;
padding: 0;
}
/* Buttons */
.fancybox-button {
background: rgba(30, 30, 30, .6);
border: 0;
border-radius: 0;
box-shadow: none;
cursor: pointer;
display: inline-block;
height: 44px;
margin: 0;
padding: 10px;
position: relative;
transition: color .2s;
vertical-align: top;
visibility: inherit;
width: 44px;
}
.fancybox-button,
.fancybox-button:visited,
.fancybox-button:link {
color: #ccc;
}
.fancybox-button:hover {
color: #fff;
}
.fancybox-button:focus {
outline: none;
}
.fancybox-button.fancybox-focus {
outline: 1px dotted;
}
.fancybox-button[disabled],
.fancybox-button[disabled]:hover {
color: #888;
cursor: default;
outline: none;
}
/* Fix IE11 */
.fancybox-button div {
height: 100%;
}
.fancybox-button svg {
display: block;
height: 100%;
overflow: visible;
position: relative;
width: 100%;
}
.fancybox-button svg path {
fill: currentColor;
stroke-width: 0;
}
.fancybox-button--play svg:nth-child(2),
.fancybox-button--fsenter svg:nth-child(2) {
display: none;
}
.fancybox-button--pause svg:nth-child(1),
.fancybox-button--fsexit svg:nth-child(1) {
display: none;
}
.fancybox-progress {
background: #ff5268;
height: 2px;
left: 0;
position: absolute;
right: 0;
top: 0;
-ms-transform: scaleX(0);
transform: scaleX(0);
-ms-transform-origin: 0;
transform-origin: 0;
transition-property: transform;
transition-timing-function: linear;
z-index: 99998;
}
/* Close button on the top right corner of html content */
.fancybox-close-small {
background: transparent;
border: 0;
border-radius: 0;
color: #ccc;
cursor: pointer;
opacity: .8;
padding: 8px;
position: absolute;
right: -12px;
top: -44px;
z-index: 401;
}
.fancybox-close-small:hover {
color: #fff;
opacity: 1;
}
.fancybox-slide--html .fancybox-close-small {
color: currentColor;
padding: 10px;
right: 0;
top: 0;
}
.fancybox-slide--image.fancybox-is-scaling .fancybox-content {
overflow: hidden;
}
.fancybox-is-scaling .fancybox-close-small,
.fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small {
display: none;
}
/* Navigation arrows */
.fancybox-navigation .fancybox-button {
background-clip: content-box;
height: 100px;
opacity: 0;
position: absolute;
top: calc(50% - 50px);
width: 70px;
}
.fancybox-navigation .fancybox-button div {
padding: 7px;
}
.fancybox-navigation .fancybox-button--arrow_left {
left: 0;
left: env(safe-area-inset-left);
padding: 31px 26px 31px 6px;
}
.fancybox-navigation .fancybox-button--arrow_right {
padding: 31px 6px 31px 26px;
right: 0;
right: env(safe-area-inset-right);
}
/* Caption */
.fancybox-caption {
background: linear-gradient(to top,
rgba(0, 0, 0, .85) 0%,
rgba(0, 0, 0, .3) 50%,
rgba(0, 0, 0, .15) 65%,
rgba(0, 0, 0, .075) 75.5%,
rgba(0, 0, 0, .037) 82.85%,
rgba(0, 0, 0, .019) 88%,
rgba(0, 0, 0, 0) 100%);
bottom: 0;
color: #eee;
font-size: 14px;
font-weight: 400;
left: 0;
line-height: 1.5;
padding: 75px 44px 25px 44px;
pointer-events: none;
right: 0;
text-align: center;
z-index: 99996;
}
@supports (padding: max(0px)) {
.fancybox-caption {
padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));
}
}
.fancybox-caption--separate {
margin-top: -50px;
}
.fancybox-caption__body {
max-height: 50vh;
overflow: auto;
pointer-events: all;
}
.fancybox-caption a,
.fancybox-caption a:link,
.fancybox-caption a:visited {
color: #ccc;
text-decoration: none;
}
.fancybox-caption a:hover {
color: #fff;
text-decoration: underline;
}
/* Loading indicator */
.fancybox-loading {
animation: fancybox-rotate 1s linear infinite;
background: transparent;
border: 4px solid #888;
border-bottom-color: #fff;
border-radius: 50%;
height: 50px;
left: 50%;
margin: -25px 0 0 -25px;
opacity: .7;
padding: 0;
position: absolute;
top: 50%;
width: 50px;
z-index: 99999;
}
@keyframes fancybox-rotate {
100% {
transform: rotate(360deg);
}
}
/* Transition effects */
.fancybox-animated {
transition-timing-function: cubic-bezier(0, 0, .25, 1);
}
/* transitionEffect: slide */
.fancybox-fx-slide.fancybox-slide--previous {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
.fancybox-fx-slide.fancybox-slide--next {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
.fancybox-fx-slide.fancybox-slide--current {
opacity: 1;
transform: translate3d(0, 0, 0);
}
/* transitionEffect: fade */
.fancybox-fx-fade.fancybox-slide--previous,
.fancybox-fx-fade.fancybox-slide--next {
opacity: 0;
transition-timing-function: cubic-bezier(.19, 1, .22, 1);
}
.fancybox-fx-fade.fancybox-slide--current {
opacity: 1;
}
/* transitionEffect: zoom-in-out */
.fancybox-fx-zoom-in-out.fancybox-slide--previous {
opacity: 0;
transform: scale3d(1.5, 1.5, 1.5);
}
.fancybox-fx-zoom-in-out.fancybox-slide--next {
opacity: 0;
transform: scale3d(.5, .5, .5);
}
.fancybox-fx-zoom-in-out.fancybox-slide--current {
opacity: 1;
transform: scale3d(1, 1, 1);
}
/* transitionEffect: rotate */
.fancybox-fx-rotate.fancybox-slide--previous {
opacity: 0;
-ms-transform: rotate(-360deg);
transform: rotate(-360deg);
}
.fancybox-fx-rotate.fancybox-slide--next {
opacity: 0;
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
.fancybox-fx-rotate.fancybox-slide--current {
opacity: 1;
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
/* transitionEffect: circular */
.fancybox-fx-circular.fancybox-slide--previous {
opacity: 0;
transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
}
.fancybox-fx-circular.fancybox-slide--next {
opacity: 0;
transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
}
.fancybox-fx-circular.fancybox-slide--current {
opacity: 1;
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
}
/* transitionEffect: tube */
.fancybox-fx-tube.fancybox-slide--previous {
transform: translate3d(-100%, 0, 0) scale(.1) skew(-10deg);
}
.fancybox-fx-tube.fancybox-slide--next {
transform: translate3d(100%, 0, 0) scale(.1) skew(10deg);
}
.fancybox-fx-tube.fancybox-slide--current {
transform: translate3d(0, 0, 0) scale(1);
}
/* Styling for Small-Screen Devices */
@media all and (max-height: 576px) {
.fancybox-slide {
padding-left: 6px;
padding-right: 6px;
}
.fancybox-slide--image {
padding: 6px 0;
}
.fancybox-close-small {
right: -6px;
}
.fancybox-slide--image .fancybox-close-small {
background: #4e4e4e;
color: #f2f4f6;
height: 36px;
opacity: 1;
padding: 6px;
right: 0;
top: 0;
width: 36px;
}
.fancybox-caption {
padding-left: 12px;
padding-right: 12px;
}
@supports (padding: max(0px)) {
.fancybox-caption {
padding-left: max(12px, env(safe-area-inset-left));
padding-right: max(12px, env(safe-area-inset-right));
}
}
}
/* Share */
.fancybox-share {
background: #f4f4f4;
border-radius: 3px;
max-width: 90%;
padding: 30px;
text-align: center;
}
.fancybox-share h1 {
color: #222;
font-size: 35px;
font-weight: 700;
margin: 0 0 20px 0;
}
.fancybox-share p {
margin: 0;
padding: 0;
}
.fancybox-share__button {
border: 0;
border-radius: 3px;
display: inline-block;
font-size: 14px;
font-weight: 700;
line-height: 40px;
margin: 0 5px 10px 5px;
min-width: 130px;
padding: 0 15px;
text-decoration: none;
transition: all .2s;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
}
.fancybox-share__button:visited,
.fancybox-share__button:link {
color: #fff;
}
.fancybox-share__button:hover {
text-decoration: none;
}
.fancybox-share__button--fb {
background: #3b5998;
}
.fancybox-share__button--fb:hover {
background: #344e86;
}
.fancybox-share__button--pt {
background: #bd081d;
}
.fancybox-share__button--pt:hover {
background: #aa0719;
}
.fancybox-share__button--tw {
background: #1da1f2;
}
.fancybox-share__button--tw:hover {
background: #0d95e8;
}
.fancybox-share__button svg {
height: 25px;
margin-right: 7px;
position: relative;
top: -1px;
vertical-align: middle;
width: 25px;
}
.fancybox-share__button svg path {
fill: #fff;
}
.fancybox-share__input {
background: transparent;
border: 0;
border-bottom: 1px solid #d7d7d7;
border-radius: 0;
color: #5d5b5b;
font-size: 14px;
margin: 10px 0 0 0;
outline: none;
padding: 10px 15px;
width: 100%;
}
/* Thumbs */
.fancybox-thumbs {
background: #ddd;
bottom: 0;
display: none;
margin: 0;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
padding: 2px 2px 4px 2px;
position: absolute;
right: 0;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
top: 0;
width: 212px;
z-index: 99995;
}
.fancybox-thumbs-x {
overflow-x: auto;
overflow-y: hidden;
}
.fancybox-show-thumbs .fancybox-thumbs {
display: block;
}
.fancybox-show-thumbs .fancybox-inner {
right: 212px;
}
.fancybox-thumbs__list {
font-size: 0;
height: 100%;
list-style: none;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
padding: 0;
position: absolute;
position: relative;
white-space: nowrap;
width: 100%;
}
.fancybox-thumbs-x .fancybox-thumbs__list {
overflow: hidden;
}
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar {
width: 7px;
}
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track {
background: #fff;
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
}
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb {
background: #2a2a2a;
border-radius: 10px;
}
.fancybox-thumbs__list a {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
background-color: rgba(0, 0, 0, .1);
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
cursor: pointer;
float: left;
height: 75px;
margin: 2px;
max-height: calc(100% - 8px);
max-width: calc(50% - 4px);
outline: none;
overflow: hidden;
padding: 0;
position: relative;
-webkit-tap-highlight-color: transparent;
width: 100px;
}
.fancybox-thumbs__list a::before {
border: 6px solid #ff5268;
bottom: 0;
content: '';
left: 0;
opacity: 0;
position: absolute;
right: 0;
top: 0;
transition: all .2s cubic-bezier(.25, .46, .45, .94);
z-index: 99991;
}
.fancybox-thumbs__list a:focus::before {
opacity: .5;
}
.fancybox-thumbs__list a.fancybox-thumbs-active::before {
opacity: 1;
}
/* Styling for Small-Screen Devices */
@media all and (max-width: 576px) {
.fancybox-thumbs {
width: 110px;
}
.fancybox-show-thumbs .fancybox-inner {
right: 110px;
}
.fancybox-thumbs__list a {
max-width: calc(100% - 10px);
}
}
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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+119
View File
@@ -0,0 +1,119 @@
# jQuery Actual Plugin CHANGELOG
## 1.0.19
- Add `main` property to `package.json`
## 1.0.18
- Depend on jQuery as a peer
## 1.0.17
- Added display inline support
## 1.0.16
- [refactoring] Keep original element styles as far as possible
## 1.0.15
- [bug fix] Replaced jQuery version detection with feature detection. Previously this would not properly detect jQuery 1.10+
## 1.0.14
- Added support for jQuery 1.9.0
## 1.0.13
- [bug fix] Local variable `style` not initialized, thanks to [Searle](https://github.com/Searle)
## 1.0.12
- [refactoring] Use `.eq( 0 )` instead of `.filter( ':first' )` for better performance, thanks to Matt Hinchliffe
## 1.0.11
- [refactoring] Select only the first hidden element to improve the perfomance
## 1.0.10
- [bug fix] Override `!imporant` css declarations
## 1.0.9
- [bug fix] jQuery 1.8.0 compatibility
## 1.0.8
- [bug fix] Inverted code lines
## 1.0.7
- [refactoring] Save/restore element style rather than individual CSS attributes( thanks to Jon Tara )
## 1.0.6
- [bug fixed] Pass `configs.includeMargin` to only `outerWidth` and `outerHeight` so it does not break in $ 1.7.2
## 1.0.5
- Add package.json for new jquery plugin site
## 1.0.4
- Add `includeMargin` for `outerWidth`( thanks to Erwin Derksen )
## 1.0.3
- [bug fixed] `$` namespace conflict
## 1.0.2
- [bug fixed] Typo
## 1.0.1
- [bug fixed] Typo
## 1.0.0
- First stable release
+20
View File
@@ -0,0 +1,20 @@
Copyright 2011, Ben Lin (http://dreamerslab.com/)
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.
+115
View File
@@ -0,0 +1,115 @@
# jQuery Actual Plugin
Get the actual width/height of invisible DOM elements with jQuery.
## Description
jQuery has trouble finding the width/height of invisible DOM elements. With element or its parent element has css property 'display' set to 'none'. `$('.hidden').width();` will return 0 instead of the actual width; This plugin simply fix it.
## Demo
- Normal usage see demo/normal.html
- If you use [css3pie](http://css3pie.com/) you might also want to take a look at another demo( demo/css3pie.html )
- Live demo please take a look at [this](http://dreamerslab.com/demos/get-hidden-element-width-with-jquery-actual-plugin) and [this](http://dreamerslab.com/demos/get-hidden-element-width-with-jquery-actual-plugin-with-css3pie/)
## Documentation
- There is a syntax highlight version, please see [this post](http://dreamerslab.com/blog/en/get-hidden-elements-width-and-height-with-jquery/)
- For chinese version please go [here](http://dreamerslab.com/blog/tw/get-hidden-elements-width-and-height-with-jquery/)
## Requires
- jQuery >= 1.2.3
## Browser Compatibility
- [Firefox](http://mzl.la/RNaI) 2.0+
- [Internet Explorer](http://bit.ly/9fMgIQ) 6+
- [Safari](http://bit.ly/gMhzVR) 3+
- [Opera](http://bit.ly/fWJzaC) 10.6+
- [Chrome](http://bit.ly/ePHvYZ) 8+
## Installation
- First, make sure you are using valid [DOCTYPE](http://bit.ly/hQK1Rk)
- Include necessary JS files
<!-- -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="path-to-file/jquery.actual.js"></script>
## Usage
Example code:
// get hidden element actual width
$( '.hidden' ).actual( 'width' );
// get hidden element actual innerWidth
$( '.hidden' ).actual( 'innerWidth' );
// get hidden element actual outerWidth
$( '.hidden' ).actual( 'outerWidth' );
// get hidden element actual outerWidth and set the `includeMargin` argument
$( '.hidden' ).actual( 'outerWidth', { includeMargin : true });
// get hidden element actual height
$( '.hidden' ).actual( 'height' );
// get hidden element actual innerHeight
$( '.hidden' ).actual( 'innerHeight' );
// get hidden element actual outerHeight
$( '.hidden' ).actual( 'outerHeight' );
// get hidden element actual outerHeight and set the `includeMargin` argument
$( '.hidden' ).actual( 'outerHeight', { includeMargin : true });
// if the page jumps or blinks, pass a attribute '{ absolute : true }'
// be very careful, you might get a wrong result depends on how you makrup your html and css
$( '.hidden' ).actual( 'height', { absolute : true });
// if you use css3pie with a float element
// for example a rounded corner navigation menu you can also try to pass a attribute '{ clone : true }'
// please see demo/css3pie in action
$( '.hidden' ).actual( 'width', { clone : true });
// if it is not a block element. By default { display: 'block' }.
// for example a inline element
$( '.hidden' ).actual( 'width', { display: 'inline-block' });
## Credits
- Erwin Derksen
- [Jon Tara](https://github.com/jtara)
- [Matt Hinchliffe](https://github.com/i-like-robots)
- [Ryan Millikin](https://github.com/dhamma)
- [Jacob Quant](https://github.com/jacobq)
- [ejn](https://github.com/ejn)
- [Rudolf](https://github.com/qakovalyov)
- [jamesallchin](https://github.com/jamesallchin)
## License
The expandable plugin is licensed under the MIT License (LICENSE.txt).
Copyright (c) 2012 [Ben Lin](http://dreamerslab.com)
+19
View File
@@ -0,0 +1,19 @@
{
"author": "dreamerslab",
"name": "jquery.actual",
"version": "1.0.19",
"description": "Get the actual width/height of invisible DOM elements with jQuery.",
"repository": {
"type": "git",
"url": "https://github.com/dreamerslab/jquery.actual"
},
"keywords": [
"jquery",
"actual"
],
"dependencies": {
"jquery": ">= 1.2.3"
},
"main": "jquery.actual.js",
"license": "MIT"
}
+107
View File
@@ -0,0 +1,107 @@
/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
* Licensed under the MIT License (LICENSE.txt).
*
* Version: 1.0.19
*
* Requires: jQuery >= 1.2.3
*/
;( function ( factory ) {
if ( typeof define === 'function' && define.amd ) {
// AMD. Register module depending on jQuery using requirejs define.
define( ['jquery'], factory );
} else {
// No AMD.
factory( jQuery );
}
}( function ( $ ){
$.fn.addBack = $.fn.addBack || $.fn.andSelf;
$.fn.extend({
actual : function ( method, options ){
// check if the jQuery method exist
if( !this[ method ]){
throw '$.actual => The jQuery method "' + method + '" you called does not exist';
}
var defaults = {
absolute : false,
clone : false,
includeMargin : false,
display : 'block'
};
var configs = $.extend( defaults, options );
var $target = this.eq( 0 );
var fix, restore;
if( configs.clone === true ){
fix = function (){
var style = 'position: absolute !important; top: -1000 !important; ';
// this is useful with css3pie
$target = $target.
clone().
attr( 'style', style ).
appendTo( 'body' );
};
restore = function (){
// remove DOM element after getting the width
$target.remove();
};
}else{
var tmp = [];
var style = '';
var $hidden;
fix = function (){
// get all hidden parents
$hidden = $target.parents().addBack().filter( ':hidden' );
style += 'visibility: hidden !important; display: ' + configs.display + ' !important; ';
if( configs.absolute === true ) style += 'position: absolute !important; ';
// save the origin style props
// set the hidden el css to be got the actual value later
$hidden.each( function (){
// Save original style. If no style was set, attr() returns undefined
var $this = $( this );
var thisStyle = $this.attr( 'style' );
tmp.push( thisStyle );
// Retain as much of the original style as possible, if there is one
$this.attr( 'style', thisStyle ? thisStyle + ';' + style : style );
});
};
restore = function (){
// restore origin style values
$hidden.each( function ( i ){
var $this = $( this );
var _tmp = tmp[ i ];
if( _tmp === undefined ){
$this.removeAttr( 'style' );
}else{
$this.attr( 'style', _tmp );
}
});
};
}
fix();
// get the actual value with user specific methed
// it can be 'width', 'height', 'outerWidth', 'innerWidth'... etc
// configs.includeMargin only works for 'outerWidth' and 'outerHeight'
var actual = /(outer)/.test( method ) ?
$target[ method ]( configs.includeMargin ) :
$target[ method ]();
restore();
// IMPORTANT, this plugin only return the value of the first element
return actual;
}
});
}));
+14
View File
@@ -0,0 +1,14 @@
/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
* Licensed under the MIT License (LICENSE.txt).
*
* Version: 1.0.19
*
* Requires: jQuery >= 1.2.3
*/
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a);
}else{a(jQuery);}}(function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf;a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual => The jQuery method "'+b+'" you called does not exist';
}var f={absolute:false,clone:false,includeMargin:false,display:"block"};var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; ";
e=e.clone().attr("style",m).appendTo("body");};j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden");
d+="visibility: hidden !important; display: "+i.display+" !important; ";if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this);
var n=m.attr("style");g.push(n);m.attr("style",n?n+";"+d:d);});};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style");
}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b]();j();return k;}});}));
+26
View File
@@ -0,0 +1,26 @@
// package metadata file for Meteor.js
'use strict';
var packageName = 'dreamerslab:jquery.actual'; // https://atmospherejs.com/mediatainment/switchery
var where = 'client'; // where to install: 'client' or 'server'. For both, pass nothing.
Package.describe({
name: packageName,
version: '1.0.19',
// Brief, one-line summary of the package.
summary: 'Get the actual width/height of invisible DOM elements with jQuery.',
// URL to the Git repository containing the source code for this package.
git: 'https://github.com/dreamerslab/jquery.actual'
});
Package.onUse(function (api) {
api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0']);
api.use('jquery', where);
api.addFiles('jquery.actual.js', where);
});
Package.onTest(function (api) {
api.use([packageName, 'sanjo:jasmine'], where);
api.use(['webapp','tinytest'], where);
api.addFiles('meteor/tests.js', where); // testing specific files
});
+30
View File
@@ -0,0 +1,30 @@
{
"name" : "jquery.actual",
"version" : "1.0.19",
"title" : "jQuery Actual Plugin",
"author" : "dreamerslab <ben@dreamerslab.com>",
"description": "Older version of jQuery has trouble finding the width/height of invisible DOM elements. With element or its parent element has css property 'display' set to 'none'. `$('.hidden').width();` will return 0 instead of the actual width; This plugin simply fix it.",
"keywords": [
"width", "height", "hidden element width", "hidden element height", "actual"
],
"peerDependencies": {
"jquery": ">=1.2.3"
},
"contributors": [
{ "name": "Ben Lin", "email": "ben@dreamerslab.com" },
{ "name": "Erwin Derksen" },
{ "name": "Jon Tara", "email": "jtara-github-public@spamex.com" },
{ "name": "Matt Hinchliffe", "email": "matt@maketea.co.uk" },
{ "name": "Ryan Millikin" },
{ "name": "Jacob Quant" },
{ "name": "ejn" },
{ "name": "Rudolf", "email": "qa.kovalyov@gmail.com" },
{ "name": "jamesallchin" }
],
"licenses": [{
"type" : "MIT",
"url" : "LICENSE.txt"
}],
"main": "jquery.actual.js",
"homepage": "http://dreamerslab.com/blog/get-hidden-elements-width-and-height-with-jquery/"
}
+129
View File
@@ -0,0 +1,129 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery AlphaNumeric</title>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jquery.alphanumeric.pack.js"></script>
<style>
body{margin:0px;padding:0px;font-family:Arial,Helvetica,sans-serif;font-size:12px}h1{font-weight:normal;font-size:24px;margin:10px 0px;color:#003366}.container{background:#eee;margin:20px;padding:10px}a{color:#0099FF;text-decoration:none}.sample{background:#ccc;padding:10px;border:1px solid #fff;margin-bottom:10px}h2{margin:10px 0px;font-size:18px;color:#0033FF;font-weight:normal}.code{background:#fff;padding:10px;border-top:5px solid #aaa;margin:10px 0px;display:none}.tb{border:0px;padding:5px;font-size:12px;font-family:Verdana,Arial,Helvetica,sans-serif}.list li{margin-bottom:10px}
</style>
</head>
<body>
<div class="container">
<h1>jQuery <b>Alpha</b>Numeric</h1>
<h2>by Paulo P. Marinas</h2>
<p>
Did you ever found a need where you want to prevent your user from entering certain characters?
</p>
<p>
Looking at the plugins available at jQuery, i found a great plugin by Sam Collet called <a href="http://www.texotela.co.uk/code/jquery/numeric/">Numeric</a>.
</p>
<p>
But it was too limited, what if I'm asking the user to create a username? or to enter a number with decimals or an IP Address?
There is another great plugin called <a href="http://digitalbush.com/projects/masked-input-plugin">Masked Input</a> by Josh Bush,
which can also control user input by defining a mask. but the problem was the length of text to be input must be defined as well.
Again, what if I needed to control input of a username? I can't tell how many characters the user will be using, and I can't force him to use just 8 characters
,so I created <b>AlphaNumeric</b>.
</p>
<p>
<strong>jQuery AlphaNumeric</strong> is a javascript control plugin that allows you to limit what characters a user can enter on textboxes or textareas. Have fun.
</p>
<h2>You can download the plugin and these examples <a href="alphanumeric.zip">here</a></h2>
<div class="sample">
<h2>Examples</h2>
<ol class="list">
<li>
<b>Allow only alphanumeric characters</b>
<input type="text" class="sample1 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample1').alphanumeric();</div>
</li>
<li>
<b>Allow only alphanumeric characters, and some exceptions like dot(.), comma (,) and space</b>
<input type="text" class="sample2 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample2').alphanumeric({allow:"., "});</div>
</li>
<li>
<b>Allow only lowercase alpha characters</b>
<input type="text" class="sample3 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample3').alpha({nocaps:true});</div>
</li>
<li>
<b>Allow only numeric characters</b>
<input type="text" class="sample4 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample4').numeric();</div>
</li>
<li>
<b>Allow only numeric characters, and some exceptions like dot (.)</b>
<input type="text" class="sample5 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample5').numeric({allow:"."});</div>
</li>
<li>
<b>Make a custom rule and define only certain characters to prevent, like dot (.), one (1), and a (a)</b>
<input type="text" class="sample6 tb" size="10" />
<a href="#" class="vcode">+ Toggle Code</a>
<div class="code">$('.sample6').alphanumeric({ichars:'.1a'});</div>
</li>
</ol>
</div>
<h2>API Functions</h2>
<ol>
<li><b>alphanumeric</b> - allow both alphabet and numeric characters</li>
<li><b>alpha</b> - allow only alphabet characters</li>
<li><b>numeric</b> - allow only numeric characters</li>
</ol>
<h2>API Properties</h2>
<ol>
<li><b>allow</b> - add excempted characters to the rule of prevention</li>
<li><b>ichars</b> - define a custome set of characters to prevent</li>
<li><b>allcaps</b> - allow only capital letters to be entered</li>
<li><b>nocaps</b> - allow only lowercase characters to be entered</li>
</ol>
<div style="clear:both"></div>
</div>
<script type="text/javascript">
$('.vcode').click(function(){$(this).next().toggle('slow'); return false;});
$('.sample1').alphanumeric();
$('.sample2').alphanumeric({allow:"., "});
$('.sample3').alpha({nocaps:true});
$('.sample4').numeric();
$('.sample5').numeric({allow:"."});
$('.sample6').alphanumeric({ichars:'.1a'});
</script>
</body>
</html>
@@ -0,0 +1,81 @@
(function ($) {
$.fn.alphanumeric = function (p) {
var input = $(this),
//add new letter (ñ, for spanish keyboard) (Felipe Pincheira A.)
// + french letter
az = 'aàáâãäåæbcçdeèéêëfghiìíîïjklmnñoðòóôõöpqrstuùúûüvwxyýÿz',
options = $.extend({
//add new characters (¡°¬´¨) (Felipe Pincheira A.)
ichars: '!@#$%^&*()+=[]\\\';,/{}|":<>?~`.- _¡°¬´¨²€ƒ^‰¥£¢¦§¨ø',
nchars: '',
allow: ''
}, p),
s = options.allow.split(''),
i = 0,
ch,
regex;
for (i; i < s.length; i++) {
if (options.ichars.indexOf(s[i]) != -1) {
s[i] = '\\' + s[i];
}
}
if (options.nocaps) {
options.nchars += az.toUpperCase();
}
if (options.allcaps) {
options.nchars += az;
}
options.allow = s.join('|');
regex = new RegExp(options.allow, 'gi');
ch = (options.ichars + options.nchars).replace(regex, '');
input
.keypress(function (e) {
var key = String.fromCharCode(!e.charCode ? e.which : e.charCode);
if (ch.indexOf(key) != -1 && !e.ctrlKey) {
e.preventDefault();
}
})
.blur(function () {
var value = input.val(),
j = 0;
for (j; j < value.length; j++) {
if (ch.indexOf(value[j]) != -1) {
input.val('');
return false;
}
}
return false;
});
return input;
};
$.fn.numeric = function (p) {
//add new letter (ñ, for spanish keyboard) (Felipe Pincheira A.)
var az = 'aàáâãäåæbcçdeèéêëfghiìíîïjklmnñoðòóôõöpqrstuùúûüvwxyýÿz',
aZ = az.toUpperCase();
return this.each(function () {
$(this).alphanumeric($.extend({ nchars: az + aZ }, p));
});
};
$.fn.alpha = function (p) {
var nm = '1234567890';
return this.each(function () {
$(this).alphanumeric($.extend({ nchars: nm }, p));
});
};
})(jQuery);
@@ -0,0 +1 @@
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){$.h.k=3(p){6 b=$(8),l="n",2=$.m({f:\'!@#$%^&*()+=[]\\\\\\\';,/{}|":<>?~`.- O\',4:\'\',c:\'\'},p),s=2.c.N(\'\'),i=0,9,d;t(i;i<s.w;i++){5(2.f.g(s[i])!=-1){s[i]=\'\\\\\'+s[i]}}5(2.L){2.4+=l.q()}5(2.K){2.4+=l}2.c=s.J(\'|\');d=y D(2.c,\'A\');9=(2.f+2.4).I(d,\'\');b.z(3(e){6 a=B.C(!e.v?e.E:e.v);5(9.g(a)!=-1&&!e.F){e.G()}});b.H(3(){6 a=b.u(),j=0;t(j;j<a.w;j++){5(9.g(a[j])!=-1){b.u(\'\');7 o}}7 o});7 b};$.h.M=3(p){6 a=\'n\',x=a.q();7 8.r(3(){$(8).k($.m({4:a+x},p))})};$.h.P=3(p){6 a=\'Q\';7 8.r(3(){$(8).k($.m({4:a},p))})}})(R);',54,54,'||options|function|nchars|if|var|return|this|ch|||allow|regex||ichars|indexOf|fn|||alphanumeric|az|extend|abcdefghijklmnopqrstuvwxyz|false||toUpperCase|each||for|val|charCode|length|aZ|new|keypress|gi|String|fromCharCode|RegExp|which|ctrlKey|preventDefault|blur|replace|join|allcaps|nocaps|numeric|split|_|alpha|1234567890|jQuery'.split('|'),0,{}))
+5
View File
@@ -0,0 +1,5 @@
port of jquery.alphanumeric, a really decent filter for form input. works best with jquery.validate
#### further info
* http://www.shiguenori.com/material/alphanumeric/index.html
+73
View File
@@ -0,0 +1,73 @@
HEAD
-----
1.4.1
-----
- Added support for CommonJS.
- Added support for package managers: Jam (http://jamjs.org), volo (http://volojs.org), Component (http://component.io), jspm (http://jspm.io).
- The expires option now interpretes fractions of numbers (e.g. days) correctly.
1.4.0
-----
- Support for AMD.
- Removed deprecated method `$.cookie('name', null)` for deleting a cookie,
use `$.removeCookie('name')`.
- `$.cookie('name')` now returns `undefined` in case such cookie does not exist
(was `null`). Because the return value is still falsy, testing for existence
of a cookie like `if ( $.cookie('foo') )` keeps working without change.
- Renamed bower package definition (component.json -> bower.json) for usage
with up-to-date bower.
- Badly encoded cookies no longer throw exception upon reading but do return
undefined (similar to how we handle JSON parse errors with json = true).
- Added conversion function as optional last argument for reading,
so that values can be changed to a different representation easily on the fly.
Useful for parsing numbers for instance:
```javascript
$.cookie('foo', '42');
$.cookie('foo', Number); // => 42
```
1.3.1
-----
- Fixed issue where it was no longer possible to check for an arbitrary cookie,
while json is set to true, there was a SyntaxError thrown from JSON.parse.
- Fixed issue where RFC 2068 decoded cookies were not properly read.
1.3.0
-----
- Configuration options: `raw`, `json`. Replaces raw option, becomes config:
```javascript
$.cookie.raw = true; // bypass encoding/decoding the cookie value
$.cookie.json = true; // automatically JSON stringify/parse value
```
Thus the default options now cleanly contain cookie attributes only.
- Removing licensing under GPL Version 2, the plugin is now released under MIT License only
(keeping it simple and following the jQuery library itself here).
- Bugfix: Properly handle RFC 2068 quoted cookie values.
- Added component.json for bower.
- Added jQuery plugin package manifest.
- `$.cookie()` returns all available cookies.
1.2.0
-----
- Adding `$.removeCookie('foo')` for deleting a cookie, using `$.cookie('foo', null)` is now deprecated.
1.1
---
- Adding default options.
+51
View File
@@ -0,0 +1,51 @@
##Issues
- Report issues or feature requests on [GitHub Issues](https://github.com/carhartl/jquery-cookie/issues).
- If reporting a bug, please add a [simplified example](http://sscce.org/).
##Pull requests
- Create a new topic branch for every separate change you make.
- Create a test case if you are fixing a bug or implementing an important feature.
- Make sure the build runs successfully.
## Development
###Tools
We use the following tools for development:
- [Qunit](http://qunitjs.com/) for tests.
- [NodeJS](http://nodejs.org/download/) required to run grunt.
- [Grunt](http://gruntjs.com/getting-started) for task management.
###Getting started
Install [NodeJS](http://nodejs.org/).
Install globally grunt-cli using the following command:
$ npm install -g grunt-cli
Browse to the project root directory and install the dev dependencies:
$ npm install -d
To execute the build and tests run the following command in the root of the project:
$ grunt
You should see a green message in the console:
Done, without errors.
###Tests
You can also run the tests in the browser.
Start a test server from the project root:
$ grunt connect:tests
This will automatically open the test suite at http://127.0.0.1:9998 in the default browser, with livereload enabled.
_Note: we recommend cleaning all the browser cookies before running the tests, that can avoid false positive failures._
###Automatic build
You can build automatically after a file change using the following command:
$ grunt watch
+20
View File
@@ -0,0 +1,20 @@
Copyright 2014 Klaus Hartl
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.
+162
View File
@@ -0,0 +1,162 @@
# IMPORTANT!
This project was moved to https://github.com/js-cookie/js-cookie, check [the discussion](https://github.com/carhartl/jquery-cookie/issues/349).
New issues should be opened at https://github.com/js-cookie/js-cookie/issues
# jquery.cookie [![Build Status](https://travis-ci.org/carhartl/jquery-cookie.png?branch=master)](https://travis-ci.org/carhartl/jquery-cookie) [![Code Climate](https://codeclimate.com/github/carhartl/jquery-cookie.png)](https://codeclimate.com/github/carhartl/jquery-cookie)
A simple, lightweight jQuery plugin for reading, writing and deleting cookies.
**If you're viewing this, you're reading the documentation for the old repository.
[View documentation for the latest backwards compatible release (1.5.1).](https://github.com/js-cookie/js-cookie/tree/v1.5.1)**
## Build Status Matrix
[![Selenium Test Status](https://saucelabs.com/browser-matrix/jquery-cookie.svg)](https://saucelabs.com/u/jquery-cookie)
## Installation
Include script *after* the jQuery library (unless you are packaging scripts somehow else):
```html
<script src="/path/to/jquery.cookie.js"></script>
```
**Do not include the script directly from GitHub (http://raw.github.com/...).** The file is being served as text/plain and as such being blocked
in Internet Explorer on Windows 7 for instance (because of the wrong MIME type). Bottom line: GitHub is not a CDN.
The plugin can also be loaded as AMD or CommonJS module.
## Usage
Create session cookie:
```javascript
$.cookie('name', 'value');
```
Create expiring cookie, 7 days from then:
```javascript
$.cookie('name', 'value', { expires: 7 });
```
Create expiring cookie, valid across entire site:
```javascript
$.cookie('name', 'value', { expires: 7, path: '/' });
```
Read cookie:
```javascript
$.cookie('name'); // => "value"
$.cookie('nothing'); // => undefined
```
Read all available cookies:
```javascript
$.cookie(); // => { "name": "value" }
```
Delete cookie:
```javascript
// Returns true when cookie was successfully deleted, otherwise false
$.removeCookie('name'); // => true
$.removeCookie('nothing'); // => false
// Need to use the same attributes (path, domain) as what the cookie was written with
$.cookie('name', 'value', { path: '/' });
// This won't work!
$.removeCookie('name'); // => false
// This will work!
$.removeCookie('name', { path: '/' }); // => true
```
*Note: when deleting a cookie, you must pass the exact same path, domain and secure options that were used to set the cookie, unless you're relying on the default options that is.*
## Configuration
### raw
By default the cookie value is encoded/decoded when writing/reading, using `encodeURIComponent`/`decodeURIComponent`. Bypass this by setting raw to true:
```javascript
$.cookie.raw = true;
```
### json
Turn on automatic storage of JSON objects passed as the cookie value. Assumes `JSON.stringify` and `JSON.parse`:
```javascript
$.cookie.json = true;
```
## Cookie Options
Cookie attributes can be set globally by setting properties of the `$.cookie.defaults` object or individually for each call to `$.cookie()` by passing a plain object to the options argument. Per-call options override the default options.
### expires
expires: 365
Define lifetime of the cookie. Value can be a `Number` which will be interpreted as days from time of creation or a `Date` object. If omitted, the cookie becomes a session cookie.
### path
path: '/'
Define the path where the cookie is valid. *By default the path of the cookie is the path of the page where the cookie was created (standard browser behavior).* If you want to make it available for instance across the entire domain use `path: '/'`. Default: path of page where the cookie was created.
**Note regarding Internet Explorer:**
> Due to an obscure bug in the underlying WinINET InternetGetCookie implementation, IE’s document.cookie will not return a cookie if it was set with a path attribute containing a filename.
(From [Internet Explorer Cookie Internals (FAQ)](http://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx))
This means one cannot set a path using `path: window.location.pathname` in case such pathname contains a filename like so: `/check.html` (or at least, such cookie cannot be read correctly).
### domain
domain: 'example.com'
Define the domain where the cookie is valid. Default: domain of page where the cookie was created.
### secure
secure: true
If true, the cookie transmission requires a secure protocol (https). Default: `false`.
## Converters
Provide a conversion function as optional last argument for reading, in order to change the cookie's value
to a different representation on the fly.
Example for parsing a value into a number:
```javascript
$.cookie('foo', '42');
$.cookie('foo', Number); // => 42
```
Dealing with cookies that have been encoded using `escape` (3rd party cookies):
```javascript
$.cookie.raw = true;
$.cookie('foo', unescape);
```
You can pass an arbitrary conversion function.
## Contributing
Check out the [Contributing Guidelines](CONTRIBUTING.md)
## Authors
[Klaus Hartl](https://github.com/carhartl)
+18
View File
@@ -0,0 +1,18 @@
{
"name": "jquery.cookie",
"version": "1.4.1",
"main": [
"src/jquery.cookie.js"
],
"dependencies": {
"jquery": ">=1.2"
},
"ignore": [
"test",
".*",
"*.json",
"*.md",
"*.txt",
"Gruntfile.js"
]
}
+14
View File
@@ -0,0 +1,14 @@
{
"name": "jquery.cookie",
"repo": "carhartl/jquery-cookie",
"description": "A simple, lightweight jQuery plugin for reading, writing and deleting cookies",
"version": "1.4.1",
"keywords": [],
"dependencies": {},
"development": {},
"license": "MIT",
"main": "src/jquery.cookie.js",
"scripts": [
"src/jquery.cookie.js"
]
}
+32
View File
@@ -0,0 +1,32 @@
{
"name": "cookie",
"version": "1.4.1",
"title": "jQuery Cookie",
"description": "A simple, lightweight jQuery plugin for reading, writing and deleting cookies.",
"author": {
"name": "Klaus Hartl",
"url": "https://github.com/carhartl"
},
"maintainers": [
{
"name": "Klaus Hartl",
"url": "https://github.com/carhartl"
},
{
"name": "Fagner Martins",
"url": "https://github.com/FagnerMartinsBrack"
}
],
"licenses": [
{
"type": "MIT",
"url": "https://raw.github.com/carhartl/jquery-cookie/master/MIT-LICENSE.txt"
}
],
"dependencies": {
"jquery": ">=1.2"
},
"bugs": "https://github.com/carhartl/jquery-cookie/issues",
"homepage": "https://github.com/carhartl/jquery-cookie",
"docs": "https://github.com/carhartl/jquery-cookie#readme"
}
+50
View File
@@ -0,0 +1,50 @@
{
"name": "jquery.cookie",
"version": "1.4.1",
"description": "A simple, lightweight jQuery plugin for reading, writing and deleting cookies.",
"main": "src/jquery.cookie.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "grunt"
},
"repository": {
"type": "git",
"url": "git://github.com/carhartl/jquery-cookie.git"
},
"author": "Klaus Hartl",
"license": "MIT",
"gitHead": "bd3c9713222bace68d25fe2128c0f8633cad1269",
"readmeFilename": "README.md",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-qunit": "~0.2.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-compare-size": "~0.4.0",
"grunt-saucelabs": "~7.0.0",
"grunt-contrib-connect": "~0.7.1",
"gzip-js": "~0.3.0"
},
"volo": {
"url": "https://raw.github.com/carhartl/jquery-cookie/v{version}/src/jquery.cookie.js"
},
"jspm": {
"main": "jquery.cookie",
"files": ["src/jquery.cookie.js"],
"buildConfig": {
"uglify": true
}
},
"jam": {
"dependencies": {
"jquery": ">=1.2"
},
"main": "src/jquery.cookie.js",
"include": [
"src/jquery.cookie.js"
]
}
}
+114
View File
@@ -0,0 +1,114 @@
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2006, 2014 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD (Register as an anonymous module)
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (arguments.length > 1 && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setMilliseconds(t.getMilliseconds() + days * 864e+5);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {},
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
cookies = document.cookie ? document.cookie.split('; ') : [],
i = 0,
l = cookies.length;
for (; i < l; i++) {
var parts = cookies[i].split('='),
name = decode(parts.shift()),
cookie = parts.join('=');
if (key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};
}));
@@ -0,0 +1,60 @@
/*
* Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery/easing
*
* Adds compatibility for applications that use the pre 1.2 easing names
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
/* globals jQuery */
(function($){
$.extend( $.easing, {
easeIn: function (x, t, b, c, d) {
return $.easing.easeInQuad(x, t, b, c, d);
},
easeOut: function (x, t, b, c, d) {
return $.easing.easeOutQuad(x, t, b, c, d);
},
easeInOut: function (x, t, b, c, d) {
return $.easing.easeInOutQuad(x, t, b, c, d);
},
expoin: function(x, t, b, c, d) {
return $.easing.easeInExpo(x, t, b, c, d);
},
expoout: function(x, t, b, c, d) {
return $.easing.easeOutExpo(x, t, b, c, d);
},
expoinout: function(x, t, b, c, d) {
return $.easing.easeInOutExpo(x, t, b, c, d);
},
bouncein: function(x, t, b, c, d) {
return $.easing.easeInBounce(x, t, b, c, d);
},
bounceout: function(x, t, b, c, d) {
return $.easing.easeOutBounce(x, t, b, c, d);
},
bounceinout: function(x, t, b, c, d) {
return $.easing.easeInOutBounce(x, t, b, c, d);
},
elasin: function(x, t, b, c, d) {
return $.easing.easeInElastic(x, t, b, c, d);
},
elasout: function(x, t, b, c, d) {
return $.easing.easeOutElastic(x, t, b, c, d);
},
elasinout: function(x, t, b, c, d) {
return $.easing.easeInOutElastic(x, t, b, c, d);
},
backin: function(x, t, b, c, d) {
return $.easing.easeInBack(x, t, b, c, d);
},
backout: function(x, t, b, c, d) {
return $.easing.easeOutBack(x, t, b, c, d);
},
backinout: function(x, t, b, c, d) {
return $.easing.easeInOutBack(x, t, b, c, d);
}
});
})(jQuery);
+168
View File
@@ -0,0 +1,168 @@
/*
* jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/
* Open source under the BSD License.
* Copyright © 2008 George McGinley Smith
* All rights reserved.
* https://raw.github.com/gdsmith/jquery.easing/master/LICENSE
*/
/* globals jQuery, define, module, require */
(function (factory) {
if (typeof define === "function" && define.amd) {
define(['jquery'], function ($) {
return factory($);
});
} else if (typeof module === "object" && typeof module.exports === "object") {
module.exports = factory(require('jquery'));
} else {
factory(jQuery);
}
})(function($){
// Preserve the original jQuery "swing" easing as "jswing"
if (typeof $.easing !== 'undefined') {
$.easing['jswing'] = $.easing['swing'];
}
var pow = Math.pow,
sqrt = Math.sqrt,
sin = Math.sin,
cos = Math.cos,
PI = Math.PI,
c1 = 1.70158,
c2 = c1 * 1.525,
c3 = c1 + 1,
c4 = ( 2 * PI ) / 3,
c5 = ( 2 * PI ) / 4.5;
// x is the fraction of animation progress, in the range 0..1
function bounceOut(x) {
var n1 = 7.5625,
d1 = 2.75;
if ( x < 1/d1 ) {
return n1*x*x;
} else if ( x < 2/d1 ) {
return n1*(x-=(1.5/d1))*x + .75;
} else if ( x < 2.5/d1 ) {
return n1*(x-=(2.25/d1))*x + .9375;
} else {
return n1*(x-=(2.625/d1))*x + .984375;
}
}
$.extend( $.easing, {
def: 'easeOutQuad',
swing: function (x) {
return $.easing[$.easing.def](x);
},
easeInQuad: function (x) {
return x * x;
},
easeOutQuad: function (x) {
return 1 - ( 1 - x ) * ( 1 - x );
},
easeInOutQuad: function (x) {
return x < 0.5 ?
2 * x * x :
1 - pow( -2 * x + 2, 2 ) / 2;
},
easeInCubic: function (x) {
return x * x * x;
},
easeOutCubic: function (x) {
return 1 - pow( 1 - x, 3 );
},
easeInOutCubic: function (x) {
return x < 0.5 ?
4 * x * x * x :
1 - pow( -2 * x + 2, 3 ) / 2;
},
easeInQuart: function (x) {
return x * x * x * x;
},
easeOutQuart: function (x) {
return 1 - pow( 1 - x, 4 );
},
easeInOutQuart: function (x) {
return x < 0.5 ?
8 * x * x * x * x :
1 - pow( -2 * x + 2, 4 ) / 2;
},
easeInQuint: function (x) {
return x * x * x * x * x;
},
easeOutQuint: function (x) {
return 1 - pow( 1 - x, 5 );
},
easeInOutQuint: function (x) {
return x < 0.5 ?
16 * x * x * x * x * x :
1 - pow( -2 * x + 2, 5 ) / 2;
},
easeInSine: function (x) {
return 1 - cos( x * PI/2 );
},
easeOutSine: function (x) {
return sin( x * PI/2 );
},
easeInOutSine: function (x) {
return -( cos( PI * x ) - 1 ) / 2;
},
easeInExpo: function (x) {
return x === 0 ? 0 : pow( 2, 10 * x - 10 );
},
easeOutExpo: function (x) {
return x === 1 ? 1 : 1 - pow( 2, -10 * x );
},
easeInOutExpo: function (x) {
return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?
pow( 2, 20 * x - 10 ) / 2 :
( 2 - pow( 2, -20 * x + 10 ) ) / 2;
},
easeInCirc: function (x) {
return 1 - sqrt( 1 - pow( x, 2 ) );
},
easeOutCirc: function (x) {
return sqrt( 1 - pow( x - 1, 2 ) );
},
easeInOutCirc: function (x) {
return x < 0.5 ?
( 1 - sqrt( 1 - pow( 2 * x, 2 ) ) ) / 2 :
( sqrt( 1 - pow( -2 * x + 2, 2 ) ) + 1 ) / 2;
},
easeInElastic: function (x) {
return x === 0 ? 0 : x === 1 ? 1 :
-pow( 2, 10 * x - 10 ) * sin( ( x * 10 - 10.75 ) * c4 );
},
easeOutElastic: function (x) {
return x === 0 ? 0 : x === 1 ? 1 :
pow( 2, -10 * x ) * sin( ( x * 10 - 0.75 ) * c4 ) + 1;
},
easeInOutElastic: function (x) {
return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ?
-( pow( 2, 20 * x - 10 ) * sin( ( 20 * x - 11.125 ) * c5 )) / 2 :
pow( 2, -20 * x + 10 ) * sin( ( 20 * x - 11.125 ) * c5 ) / 2 + 1;
},
easeInBack: function (x) {
return c3 * x * x * x - c1 * x * x;
},
easeOutBack: function (x) {
return 1 + c3 * pow( x - 1, 3 ) + c1 * pow( x - 1, 2 );
},
easeInOutBack: function (x) {
return x < 0.5 ?
( pow( 2 * x, 2 ) * ( ( c2 + 1 ) * 2 * x - c2 ) ) / 2 :
( pow( 2 * x - 2, 2 ) *( ( c2 + 1 ) * ( x * 2 - 2 ) + c2 ) + 2 ) / 2;
},
easeInBounce: function (x) {
return 1 - bounceOut( 1 - x );
},
easeOutBounce: bounceOut,
easeInOutBounce: function (x) {
return x < 0.5 ?
( 1 - bounceOut( 1 - 2 * x ) ) / 2 :
( 1 + bounceOut( 2 * x - 1 ) ) / 2;
}
});
return $;
});
+1
View File
@@ -0,0 +1 @@
!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){function e(n){var e=7.5625,t=2.75;return n<1/t?e*n*n:n<2/t?e*(n-=1.5/t)*n+.75:n<2.5/t?e*(n-=2.25/t)*n+.9375:e*(n-=2.625/t)*n+.984375}void 0!==n.easing&&(n.easing.jswing=n.easing.swing);var t=Math.pow,u=Math.sqrt,r=Math.sin,i=Math.cos,a=Math.PI,o=1.70158,c=1.525*o,s=2*a/3,f=2*a/4.5;return n.extend(n.easing,{def:"easeOutQuad",swing:function(e){return n.easing[n.easing.def](e)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-i(n*a/2)},easeOutSine:function(n){return r(n*a/2)},easeInOutSine:function(n){return-(i(a*n)-1)/2},easeInExpo:function(n){return 0===n?0:t(2,10*n-10)},easeOutExpo:function(n){return 1===n?1:1-t(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2},easeInElastic:function(n){return 0===n?0:1===n?1:-t(2,10*n-10)*r((10*n-10.75)*s)},easeOutElastic:function(n){return 0===n?0:1===n?1:t(2,-10*n)*r((10*n-.75)*s)+1},easeInOutElastic:function(n){return 0===n?0:1===n?1:n<.5?-t(2,20*n-10)*r((20*n-11.125)*f)/2:t(2,-20*n+10)*r((20*n-11.125)*f)/2+1},easeInBack:function(n){return 2.70158*n*n*n-o*n*n},easeOutBack:function(n){return 1+2.70158*t(n-1,3)+o*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*(7.189819*n-c)/2:(t(2*n-2,2)*((c+1)*(2*n-2)+c)+2)/2},easeInBounce:function(n){return 1-e(1-n)},easeOutBounce:e,easeInOutBounce:function(n){return n<.5?(1-e(1-2*n))/2:(1+e(2*n-1))/2}}),n});
+42
View File
@@ -0,0 +1,42 @@
# equalize.js
The jQuery plugin for equalizing the height or width of elements. [See it in action »](http://tsvensen.github.com/equalize.js).
## How to Use
Call the plugin on the parent of the elements to equalize their height.
Equalize will accept any of the <a target="_blank" href="http://api.jquery.com/category/dimensions/">jQuery Dimension</a> methods: height, outerHeight, innerHeight, width, outerWidth, innerWidth.
<pre>$('#height-example').equalize();</pre>
## Advanced Usage
Equalize will now accept a settings object to get the "minimum max dimension". By setting reset to true the height/width will be removed before determining the max.
<pre>$('.parent').equalize({reset: true}); // default to height
$('.parent').equalize({equalize: 'width', reset: true});</pre>
This advanced usage is for dynamic instances where equalize is ran after elements are added or removed to maintain minimum max height or width.
Equalize the .parent's child element. See @larsbo's <a href="http://jsfiddle.net/4QTNP/3/">example</a>.
<pre>$('.parent').equalize({children: 'p'}); // equalize height of paragraphs within .parent</pre>
## Examples
<pre>$('.parent').equalize('height'); // default, same as above
$('.parent').equalize('outerHeight');
$('.parent').equalize('innerHeight');
$('.parent').equalize('width');
$('.parent').equalize('outerWidth');
$('.parent').equalize('innerWidth');</pre>
# Legal
Author & copyright (c) 2012: [Tim Svensen](http://timsvensen.com)
Dual MIT & GPLv2 license
+38
View File
@@ -0,0 +1,38 @@
{
"name": "equalize",
"version": "1.0.1",
"description": "jQuery plugin for equalizing the height or width of your elements",
"homepage": "http://tsvensen.github.io/equalize.js/",
"keywords": [
"ui",
"equalize",
"equal",
"height",
"width",
"layout"
],
"author": {
"name": "Tim Svensen",
"url": "http://timsvensen.com"
},
"licenses": [{
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
}, {
"type": "GPLv2",
"url": "http://opensource.org/licenses/GPL-2.0"
}],
"main": [
"js/equalize.js",
"js/equalize.min.js"
],
"dependencies": {
"jquery": ">=1.4.x"
},
"ignore": [
"**/.*",
"index.html",
"css",
"js/libs/*"
]
}
@@ -0,0 +1,35 @@
{
"name": "equalize.js",
"title": "equalize",
"description": "The jQuery plugin for equalizing the height or width of your elements",
"keywords": [
"ui",
"equalize",
"equal",
"height",
"width",
"layout"
],
"version": "1.0.1",
"author": {
"name": "Tim Svensen",
"url": "http://timsvensen.com"
},
"licenses": [{
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
}, {
"type": "GPLv2",
"url": "http://opensource.org/licenses/GPL-2.0"
}],
"homepage": "https://github.com/tsvensen/equalize.js",
"demo": "http://tsvensen.github.com/equalize.js/",
"dependencies": {
"jquery": ">=1.4.x"
}
}
+68
View File
@@ -0,0 +1,68 @@
/**
* equalize.js
* Author & copyright (c) 2012: Tim Svensen
* Dual MIT & GPL license
*
* Page: http://tsvensen.github.com/equalize.js
* Repo: https://github.com/tsvensen/equalize.js/
*
* The jQuery plugin for equalizing the height or width of elements.
*
* Equalize will accept any of the jQuery Dimension methods:
* height, outerHeight, innerHeight,
* width, outerWidth, innerWidth.
*
* EXAMPLE
* $('.parent').equalize(); // defaults to 'height'
* $('.parent').equalize('width'); // equalize the widths
*
* ADVANCED EXAMPLES
* Get the minimum max dimension by removing the existing height/width
* $('.parent').equalize({reset: true}); // equalize height by default, remove existing height, then determin max
* $('.parent').equalize({equalize: 'width', reset: true}); // equalize width, remove existing width, then determin max
*
* Equalize internal child elements
* From @larsbo : http://jsfiddle.net/4QTNP/3/
* $('.parent').equalize({children: 'p'}); // equalize height of paragraphs within .parent
*/
;(function($) {
$.fn.equalize = function(options) {
var $containers = this, // this is the jQuery object
children = false,
reset = false,
equalize,
type;
// when options are an object
if ($.isPlainObject(options)) {
equalize = options.equalize || 'height';
children = options.children || false;
reset = options.reset || false;
} else { // otherwise, a string was passed in or default to height
equalize = options || 'height';
}
if (!$.isFunction($.fn[equalize])) { return false; }
// determine if the height or width is being equalized
type = (equalize.indexOf('eight') > 0) ? 'height' : 'width';
return $containers.each(function() {
// when children exist, equalize the passed in child elements, otherwise equalize the children
var $children = (children) ? $(this).find(children) : $(this).children(),
max = 0; // reset for each container
$children.each(function() {
var $element = $(this),
value;
if (reset) { $element.css(type, ''); } // remove existing height/width dimension
value = $element[equalize](); // call height(), outerHeight(), etc.
if (value > max) { max = value; } // update max
});
$children.css(type, max +'px'); // add CSS to children
});
};
}(jQuery));
+9
View File
@@ -0,0 +1,9 @@
/*!
* equalize.js
* Author & copyright (c) 2012: Tim Svensen
* Dual MIT & GPL license
*
* Page: http://tsvensen.github.com/equalize.js
* Repo: https://github.com/tsvensen/equalize.js/
*/
!function(i){i.fn.equalize=function(e){var n,t,h=!1,c=!1;return i.isPlainObject(e)?(n=e.equalize||"height",h=e.children||!1,c=e.reset||!1):n=e||"height",i.isFunction(i.fn[n])?(t=0<n.indexOf("eight")?"height":"width",this.each(function(){var e=h?i(this).find(h):i(this).children(),s=0;e.each(function(){var e=i(this);c&&e.css(t,""),e=e[n](),e>s&&(s=e)}),e.css(t,s+"px")})):!1}}(jQuery);
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013 yeikos
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.
+199
View File
@@ -0,0 +1,199 @@
jQuery.history v1.1.0
==================================================
What is it?
--------------------------------------
It's a jQuery plugin that lets manage the browser history using history.pushState (HTML5) and cross-browser compatibility (including IE6).
Demo online
--------------------------------------
http://fiddle.jshell.net/yeikos/rcZWb/show/light
Changelog
--------------------------------------
**v1.1.0 - 20/07/13**
- New methods: `url`, `type`.
- New event: `pushed`.
- Bug fix in `load` event.
**v1.0.1 - 07/05/13**
- Bug fix in `load` event.
**v1.0.0 - 28/01/13**
- Initial version.
Example
--------------------------------------
<!DOCTYPE html><html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/yeikos/jquery.history/jquery.history.js"></script>
<script>
$(function() {
$.history.on('load change push pushed', function(event, url, type) {
alert(event.type + ': ' + url);
}).listen('hash');
$('body').on('click', 'a', function(event) {
$.history.push($(this).attr('href'));
event.preventDefault();
});
$('button').click(function() {
location.reload();
});
});
</script>
</head>
<body>
<ul>
<li><a href="/one">one</a></li>
<li><a href="/two">two</a></li>
<li><a href="/three">three</a></li>
<li><a href="/four">four</a></li>
</ul>
<button>refresh</button>
</body>
</html>
Events
--------------------------------------
**load**
> Fired when the listen is started.
**push**
> Fired before `jQuery.history.push` is called (it can be prevented).
**pushed**
> Fired after `jQuery.history.push` is called.
**change**
> Fired when it happens a change in browser history (back, forward, go).
All events are trigger passing two arguments (address, listen type).
API Methods
--------------------------------------
**jQuery.history.push(address)**
_address: string._
> Add a new address to history (first it is needed call to `listen`).
returns `jQuery.history`.
***
**jQuery.history.listen()**
> Starts a automatic listening in base to browser support and in this order: pathname, hash or hash interval.
returns `jQuery.history`.
**jQuery.history.listen('pathname')**
> Starts a listening using `pathname` (pushState).
returns `jQuery.history`.
**jQuery.history.listen('hash')**
> Starts a listening using `hash` (onhaschange). If browser doesn't supports it, then it will use a emulation (hash interval).
returns `jQuery.history`.
**jQuery.history.listen('hash', interval)**
_interval: interval delay (number). If interval is `true`, it will convert to jQuery.history.config.interval._
> Starts a listening using an emulation (hash interval).
returns `jQuery.history`.
***
**jQuery.history.unlisten()**
> Undoes all changes done by `jQuery.history.listen`.
returns `jQuery.history`.
***
**jQuery.history.url()**
> Get the current URL.
returns `string`.
***
**jQuery.history.type()**
> Get the current listening type (hash, pathname or null).
returns `string` or `null`.
***
**jQuery.history.on**
> http://api.jquery.com/on/
returns `jQuery.history`.
***
**jQuery.history.off**
> http://api.jquery.com/off/
returns `jQuery.history`.
***
**jQuery.history.trigger**
> http://api.jquery.com/trigger/
returns `jQuery.history`.
+57
View File
@@ -0,0 +1,57 @@
<!DOCTYPE html><html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/yeikos/jquery.history/jquery.history.js"></script>
<script>
$(function() {
$.history.on('load change push pushed', function(event, url, type) {
alert(event.type + ': ' + url);
}).listen('hash');
$('body').on('click', 'a', function(event) {
$.history.push($(this).attr('href'));
event.preventDefault();
});
$('button').click(function() {
location.reload();
});
});
</script>
</head>
<body>
<ul>
<li><a href="/one">one</a></li>
<li><a href="/two">two</a></li>
<li><a href="/three">three</a></li>
<li><a href="/four">four</a></li>
</ul>
<button>refresh</button>
</body>
</html>
@@ -0,0 +1,6 @@
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?section=$1 [L,QSA]
@@ -0,0 +1 @@
Put this files (index.php, .htaccess) into root folder of HTTP server.
@@ -0,0 +1,95 @@
<!DOCTYPE html><html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/yeikos/jquery.history/jquery.history.js"></script>
<script>
$(function() {
var type;
$.history.on('load change', function(event, url, type) {
if (event.type === 'change' || (event.type === 'load' && type === 'hash'))
request(url);
}).listen();
type = $.history.type();
if (type === 'hash' && location.pathname.length > 1) {
// /pathname -> /#/pathname
location.href = '/#' + location.pathname;
} else if (type === 'pathname' && location.hash.substr(1, 1) === '/') {
// /#/pathname -> /pathname
location.href = location.hash.substr(1);
}
// dom listener
$('body').on('click', 'a', function(event) {
var url = $(this).attr('href');
$.history.push(url);
request(url);
event.preventDefault();
});
// request
function request(url) {
$('#output').text(url);
}
});
</script>
</head>
<body>
<div>time: <?php echo time(); ?></div>
<ul>
<li><a href="/one">one</a></li>
<li><a href="/two">two</a></li>
<li><a href="/three">three</a></li>
<li><a href="/four">four</a></li>
</ul>
<div id="output">
<?php
echo isset($_GET['section']) ? htmlspecialchars('/' . $_GET['section']) : '';
?>
</div>
</body>
</html>
+450
View File
@@ -0,0 +1,450 @@
/*!
* @name jQuery.history v1.1.0
* @author yeikos
* @repository https://github.com/yeikos/jquery.history
* @dependencies jQuery 1.7.0+
* Copyright 2013 yeikos - MIT license
* https://raw.github.com/yeikos/js.merge/master/LICENSE
*/
;(function($, undefined) {
var Public = function(url) {
var event = $.Event('push');
Public.context.trigger(event, [url, _type]);
if (event.isDefaultPrevented())
return Public;
// Establecemos la nueva dirección siempre y cuando haya cambiado
if (_type === 'pathname') {
if (_last !== url)
window.history.pushState({}, null, _last = url);
} else if (_type === 'hash') {
if (_last !== url) {
location.hash = _last = url;
// Si se trata de IE6/IE7
if (_ie67) {
// El `iframe` ha de encontrarse en el documento
if (!$('#jQueryHistory').length)
throw new Error('jQuery.' + publicName + '.push: iframe not found.');
// Si es la primera vez
if (_firstTime) {
_firstTime = 0;
// Añadimos primero al historial una entrada vacía para que el usuario
// pueda volver al inicio de página, de lo contrario saldrá fuera de ella
_iframe.contentWindow.document.open().close();
_iframe.contentWindow.location.hash = '/';
}
// Cambiamos la dirección del `iframe` para simular el historial
_iframe.contentWindow.document.open().close();
_iframe.contentWindow.location.hash = url;
}
}
} else {
// Es necesario que se haya iniciado una escucha activa para establecer una dirección
throw new Error('jQuery.' + publicName + '.push: the listening is not active.');
}
Public.context.trigger('pushed', [url, _type]);
return Public;
}, publicName = 'history';
// Contexto donde se centralizan los eventos (`load`, `change`, `push`, `pushed`)
Public.context = $({});
// Accesos directos a los métodos `on`, `off` y `trigger`
$.each(['on', 'off', 'trigger'], function(index, method) {
Public[method] = function() {
Public.context[method].apply(Public.context, arguments);
return Public;
};
});
// Acceso directo a la función principal
Public.push = Public;
// Obtiene el tipo de escucha actual (`pathname`, `hash`, `null`)
Public.type = function() {
return _type;
};
// Obtiene la dirección actual según el tipo de escucha
Public.url = function(_location) {
_location = _location || location;
if (_type === null)
throw new Error ('jQuery.' + publicName + '.url: the listening has not started.');
if (_type === 'pathname')
return _location.pathname + _location.search + _location.hash;
if (_location.hash.length > 1) {
spl = _location.href.split('#');
spl.shift();
spl = spl.join('#');
return spl;
}
return '';
};
// Inicializa una escucha en el documento para intervenir los cambios del historial y poder establecer direcciones
Public.listen = function(type, interval) {
// Desactivamos posibles escuchas anteriores
Public.unlisten();
var size = arguments.length;
// Detección automática del modo de escucha
if (!size || type === 'auto') {
type = _pushState ? 'pathname' : 'hash';
size = 1;
} else if (type !== 'pathname' && type !== 'hash') {
throw new Error('jQuery.' + publicName + '.listen: type is not valid.');
}
// Si el modo de escucha es `hash`
if (type === 'hash') {
// Si no hay soporte para `onhaschange` y no se especificó un intervalo, o el intervalo es `true`
if ((!_onhashchange && size === 1) || interval === true) {
// Establecemos el intervalo de la configuración
interval = Public.config.interval;
size = 2;
}
// Si el intervalo fue fijado comprobamos si su valor es correcto
if (size === 2 && (isNaN(interval) || interval < 1))
throw new Error('jQuery.' + publicName + '.listen: interval delay is not valid.');
}
// Si el modo de escucha es `pathname`
if ((_type = type) === 'pathname') {
// Ha de haber soporte nativo
if (!_pushState)
throw new Error('jQuery.' + publicName + '.listen: this browser has not support to pushState.');
// Cuando haya un cambio en la dirección URL
$(window).on('popstate.history', function(event) {
// Si se trata de un evento real originado internamente por el navegador
// y la dirección ha cambiado emitimos el evento `change`
if (event.originalEvent && event.originalEvent.state && _last !== location.pathname)
Public.trigger('change', [_last = Public.url(), 'pathname']);
});
if (location.pathname.length > 1)
Public.trigger('load', [Public.url(), 'pathname']);
} else {
// Si hay soporte nativo de `onhashchange` y no se especificó el argumento intervalo
if (_onhashchange && !interval) {
// Hacemos uso del evento nativo `hashchange`
$(window).on('hashchange.history', function(event) {
var hash = Public.url();
if (_last !== hash)
Public.trigger('change', [_last = hash, 'hash']);
});
// Si no hay soporte o simplemente se especificó el argumento intervalo
} else {
// Si no se ha detecto si el navegador es IE6/IE7
if (_ie67 === undefined)
// Realizamos la comprobación una sola vez
_ie67 = Public.ieCondition('lte IE 7');
// Si se trata de IE6/IE7
if (_ie67) {
// Es necesario que se encuentre disponible `body` (dom ready)
if (!(size = $('body')).length)
throw new Error('jQuery.' + publicName + '.listen: document is not ready.');
// Creamos un `iframe` con el que emular el historial
_iframe = $('<iframe id="jQueryHistory" style="display:none" src="javascript:void(0);" />').appendTo(size)[0];
var win = _iframe.contentWindow;
// Si el documento ya contiene una dirección, la establecemos en el `iframe`
if (location.hash.length > 1) {
win.document.open().close();
win.location.hash = '#' + Public.url();
}
// Emulamos el evento `haschange` mediante un intervalo
_interval = setInterval(function() {
// Si la dirección actual es diferente a la del `iframe`
if ((_last = '#' + Public.url()) !== ('#' + Public.url(win.location))) {
// Actualizamos la dirección del `iframe`
win.document.open().close();
win.location.hash = _last;
Public.trigger('change', [_last.substr(1), 'hash']);
}
}, interval);
} else {
// Emulamos el evento `haschange` mediante un intervalo
_last = Public.url();
_interval = setInterval(function() {
var hash = Public.url();
if (_last !== hash)
Public.trigger('change', [_last = hash, 'hash']);
}, interval);
}
}
// Si ya se encuentra un `hash` definido en el documento
if (location.hash.length > 1) {
// Emitimos el evento `load`
Public.trigger('load', [Public.url(), 'hash']);
}
}
return Public;
};
// Desactiva cualquier tipo de escucha realizada por `listen`
Public.unlisten = function() {
_type = _last = _iframe = null;
$(window).off('popstate.history hashchange.history');
$('#jQueryHistory').remove();
clearInterval(_interval);
return Public;
};
// Obtiene el soporte de ciertas funcionalidades del navegador
Public.getSupports = function(type) {
var result = {},
size = arguments.length,
docmode;
if (!size || type === 'pushState')
result.pushState = ('pushState' in window.history);
if (!size || type === 'onhashchange')
result.onhashchange = ('onhashchange' in window && ((docmode = document.documentMode) === undefined || docmode > 7 ));
if (size)
return result[type];
return result;
};
// Comprueba si el navegador corresponde con las versiones de IE especificadas
Public.ieCondition = function(input) {
var id = Math.random().toString(36).substring(2),
name = '_ie_condition_' + id,
$msie, result;
$msie = $('<span><!--[if ' + $('<i/>').html(input).text() + ']><script type="text/javascript">window.' + name + '=true;</script><![endif]--></span>').appendTo(document.body);
result = (window[name] === true);
try {
delete window[name];
} catch(e) {
window[name] = undefined;
}
$msie.remove();
return result;
};
// Soporte de funcionalidades del navegador
Public.supports = Public.getSupports();
// Configuración
Public.config = {
// Retraso del intervalo en la emulación del evento `haschange`
interval: 100
};
// Accesos directos a los soportes
var _pushState = Public.supports.pushState,
_onhashchange = Public.supports.onhashchange,
// Versión IE6/7
_ie67 = Public.ieCondition('lte IE 7'),
// Tipo actual de escucha
_type = null,
// Intervalo utilizado por la emulación del evento `hashchange`
_interval,
// Iframe utilizado para generar el historial en IE6/IE7
_iframe,
// Marcador utilizado por IE6/IE7
_firstTime = 1,
// Última dirección establecida
_last;
// Acceso desde al exterior
$[publicName] = Public;
})(jQuery);
+3
View File
@@ -0,0 +1,3 @@
/*! jQuery.history v1.1.0 | Copyright 2013 yeikos - MIT license | https://github.com/yeikos/jquery.history */
;(function(e,t){var n=function(t){var i=e.Event("push");n.context.trigger(i,[t,u]);if(i.isDefaultPrevented())return n;if(u==="pathname"){if(c!==t)window.history.pushState({},null,c=t)}else if(u==="hash"){if(c!==t){location.hash=c=t;if(o){if(!e("#jQueryHistory").length)throw new Error("jQuery."+r+".push: iframe not found.");if(l){l=0;f.contentWindow.document.open().close();f.contentWindow.location.hash="/"}f.contentWindow.document.open().close();f.contentWindow.location.hash=t}}}else{throw new Error("jQuery."+r+".push: the listening is not active.")}n.context.trigger("pushed",[t,u]);return n},r="history";n.context=e({});e.each(["on","off","trigger"],function(e,t){n[t]=function(){n.context[t].apply(n.context,arguments);return n}});n.push=n;n.type=function(){return u};n.url=function(e){e=e||location;if(u===null)throw new Error("jQuery."+r+".url: the listening has not started.");if(u==="pathname")return e.pathname+e.search+e.hash;if(e.hash.length>1){spl=e.href.split("#");spl.shift();spl=spl.join("#");return spl}return""};n.listen=function(l,h){n.unlisten();var p=arguments.length;if(!p||l==="auto"){l=i?"pathname":"hash";p=1}else if(l!=="pathname"&&l!=="hash"){throw new Error("jQuery."+r+".listen: type is not valid.")}if(l==="hash"){if(!s&&p===1||h===true){h=n.config.interval;p=2}if(p===2&&(isNaN(h)||h<1))throw new Error("jQuery."+r+".listen: interval delay is not valid.")}if((u=l)==="pathname"){if(!i)throw new Error("jQuery."+r+".listen: this browser has not support to pushState.");e(window).on("popstate.history",function(e){if(e.originalEvent&&e.originalEvent.state&&c!==location.pathname)n.trigger("change",[c=n.url(),"pathname"])});if(location.pathname.length>1)n.trigger("load",[n.url(),"pathname"])}else{if(s&&!h){e(window).on("hashchange.history",function(e){var t=n.url();if(c!==t)n.trigger("change",[c=t,"hash"])})}else{if(o===t)o=n.ieCondition("lte IE 7");if(o){if(!(p=e("body")).length)throw new Error("jQuery."+r+".listen: document is not ready.");f=e('<iframe id="jQueryHistory" style="display:none" src="javascript:void(0);" />').appendTo(p)[0];var d=f.contentWindow;if(location.hash.length>1){d.document.open().close();d.location.hash="#"+n.url()}a=setInterval(function(){if((c="#"+n.url())!=="#"+n.url(d.location)){d.document.open().close();d.location.hash=c;n.trigger("change",[c.substr(1),"hash"])}},h)}else{c=n.url();a=setInterval(function(){var e=n.url();if(c!==e)n.trigger("change",[c=e,"hash"])},h)}}if(location.hash.length>1){n.trigger("load",[n.url(),"hash"])}}return n};n.unlisten=function(){u=c=f=null;e(window).off("popstate.history hashchange.history");e("#jQueryHistory").remove();clearInterval(a);return n};n.getSupports=function(e){var n={},r=arguments.length,i;if(!r||e==="pushState")n.pushState="pushState"in window.history;if(!r||e==="onhashchange")n.onhashchange="onhashchange"in window&&((i=document.documentMode)===t||i>7);if(r)return n[e];return n};n.ieCondition=function(n){var r=Math.random().toString(36).substring(2),i="_ie_condition_"+r,s,o;s=e("<span><!--[if "+e("<i/>").html(n).text()+']><script type="text/javascript">window.'+i+"=true;</script><![endif]--></span>").appendTo(document.body);o=window[i]===true;try{delete window[i]}catch(u){window[i]=t}s.remove();return o};n.supports=n.getSupports();n.config={interval:100};var i=n.supports.pushState,s=n.supports.onhashchange,o=n.ieCondition("lte IE 7"),u=null,a,f,l=1,c;e[r]=n})(jQuery);
+24
View File
@@ -0,0 +1,24 @@
<!DOCTYPE html><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jQuery.history v1.1.0</title>
<link rel="stylesheet" href="qunit/qunit.css" />
<script src="qunit/qunit.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="../jquery.history.js"></script>
<script src="tests.js"></script>
</head>
<body>
<div id="qunit"></div>
</body>
</html>
+244
View File
@@ -0,0 +1,244 @@
/**
* QUnit v1.11.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699a4;
background-color: #0d3349;
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
#qunit-header a {
text-decoration: none;
color: #c2ccd1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #fff;
}
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 .5em 0 .1em;
}
#qunit-banner {
height: 5px;
}
#qunit-testrunner-toolbar {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
overflow: hidden;
}
#qunit-userAgent {
padding: 0.5em 0 0.5em 2.5em;
background-color: #2b81af;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
#qunit-modulefilter-container {
float: right;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #fff;
list-style-position: inside;
}
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
display: none;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li a {
padding: 0.5em;
color: #c2ccd1;
text-decoration: none;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests li .runtime {
float: right;
font-size: smaller;
}
.qunit-assert-list {
margin-top: 0.5em;
padding: 0.5em;
background-color: #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.qunit-collapsed {
display: none;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 .5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
background-color: #e0f2be;
color: #374e0c;
text-decoration: none;
}
#qunit-tests ins {
background-color: #ffcaca;
color: #500;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: black; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #fff;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3c510c;
background-color: #fff;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: green; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/** Result */
#qunit-testresult {
padding: 0.5em 0.5em 0.5em 2.5em;
color: #2b81af;
background-color: #D2E0E6;
border-bottom: 1px solid white;
}
#qunit-testresult .module-name {
font-weight: bold;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}
File diff suppressed because it is too large Load Diff
+250
View File
@@ -0,0 +1,250 @@
var pathname = location.pathname + location.search + location.hash;
test('$.history.context', function() {
ok($.history.context instanceof jQuery && $.history.context.length === 1);
});
test('$.history.on', 2, function() {
$.history.on('test', function(event, a, b) {
ok(event instanceof $.Event);
ok(a === 'a' && b === 'b');
});
$.history.context.trigger('test', ['a', 'b']).off();
});
test('$.history.off', 0, function() {
$.history.on('test', function() {
ok();
}).off();
$.history.context.trigger('test');
});
test('$.history.trigger', 2, function() {
$.history.on('test', function(event, a, b) {
ok(event instanceof $.Event);
ok(a === 'a' && b === 'b');
}).trigger('test', ['a', 'b']).off();
});
test('$.history.getSupports', function() {
var supports = $.history.getSupports();
ok($.type(supports) === 'object');
ok($.type(supports.pushState) === 'boolean');
ok($.type(supports.onhashchange) === 'boolean');
ok($.type($.history.getSupports('pushState')) === 'boolean');
ok($.type($.history.getSupports('onhashchange')) === 'boolean');
ok($.type($.history.getSupports('not-exists')) === 'undefined');
});
test('$.history.supports', function() {
var supports = $.history.supports;
ok($.type(supports) === 'object');
ok($.type(supports.pushState), 'boolean');
ok($.type(supports.onhashchange), 'boolean');
});
test('$.history.ieCondition', function() {
var x;
for(x=6;x<=10;++x)
ok(true, 'You are' + ($.history.ieCondition('IE ' + x) ? ' ' : ' not ') + 'over IE ' + x);
});
test('$.history.unlisten', 2, function() {
$(window).on('popstate.history hashchange.history', function() {
ok();
});
$.history.unlisten();
$(window).trigger('popstate.history hashchange.history');
ok(!$('#jQueryHistory').length);
ok($.history.type() === null);
});
test('$.history.listen', function() {
raises(function() {
$.history.listen('not-exists');
});
if (!$.history.supports.pushState)
raises(function() {
$.history.listen('pathname');
});
});
function handler(_type, _start, _finish) {
$.history.on('load', function(event, url, type) {
ok(url === '/example1?var=1#bottom');
ok(type === _type);
ok(url === $.history.url());
ok(type === $.history.type());
}).on('change', function(event, url, type) {
ok(url === '/example2#top');
ok(type === _type);
ok(url === $.history.url());
ok(type === $.history.type());
$.history.push('/example3');
$.history.push('/example4');
}).on('push', function(event, url, type) {
if (url === '/example3')
return event.preventDefault();
ok(url === '/example4');
ok(type === _type);
ok($.history.url() === '/example2#top');
ok(type === $.history.type());
}).on('pushed', function(event, url, type) {
ok(url === '/example4');
ok(type === _type);
ok(url === $.history.url());
ok(type === $.history.type());
$.history.off().unlisten();
_finish();
ok($.history.type() === null);
start();
});
_start();
ok($.history.url() === '/example1?var=1#bottom');
ok($.history.type() === _type);
}
asyncTest('$.history.listen("hash", [interval])', function() {
location.hash = '/example1?var=1#bottom';
handler('hash', function() {
$.history.listen('hash', true);
}, function() {
location.hash = '';
});
location.hash = '/example2#top';
});
asyncTest('$.history.listen("hash")', 19, function() {
location.hash = '/example1?var=1#bottom';
handler('hash', function() {
$.history.listen('hash');
}, function() {
location.hash = '';
});
location.hash = '/example2#top';
});
if (location.protocol === 'file:') {
(function() {
var message = '$.history.listen("pathname") can not run over FILE protocol.';
if (typeof console === 'object' && typeof console.log === 'function')
return console.log(message);
alert(message);
})();
} else {
asyncTest('$.history.listen("pathname")', 19, function() {
window.history.pushState({}, null, '/example1?var=1#bottom');
handler('pathname', function() {
$.history.listen('pathname');
}, function() {
window.history.pushState({}, null, pathname);
});
window.history.pushState({}, null, '/example2#top');
var event = $.Event('popstate.history');
event.originalEvent = { state: true };
$(window).trigger(event);
});
}
@@ -0,0 +1,32 @@
/*
Input Mask plugin binding
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*/
(function(factory) {
if (typeof define === "function" && define.amd) {
define(["jquery", "inputmask"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"), require("./inputmask"));
} else {
factory(jQuery, window.Inputmask);
}
}
(function($, Inputmask) {
$(document).ajaxComplete(function(event, xmlHttpRequest, ajaxOptions) {
if ($.inArray("html", ajaxOptions.dataTypes) !== -1) {
$(":input").each(function(ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
}
}).ready(function() {
$(":input").each(function(ndx, lmnt) {
if (lmnt.inputmask === undefined) {
Inputmask().mask(lmnt);
}
});
});
}));
@@ -0,0 +1,227 @@
/*
Input Mask plugin dependencyLib
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["jqlite"], factory);
} else if (typeof exports === "object") {
module.exports = factory(require("jqlite"));
} else {
factory(jQuery);
}
}
(function ($) {
// Use a stripped-down indexOf as it's faster than native
// http://jsperf.com/thor-indexof-vs-for/5
function indexOf(list, elem) {
var i = 0,
len = list.length;
for (; i < len; i++) {
if (list[i] === elem) {
return i;
}
}
return -1;
}
var class2type = {},
classTypes = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
for (var nameNdx = 0; nameNdx < classTypes.length; nameNdx++) {
class2type["[object " + classTypes[nameNdx] + "]"] = classTypes[nameNdx].toLowerCase();
}
function type(obj) {
if (obj == null) {
return obj + "";
}
// Support: Android<4.0, iOS<6 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ?
class2type[class2type.toString.call(obj)] || "object" :
typeof obj;
}
function isWindow(obj) {
return obj != null && obj === obj.window;
}
function isArraylike(obj) {
// Support: iOS 8.2 (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = "length" in obj && obj.length,
ltype = type(obj);
if (ltype === "function" || isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return ltype === "array" || length === 0 ||
typeof length === "number" && length > 0 && (length - 1) in obj;
}
$.inArray = function (elem, arr, i) {
return arr == null ? -1 : indexOf(arr, elem, i);
};
$.isFunction = function (obj) {
return type(obj) === "function";
};
$.isArray = Array.isArray;
$.isPlainObject = function (obj) {
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
if (type(obj) !== "object" || obj.nodeType || isWindow(obj)) {
return false;
}
if (obj.constructor && !class2type.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
// If the function hasn't returned already, we're confident that
// |obj| is a plain object, created by {} or constructed with new Object
return true;
};
$.extend = function () {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if (typeof target === "boolean") {
deep = target;
// Skip the boolean and the target
target = arguments[i] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" && !$.isFunction(target)) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if (i === length) {
target = this;
i--;
}
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
// Prevent never-ending loop
if (target === copy) {
continue;
}
// Recurse if we're merging plain objects or arrays
if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && $.isArray(src) ? src : [];
} else {
clone = src && $.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[name] = $.extend(deep, clone, copy);
// Don't bring in undefined values
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
// Return the modified object
return target;
};
$.each = function (obj, callback) {
var value, i = 0;
if (isArraylike(obj)) {
for (var length = obj.length; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
}
return obj;
};
$.map = function (elems, callback) {
var value,
i = 0,
length = elems.length,
isArray = isArraylike(elems),
ret = [];
// Go through the array, translating each of the items to their new values
if (isArray) {
for (; i < length; i++) {
value = callback(elems[i], i);
if (value != null) {
ret.push(value);
}
}
// Go through every key on the object,
} else {
for (i in elems) {
value = callback(elems[i], i);
if (value != null) {
ret.push(value);
}
}
}
// Flatten any nested arrays
return [].concat(ret);
};
$.data = function (elem, name, data) {
return $(elem).data(name, data);
};
$.Event = $.Event || function CustomEvent(event, params) {
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
$.Event.prototype = window.Event.prototype;
window.dependencyLib = $;
return $;
}));
@@ -0,0 +1,424 @@
/*
Input Mask plugin dependencyLib
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
define(factory);
} else if (typeof exports === "object") {
module.exports = factory();
} else {
factory();
}
}
(function () {
//helper functions
// Use a stripped-down indexOf as it's faster than native
// http://jsperf.com/thor-indexof-vs-for/5
function indexOf(list, elem) {
var i = 0,
len = list.length;
for (; i < len; i++) {
if (list[i] === elem) {
return i;
}
}
return -1;
}
var class2type = {},
classTypes = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
for (var nameNdx = 0; nameNdx < classTypes.length; nameNdx++) {
class2type["[object " + classTypes[nameNdx] + "]"] = classTypes[nameNdx].toLowerCase();
}
function type(obj) {
if (obj == null) {
return obj + "";
}
// Support: Android<4.0, iOS<6 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ?
class2type[class2type.toString.call(obj)] || "object" :
typeof obj;
}
function isWindow(obj) {
return obj != null && obj === obj.window;
}
function isArraylike(obj) {
// Support: iOS 8.2 (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = "length" in obj && obj.length,
ltype = type(obj);
if (ltype === "function" || isWindow(obj)) {
return false;
}
if (obj.nodeType === 1 && length) {
return true;
}
return ltype === "array" || length === 0 ||
typeof length === "number" && length > 0 && (length - 1) in obj;
}
function isValidElement(elem) {
return elem instanceof Element;
}
function DependencyLib(elem) {
if (elem instanceof DependencyLib) {
return elem;
}
if (!(this instanceof DependencyLib)) {
return new DependencyLib(elem);
}
if (elem !== undefined && elem !== null && elem !== window) {
this[0] = elem.nodeName ? elem : (elem[0] !== undefined && elem[0].nodeName ? elem[0] : document.querySelector(elem));
if (this[0] !== undefined && this[0] !== null) {
this[0].eventRegistry = this[0].eventRegistry || {};
}
}
}
DependencyLib.prototype = {
on: function (events, handler) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry,
elem = this[0];
function addEvent(ev, namespace) {
//register domevent
if (elem.addEventListener) { // all browsers except IE before version 9
elem.addEventListener(ev, handler, false);
} else if (elem.attachEvent) { // IE before version 9
elem.attachEvent("on" + ev, handler);
}
eventRegistry[ev] = eventRegistry[ev] || {};
eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [];
eventRegistry[ev][namespace].push(handler);
}
var _events = events.split(" ");
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."),
ev = nsEvent[0],
namespace = nsEvent[1] || "global";
addEvent(ev, namespace);
}
}
return this;
},
off: function (events, handler) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry,
elem = this[0];
function removeEvent(ev, namespace, handler) {
if (ev in eventRegistry === true) {
//unbind to dom events
if (elem.removeEventListener) { // all browsers except IE before version 9
elem.removeEventListener(ev, handler, false);
} else if (elem.detachEvent) { // IE before version 9
elem.detachEvent("on" + ev, handler);
}
if (namespace === "global") {
for (var nmsp in eventRegistry[ev]) {
eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1);
}
} else {
eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);
}
}
}
function resolveNamespace(ev, namespace) {
var evts = [],
hndx, hndL;
if (ev.length > 0) {
if (handler === undefined) {
for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) {
evts.push({
ev: ev,
namespace: namespace && namespace.length > 0 ? namespace : "global",
handler: eventRegistry[ev][namespace][hndx]
});
}
} else {
evts.push({
ev: ev,
namespace: namespace && namespace.length > 0 ? namespace : "global",
handler: handler
});
}
} else if (namespace.length > 0) {
for (var evNdx in eventRegistry) {
for (var nmsp in eventRegistry[evNdx]) {
if (nmsp === namespace) {
if (handler === undefined) {
for (hndx = 0, hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) {
evts.push({
ev: evNdx,
namespace: nmsp,
handler: eventRegistry[evNdx][nmsp][hndx]
});
}
} else {
evts.push({
ev: evNdx,
namespace: nmsp,
handler: handler
});
}
}
}
}
}
return evts;
}
var _events = events.split(" ");
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."),
offEvents = resolveNamespace(nsEvent[0], nsEvent[1]);
for (var i = 0, offEventsL = offEvents.length; i < offEventsL; i++) {
removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);
}
}
}
return this;
},
trigger: function (events /* , args... */) {
if (isValidElement(this[0])) {
var eventRegistry = this[0].eventRegistry,
elem = this[0];
var _events = typeof events === "string" ? events.split(" ") : [events.type];
for (var endx = 0; endx < _events.length; endx++) {
var nsEvent = _events[endx].split("."),
ev = nsEvent[0],
namespace = nsEvent[1] || "global";
if (document !== undefined && namespace === "global") {
//trigger domevent
var evnt, i, params = {
bubbles: false,
cancelable: true,
detail: Array.prototype.slice.call(arguments, 1)
};
// The custom event that will be created
if (document.createEvent) {
try {
evnt = new CustomEvent(ev, params);
} catch (e) {
evnt = document.createEvent("CustomEvent");
evnt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
}
if (events.type) DependencyLib.extend(evnt, events);
elem.dispatchEvent(evnt);
} else {
evnt = document.createEventObject();
evnt.eventType = ev;
if (events.type) DependencyLib.extend(evnt, events);
elem.fireEvent("on" + evnt.eventType, evnt);
}
} else if (eventRegistry[ev] !== undefined) {
arguments[0] = arguments[0].type ? arguments[0] : DependencyLib.Event(arguments[0]);
if (namespace === "global") {
for (var nmsp in eventRegistry[ev]) {
for (i = 0; i < eventRegistry[ev][nmsp].length; i++) {
eventRegistry[ev][nmsp][i].apply(elem, arguments);
}
}
} else {
for (i = 0; i < eventRegistry[ev][namespace].length; i++) {
eventRegistry[ev][namespace][i].apply(elem, arguments);
}
}
}
}
}
return this;
}
};
//static
DependencyLib.isFunction = function (obj) {
return type(obj) === "function";
};
DependencyLib.noop = function () {
};
DependencyLib.isArray = Array.isArray;
DependencyLib.inArray = function (elem, arr, i) {
return arr == null ? -1 : indexOf(arr, elem, i);
};
DependencyLib.valHooks = undefined;
DependencyLib.isPlainObject = function (obj) {
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
if (type(obj) !== "object" || obj.nodeType || isWindow(obj)) {
return false;
}
if (obj.constructor && !class2type.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
return false;
}
// If the function hasn't returned already, we're confident that
// |obj| is a plain object, created by {} or constructed with new Object
return true;
};
DependencyLib.extend = function () {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if (typeof target === "boolean") {
deep = target;
// Skip the boolean and the target
target = arguments[i] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" && !DependencyLib.isFunction(target)) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if (i === length) {
target = this;
i--;
}
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Extend the base object
for (name in options) {
src = target[name];
copy = options[name];
// Prevent never-ending loop
if (target === copy) {
continue;
}
// Recurse if we're merging plain objects or arrays
if (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy)))) {
if (copyIsArray) {
copyIsArray = false;
clone = src && DependencyLib.isArray(src) ? src : [];
} else {
clone = src && DependencyLib.isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[name] = DependencyLib.extend(deep, clone, copy);
// Don't bring in undefined values
} else if (copy !== undefined) {
target[name] = copy;
}
}
}
}
// Return the modified object
return target;
};
DependencyLib.each = function (obj, callback) {
var value, i = 0;
if (isArraylike(obj)) {
for (var length = obj.length; i < length; i++) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
} else {
for (i in obj) {
value = callback.call(obj[i], i, obj[i]);
if (value === false) {
break;
}
}
}
return obj;
};
DependencyLib.map = function (elems, callback) {
var value,
i = 0,
length = elems.length,
isArray = isArraylike(elems),
ret = [];
// Go through the array, translating each of the items to their new values
if (isArray) {
for (; i < length; i++) {
value = callback(elems[i], i);
if (value != null) {
ret.push(value);
}
}
// Go through every key on the object,
} else {
for (i in elems) {
value = callback(elems[i], i);
if (value != null) {
ret.push(value);
}
}
}
// Flatten any nested arrays
return [].concat(ret);
};
DependencyLib.data = function (owner, key, value) {
if (value === undefined) {
return owner.__data ? owner.__data[key] : null;
} else {
owner.__data = owner.__data || {};
owner.__data[key] = value;
}
};
DependencyLib.Event = function CustomEvent(event, params) {
params = params || {
bubbles: false,
cancelable: false,
detail: undefined
};
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
}
DependencyLib.Event.prototype = window.Event.prototype;
window.dependencyLib = DependencyLib;
return DependencyLib;
}));
+47
View File
@@ -0,0 +1,47 @@
[
{"mask": "+32(53)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Aalst (Alost)"},
{"mask": "+32(3)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Antwerpen (Anvers)"},
{"mask": "+32(63)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Arlon"},
{"mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ath"},
{"mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Brugge (Bruges)"},
{"mask": "+32(2)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Brussel/Bruxelles (Brussels)"},
{"mask": "+32(71)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Charleroi"},
{"mask": "+32(60)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Chimay"},
{"mask": "+32(83)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ciney"},
{"mask": "+32(52)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dendermonde"},
{"mask": "+32(13)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Diest"},
{"mask": "+32(82)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dinant"},
{"mask": "+32(86)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Durbuy"},
{"mask": "+32(89)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Genk"},
{"mask": "+32(9)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Gent (Gand)"},
{"mask": "+32(11)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Hasselt"},
{"mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Herentals"},
{"mask": "+32(85)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Huy (Hoei)"},
{"mask": "+32(64)##-##-##", "cc": "BE", "cd": "Belgium", "city": "La Louvière"},
{"mask": "+32(16)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Leuven (Louvain)"},
{"mask": "+32(61)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Libramont"},
{"mask": "+32(4)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Liège (Luik)"},
{"mask": "+32(15)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mechelen (Malines)"},
{"mask": "+32(46#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones"},
{"mask": "+32(47#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones"},
{"mask": "+32(48#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones"},
{"mask": "+32(49#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones"},
{"mask": "+32(461)8#-##-##", "cc": "BE", "cd": "Belgium", "city": "GSM-R (NMBS)"},
{"mask": "+32(65)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mons (Bergen)"},
{"mask": "+32(81)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Namur (Namen)"},
{"mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nieuwpoort (Nieuport)"},
{"mask": "+32(54)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ninove"},
{"mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nivelles (Nijvel)"},
{"mask": "+32(59)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Oostende (Ostende)"},
{"mask": "+32(51)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Roeselare (Roulers)"},
{"mask": "+32(55)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ronse"},
{"mask": "+32(80)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Stavelot"},
{"mask": "+32(12)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tongeren (Tongres)"},
{"mask": "+32(69)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tounai"},
{"mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Turnhout"},
{"mask": "+32(87)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Verviers"},
{"mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Veurne"},
{"mask": "+32(19)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wareme"},
{"mask": "+32(10)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wavre (Waver)"},
{"mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Zeebrugge"}
]
+294
View File
@@ -0,0 +1,294 @@
[
{ "mask": "+247-####", "cc": "AC", "cd": "Ascension", "desc_en": "", "name_ru": "Остров Вознесения", "desc_ru": "" },
{ "mask": "+376-###-###", "cc": "AD", "cd": "Andorra", "desc_en": "", "name_ru": "Андорра", "desc_ru": "" },
{ "mask": "+971-5#-###-####", "cc": "AE", "cd": "United Arab Emirates", "desc_en": "mobile", "name_ru": "Объединенные Арабские Эмираты", "desc_ru": "мобильные" },
{ "mask": "+971-#-###-####", "cc": "AE", "cd": "United Arab Emirates", "desc_en": "", "name_ru": "Объединенные Арабские Эмираты", "desc_ru": "" },
{ "mask": "+93-##-###-####", "cc": "AF", "cd": "Afghanistan", "desc_en": "", "name_ru": "Афганистан", "desc_ru": "" },
{ "mask": "+1(268)###-####", "cc": "AG", "cd": "Antigua & Barbuda", "desc_en": "", "name_ru": "Антигуа и Барбуда", "desc_ru": "" },
{ "mask": "+1(264)###-####", "cc": "AI", "cd": "Anguilla", "desc_en": "", "name_ru": "Ангилья", "desc_ru": "" },
{ "mask": "+355(###)###-###", "cc": "AL", "cd": "Albania", "desc_en": "", "name_ru": "Албания", "desc_ru": "" },
{ "mask": "+374-##-###-###", "cc": "AM", "cd": "Armenia", "desc_en": "", "name_ru": "Армения", "desc_ru": "" },
{ "mask": "+599-###-####", "cc": "AN", "cd": "Caribbean Netherlands", "desc_en": "", "name_ru": "Карибские Нидерланды", "desc_ru": "" },
{ "mask": "+599-###-####", "cc": "AN", "cd": "Netherlands Antilles", "desc_en": "", "name_ru": "Нидерландские Антильские острова", "desc_ru": "" },
{ "mask": "+599-9###-####", "cc": "AN", "cd": "Netherlands Antilles", "desc_en": "Curacao", "name_ru": "Нидерландские Антильские острова", "desc_ru": "Кюрасао" },
{ "mask": "+244(###)###-###", "cc": "AO", "cd": "Angola", "desc_en": "", "name_ru": "Ангола", "desc_ru": "" },
{ "mask": "+672-1##-###", "cc": "AQ", "cd": "Australian bases in Antarctica", "desc_en": "", "name_ru": "Австралийская антарктическая база", "desc_ru": "" },
{ "mask": "+54(###)###-####", "cc": "AR", "cd": "Argentina", "desc_en": "", "name_ru": "Аргентина", "desc_ru": "" },
{ "mask": "+1(684)###-####", "cc": "AS", "cd": "American Samoa", "desc_en": "", "name_ru": "Американское Самоа", "desc_ru": "" },
{ "mask": "+43(###)###-####", "cc": "AT", "cd": "Austria", "desc_en": "", "name_ru": "Австрия", "desc_ru": "" },
{ "mask": "+61-#-####-####", "cc": "AU", "cd": "Australia", "desc_en": "", "name_ru": "Австралия", "desc_ru": "" },
{ "mask": "+297-###-####", "cc": "AW", "cd": "Aruba", "desc_en": "", "name_ru": "Аруба", "desc_ru": "" },
{ "mask": "+994-##-###-##-##", "cc": "AZ", "cd": "Azerbaijan", "desc_en": "", "name_ru": "Азербайджан", "desc_ru": "" },
{ "mask": "+387-##-#####", "cc": "BA", "cd": "Bosnia and Herzegovina", "desc_en": "", "name_ru": "Босния и Герцеговина", "desc_ru": "" },
{ "mask": "+387-##-####", "cc": "BA", "cd": "Bosnia and Herzegovina", "desc_en": "", "name_ru": "Босния и Герцеговина", "desc_ru": "" },
{ "mask": "+1(246)###-####", "cc": "BB", "cd": "Barbados", "desc_en": "", "name_ru": "Барбадос", "desc_ru": "" },
{ "mask": "+880-##-###-###", "cc": "BD", "cd": "Bangladesh", "desc_en": "", "name_ru": "Бангладеш", "desc_ru": "" },
{ "mask": "+32(###)###-###", "cc": "BE", "cd": "Belgium", "desc_en": "", "name_ru": "Бельгия", "desc_ru": "" },
{ "mask": "+226-##-##-####", "cc": "BF", "cd": "Burkina Faso", "desc_en": "", "name_ru": "Буркина Фасо", "desc_ru": "" },
{ "mask": "+359(###)###-###", "cc": "BG", "cd": "Bulgaria", "desc_en": "", "name_ru": "Болгария", "desc_ru": "" },
{ "mask": "+973-####-####", "cc": "BH", "cd": "Bahrain", "desc_en": "", "name_ru": "Бахрейн", "desc_ru": "" },
{ "mask": "+257-##-##-####", "cc": "BI", "cd": "Burundi", "desc_en": "", "name_ru": "Бурунди", "desc_ru": "" },
{ "mask": "+229-##-##-####", "cc": "BJ", "cd": "Benin", "desc_en": "", "name_ru": "Бенин", "desc_ru": "" },
{ "mask": "+1(441)###-####", "cc": "BM", "cd": "Bermuda", "desc_en": "", "name_ru": "Бермудские острова", "desc_ru": "" },
{ "mask": "+673-###-####", "cc": "BN", "cd": "Brunei Darussalam", "desc_en": "", "name_ru": "Бруней-Даруссалам", "desc_ru": "" },
{ "mask": "+591-#-###-####", "cc": "BO", "cd": "Bolivia", "desc_en": "", "name_ru": "Боливия", "desc_ru": "" },
{ "mask": "+55-##-####[#]-####", "cc": "BR", "cd": "Brazil", "desc_en": "", "name_ru": "Бразилия", "desc_ru": "" },
{ "mask": "+1(242)###-####", "cc": "BS", "cd": "Bahamas", "desc_en": "", "name_ru": "Багамские Острова", "desc_ru": "" },
{ "mask": "+975-17-###-###", "cc": "BT", "cd": "Bhutan", "desc_en": "", "name_ru": "Бутан", "desc_ru": "" },
{ "mask": "+975-#-###-###", "cc": "BT", "cd": "Bhutan", "desc_en": "", "name_ru": "Бутан", "desc_ru": "" },
{ "mask": "+267-##-###-###", "cc": "BW", "cd": "Botswana", "desc_en": "", "name_ru": "Ботсвана", "desc_ru": "" },
{ "mask": "+375(##)###-##-##", "cc": "BY", "cd": "Belarus", "desc_en": "", "name_ru": "Беларусь (Белоруссия)", "desc_ru": "" },
{ "mask": "+501-###-####", "cc": "BZ", "cd": "Belize", "desc_en": "", "name_ru": "Белиз", "desc_ru": "" },
{ "mask": "+243(###)###-###", "cc": "CD", "cd": "Dem. Rep. Congo", "desc_en": "", "name_ru": "Дем. Респ. Конго (Киншаса)", "desc_ru": "" },
{ "mask": "+236-##-##-####", "cc": "CF", "cd": "Central African Republic", "desc_en": "", "name_ru": "Центральноафриканская Республика", "desc_ru": "" },
{ "mask": "+242-##-###-####", "cc": "CG", "cd": "Congo (Brazzaville)", "desc_en": "", "name_ru": "Конго (Браззавиль)", "desc_ru": "" },
{ "mask": "+41-##-###-####", "cc": "CH", "cd": "Switzerland", "desc_en": "", "name_ru": "Швейцария", "desc_ru": "" },
{ "mask": "+225-##-###-###", "cc": "CI", "cd": "Cote d’Ivoire (Ivory Coast)", "desc_en": "", "name_ru": "Кот-д’Ивуар", "desc_ru": "" },
{ "mask": "+682-##-###", "cc": "CK", "cd": "Cook Islands", "desc_en": "", "name_ru": "Острова Кука", "desc_ru": "" },
{ "mask": "+56-#-####-####", "cc": "CL", "cd": "Chile", "desc_en": "", "name_ru": "Чили", "desc_ru": "" },
{ "mask": "+237-####-####", "cc": "CM", "cd": "Cameroon", "desc_en": "", "name_ru": "Камерун", "desc_ru": "" },
{ "mask": "+86(###)####-####", "cc": "CN", "cd": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" },
{ "mask": "+86(###)####-###", "cc": "CN", "cd": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" },
{ "mask": "+86-##-#####-#####", "cc": "CN", "cd": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" },
{ "mask": "+57(###)###-####", "cc": "CO", "cd": "Colombia", "desc_en": "", "name_ru": "Колумбия", "desc_ru": "" },
{ "mask": "+506-####-####", "cc": "CR", "cd": "Costa Rica", "desc_en": "", "name_ru": "Коста-Рика", "desc_ru": "" },
{ "mask": "+53-#-###-####", "cc": "CU", "cd": "Cuba", "desc_en": "", "name_ru": "Куба", "desc_ru": "" },
{ "mask": "+238(###)##-##", "cc": "CV", "cd": "Cape Verde", "desc_en": "", "name_ru": "Кабо-Верде", "desc_ru": "" },
{ "mask": "+599-###-####", "cc": "CW", "cd": "Curacao", "desc_en": "", "name_ru": "Кюрасао", "desc_ru": "" },
{ "mask": "+357-##-###-###", "cc": "CY", "cd": "Cyprus", "desc_en": "", "name_ru": "Кипр", "desc_ru": "" },
{ "mask": "+420(###)###-###", "cc": "CZ", "cd": "Czech Republic", "desc_en": "", "name_ru": "Чехия", "desc_ru": "" },
{ "mask": "+49(####)###-####", "cc": "DE", "cd": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
{ "mask": "+49(###)###-####", "cc": "DE", "cd": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
{ "mask": "+49(###)##-####", "cc": "DE", "cd": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
{ "mask": "+49(###)##-###", "cc": "DE", "cd": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
{ "mask": "+49(###)##-##", "cc": "DE", "cd": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
{ "mask": "+49-###-###", "cc": "DE", "cd": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
{ "mask": "+253-##-##-##-##", "cc": "DJ", "cd": "Djibouti", "desc_en": "", "name_ru": "Джибути", "desc_ru": "" },
{ "mask": "+45-##-##-##-##", "cc": "DK", "cd": "Denmark", "desc_en": "", "name_ru": "Дания", "desc_ru": "" },
{ "mask": "+1(767)###-####", "cc": "DM", "cd": "Dominica", "desc_en": "", "name_ru": "Доминика", "desc_ru": "" },
{ "mask": "+1(809)###-####", "cc": "DO", "cd": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" },
{ "mask": "+1(829)###-####", "cc": "DO", "cd": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" },
{ "mask": "+1(849)###-####", "cc": "DO", "cd": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" },
{ "mask": "+213-##-###-####", "cc": "DZ", "cd": "Algeria", "desc_en": "", "name_ru": "Алжир", "desc_ru": "" },
{ "mask": "+593-##-###-####", "cc": "EC", "cd": "Ecuador ", "desc_en": "mobile", "name_ru": "Эквадор ", "desc_ru": "мобильные" },
{ "mask": "+593-#-###-####", "cc": "EC", "cd": "Ecuador", "desc_en": "", "name_ru": "Эквадор", "desc_ru": "" },
{ "mask": "+372-####-####", "cc": "EE", "cd": "Estonia ", "desc_en": "mobile", "name_ru": "Эстония ", "desc_ru": "мобильные" },
{ "mask": "+372-###-####", "cc": "EE", "cd": "Estonia", "desc_en": "", "name_ru": "Эстония", "desc_ru": "" },
{ "mask": "+20(###)###-####", "cc": "EG", "cd": "Egypt", "desc_en": "", "name_ru": "Египет", "desc_ru": "" },
{ "mask": "+291-#-###-###", "cc": "ER", "cd": "Eritrea", "desc_en": "", "name_ru": "Эритрея", "desc_ru": "" },
{ "mask": "+34(###)###-###", "cc": "ES", "cd": "Spain", "desc_en": "", "name_ru": "Испания", "desc_ru": "" },
{ "mask": "+251-##-###-####", "cc": "ET", "cd": "Ethiopia", "desc_en": "", "name_ru": "Эфиопия", "desc_ru": "" },
{ "mask": "+358(###)###-##-##", "cc": "FI", "cd": "Finland", "desc_en": "", "name_ru": "Финляндия", "desc_ru": "" },
{ "mask": "+679-##-#####", "cc": "FJ", "cd": "Fiji", "desc_en": "", "name_ru": "Фиджи", "desc_ru": "" },
{ "mask": "+500-#####", "cc": "FK", "cd": "Falkland Islands", "desc_en": "", "name_ru": "Фолклендские острова", "desc_ru": "" },
{ "mask": "+691-###-####", "cc": "FM", "cd": "F.S. Micronesia", "desc_en": "", "name_ru": "Ф.Ш. Микронезии", "desc_ru": "" },
{ "mask": "+298-###-###", "cc": "FO", "cd": "Faroe Islands", "desc_en": "", "name_ru": "Фарерские острова", "desc_ru": "" },
{ "mask": "+262-#####-####", "cc": "FR", "cd": "Mayotte", "desc_en": "", "name_ru": "Майотта", "desc_ru": "" },
{ "mask": "+33(###)###-###", "cc": "FR", "cd": "France", "desc_en": "", "name_ru": "Франция", "desc_ru": "" },
{ "mask": "+508-##-####", "cc": "FR", "cd": "St Pierre & Miquelon", "desc_en": "", "name_ru": "Сен-Пьер и Микелон", "desc_ru": "" },
{ "mask": "+590(###)###-###", "cc": "FR", "cd": "Guadeloupe", "desc_en": "", "name_ru": "Гваделупа", "desc_ru": "" },
{ "mask": "+241-#-##-##-##", "cc": "GA", "cd": "Gabon", "desc_en": "", "name_ru": "Габон", "desc_ru": "" },
{ "mask": "+1(473)###-####", "cc": "GD", "cd": "Grenada", "desc_en": "", "name_ru": "Гренада", "desc_ru": "" },
{ "mask": "+995(###)###-###", "cc": "GE", "cd": "Rep. of Georgia", "desc_en": "", "name_ru": "Грузия", "desc_ru": "" },
{ "mask": "+594-#####-####", "cc": "GF", "cd": "Guiana (French)", "desc_en": "", "name_ru": "Фр. Гвиана", "desc_ru": "" },
{ "mask": "+233(###)###-###", "cc": "GH", "cd": "Ghana", "desc_en": "", "name_ru": "Гана", "desc_ru": "" },
{ "mask": "+350-###-#####", "cc": "GI", "cd": "Gibraltar", "desc_en": "", "name_ru": "Гибралтар", "desc_ru": "" },
{ "mask": "+299-##-##-##", "cc": "GL", "cd": "Greenland", "desc_en": "", "name_ru": "Гренландия", "desc_ru": "" },
{ "mask": "+220(###)##-##", "cc": "GM", "cd": "Gambia", "desc_en": "", "name_ru": "Гамбия", "desc_ru": "" },
{ "mask": "+224-##-###-###", "cc": "GN", "cd": "Guinea", "desc_en": "", "name_ru": "Гвинея", "desc_ru": "" },
{ "mask": "+240-##-###-####", "cc": "GQ", "cd": "Equatorial Guinea", "desc_en": "", "name_ru": "Экваториальная Гвинея", "desc_ru": "" },
{ "mask": "+30(###)###-####", "cc": "GR", "cd": "Greece", "desc_en": "", "name_ru": "Греция", "desc_ru": "" },
{ "mask": "+502-#-###-####", "cc": "GT", "cd": "Guatemala", "desc_en": "", "name_ru": "Гватемала", "desc_ru": "" },
{ "mask": "+1(671)###-####", "cc": "GU", "cd": "Guam", "desc_en": "", "name_ru": "Гуам", "desc_ru": "" },
{ "mask": "+245-#-######", "cc": "GW", "cd": "Guinea-Bissau", "desc_en": "", "name_ru": "Гвинея-Бисау", "desc_ru": "" },
{ "mask": "+592-###-####", "cc": "GY", "cd": "Guyana", "desc_en": "", "name_ru": "Гайана", "desc_ru": "" },
{ "mask": "+852-####-####", "cc": "HK", "cd": "Hong Kong", "desc_en": "", "name_ru": "Гонконг", "desc_ru": "" },
{ "mask": "+504-####-####", "cc": "HN", "cd": "Honduras", "desc_en": "", "name_ru": "Гондурас", "desc_ru": "" },
{ "mask": "+385-##-###-###", "cc": "HR", "cd": "Croatia", "desc_en": "", "name_ru": "Хорватия", "desc_ru": "" },
{ "mask": "+509-##-##-####", "cc": "HT", "cd": "Haiti", "desc_en": "", "name_ru": "Гаити", "desc_ru": "" },
{ "mask": "+36(###)###-###", "cc": "HU", "cd": "Hungary", "desc_en": "", "name_ru": "Венгрия", "desc_ru": "" },
{ "mask": "+62(8##)###-####", "cc": "ID", "cd": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" },
{ "mask": "+62-##-###-##", "cc": "ID", "cd": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" },
{ "mask": "+62-##-###-###", "cc": "ID", "cd": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" },
{ "mask": "+62-##-###-####", "cc": "ID", "cd": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" },
{ "mask": "+62(8##)###-###", "cc": "ID", "cd": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" },
{ "mask": "+62(8##)###-##-###", "cc": "ID", "cd": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" },
{ "mask": "+353(###)###-###", "cc": "IE", "cd": "Ireland", "desc_en": "", "name_ru": "Ирландия", "desc_ru": "" },
{ "mask": "+972-5#-###-####", "cc": "IL", "cd": "Israel ", "desc_en": "mobile", "name_ru": "Израиль ", "desc_ru": "мобильные" },
{ "mask": "+972-#-###-####", "cc": "IL", "cd": "Israel", "desc_en": "", "name_ru": "Израиль", "desc_ru": "" },
{ "mask": "+91(####)###-###", "cc": "IN", "cd": "India", "desc_en": "", "name_ru": "Индия", "desc_ru": "" },
{ "mask": "+246-###-####", "cc": "IO", "cd": "Diego Garcia", "desc_en": "", "name_ru": "Диего-Гарсия", "desc_ru": "" },
{ "mask": "+964(###)###-####", "cc": "IQ", "cd": "Iraq", "desc_en": "", "name_ru": "Ирак", "desc_ru": "" },
{ "mask": "+98(###)###-####", "cc": "IR", "cd": "Iran", "desc_en": "", "name_ru": "Иран", "desc_ru": "" },
{ "mask": "+354-###-####", "cc": "IS", "cd": "Iceland", "desc_en": "", "name_ru": "Исландия", "desc_ru": "" },
{ "mask": "+39(###)####-###", "cc": "IT", "cd": "Italy", "desc_en": "", "name_ru": "Италия", "desc_ru": "" },
{ "mask": "+1(876)###-####", "cc": "JM", "cd": "Jamaica", "desc_en": "", "name_ru": "Ямайка", "desc_ru": "" },
{ "mask": "+962-#-####-####", "cc": "JO", "cd": "Jordan", "desc_en": "", "name_ru": "Иордания", "desc_ru": "" },
{ "mask": "+81-##-####-####", "cc": "JP", "cd": "Japan ", "desc_en": "mobile", "name_ru": "Япония ", "desc_ru": "мобильные" },
{ "mask": "+81(###)###-###", "cc": "JP", "cd": "Japan", "desc_en": "", "name_ru": "Япония", "desc_ru": "" },
{ "mask": "+254-###-######", "cc": "KE", "cd": "Kenya", "desc_en": "", "name_ru": "Кения", "desc_ru": "" },
{ "mask": "+996(###)###-###", "cc": "KG", "cd": "Kyrgyzstan", "desc_en": "", "name_ru": "Киргизия", "desc_ru": "" },
{ "mask": "+855-##-###-###", "cc": "KH", "cd": "Cambodia", "desc_en": "", "name_ru": "Камбоджа", "desc_ru": "" },
{ "mask": "+686-##-###", "cc": "KI", "cd": "Kiribati", "desc_en": "", "name_ru": "Кирибати", "desc_ru": "" },
{ "mask": "+269-##-#####", "cc": "KM", "cd": "Comoros", "desc_en": "", "name_ru": "Коморы", "desc_ru": "" },
{ "mask": "+1(869)###-####", "cc": "KN", "cd": "Saint Kitts & Nevis", "desc_en": "", "name_ru": "Сент-Китс и Невис", "desc_ru": "" },
{ "mask": "+850-191-###-####", "cc": "KP", "cd": "DPR Korea (North) ", "desc_en": "mobile", "name_ru": "Корейская НДР ", "desc_ru": "мобильные" },
{ "mask": "+850-##-###-###", "cc": "KP", "cd": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
{ "mask": "+850-###-####-###", "cc": "KP", "cd": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
{ "mask": "+850-###-###", "cc": "KP", "cd": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
{ "mask": "+850-####-####", "cc": "KP", "cd": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
{ "mask": "+850-####-#############", "cc": "KP", "cd": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
{ "mask": "+82-##-###-####", "cc": "KR", "cd": "Korea (South)", "desc_en": "", "name_ru": "Респ. Корея", "desc_ru": "" },
{ "mask": "+965-####-####", "cc": "KW", "cd": "Kuwait", "desc_en": "", "name_ru": "Кувейт", "desc_ru": "" },
{ "mask": "+1(345)###-####", "cc": "KY", "cd": "Cayman Islands", "desc_en": "", "name_ru": "Каймановы острова", "desc_ru": "" },
{ "mask": "+7(6##)###-##-##", "cc": "KZ", "cd": "Kazakhstan", "desc_en": "", "name_ru": "Казахстан", "desc_ru": "" },
{ "mask": "+7(7##)###-##-##", "cc": "KZ", "cd": "Kazakhstan", "desc_en": "", "name_ru": "Казахстан", "desc_ru": "" },
{ "mask": "+856(20##)###-###", "cc": "LA", "cd": "Laos ", "desc_en": "mobile", "name_ru": "Лаос ", "desc_ru": "мобильные" },
{ "mask": "+856-##-###-###", "cc": "LA", "cd": "Laos", "desc_en": "", "name_ru": "Лаос", "desc_ru": "" },
{ "mask": "+961-##-###-###", "cc": "LB", "cd": "Lebanon ", "desc_en": "mobile", "name_ru": "Ливан ", "desc_ru": "мобильные" },
{ "mask": "+961-#-###-###", "cc": "LB", "cd": "Lebanon", "desc_en": "", "name_ru": "Ливан", "desc_ru": "" },
{ "mask": "+1(758)###-####", "cc": "LC", "cd": "Saint Lucia", "desc_en": "", "name_ru": "Сент-Люсия", "desc_ru": "" },
{ "mask": "+423(###)###-####", "cc": "LI", "cd": "Liechtenstein", "desc_en": "", "name_ru": "Лихтенштейн", "desc_ru": "" },
{ "mask": "+94-##-###-####", "cc": "LK", "cd": "Sri Lanka", "desc_en": "", "name_ru": "Шри-Ланка", "desc_ru": "" },
{ "mask": "+231-##-###-###", "cc": "LR", "cd": "Liberia", "desc_en": "", "name_ru": "Либерия", "desc_ru": "" },
{ "mask": "+266-#-###-####", "cc": "LS", "cd": "Lesotho", "desc_en": "", "name_ru": "Лесото", "desc_ru": "" },
{ "mask": "+370(###)##-###", "cc": "LT", "cd": "Lithuania", "desc_en": "", "name_ru": "Литва", "desc_ru": "" },
{ "mask": "+352(###)###-###", "cc": "LU", "cd": "Luxembourg", "desc_en": "", "name_ru": "Люксембург", "desc_ru": "" },
{ "mask": "+371-##-###-###", "cc": "LV", "cd": "Latvia", "desc_en": "", "name_ru": "Латвия", "desc_ru": "" },
{ "mask": "+218-##-###-###", "cc": "LY", "cd": "Libya", "desc_en": "", "name_ru": "Ливия", "desc_ru": "" },
{ "mask": "+218-21-###-####", "cc": "LY", "cd": "Libya", "desc_en": "Tripoli", "name_ru": "Ливия", "desc_ru": "Триполи" },
{ "mask": "+212-##-####-###", "cc": "MA", "cd": "Morocco", "desc_en": "", "name_ru": "Марокко", "desc_ru": "" },
{ "mask": "+377(###)###-###", "cc": "MC", "cd": "Monaco", "desc_en": "", "name_ru": "Монако", "desc_ru": "" },
{ "mask": "+377-##-###-###", "cc": "MC", "cd": "Monaco", "desc_en": "", "name_ru": "Монако", "desc_ru": "" },
{ "mask": "+373-####-####", "cc": "MD", "cd": "Moldova", "desc_en": "", "name_ru": "Молдова", "desc_ru": "" },
{ "mask": "+382-##-###-###", "cc": "ME", "cd": "Montenegro", "desc_en": "", "name_ru": "Черногория", "desc_ru": "" },
{ "mask": "+261-##-##-#####", "cc": "MG", "cd": "Madagascar", "desc_en": "", "name_ru": "Мадагаскар", "desc_ru": "" },
{ "mask": "+692-###-####", "cc": "MH", "cd": "Marshall Islands", "desc_en": "", "name_ru": "Маршалловы Острова", "desc_ru": "" },
{ "mask": "+389-##-###-###", "cc": "MK", "cd": "Republic of Macedonia", "desc_en": "", "name_ru": "Респ. Македония", "desc_ru": "" },
{ "mask": "+223-##-##-####", "cc": "ML", "cd": "Mali", "desc_en": "", "name_ru": "Мали", "desc_ru": "" },
{ "mask": "+95-##-###-###", "cc": "MM", "cd": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" },
{ "mask": "+95-#-###-###", "cc": "MM", "cd": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" },
{ "mask": "+95-###-###", "cc": "MM", "cd": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" },
{ "mask": "+976-##-##-####", "cc": "MN", "cd": "Mongolia", "desc_en": "", "name_ru": "Монголия", "desc_ru": "" },
{ "mask": "+853-####-####", "cc": "MO", "cd": "Macau", "desc_en": "", "name_ru": "Макао", "desc_ru": "" },
{ "mask": "+1(670)###-####", "cc": "MP", "cd": "Northern Mariana Islands", "desc_en": "", "name_ru": "Северные Марианские острова Сайпан", "desc_ru": "" },
{ "mask": "+596(###)##-##-##", "cc": "MQ", "cd": "Martinique", "desc_en": "", "name_ru": "Мартиника", "desc_ru": "" },
{ "mask": "+222-##-##-####", "cc": "MR", "cd": "Mauritania", "desc_en": "", "name_ru": "Мавритания", "desc_ru": "" },
{ "mask": "+1(664)###-####", "cc": "MS", "cd": "Montserrat", "desc_en": "", "name_ru": "Монтсеррат", "desc_ru": "" },
{ "mask": "+356-####-####", "cc": "MT", "cd": "Malta", "desc_en": "", "name_ru": "Мальта", "desc_ru": "" },
{ "mask": "+230-###-####", "cc": "MU", "cd": "Mauritius", "desc_en": "", "name_ru": "Маврикий", "desc_ru": "" },
{ "mask": "+960-###-####", "cc": "MV", "cd": "Maldives", "desc_en": "", "name_ru": "Мальдивские острова", "desc_ru": "" },
{ "mask": "+265-1-###-###", "cc": "MW", "cd": "Malawi", "desc_en": "Telecom Ltd", "name_ru": "Малави", "desc_ru": "Telecom Ltd" },
{ "mask": "+265-#-####-####", "cc": "MW", "cd": "Malawi", "desc_en": "", "name_ru": "Малави", "desc_ru": "" },
{ "mask": "+52(###)###-####", "cc": "MX", "cd": "Mexico", "desc_en": "", "name_ru": "Мексика", "desc_ru": "" },
{ "mask": "+52-##-##-####", "cc": "MX", "cd": "Mexico", "desc_en": "", "name_ru": "Мексика", "desc_ru": "" },
{ "mask": "+60-##-###-####", "cc": "MY", "cd": "Malaysia ", "desc_en": "mobile", "name_ru": "Малайзия ", "desc_ru": "мобильные" },
{ "mask": "+60(###)###-###", "cc": "MY", "cd": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" },
{ "mask": "+60-##-###-###", "cc": "MY", "cd": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" },
{ "mask": "+60-#-###-###", "cc": "MY", "cd": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" },
{ "mask": "+258-##-###-###", "cc": "MZ", "cd": "Mozambique", "desc_en": "", "name_ru": "Мозамбик", "desc_ru": "" },
{ "mask": "+264-##-###-####", "cc": "NA", "cd": "Namibia", "desc_en": "", "name_ru": "Намибия", "desc_ru": "" },
{ "mask": "+687-##-####", "cc": "NC", "cd": "New Caledonia", "desc_en": "", "name_ru": "Новая Каледония", "desc_ru": "" },
{ "mask": "+227-##-##-####", "cc": "NE", "cd": "Niger", "desc_en": "", "name_ru": "Нигер", "desc_ru": "" },
{ "mask": "+672-3##-###", "cc": "NF", "cd": "Norfolk Island", "desc_en": "", "name_ru": "Норфолк (остров)", "desc_ru": "" },
{ "mask": "+234(###)###-####", "cc": "NG", "cd": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" },
{ "mask": "+234-##-###-###", "cc": "NG", "cd": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" },
{ "mask": "+234-##-###-##", "cc": "NG", "cd": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" },
{ "mask": "+234(###)###-####", "cc": "NG", "cd": "Nigeria ", "desc_en": "mobile", "name_ru": "Нигерия ", "desc_ru": "мобильные" },
{ "mask": "+505-####-####", "cc": "NI", "cd": "Nicaragua", "desc_en": "", "name_ru": "Никарагуа", "desc_ru": "" },
{ "mask": "+31-##-###-####", "cc": "NL", "cd": "Netherlands", "desc_en": "", "name_ru": "Нидерланды", "desc_ru": "" },
{ "mask": "+47(###)##-###", "cc": "NO", "cd": "Norway", "desc_en": "", "name_ru": "Норвегия", "desc_ru": "" },
{ "mask": "+977-##-###-###", "cc": "NP", "cd": "Nepal", "desc_en": "", "name_ru": "Непал", "desc_ru": "" },
{ "mask": "+674-###-####", "cc": "NR", "cd": "Nauru", "desc_en": "", "name_ru": "Науру", "desc_ru": "" },
{ "mask": "+683-####", "cc": "NU", "cd": "Niue", "desc_en": "", "name_ru": "Ниуэ", "desc_ru": "" },
{ "mask": "+64(###)###-###", "cc": "NZ", "cd": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" },
{ "mask": "+64-##-###-###", "cc": "NZ", "cd": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" },
{ "mask": "+64(###)###-####", "cc": "NZ", "cd": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" },
{ "mask": "+968-##-###-###", "cc": "OM", "cd": "Oman", "desc_en": "", "name_ru": "Оман", "desc_ru": "" },
{ "mask": "+507-###-####", "cc": "PA", "cd": "Panama", "desc_en": "", "name_ru": "Панама", "desc_ru": "" },
{ "mask": "+51(###)###-###", "cc": "PE", "cd": "Peru", "desc_en": "", "name_ru": "Перу", "desc_ru": "" },
{ "mask": "+689-##-##-##", "cc": "PF", "cd": "French Polynesia", "desc_en": "", "name_ru": "Французская Полинезия (Таити)", "desc_ru": "" },
{ "mask": "+675(###)##-###", "cc": "PG", "cd": "Papua New Guinea", "desc_en": "", "name_ru": "Папуа-Новая Гвинея", "desc_ru": "" },
{ "mask": "+63(###)###-####", "cc": "PH", "cd": "Philippines", "desc_en": "", "name_ru": "Филиппины", "desc_ru": "" },
{ "mask": "+92(###)###-####", "cc": "PK", "cd": "Pakistan", "desc_en": "", "name_ru": "Пакистан", "desc_ru": "" },
{ "mask": "+48(###)###-###", "cc": "PL", "cd": "Poland", "desc_en": "", "name_ru": "Польша", "desc_ru": "" },
{ "mask": "+970-##-###-####", "cc": "PS", "cd": "Palestine", "desc_en": "", "name_ru": "Палестина", "desc_ru": "" },
{ "mask": "+351-##-###-####", "cc": "PT", "cd": "Portugal", "desc_en": "", "name_ru": "Португалия", "desc_ru": "" },
{ "mask": "+680-###-####", "cc": "PW", "cd": "Palau", "desc_en": "", "name_ru": "Палау", "desc_ru": "" },
{ "mask": "+595(###)###-###", "cc": "PY", "cd": "Paraguay", "desc_en": "", "name_ru": "Парагвай", "desc_ru": "" },
{ "mask": "+974-####-####", "cc": "QA", "cd": "Qatar", "desc_en": "", "name_ru": "Катар", "desc_ru": "" },
{ "mask": "+262-#####-####", "cc": "RE", "cd": "Reunion", "desc_en": "", "name_ru": "Реюньон", "desc_ru": "" },
{ "mask": "+40-##-###-####", "cc": "RO", "cd": "Romania", "desc_en": "", "name_ru": "Румыния", "desc_ru": "" },
{ "mask": "+381-##-###-####", "cc": "RS", "cd": "Serbia", "desc_en": "", "name_ru": "Сербия", "desc_ru": "" },
{ "mask": "+7(###)###-##-##", "cc": "RU", "cd": "Russia", "desc_en": "", "name_ru": "Россия", "desc_ru": "" },
{ "mask": "+250(###)###-###", "cc": "RW", "cd": "Rwanda", "desc_en": "", "name_ru": "Руанда", "desc_ru": "" },
{ "mask": "+966-5-####-####", "cc": "SA", "cd": "Saudi Arabia ", "desc_en": "mobile", "name_ru": "Саудовская Аравия ", "desc_ru": "мобильные" },
{ "mask": "+966-#-###-####", "cc": "SA", "cd": "Saudi Arabia", "desc_en": "", "name_ru": "Саудовская Аравия", "desc_ru": "" },
{ "mask": "+677-###-####", "cc": "SB", "cd": "Solomon Islands ", "desc_en": "mobile", "name_ru": "Соломоновы Острова ", "desc_ru": "мобильные" },
{ "mask": "+677-#####", "cc": "SB", "cd": "Solomon Islands", "desc_en": "", "name_ru": "Соломоновы Острова", "desc_ru": "" },
{ "mask": "+248-#-###-###", "cc": "SC", "cd": "Seychelles", "desc_en": "", "name_ru": "Сейшелы", "desc_ru": "" },
{ "mask": "+249-##-###-####", "cc": "SD", "cd": "Sudan", "desc_en": "", "name_ru": "Судан", "desc_ru": "" },
{ "mask": "+46-##-###-####", "cc": "SE", "cd": "Sweden", "desc_en": "", "name_ru": "Швеция", "desc_ru": "" },
{ "mask": "+65-####-####", "cc": "SG", "cd": "Singapore", "desc_en": "", "name_ru": "Сингапур", "desc_ru": "" },
{ "mask": "+290-####", "cc": "SH", "cd": "Saint Helena", "desc_en": "", "name_ru": "Остров Святой Елены", "desc_ru": "" },
{ "mask": "+290-####", "cc": "SH", "cd": "Tristan da Cunha", "desc_en": "", "name_ru": "Тристан-да-Кунья", "desc_ru": "" },
{ "mask": "+386-##-###-###", "cc": "SI", "cd": "Slovenia", "desc_en": "", "name_ru": "Словения", "desc_ru": "" },
{ "mask": "+421(###)###-###", "cc": "SK", "cd": "Slovakia", "desc_en": "", "name_ru": "Словакия", "desc_ru": "" },
{ "mask": "+232-##-######", "cc": "SL", "cd": "Sierra Leone", "desc_en": "", "name_ru": "Сьерра-Леоне", "desc_ru": "" },
{ "mask": "+378-####-######", "cc": "SM", "cd": "San Marino", "desc_en": "", "name_ru": "Сан-Марино", "desc_ru": "" },
{ "mask": "+221-##-###-####", "cc": "SN", "cd": "Senegal", "desc_en": "", "name_ru": "Сенегал", "desc_ru": "" },
{ "mask": "+252-##-###-###", "cc": "SO", "cd": "Somalia", "desc_en": "", "name_ru": "Сомали", "desc_ru": "" },
{ "mask": "+252-#-###-###", "cc": "SO", "cd": "Somalia", "desc_en": "", "name_ru": "Сомали", "desc_ru": "" },
{ "mask": "+252-#-###-###", "cc": "SO", "cd": "Somalia ", "desc_en": "mobile", "name_ru": "Сомали ", "desc_ru": "мобильные" },
{ "mask": "+597-###-####", "cc": "SR", "cd": "Suriname ", "desc_en": "mobile", "name_ru": "Суринам ", "desc_ru": "мобильные" },
{ "mask": "+597-###-###", "cc": "SR", "cd": "Suriname", "desc_en": "", "name_ru": "Суринам", "desc_ru": "" },
{ "mask": "+211-##-###-####", "cc": "SS", "cd": "South Sudan", "desc_en": "", "name_ru": "Южный Судан", "desc_ru": "" },
{ "mask": "+239-##-#####", "cc": "ST", "cd": "Sao Tome and Principe", "desc_en": "", "name_ru": "Сан-Томе и Принсипи", "desc_ru": "" },
{ "mask": "+503-##-##-####", "cc": "SV", "cd": "El Salvador", "desc_en": "", "name_ru": "Сальвадор", "desc_ru": "" },
{ "mask": "+1(721)###-####", "cc": "SX", "cd": "Sint Maarten", "desc_en": "", "name_ru": "Синт-Маартен", "desc_ru": "" },
{ "mask": "+963-##-####-###", "cc": "SY", "cd": "Syrian Arab Republic", "desc_en": "", "name_ru": "Сирийская арабская республика", "desc_ru": "" },
{ "mask": "+268-##-##-####", "cc": "SZ", "cd": "Swaziland", "desc_en": "", "name_ru": "Свазиленд", "desc_ru": "" },
{ "mask": "+1(649)###-####", "cc": "TC", "cd": "Turks & Caicos", "desc_en": "", "name_ru": "Тёркс и Кайкос", "desc_ru": "" },
{ "mask": "+235-##-##-##-##", "cc": "TD", "cd": "Chad", "desc_en": "", "name_ru": "Чад", "desc_ru": "" },
{ "mask": "+228-##-###-###", "cc": "TG", "cd": "Togo", "desc_en": "", "name_ru": "Того", "desc_ru": "" },
{ "mask": "+66-##-###-####", "cc": "TH", "cd": "Thailand ", "desc_en": "mobile", "name_ru": "Таиланд ", "desc_ru": "мобильные" },
{ "mask": "+66-##-###-###", "cc": "TH", "cd": "Thailand", "desc_en": "", "name_ru": "Таиланд", "desc_ru": "" },
{ "mask": "+992-##-###-####", "cc": "TJ", "cd": "Tajikistan", "desc_en": "", "name_ru": "Таджикистан", "desc_ru": "" },
{ "mask": "+690-####", "cc": "TK", "cd": "Tokelau", "desc_en": "", "name_ru": "Токелау", "desc_ru": "" },
{ "mask": "+670-###-####", "cc": "TL", "cd": "East Timor", "desc_en": "", "name_ru": "Восточный Тимор", "desc_ru": "" },
{ "mask": "+670-77#-#####", "cc": "TL", "cd": "East Timor", "desc_en": "Timor Telecom", "name_ru": "Восточный Тимор", "desc_ru": "Timor Telecom" },
{ "mask": "+670-78#-#####", "cc": "TL", "cd": "East Timor", "desc_en": "Timor Telecom", "name_ru": "Восточный Тимор", "desc_ru": "Timor Telecom" },
{ "mask": "+993-#-###-####", "cc": "TM", "cd": "Turkmenistan", "desc_en": "", "name_ru": "Туркменистан", "desc_ru": "" },
{ "mask": "+216-##-###-###", "cc": "TN", "cd": "Tunisia", "desc_en": "", "name_ru": "Тунис", "desc_ru": "" },
{ "mask": "+676-#####", "cc": "TO", "cd": "Tonga", "desc_en": "", "name_ru": "Тонга", "desc_ru": "" },
{ "mask": "+90(###)###-####", "cc": "TR", "cd": "Turkey", "desc_en": "", "name_ru": "Турция", "desc_ru": "" },
{ "mask": "+1(868)###-####", "cc": "TT", "cd": "Trinidad & Tobago", "desc_en": "", "name_ru": "Тринидад и Тобаго", "desc_ru": "" },
{ "mask": "+688-90####", "cc": "TV", "cd": "Tuvalu ", "desc_en": "mobile", "name_ru": "Тувалу ", "desc_ru": "мобильные" },
{ "mask": "+688-2####", "cc": "TV", "cd": "Tuvalu", "desc_en": "", "name_ru": "Тувалу", "desc_ru": "" },
{ "mask": "+886-#-####-####", "cc": "TW", "cd": "Taiwan", "desc_en": "", "name_ru": "Тайвань", "desc_ru": "" },
{ "mask": "+886-####-####", "cc": "TW", "cd": "Taiwan", "desc_en": "", "name_ru": "Тайвань", "desc_ru": "" },
{ "mask": "+255-##-###-####", "cc": "TZ", "cd": "Tanzania", "desc_en": "", "name_ru": "Танзания", "desc_ru": "" },
{ "mask": "+380(##)###-##-##", "cc": "UA", "cd": "Ukraine", "desc_en": "", "name_ru": "Украина", "desc_ru": "" },
{ "mask": "+256(###)###-###", "cc": "UG", "cd": "Uganda", "desc_en": "", "name_ru": "Уганда", "desc_ru": "" },
{ "mask": "+44-##-####-####", "cc": "UK", "cd": "United Kingdom", "desc_en": "", "name_ru": "Великобритания", "desc_ru": "" },
{ "mask": "+598-#-###-##-##", "cc": "UY", "cd": "Uruguay", "desc_en": "", "name_ru": "Уругвай", "desc_ru": "" },
{ "mask": "+998-##-###-####", "cc": "UZ", "cd": "Uzbekistan", "desc_en": "", "name_ru": "Узбекистан", "desc_ru": "" },
{ "mask": "+39-6-698-#####", "cc": "VA", "cd": "Vatican City", "desc_en": "", "name_ru": "Ватикан", "desc_ru": "" },
{ "mask": "+1(784)###-####", "cc": "VC", "cd": "Saint Vincent & the Grenadines", "desc_en": "", "name_ru": "Сент-Винсент и Гренадины", "desc_ru": "" },
{ "mask": "+58(###)###-####", "cc": "VE", "cd": "Venezuela", "desc_en": "", "name_ru": "Венесуэла", "desc_ru": "" },
{ "mask": "+1(284)###-####", "cc": "VG", "cd": "British Virgin Islands", "desc_en": "", "name_ru": "Британские Виргинские острова", "desc_ru": "" },
{ "mask": "+1(340)###-####", "cc": "VI", "cd": "US Virgin Islands", "desc_en": "", "name_ru": "Американские Виргинские острова", "desc_ru": "" },
{ "mask": "+84-##-####-###", "cc": "VN", "cd": "Vietnam", "desc_en": "", "name_ru": "Вьетнам", "desc_ru": "" },
{ "mask": "+84(###)####-###", "cc": "VN", "cd": "Vietnam", "desc_en": "", "name_ru": "Вьетнам", "desc_ru": "" },
{ "mask": "+678-##-#####", "cc": "VU", "cd": "Vanuatu ", "desc_en": "mobile", "name_ru": "Вануату ", "desc_ru": "мобильные" },
{ "mask": "+678-#####", "cc": "VU", "cd": "Vanuatu", "desc_en": "", "name_ru": "Вануату", "desc_ru": "" },
{ "mask": "+681-##-####", "cc": "WF", "cd": "Wallis and Futuna", "desc_en": "", "name_ru": "Уоллис и Футуна", "desc_ru": "" },
{ "mask": "+685-##-####", "cc": "WS", "cd": "Samoa", "desc_en": "", "name_ru": "Самоа", "desc_ru": "" },
{ "mask": "+967-###-###-###", "cc": "YE", "cd": "Yemen ", "desc_en": "mobile", "name_ru": "Йемен ", "desc_ru": "мобильные" },
{ "mask": "+967-#-###-###", "cc": "YE", "cd": "Yemen", "desc_en": "", "name_ru": "Йемен", "desc_ru": "" },
{ "mask": "+967-##-###-###", "cc": "YE", "cd": "Yemen", "desc_en": "", "name_ru": "Йемен", "desc_ru": "" },
{ "mask": "+27-##-###-####", "cc": "ZA", "cd": "South Africa", "desc_en": "", "name_ru": "Южно-Африканская Респ.", "desc_ru": "" },
{ "mask": "+260-##-###-####", "cc": "ZM", "cd": "Zambia", "desc_en": "", "name_ru": "Замбия", "desc_ru": "" },
{ "mask": "+263-#-######", "cc": "ZW", "cd": "Zimbabwe", "desc_en": "", "name_ru": "Зимбабве", "desc_ru": "" },
{ "mask": "+1(###)###-####", "cc": ["US", "CA"], "cd": "USA and Canada", "desc_en": "", "name_ru": "США и Канада", "desc_ru": "" }
]
+189
View File
@@ -0,0 +1,189 @@
[
{"mask": "+31-10-###-####", "cc": "NL", "cd": "Netherlands", "city": "Rotterdam"},
{"mask": "+31-111-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zierikzee"},
{"mask": "+31-113-###-###", "cc": "NL", "cd": "Netherlands", "city": "Goes"},
{"mask": "+31-114-###-###", "cc": "NL", "cd": "Netherlands", "city": "Hulst"},
{"mask": "+31-115-###-###", "cc": "NL", "cd": "Netherlands", "city": "Terneuzen"},
{"mask": "+31-117-###-###", "cc": "NL", "cd": "Netherlands", "city": "Oostburg"},
{"mask": "+31-118-###-###", "cc": "NL", "cd": "Netherlands", "city": "Middelburg"},
{"mask": "+31-13-###-####", "cc": "NL", "cd": "Netherlands", "city": "Tilburg"},
{"mask": "+31-14-###-####", "cc": "NL", "cd": "Netherlands", "city": "Intern gebruik door KPN"},
{"mask": "+31-15-###-####", "cc": "NL", "cd": "Netherlands", "city": "Delft"},
{"mask": "+31-161-###-###", "cc": "NL", "cd": "Netherlands", "city": "Rijen"},
{"mask": "+31-162-###-###", "cc": "NL", "cd": "Netherlands", "city": "Oosterhout"},
{"mask": "+31-164-###-###", "cc": "NL", "cd": "Netherlands", "city": "Bergen op Zoom"},
{"mask": "+31-165-###-###", "cc": "NL", "cd": "Netherlands", "city": "Roosendaal"},
{"mask": "+31-166-###-###", "cc": "NL", "cd": "Netherlands", "city": "Tholen"},
{"mask": "+31-167-###-###", "cc": "NL", "cd": "Netherlands", "city": "Steenbergen"},
{"mask": "+31-168-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zevenbergen"},
{"mask": "+31-172-###-###", "cc": "NL", "cd": "Netherlands", "city": "Alphen aan den Rijn"},
{"mask": "+31-174-###-###", "cc": "NL", "cd": "Netherlands", "city": "Naaldwijk"},
{"mask": "+31-180-###-###", "cc": "NL", "cd": "Netherlands", "city": "Krimpen aan den IJsel"},
{"mask": "+31-181-###-###", "cc": "NL", "cd": "Netherlands", "city": "Spijkenisse"},
{"mask": "+31-182-###-###", "cc": "NL", "cd": "Netherlands", "city": "Gouda"},
{"mask": "+31-183-###-###", "cc": "NL", "cd": "Netherlands", "city": "Gorinchem"},
{"mask": "+31-184-###-###", "cc": "NL", "cd": "Netherlands", "city": "Sliedrecht"},
{"mask": "+31-186-###-###", "cc": "NL", "cd": "Netherlands", "city": "Oud-Beijerland"},
{"mask": "+31-187-###-###", "cc": "NL", "cd": "Netherlands", "city": "Middelharnis"},
{"mask": "+31-20-###-####", "cc": "NL", "cd": "Netherlands", "city": "Amsterdam"},
{"mask": "+31-222-###-###", "cc": "NL", "cd": "Netherlands", "city": "Den Burg"},
{"mask": "+31-223-###-###", "cc": "NL", "cd": "Netherlands", "city": "Den Helder"},
{"mask": "+31-224-###-###", "cc": "NL", "cd": "Netherlands", "city": "Schagen"},
{"mask": "+31-226-###-###", "cc": "NL", "cd": "Netherlands", "city": "Noord-Scharwoude"},
{"mask": "+31-227-###-###", "cc": "NL", "cd": "Netherlands", "city": "Middenmeer"},
{"mask": "+31-228-###-###", "cc": "NL", "cd": "Netherlands", "city": "Enkhuizen"},
{"mask": "+31-229-###-###", "cc": "NL", "cd": "Netherlands", "city": "Hoorn"},
{"mask": "+31-23-###-####", "cc": "NL", "cd": "Netherlands", "city": "Haarlem"},
{"mask": "+31-24-###-####", "cc": "NL", "cd": "Netherlands", "city": "Nijmegen"},
{"mask": "+31-251-###-###", "cc": "NL", "cd": "Netherlands", "city": "Beverwijk"},
{"mask": "+31-252-###-###", "cc": "NL", "cd": "Netherlands", "city": "Hillegom"},
{"mask": "+31-255-###-###", "cc": "NL", "cd": "Netherlands", "city": "IJmuiden"},
{"mask": "+31-26-###-####", "cc": "NL", "cd": "Netherlands", "city": "Arnhem"},
{"mask": "+31-294-###-###", "cc": "NL", "cd": "Netherlands", "city": "Weesp"},
{"mask": "+31-297-###-###", "cc": "NL", "cd": "Netherlands", "city": "Uithoorn"},
{"mask": "+31-299-###-###", "cc": "NL", "cd": "Netherlands", "city": "Purmerend"},
{"mask": "+31-30-###-####", "cc": "NL", "cd": "Netherlands", "city": "Utrecht"},
{"mask": "+31-313-###-###", "cc": "NL", "cd": "Netherlands", "city": "Dieren"},
{"mask": "+31-314-###-###", "cc": "NL", "cd": "Netherlands", "city": "Doetinchem"},
{"mask": "+31-315-###-###", "cc": "NL", "cd": "Netherlands", "city": "Terborg"},
{"mask": "+31-316-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zevenaar"},
{"mask": "+31-317-###-###", "cc": "NL", "cd": "Netherlands", "city": "Wageningen"},
{"mask": "+31-318-###-###", "cc": "NL", "cd": "Netherlands", "city": "Ede"},
{"mask": "+31-320-###-###", "cc": "NL", "cd": "Netherlands", "city": "Lelystad"},
{"mask": "+31-321-###-###", "cc": "NL", "cd": "Netherlands", "city": "Dronten"},
{"mask": "+31-33-###-####", "cc": "NL", "cd": "Netherlands", "city": "Amersfoort"},
{"mask": "+31-341-###-###", "cc": "NL", "cd": "Netherlands", "city": "Harderwijk"},
{"mask": "+31-342-###-###", "cc": "NL", "cd": "Netherlands", "city": "Barneveld"},
{"mask": "+31-343-###-###", "cc": "NL", "cd": "Netherlands", "city": "Doorn"},
{"mask": "+31-344-###-###", "cc": "NL", "cd": "Netherlands", "city": "Tiel"},
{"mask": "+31-294-###-###", "cc": "NL", "cd": "Netherlands", "city": "Weesp"},
{"mask": "+31-297-###-###", "cc": "NL", "cd": "Netherlands", "city": "Uithoorn"},
{"mask": "+31-299-###-###", "cc": "NL", "cd": "Netherlands", "city": "Purmerend"},
{"mask": "+31-30-###-####", "cc": "NL", "cd": "Netherlands", "city": "Utrecht"},
{"mask": "+31-313-###-###", "cc": "NL", "cd": "Netherlands", "city": "Dieren"},
{"mask": "+31-314-###-###", "cc": "NL", "cd": "Netherlands", "city": "Doetinchem"},
{"mask": "+31-315-###-###", "cc": "NL", "cd": "Netherlands", "city": "Terborg"},
{"mask": "+31-316-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zevenaar"},
{"mask": "+31-317-###-###", "cc": "NL", "cd": "Netherlands", "city": "Wageningen"},
{"mask": "+31-318-###-###", "cc": "NL", "cd": "Netherlands", "city": "Ede"},
{"mask": "+31-320-###-###", "cc": "NL", "cd": "Netherlands", "city": "Lelystad"},
{"mask": "+31-321-###-###", "cc": "NL", "cd": "Netherlands", "city": "Dronten"},
{"mask": "+31-33-###-####", "cc": "NL", "cd": "Netherlands", "city": "Amersfoort"},
{"mask": "+31-341-###-###", "cc": "NL", "cd": "Netherlands", "city": "Harderwijk"},
{"mask": "+31-342-###-###", "cc": "NL", "cd": "Netherlands", "city": "Barneveld"},
{"mask": "+31-343-###-###", "cc": "NL", "cd": "Netherlands", "city": "Doorn"},
{"mask": "+31-344-###-###", "cc": "NL", "cd": "Netherlands", "city": "Tiel"},
{"mask": "+31-345-###-###", "cc": "NL", "cd": "Netherlands", "city": "Culemborg"},
{"mask": "+31-346-###-###", "cc": "NL", "cd": "Netherlands", "city": "Maarssen"},
{"mask": "+31-347-###-###", "cc": "NL", "cd": "Netherlands", "city": "Vianen"},
{"mask": "+31-348-###-###", "cc": "NL", "cd": "Netherlands", "city": "Woerden"},
{"mask": "+31-35-###-####", "cc": "NL", "cd": "Netherlands", "city": "Hilversum"},
{"mask": "+31-36-###-####", "cc": "NL", "cd": "Netherlands", "city": "Almere"},
{"mask": "+31-38-###-####", "cc": "NL", "cd": "Netherlands", "city": "Zwolle"},
{"mask": "+31-40-###-####", "cc": "NL", "cd": "Netherlands", "city": "Eindhoven"},
{"mask": "+31-411-###-###", "cc": "NL", "cd": "Netherlands", "city": "Boxtel"},
{"mask": "+31-412-###-###", "cc": "NL", "cd": "Netherlands", "city": "Oss"},
{"mask": "+31-413-###-###", "cc": "NL", "cd": "Netherlands", "city": "Veghel"},
{"mask": "+31-416-###-###", "cc": "NL", "cd": "Netherlands", "city": "Waalwijk"},
{"mask": "+31-418-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zaltbommel"},
{"mask": "+31-43-###-####", "cc": "NL", "cd": "Netherlands", "city": "Maastricht"},
{"mask": "+31-45-###-####", "cc": "NL", "cd": "Netherlands", "city": "Heerlen"},
{"mask": "+31-46-###-####", "cc": "NL", "cd": "Netherlands", "city": "Sittard"},
{"mask": "+31-475-###-###", "cc": "NL", "cd": "Netherlands", "city": "Roermond"},
{"mask": "+31-478-###-###", "cc": "NL", "cd": "Netherlands", "city": "Venray"},
{"mask": "+31-481-###-###", "cc": "NL", "cd": "Netherlands", "city": "Bemmel"},
{"mask": "+31-485-###-###", "cc": "NL", "cd": "Netherlands", "city": "Cuijk"},
{"mask": "+31-486-###-###", "cc": "NL", "cd": "Netherlands", "city": "Grave"},
{"mask": "+31-487-###-###", "cc": "NL", "cd": "Netherlands", "city": "Druten"},
{"mask": "+31-488-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zetten"},
{"mask": "+31-492-###-###", "cc": "NL", "cd": "Netherlands", "city": "Helmond"},
{"mask": "+31-493-###-###", "cc": "NL", "cd": "Netherlands", "city": "Deurne"},
{"mask": "+31-495-###-###", "cc": "NL", "cd": "Netherlands", "city": "Weert"},
{"mask": "+31-497-###-###", "cc": "NL", "cd": "Netherlands", "city": "Eersel"},
{"mask": "+31-499-###-###", "cc": "NL", "cd": "Netherlands", "city": "Best"},
{"mask": "+31-50-###-####", "cc": "NL", "cd": "Netherlands", "city": "Groningen"},
{"mask": "+31-511-###-###", "cc": "NL", "cd": "Netherlands", "city": "Feanw�lden"},
{"mask": "+31-512-###-###", "cc": "NL", "cd": "Netherlands", "city": "Drachten"},
{"mask": "+31-513-###-###", "cc": "NL", "cd": "Netherlands", "city": "Heerenveen"},
{"mask": "+31-514-###-###", "cc": "NL", "cd": "Netherlands", "city": "Balk"},
{"mask": "+31-515-###-###", "cc": "NL", "cd": "Netherlands", "city": "Sneek"},
{"mask": "+31-516-###-###", "cc": "NL", "cd": "Netherlands", "city": "Oosterwolde"},
{"mask": "+31-517-###-###", "cc": "NL", "cd": "Netherlands", "city": "Franeker"},
{"mask": "+31-518-###-###", "cc": "NL", "cd": "Netherlands", "city": "St Annaparochie"},
{"mask": "+31-519-###-###", "cc": "NL", "cd": "Netherlands", "city": "Dokkum"},
{"mask": "+31-521-###-###", "cc": "NL", "cd": "Netherlands", "city": "Steenwijk"},
{"mask": "+31-522-###-###", "cc": "NL", "cd": "Netherlands", "city": "Meppel"},
{"mask": "+31-523-###-###", "cc": "NL", "cd": "Netherlands", "city": "Dedemsvaart"},
{"mask": "+31-524-###-###", "cc": "NL", "cd": "Netherlands", "city": "Coevorden"},
{"mask": "+31-525-###-###", "cc": "NL", "cd": "Netherlands", "city": "Elburg"},
{"mask": "+31-527-###-###", "cc": "NL", "cd": "Netherlands", "city": "Emmeloord"},
{"mask": "+31-528-###-###", "cc": "NL", "cd": "Netherlands", "city": "Hoogeveen"},
{"mask": "+31-529-###-###", "cc": "NL", "cd": "Netherlands", "city": "Ommen"},
{"mask": "+31-53-###-####", "cc": "NL", "cd": "Netherlands", "city": "Enschede"},
{"mask": "+31-541-###-###", "cc": "NL", "cd": "Netherlands", "city": "Oldenzaal"},
{"mask": "+31-543-###-###", "cc": "NL", "cd": "Netherlands", "city": "Winterswijk"},
{"mask": "+31-544-###-###", "cc": "NL", "cd": "Netherlands", "city": "Groenlo"},
{"mask": "+31-545-###-###", "cc": "NL", "cd": "Netherlands", "city": "Neede"},
{"mask": "+31-546-###-###", "cc": "NL", "cd": "Netherlands", "city": "Almelo"},
{"mask": "+31-547-###-###", "cc": "NL", "cd": "Netherlands", "city": "Goor"},
{"mask": "+31-548-###-###", "cc": "NL", "cd": "Netherlands", "city": "Rijssen"},
{"mask": "+31-55-###-####", "cc": "NL", "cd": "Netherlands", "city": "Apeldoorn"},
{"mask": "+31-561-###-###", "cc": "NL", "cd": "Netherlands", "city": "Wolvega"},
{"mask": "+31-562-###-###", "cc": "NL", "cd": "Netherlands", "city": "West-Terschelling"},
{"mask": "+31-566-###-###", "cc": "NL", "cd": "Netherlands", "city": "Jirnsum"},
{"mask": "+31-570-###-###", "cc": "NL", "cd": "Netherlands", "city": "Deventer"},
{"mask": "+31-571-###-###", "cc": "NL", "cd": "Netherlands", "city": "Twello"},
{"mask": "+31-572-###-###", "cc": "NL", "cd": "Netherlands", "city": "Raalte"},
{"mask": "+31-573-###-###", "cc": "NL", "cd": "Netherlands", "city": "Lochem"},
{"mask": "+31-575-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zutphen"},
{"mask": "+31-577-###-###", "cc": "NL", "cd": "Netherlands", "city": "Uddel"},
{"mask": "+31-578-###-###", "cc": "NL", "cd": "Netherlands", "city": "Epe"},
{"mask": "+31-58-###-####", "cc": "NL", "cd": "Netherlands", "city": "Leeuwarden"},
{"mask": "+31-591-###-###", "cc": "NL", "cd": "Netherlands", "city": "Emmen"},
{"mask": "+31-592-###-###", "cc": "NL", "cd": "Netherlands", "city": "Assen"},
{"mask": "+31-593-###-###", "cc": "NL", "cd": "Netherlands", "city": "Beilen"},
{"mask": "+31-594-###-###", "cc": "NL", "cd": "Netherlands", "city": "Zuidhorn"},
{"mask": "+31-595-###-###", "cc": "NL", "cd": "Netherlands", "city": "Warffum"},
{"mask": "+31-596-###-###", "cc": "NL", "cd": "Netherlands", "city": "Appingedam"},
{"mask": "+31-597-###-###", "cc": "NL", "cd": "Netherlands", "city": "Winschoten"},
{"mask": "+31-598-###-###", "cc": "NL", "cd": "Netherlands", "city": "Hoogezand"},
{"mask": "+31-599-###-###", "cc": "NL", "cd": "Netherlands", "city": "Stadskanaal"},
{"mask": "+31-70-###-####", "cc": "NL", "cd": "Netherlands", "city": "Den Haag"},
{"mask": "+31-71-###-####", "cc": "NL", "cd": "Netherlands", "city": "Leiden"},
{"mask": "+31-72-###-####", "cc": "NL", "cd": "Netherlands", "city": "Alkmaar"},
{"mask": "+31-73-###-####", "cc": "NL", "cd": "Netherlands", "city": "'s-Hertogenbosch"},
{"mask": "+31-74-###-####", "cc": "NL", "cd": "Netherlands", "city": "Hengelo"},
{"mask": "+31-75-###-####", "cc": "NL", "cd": "Netherlands", "city": "Zaandam"},
{"mask": "+31-76-###-####", "cc": "NL", "cd": "Netherlands", "city": "Breda"},
{"mask": "+31-77-###-####", "cc": "NL", "cd": "Netherlands", "city": "Venlo"},
{"mask": "+31-78-###-####", "cc": "NL", "cd": "Netherlands", "city": "Dordrecht"},
{"mask": "+31-79-###-####", "cc": "NL", "cd": "Netherlands", "city": "Zoetermeer"},
{"mask": "+31-61-###-####", "cc": "NL", "cd": "Netherlands", "city": "Mobiele nummers"},
{"mask": "+31-62-###-####", "cc": "NL", "cd": "Netherlands", "city": "Mobiele nummers"},
{"mask": "+31-63-###-####", "cc": "NL", "cd": "Netherlands", "city": "Mobiele nummers"},
{"mask": "+31-64-###-####", "cc": "NL", "cd": "Netherlands", "city": "Mobiele nummers"},
{"mask": "+31-65-###-####", "cc": "NL", "cd": "Netherlands", "city": "Mobiele nummers"},
{"mask": "+31-68-###-####", "cc": "NL", "cd": "Netherlands", "city": "Mobiele nummers"},
{"mask": "+31-69-###-####", "cc": "NL", "cd": "Netherlands", "city": "Mobiele nummers"},
{"mask": "+31-66-###-####", "cc": "NL", "cd": "Netherlands", "city": "Semafonie"},
{"mask": "+31-670-###-###", "cc": "NL", "cd": "Netherlands", "city": "Videotex"},
{"mask": "+31-671-###-###", "cc": "NL", "cd": "Netherlands", "city": "Videotex"},
{"mask": "+31-672-###-###", "cc": "NL", "cd": "Netherlands", "city": "Videotex"},
{"mask": "+31-673-###-###", "cc": "NL", "cd": "Netherlands", "city": "Videotex"},
{"mask": "+31-674-###-###", "cc": "NL", "cd": "Netherlands", "city": "Videotex"},
{"mask": "+31-675-###-###", "cc": "NL", "cd": "Netherlands", "city": "Videotex"},
{"mask": "+31-676-###-###", "cc": "NL", "cd": "Netherlands", "city": "Inbelnummers van internetproviders"},
{"mask": "+31-800-###-###", "cc": "NL", "cd": "Netherlands", "city": "Gratis informatienummers"},
{"mask": "+31-82-###-####", "cc": "NL", "cd": "Netherlands", "city": "Virtual Private Network"},
{"mask": "+31-88-###-####", "cc": "NL", "cd": "Netherlands", "city": "Bedrijfsnummers"},
{"mask": "+31-900-###-###", "cc": "NL", "cd": "Netherlands", "city": "Betaalde informatienummers"},
{"mask": "+31-906-###-###", "cc": "NL", "cd": "Netherlands", "city": "Betaalde informatienummers"},
{"mask": "+31-909-###-###", "cc": "NL", "cd": "Netherlands", "city": "Betaalde informatienummers"},
{
"mask": "+31-91-###-####",
"cc": "NL",
"cd": "Netherlands",
"city": "Plaatsonafhankelijk netnummer, geschikt voor beeldtelefonie of lijnen met verhoogde kwaliteit"
}
]
File diff suppressed because it is too large Load Diff
+617
View File
@@ -0,0 +1,617 @@
[
{ "mask": "+44(113)-###-####", "cc": "UK", "cd": "United Kingdom", "city": "Leeds" },
{ "mask": "+44(114)-###-####", "cc": "UK", "cd": "United Kingdom", "city": "Sheffield" },
{ "mask": "+44(115)-###-####", "cc": "UK", "cd": "United Kingdom", "city": "Nottingham" },
{ "mask": "+44(116)-###-####", "cc": "UK", "cd": "United Kingdom", "city": "Leicester" },
{ "mask": "+44(117)-###-####", "cc": "UK", "cd": "United Kingdom", "city": "Bristol" },
{ "mask": "+44(118)-###-####", "cc": "UK", "cd": "United Kingdom", "city": "Reading" },
{ "mask": "+44(1200)-######", "cc": "UK", "cd": "United Kingdom", "city": "Clitheroe" },
{ "mask": "+44(1202)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bournemouth" },
{ "mask": "+44(1204)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bolton" },
{ "mask": "+44(1205)-######", "cc": "UK", "cd": "United Kingdom", "city": "Boston" },
{ "mask": "+44(1206)-######", "cc": "UK", "cd": "United Kingdom", "city": "Colchester" },
{ "mask": "+44(1207)-######", "cc": "UK", "cd": "United Kingdom", "city": "Consett" },
{ "mask": "+44(1208)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bodmin" },
{ "mask": "+44(1209)-######", "cc": "UK", "cd": "United Kingdom", "city": "Redruth" },
{ "mask": "+44(121)-###-####", "cc": "UK", "cd": "United Kingdom", "city": "Birmingham" },
{ "mask": "+44(1223)-######", "cc": "UK", "cd": "United Kingdom", "city": "Cambridge" },
{ "mask": "+44(1224)-######", "cc": "UK", "cd": "United Kingdom", "city": "Aberdeen" },
{ "mask": "+44(1225)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bath" },
{ "mask": "+44(1226)-######", "cc": "UK", "cd": "United Kingdom", "city": "Barnsley" },
{ "mask": "+44(1227)-######", "cc": "UK", "cd": "United Kingdom", "city": "Canterbury" },
{ "mask": "+44(1228)-######", "cc": "UK", "cd": "United Kingdom", "city": "Carlisle" },
{ "mask": "+44(1229)-######", "cc": "UK", "cd": "United Kingdom", "city": "Barrow-in-Furness(2,4,5,6,8), Millom(3,7,9)" },
{ "mask": "+44(1233)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ashford (Kent)" },
{ "mask": "+44(1234)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bedford" },
{ "mask": "+44(1235)-######", "cc": "UK", "cd": "United Kingdom", "city": "Abingdon" },
{ "mask": "+44(1236)-######", "cc": "UK", "cd": "United Kingdom", "city": "Coatbridge" },
{ "mask": "+44(1237)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bideford" },
{ "mask": "+44(1239)-######", "cc": "UK", "cd": "United Kingdom", "city": "Cardigan" },
{ "mask": "+44(1241)-######", "cc": "UK", "cd": "United Kingdom", "city": "Arbroath" },
{ "mask": "+44(1242)-######", "cc": "UK", "cd": "United Kingdom", "city": "Cheltenham" },
{ "mask": "+44(1243)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chichester" },
{ "mask": "+44(1244)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chester" },
{ "mask": "+44(1245)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chelmsford" },
{ "mask": "+44(1246)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chesterfield" },
{ "mask": "+44(1248)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bangor (Gwynedd)" },
{ "mask": "+44(1249)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chippenham" },
{ "mask": "+44(1250)-######", "cc": "UK", "cd": "United Kingdom", "city": "Blairgowrie" },
{ "mask": "+44(1252)-######", "cc": "UK", "cd": "United Kingdom", "city": "Aldershot" },
{ "mask": "+44(1253)-######", "cc": "UK", "cd": "United Kingdom", "city": "Blackpool" },
{ "mask": "+44(1254)-######", "cc": "UK", "cd": "United Kingdom", "city": "Blackburn" },
{ "mask": "+44(1255)-######", "cc": "UK", "cd": "United Kingdom", "city": "Clacton-on-Sea" },
{ "mask": "+44(1256)-######", "cc": "UK", "cd": "United Kingdom", "city": "Basingstoke" },
{ "mask": "+44(1257)-######", "cc": "UK", "cd": "United Kingdom", "city": "Coppull" },
{ "mask": "+44(1258)-######", "cc": "UK", "cd": "United Kingdom", "city": "Blandford" },
{ "mask": "+44(1259)-######", "cc": "UK", "cd": "United Kingdom", "city": "Alloa" },
{ "mask": "+44(1260)-######", "cc": "UK", "cd": "United Kingdom", "city": "Congleton" },
{ "mask": "+44(1261)-######", "cc": "UK", "cd": "United Kingdom", "city": "Banff" },
{ "mask": "+44(1262)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bridlington" },
{ "mask": "+44(1263)-######", "cc": "UK", "cd": "United Kingdom", "city": "Cromer" },
{ "mask": "+44(1264)-######", "cc": "UK", "cd": "United Kingdom", "city": "Andover" },
{ "mask": "+44(1267)-######", "cc": "UK", "cd": "United Kingdom", "city": "Carmarthen" },
{ "mask": "+44(1268)-######", "cc": "UK", "cd": "United Kingdom", "city": "Basildon" },
{ "mask": "+44(1269)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ammanford" },
{ "mask": "+44(1270)-######", "cc": "UK", "cd": "United Kingdom", "city": "Crewe" },
{ "mask": "+44(1271)-######", "cc": "UK", "cd": "United Kingdom", "city": "Barnstaple" },
{ "mask": "+44(1273)-######", "cc": "UK", "cd": "United Kingdom", "city": "Brighton" },
{ "mask": "+44(1274)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bradford" },
{ "mask": "+44(1275)-######", "cc": "UK", "cd": "United Kingdom", "city": "Clevedon" },
{ "mask": "+44(1276)-######", "cc": "UK", "cd": "United Kingdom", "city": "Camberley" },
{ "mask": "+44(1277)-######", "cc": "UK", "cd": "United Kingdom", "city": "Brentwood" },
{ "mask": "+44(1278)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bridgwater" },
{ "mask": "+44(1279)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bishops Stortford" },
{ "mask": "+44(1280)-######", "cc": "UK", "cd": "United Kingdom", "city": "Buckingham" },
{ "mask": "+44(1282)-######", "cc": "UK", "cd": "United Kingdom", "city": "Burnley" },
{ "mask": "+44(1283)-######", "cc": "UK", "cd": "United Kingdom", "city": "Burton-on-Trent" },
{ "mask": "+44(1284)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bury St Edmunds" },
{ "mask": "+44(1285)-######", "cc": "UK", "cd": "United Kingdom", "city": "Cirencester" },
{ "mask": "+44(1286)-######", "cc": "UK", "cd": "United Kingdom", "city": "Caernarfon" },
{ "mask": "+44(1287)-######", "cc": "UK", "cd": "United Kingdom", "city": "Guisborough" },
{ "mask": "+44(1288)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bude" },
{ "mask": "+44(1289)-######", "cc": "UK", "cd": "United Kingdom", "city": "Berwick-upon-Tweed" },
{ "mask": "+44(1290)-######", "cc": "UK", "cd": "United Kingdom", "city": "Cumnock" },
{ "mask": "+44(1291)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chepstow" },
{ "mask": "+44(1292)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ayr" },
{ "mask": "+44(1293)-######", "cc": "UK", "cd": "United Kingdom", "city": "Crawley" },
{ "mask": "+44(1294)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ardrossan" },
{ "mask": "+44(1295)-######", "cc": "UK", "cd": "United Kingdom", "city": "Banbury" },
{ "mask": "+44(1296)-######", "cc": "UK", "cd": "United Kingdom", "city": "Aylesbury" },
{ "mask": "+44(1297)-######", "cc": "UK", "cd": "United Kingdom", "city": "Axminster" },
{ "mask": "+44(1298)-######", "cc": "UK", "cd": "United Kingdom", "city": "Buxton" },
{ "mask": "+44(1299)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bewdley" },
{ "mask": "+44(1300)-######", "cc": "UK", "cd": "United Kingdom", "city": "Cerne Abbas" },
{ "mask": "+44(1301)-######", "cc": "UK", "cd": "United Kingdom", "city": "Arrochar" },
{ "mask": "+44(1302)-######", "cc": "UK", "cd": "United Kingdom", "city": "Doncaster" },
{ "mask": "+44(1303)-######", "cc": "UK", "cd": "United Kingdom", "city": "Folkestone" },
{ "mask": "+44(1304)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dover" },
{ "mask": "+44(1305)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dorchester" },
{ "mask": "+44(1306)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dorking" },
{ "mask": "+44(1307)-######", "cc": "UK", "cd": "United Kingdom", "city": "Forfar" },
{ "mask": "+44(1308)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bridport" },
{ "mask": "+44(1309)-######", "cc": "UK", "cd": "United Kingdom", "city": "Forres" },
{ "mask": "+44(131)-###-###", "cc": "UK", "cd": "United Kingdom", "city": "Edinburgh" },
{ "mask": "+44(1320)-######", "cc": "UK", "cd": "United Kingdom", "city": "Fort Augustus" },
{ "mask": "+44(1322)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dartford" },
{ "mask": "+44(1323)-######", "cc": "UK", "cd": "United Kingdom", "city": "Eastbourne" },
{ "mask": "+44(1324)-######", "cc": "UK", "cd": "United Kingdom", "city": "Falkirk" },
{ "mask": "+44(1325)-######", "cc": "UK", "cd": "United Kingdom", "city": "Darlington" },
{ "mask": "+44(1326)-######", "cc": "UK", "cd": "United Kingdom", "city": "Falmouth" },
{ "mask": "+44(1327)-######", "cc": "UK", "cd": "United Kingdom", "city": "Daventry" },
{ "mask": "+44(1328)-######", "cc": "UK", "cd": "United Kingdom", "city": "Fakenham" },
{ "mask": "+44(1329)-######", "cc": "UK", "cd": "United Kingdom", "city": "Fareham" },
{ "mask": "+44(1330)-######", "cc": "UK", "cd": "United Kingdom", "city": "Banchory" },
{ "mask": "+44(1332)-######", "cc": "UK", "cd": "United Kingdom", "city": "Derby" },
{ "mask": "+44(1333)-######", "cc": "UK", "cd": "United Kingdom", "city": "Peat Inn" },
{ "mask": "+44(1334)-######", "cc": "UK", "cd": "United Kingdom", "city": "St Andrews" },
{ "mask": "+44(1335)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ashbourne" },
{ "mask": "+44(1337)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ladybank" },
{ "mask": "+44(1339)-######", "cc": "UK", "cd": "United Kingdom", "city": "Aboyne(2,3,5,8), Ballater(4,6,7,9)" },
{ "mask": "+44(1340)-######", "cc": "UK", "cd": "United Kingdom", "city": "Craigellachie" },
{ "mask": "+44(1341)-######", "cc": "UK", "cd": "United Kingdom", "city": "Barmouth" },
{ "mask": "+44(1342)-######", "cc": "UK", "cd": "United Kingdom", "city": "East Grinstead" },
{ "mask": "+44(1343)-######", "cc": "UK", "cd": "United Kingdom", "city": "Elgin" },
{ "mask": "+44(1344)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bracknell" },
{ "mask": "+44(1346)-######", "cc": "UK", "cd": "United Kingdom", "city": "Fraserburgh" },
{ "mask": "+44(1347)-######", "cc": "UK", "cd": "United Kingdom", "city": "Easingwold" },
{ "mask": "+44(1348)-######", "cc": "UK", "cd": "United Kingdom", "city": "Fishguard" },
{ "mask": "+44(1349)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dingwall" },
{ "mask": "+44(1350)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dunkeld" },
{ "mask": "+44(1352)-######", "cc": "UK", "cd": "United Kingdom", "city": "Mold" },
{ "mask": "+44(1353)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ely" },
{ "mask": "+44(1354)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chatteris" },
{ "mask": "+44(1355)-######", "cc": "UK", "cd": "United Kingdom", "city": "East Kilbride" },
{ "mask": "+44(1356)-######", "cc": "UK", "cd": "United Kingdom", "city": "Brechin" },
{ "mask": "+44(1357)-######", "cc": "UK", "cd": "United Kingdom", "city": "Strathaven" },
{ "mask": "+44(1358)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ellon" },
{ "mask": "+44(1359)-######", "cc": "UK", "cd": "United Kingdom", "city": "Pakenham" },
{ "mask": "+44(1360)-######", "cc": "UK", "cd": "United Kingdom", "city": "Killearn" },
{ "mask": "+44(1361)-######", "cc": "UK", "cd": "United Kingdom", "city": "Duns" },
{ "mask": "+44(1362)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dereham" },
{ "mask": "+44(1363)-######", "cc": "UK", "cd": "United Kingdom", "city": "Crediton" },
{ "mask": "+44(1364)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ashburton" },
{ "mask": "+44(1366)-######", "cc": "UK", "cd": "United Kingdom", "city": "Downham Market" },
{ "mask": "+44(1367)-######", "cc": "UK", "cd": "United Kingdom", "city": "Faringdon" },
{ "mask": "+44(1368)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dunbar" },
{ "mask": "+44(1369)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dunoon" },
{ "mask": "+44(1371)-######", "cc": "UK", "cd": "United Kingdom", "city": "Great Dunmow" },
{ "mask": "+44(1372)-######", "cc": "UK", "cd": "United Kingdom", "city": "Esher" },
{ "mask": "+44(1373)-######", "cc": "UK", "cd": "United Kingdom", "city": "Frome" },
{ "mask": "+44(1375)-######", "cc": "UK", "cd": "United Kingdom", "city": "Grays Thurrock" },
{ "mask": "+44(1376)-######", "cc": "UK", "cd": "United Kingdom", "city": "Braintree" },
{ "mask": "+44(1377)-######", "cc": "UK", "cd": "United Kingdom", "city": "Driffield" },
{ "mask": "+44(1379)-######", "cc": "UK", "cd": "United Kingdom", "city": "Diss" },
{ "mask": "+44(1380)-######", "cc": "UK", "cd": "United Kingdom", "city": "Devizes" },
{ "mask": "+44(1381)-######", "cc": "UK", "cd": "United Kingdom", "city": "Fortrose" },
{ "mask": "+44(1382)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dundee" },
{ "mask": "+44(1383)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dunfermline" },
{ "mask": "+44(1384)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dudley" },
{ "mask": "+44(1386)-######", "cc": "UK", "cd": "United Kingdom", "city": "Evesham" },
{ "mask": "+44(1387)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dumfries" },
{ "mask": "+44(13873)-####[#]", "cc": "UK", "cd": "United Kingdom", "city": "Langholm" },
{ "mask": "+44(1388)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bishop Auckland(3,4,6,7,8,9), Stanhope(2,5)" },
{ "mask": "+44(1389)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dumbarton" },
{ "mask": "+44(1392)-######", "cc": "UK", "cd": "United Kingdom", "city": "Exeter" },
{ "mask": "+44(1394)-######", "cc": "UK", "cd": "United Kingdom", "city": "Felixstowe" },
{ "mask": "+44(1395)-######", "cc": "UK", "cd": "United Kingdom", "city": "Budleigh Salterton" },
{ "mask": "+44(1397)-######", "cc": "UK", "cd": "United Kingdom", "city": "Fort William" },
{ "mask": "+44(1398)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dulverton" },
{ "mask": "+44(1400)-######", "cc": "UK", "cd": "United Kingdom", "city": "Honington" },
{ "mask": "+44(1403)-######", "cc": "UK", "cd": "United Kingdom", "city": "Horsham" },
{ "mask": "+44(1404)-######", "cc": "UK", "cd": "United Kingdom", "city": "Honiton" },
{ "mask": "+44(1405)-######", "cc": "UK", "cd": "United Kingdom", "city": "Goole" },
{ "mask": "+44(1406)-######", "cc": "UK", "cd": "United Kingdom", "city": "Holbeach" },
{ "mask": "+44(1407)-######", "cc": "UK", "cd": "United Kingdom", "city": "Holyhead" },
{ "mask": "+44(1408)-######", "cc": "UK", "cd": "United Kingdom", "city": "Golspie" },
{ "mask": "+44(1409)-######", "cc": "UK", "cd": "United Kingdom", "city": "Holsworthy" },
{ "mask": "+44(141)-###-###", "cc": "UK", "cd": "United Kingdom", "city": "Glasgow" },
{ "mask": "+44(1420)-######", "cc": "UK", "cd": "United Kingdom", "city": "Alton" },
{ "mask": "+44(1422)-######", "cc": "UK", "cd": "United Kingdom", "city": "Halifax" },
{ "mask": "+44(1423)-######", "cc": "UK", "cd": "United Kingdom", "city": "Boroughbridge(3,4,9), Harrogate(2,5,6,7,8)" },
{ "mask": "+44(1424)-######", "cc": "UK", "cd": "United Kingdom", "city": "Hastings" },
{ "mask": "+44(1425)-######", "cc": "UK", "cd": "United Kingdom", "city": "Ringwood" },
{ "mask": "+44(1427)-######", "cc": "UK", "cd": "United Kingdom", "city": "Gainsborough" },
{ "mask": "+44(1428)-######", "cc": "UK", "cd": "United Kingdom", "city": "Haslemere" },
{ "mask": "+44(1429)-######", "cc": "UK", "cd": "United Kingdom", "city": "Hartlepool" },
{ "mask": "+44(1430)-######", "cc": "UK", "cd": "United Kingdom", "city": "Market Weighton(6,7,8,9), North Cave(2,3,4,5)" },
{ "mask": "+44(1431)-######", "cc": "UK", "cd": "United Kingdom", "city": "Helmsdale" },
{ "mask": "+44(1432)-######", "cc": "UK", "cd": "United Kingdom", "city": "Hereford" },
{ "mask": "+44(1433)-######", "cc": "UK", "cd": "United Kingdom", "city": "Hathersage" },
{ "mask": "+44(1434)-######", "cc": "UK", "cd": "United Kingdom", "city": "Bellingham(2,4,9), Haltwhistle(3,5), Hexham(6,7,8)" },
{ "mask": "+44(1435)-######", "cc": "UK", "cd": "United Kingdom", "city": "Heathfield" },
{ "mask": "+44(1436)-######", "cc": "UK", "cd": "United Kingdom", "city": "Helensburgh" },
{ "mask": "+44(1437)-######", "cc": "UK", "cd": "United Kingdom", "city": "Clynderwen(2,3,4,5), Haverfordwest(6,7,8,9)" },
{ "mask": "+44(1438)-######", "cc": "UK", "cd": "United Kingdom", "city": "Stevenage" },
{ "mask": "+44(1439)-######", "cc": "UK", "cd": "United Kingdom", "city": "Helmsley" },
{ "mask": "+44(1440)-######", "cc": "UK", "cd": "United Kingdom", "city": "Haverhill" },
{ "mask": "+44(1442)-######", "cc": "UK", "cd": "United Kingdom", "city": "Hemel Hempstead" },
{ "mask": "+44(1443)-######", "cc": "UK", "cd": "United Kingdom", "city": "Pontypridd" },
{ "mask": "+44(1444)-######", "cc": "UK", "cd": "United Kingdom", "city": "Haywards Heath" },
{ "mask": "+44(1445)-######", "cc": "UK", "cd": "United Kingdom", "city": "Gairloch" },
{ "mask": "+44(1446)-######", "cc": "UK", "cd": "United Kingdom", "city": "Barry" },
{ "mask": "+44(1449)-######", "cc": "UK", "cd": "United Kingdom", "city": "Stowmarket" },
{ "mask": "+44(1450)-######", "cc": "UK", "cd": "United Kingdom", "city": "Hawick" },
{ "mask": "+44(1451)-######", "cc": "UK", "cd": "United Kingdom", "city": "Stow-on-the-Wold" },
{ "mask": "+44(1452)-######", "cc": "UK", "cd": "United Kingdom", "city": "Gloucester" },
{ "mask": "+44(1453)-######", "cc": "UK", "cd": "United Kingdom", "city": "Dursley" },
{ "mask": "+44(1454)-######", "cc": "UK", "cd": "United Kingdom", "city": "Chipping Sodbury" },
{ "mask": "+44(1455)-######", "cc": "UK", "cd": "United Kingdom", "city": "Hinckley" },
{ "mask": "+44(1456)-######", "cc": "UK", "cd": "United Kingdom", "city": "Glenurquhart" }
//
// //http://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom
// 01457 Glossop
// 01458 Glastonbury
// 01460 Chard
// 01461 Gretna
// 01462 Hitchin
// 01463 Inverness
// 01464 Insch
// 01465 Girvan
// 01466 Huntly
// 01467 Inverurie
// 01469 Killingholme
// 01470 Isle of Skye - Edinbane
// 01471 Isle of Skye - Broadford
// 01472 Grimsby
// 01473 Ipswich
// 01474 Gravesend
// 01475 Greenock
// 01476 Grantham
// 01477 Holmes Chapel
// 01478 Isle of Skye - Portree
// 01479 Grantown-on-Spey
// 01480 Huntingdon
// 01481 Guernsey
// 01482 Hull
// 01483 Guildford
// 01484 Huddersfield
// 01485 Hunstanton
// 01487 Warboys
// 01488 Hungerford
// 01489 Bishops Waltham
// 01490 Corwen
// 01491 Henley-on-Thames
// 01492 Colwyn Bay
// 01493 Great Yarmouth
// 01494 High Wycombe
// 01495 Pontypool
// 01496 Port Ellen
// 01497 Hay-on-Wye
// 01499 Inveraray
// 01501 Harthill
// 01502 Lowestoft
// 01503 Looe
// 01505 Johnstone
// 01506 Bathgate
// 01507 Alford (Lincs)(4,8,9), Louth (3,6,7), Spilsby(2,5)
// 01508 Brooke
// 01509 Loughborough
// 0151 Liverpool
// 01520 Lochcarron
// 01522 Lincoln
// 01524 Lancaster
// 015242 Hornby
// 01525 Leighton Buzzard
// 01526 Martin
// 01527 Redditch
// 01528 Laggan
// 01529 Sleaford
// 01530 Coalville
// 01531 Ledbury
// 01534 Jersey
// 01535 Keighley
// 01536 Kettering
// 01538 Ipstones
// 01539 Kendal
// 015394 Hawkshead
// 015395 Grange-over-Sands
// 015396 Sedbergh
// 01540 Kingussie
// 01542 Keith
// 01543 Cannock
// 01544 Kington
// 01545 Llanarth
// 01546 Lochgilphead
// 01547 Knighton
// 01548 Kingsbridge
// 01549 Lairg
// 01550 Llandovery
// 01553 Kings Lynn
// 01554 Llanelli
// 01555 Lanark
// 01556 Castle Douglas
// 01557 Kirkcudbright
// 01558 Llandeilo
// 01559 Llandysul
// 01560 Moscow
// 01561 Laurencekirk
// 01562 Kidderminster
// 01563 Kilmarnock
// 01564 Lapworth
// 01565 Knutsford
// 01566 Launceston
// 01567 Killin
// 01568 Leominster
// 01569 Stonehaven
// 01570 Lampeter
// 01571 Lochinver
// 01572 Oakham
// 01573 Kelso
// 01575 Kirriemuir
// 01576 Lockerbie
// 01577 Kinross
// 01578 Lauder
// 01579 Liskeard
// 01580 Cranbrook
// 01581 New Luce
// 01582 Luton
// 01583 Carradale
// 01584 Ludlow
// 01586 Campbeltown
// 01588 Bishops Castle
// 01590 Lymington
// 01591 Llanwrtyd Wells
// 01592 Kirkcaldy
// 01593 Lybster
// 01594 Lydney
// 01595 Lerwick, Foula(75), Fair Isle(76)
// 01597 Llandrindod Wells
// 01598 Lynton
// 01599 Kyle
// 01600 Monmouth
// 01603 Norwich
// 01604 Northampton
// 01606 Northwich
// 01608 Chipping Norton
// 01609 Northallerton
// 0161 Manchester
// 01620 North Berwick
// 01621 Maldon
// 01622 Maidstone
// 01623 Mansfield
// 01624 Isle of Man
// 01625 Macclesfield
// 01626 Newton Abbot
// 01628 Maidenhead
// 01629 Matlock
// 01630 Market Drayton
// 01631 Oban
// 01633 Newport
// 01634 Medway
// 01635 Newbury
// 01636 Newark
// 01637 Newquay
// 01638 Newmarket
// 01639 Neath
// 01641 Strathy
// 01642 Middlesbrough
// 01643 Minehead
// 01644 New Galloway
// 01646 Milford Haven
// 01647 Moretonhampstead
// 01650 Cemmaes Road
// 01651 Oldmeldrum
// 01652 Brigg
// 01653 Malton
// 01654 Machynlleth
// 01655 Maybole
// 01656 Bridgend
// 01659 Sanquhar
// 01661 Prudhoe
// 01663 New Mills
// 01664 Melton Mowbray
// 01665 Alnwick
// 01666 Malmesbury
// 01667 Nairn
// 01668 Bamburgh
// 01669 Rothbury
// 01670 Morpeth
// 01671 Newton Stewart
// 01672 Marlborough
// 01673 Market Rasen
// 01674 Montrose
// 01675 Coleshill
// 01676 Meriden
// 01677 Bedale
// 01678 Bala
// 01680 Isle of Mull - Craignure
// 01681 Isle of Mull - Fionnphort
// 01683 Moffat
// 01684 Malvern
// 01685 Merthyr Tydfil
// 01686 Llanidloes(2,3,4,7), Newtown(5,6,8,9)
// 01687 Mallaig
// 01688 Isle of Mull - Tobermory
// 01689 Orpington
// 01690 Betws-y-Coed
// 01691 Oswestry
// 01692 North Walsham
// 01694 Church Stretton
// 01695 Skelmersdale
// 01697 Brampton
// 016973 Wigton
// 016974 Raughton Head
// 01698 Motherwell
// 01700 Rothesay
// 01702 Southend-on-Sea
// 01704 Southport
// 01706 Rochdale
// 01707 Welwyn Garden City
// 01708 Romford
// 01709 Rotherham
// 01720 Isles of Scilly
// 01721 Peebles
// 01722 Salisbury
// 01723 Scarborough
// 01724 Scunthorpe
// 01725 Rockbourne
// 01726 St Austell
// 01727 St Albans
// 01728 Saxmundham
// 01729 Settle
// 01730 Petersfield
// 01732 Sevenoaks
// 01733 Peterborough
// 01736 Penzance
// 01737 Redhill
// 01738 Perth
// 01740 Sedgefield
// 01743 Shrewsbury
// 01744 St Helens
// 01745 Rhyl
// 01746 Bridgnorth
// 01747 Shaftesbury
// 01748 Richmond
// 01749 Shepton Mallet
// 01750 Selkirk
// 01751 Pickering
// 01752 Plymouth
// 01753 Slough
// 01754 Skegness
// 01756 Skipton
// 01757 Selby
// 01758 Pwllheli
// 01759 Pocklington
// 01760 Swaffham
// 01761 Temple Cloud
// 01763 Royston
// 01764 Crieff
// 01765 Ripon
// 01766 Porthmadog
// 01767 Sandy
// 01768 Penrith
// 017683 Appleby
// 017684 Pooley Bridge
// 017687 Keswick
// 01769 South Molton
// 01770 Isle of Arran
// 01771 Maud
// 01772 Preston
// 01773 Ripley
// 01775 Spalding
// 01776 Stranraer
// 01777 Retford
// 01778 Bourne
// 01779 Peterhead
// 01780 Stamford
// 01782 Stoke-on-Trent
// 01784 Staines
// 01785 Stafford
// 01786 Stirling
// 01787 Sudbury
// 01788 Rugby
// 01789 Stratford-upon-Avon
// 01790 Spilsby
// 01792 Swansea
// 01793 Swindon
// 01794 Romsey
// 01795 Sittingbourne
// 01796 Pitlochry
// 01797 Rye
// 01798 Pulborough
// 01799 Saffron Walden
// 01803 Torquay
// 01805 Torrington
// 01806 Shetland
// 01807 Ballindalloch
// 01808 Tomatin
// 01809 Tomdoun
// 01821 Kinrossie
// 01822 Tavistock
// 01823 Taunton
// 01824 Ruthin
// 01825 Uckfield
// 01827 Tamworth
// 01828 Coupar Angus
// 01829 Tarporley
// 01830 Kirkwhelpington
// 01832 Clopton
// 01833 Barnard Castle
// 01834 Narberth
// 01835 St Boswells
// 01837 Okehampton
// 01838 Dalmally
// 01840 Camelford
// 01841 Newquay
// 01842 Thetford
// 01843 Thanet
// 01844 Thame
// 01845 Thirsk
// 01847 Thurso(2,3,4,5,8), Tongue(6,7,9)
// 01848 Thornhill
// 01851 Great Bernera(4,6,9), Stornoway(2,3,5,7,8)
// 01852 Kilmelford
// 01854 Ullapool
// 01855 Ballachulish
// 01856 Orkney
// 01857 Sanday
// 01858 Market Harborough
// 01859 Harris
// 01862 Tain
// 01863 Ardgay
// 01864 Abington
// 01865 Oxford
// 01866 Kilchrenan
// 01869 Bicester
// 01870 Isle of Benbecula
// 01871 Castlebay
// 01872 Truro
// 01873 Abergavenny
// 01874 Brecon
// 01875 Tranent
// 01876 Lochmaddy
// 01877 Callander
// 01878 Lochboisdale
// 01879 Scarinish
// 01880 Tarbert
// 01882 Kinloch Rannoch
// 01883 Caterham
// 01884 Tiverton
// 01885 Pencombe
// 01886 Bromyard
// 01887 Aberfeldy
// 01888 Turriff
// 01889 Rugeley
// 01890 Ayton(5,6,7,9), Coldstream(2,3,4,8)
// 01892 Tunbridge Wells
// 01895 Uxbridge
// 01896 Galashiels
// 01899 Biggar
// 01900 Workington
// 01902 Wolverhampton
// 01903 Worthing
// 01904 York
// 01905 Worcester
// 01908 Milton Keynes
// 01909 Worksop
// 0191 Tyneside(2,4,6), Durham(3), Sunderland(5)
// 01920 Ware
// 01922 Walsall
// 01923 Watford
// 01924 Wakefield
// 01925 Warrington
// 01926 Warwick
// 01928 Runcorn
// 01929 Wareham
// 01931 Shap
// 01932 Weybridge
// 01933 Wellingborough
// 01934 Weston-super-Mare
// 01935 Yeovil
// 01937 Wetherby
// 01938 Welshpool
// 01939 Wem
// 01942 Wigan
// 01943 Guiseley
// 01944 West Heslerton
// 01945 Wisbech
// 01946 Whitehaven
// 019467 Gosforth
// 01947 Whitby
// 01948 Whitchurch
// 01949 Whatton
// 01950 Sandwick
// 01951 Colonsay
// 01952 Telford
// 01953 Wymondham
// 01954 Madingley
// 01955 Wick
// 01957 Mid Yell
// 01959 Westerham
// 01962 Winchester
// 01963 Wincanton
// 01964 Hornsea(2,5,8,9), Patrington(3,4,6,7)
// 01967 Strontian
// 01968 Penicuik
// 01969 Leyburn
// 01970 Aberystwyth
// 01971 Scourie
// 01972 Glenborrodale
// 01974 Llanon
// 01975 Alford (Aberdeen)(2,4,5,9), Strathdon(3,6,7,8)
// 01977 Pontefract
// 01978 Wrexham
// 01980 Amesbury
// 01981 Wormbridge
// 01982 Builth Wells
// 01983 Isle of Wight
// 01984 Watchet
// 01985 Warminster
// 01986 Bungay
// 01987 Ebbsfleet
// 01988 Wigtown
// 01989 Ross-on-Wye
// 01992 Lea Valley
// 01993 Witney
// 01994 St Clears
// 01995 Garstang
// 01997 Strathpeffer
// 020 London
// 023 Southampton(8X), Portsmouth(9X)
// 024 Coventry
// 028 Ballycastle(20), Martinstown(21), Ballymena(25), Ballymoney(27), Larne(28), Kilrea(29), Newry(30), Armagh(37), Portadown(38), Banbridge(40), Rostrevor(41), Kircubbin(42), Newcastle(Co. Down)(43), Downpatrick(44), Enniskillen(66), Lisnaskea(67), Kesh(68), Coleraine(70), Londonderry(71), Limavady(77), Magherafelt(79), Carrickmore(80), Newtownstewart(81), Omagh(82), Ballygawley(85), Cookstown(86), Dungannon(87), Fivemiletown(89), Belfast(90&95), Bangor(Co. Down)(91), Lisburn(92), Ballyclare(93), Antrim(94), Saintfield(97)
// 029 Cardiff
//
//
]
@@ -0,0 +1,515 @@
/*!
* inputmask.date.extensions.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(factory) {
"function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
}(function($, Inputmask) {
return Inputmask.extendDefinitions({
h: {
validator: "[01][0-9]|2[0-3]",
cardinality: 2,
prevalidator: [ {
validator: "[0-2]",
cardinality: 1
} ]
},
s: {
validator: "[0-5][0-9]",
cardinality: 2,
prevalidator: [ {
validator: "[0-5]",
cardinality: 1
} ]
},
d: {
validator: "0[1-9]|[12][0-9]|3[01]",
cardinality: 2,
prevalidator: [ {
validator: "[0-3]",
cardinality: 1
} ]
},
m: {
validator: "0[1-9]|1[012]",
cardinality: 2,
prevalidator: [ {
validator: "[01]",
cardinality: 1
} ]
},
y: {
validator: "(19|20)\\d{2}",
cardinality: 4,
prevalidator: [ {
validator: "[12]",
cardinality: 1
}, {
validator: "(19|20)",
cardinality: 2
}, {
validator: "(19|20)\\d",
cardinality: 3
} ]
}
}), Inputmask.extendAliases({
"dd/mm/yyyy": {
mask: "1/2/y",
placeholder: "dd/mm/yyyy",
regex: {
val1pre: new RegExp("[0-3]"),
val1: new RegExp("0[1-9]|[12][0-9]|3[01]"),
val2pre: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])");
},
val2: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))");
}
},
leapday: "29/02/",
separator: "/",
yearrange: {
minyear: 1900,
maxyear: 2099
},
isInYearRange: function(chrs, minyear, maxyear) {
if (isNaN(chrs)) return !1;
var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length))), enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length)));
return (isNaN(enteredyear) ? !1 : enteredyear >= minyear && maxyear >= enteredyear) || (isNaN(enteredyear2) ? !1 : enteredyear2 >= minyear && maxyear >= enteredyear2);
},
determinebaseyear: function(minyear, maxyear, hint) {
var currentyear = new Date().getFullYear();
if (minyear > currentyear) return minyear;
if (currentyear > maxyear) {
for (var maxYearPrefix = maxyear.toString().slice(0, 2), maxYearPostfix = maxyear.toString().slice(2, 4); maxYearPrefix + hint > maxyear; ) maxYearPrefix--;
var maxxYear = maxYearPrefix + maxYearPostfix;
return minyear > maxxYear ? minyear : maxxYear;
}
if (currentyear >= minyear && maxyear >= currentyear) {
for (var currentYearPrefix = currentyear.toString().slice(0, 2); currentYearPrefix + hint > maxyear; ) currentYearPrefix--;
var currentYearAndHint = currentYearPrefix + hint;
return minyear > currentYearAndHint ? minyear : currentYearAndHint;
}
return currentyear;
},
onKeyDown: function(e, buffer, caretPos, opts) {
var $input = $(this);
if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
var today = new Date();
$input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString()),
$input.trigger("setvalue");
}
},
getFrontValue: function(mask, buffer, opts) {
for (var start = 0, length = 0, i = 0; i < mask.length && "2" !== mask.charAt(i); i++) {
var definition = opts.definitions[mask.charAt(i)];
definition ? (start += length, length = definition.cardinality) : length++;
}
return buffer.join("").substr(start, length);
},
definitions: {
"1": {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.regex.val1.test(chrs);
return strict || isValid || chrs.charAt(1) !== opts.separator && -1 === "-./".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val1.test("0" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = "0",
{
refreshFromBuffer: {
start: pos - 1,
end: pos
},
pos: pos,
c: chrs.charAt(0)
});
},
cardinality: 2,
prevalidator: [ {
validator: function(chrs, maskset, pos, strict, opts) {
var pchrs = chrs;
isNaN(maskset.buffer[pos + 1]) || (pchrs += maskset.buffer[pos + 1]);
var isValid = 1 === pchrs.length ? opts.regex.val1pre.test(pchrs) : opts.regex.val1.test(pchrs);
if (!strict && !isValid) {
if (isValid = opts.regex.val1.test(chrs + "0")) return maskset.buffer[pos] = chrs,
maskset.buffer[++pos] = "0", {
pos: pos,
c: "0"
};
if (isValid = opts.regex.val1.test("0" + chrs)) return maskset.buffer[pos] = "0",
pos++, {
pos: pos
};
}
return isValid;
},
cardinality: 1
} ]
},
"2": {
validator: function(chrs, maskset, pos, strict, opts) {
var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);
-1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator);
var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
if (!strict && !isValid && (chrs.charAt(1) === opts.separator || -1 !== "-./".indexOf(chrs.charAt(1))) && (isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0)))) return maskset.buffer[pos - 1] = "0",
{
refreshFromBuffer: {
start: pos - 1,
end: pos
},
pos: pos,
c: chrs.charAt(0)
};
if (opts.mask.indexOf("2") === opts.mask.length - 1 && isValid) {
var dayMonthValue = maskset.buffer.join("").substr(4, 4) + chrs;
if (dayMonthValue !== opts.leapday) return !0;
var year = parseInt(maskset.buffer.join("").substr(0, 4), 10);
return year % 4 === 0 ? year % 100 === 0 ? year % 400 === 0 ? !0 : !1 : !0 : !1;
}
return isValid;
},
cardinality: 2,
prevalidator: [ {
validator: function(chrs, maskset, pos, strict, opts) {
isNaN(maskset.buffer[pos + 1]) || (chrs += maskset.buffer[pos + 1]);
var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);
-1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator);
var isValid = 1 === chrs.length ? opts.regex.val2pre(opts.separator).test(frontValue + chrs) : opts.regex.val2(opts.separator).test(frontValue + chrs);
return strict || isValid || !(isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
pos++, {
pos: pos
});
},
cardinality: 1
} ]
},
y: {
validator: function(chrs, maskset, pos, strict, opts) {
if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
var dayMonthValue = maskset.buffer.join("").substr(0, 6);
if (dayMonthValue !== opts.leapday) return !0;
var year = parseInt(chrs, 10);
return year % 4 === 0 ? year % 100 === 0 ? year % 400 === 0 ? !0 : !1 : !0 : !1;
}
return !1;
},
cardinality: 4,
prevalidator: [ {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
if (!strict && !isValid) {
var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 1);
if (isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0),
{
pos: pos
};
if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 2),
isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0),
maskset.buffer[pos++] = yearPrefix.charAt(1), {
pos: pos
};
}
return isValid;
},
cardinality: 1
}, {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
if (!strict && !isValid) {
var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2);
if (isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(1),
{
pos: pos
};
if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2),
opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
var dayMonthValue = maskset.buffer.join("").substr(0, 6);
if (dayMonthValue !== opts.leapday) isValid = !0; else {
var year = parseInt(chrs, 10);
isValid = year % 4 === 0 ? year % 100 === 0 ? year % 400 === 0 ? !0 : !1 : !0 : !1;
}
} else isValid = !1;
if (isValid) return maskset.buffer[pos - 1] = yearPrefix.charAt(0), maskset.buffer[pos++] = yearPrefix.charAt(1),
maskset.buffer[pos++] = chrs.charAt(0), {
refreshFromBuffer: {
start: pos - 3,
end: pos
},
pos: pos
};
}
return isValid;
},
cardinality: 2
}, {
validator: function(chrs, maskset, pos, strict, opts) {
return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
},
cardinality: 3
} ]
}
},
insertMode: !1,
autoUnmask: !1
},
"mm/dd/yyyy": {
placeholder: "mm/dd/yyyy",
alias: "dd/mm/yyyy",
regex: {
val2pre: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
},
val2: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
},
val1pre: new RegExp("[01]"),
val1: new RegExp("0[1-9]|1[012]")
},
leapday: "02/29/",
onKeyDown: function(e, buffer, caretPos, opts) {
var $input = $(this);
if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
var today = new Date();
$input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()),
$input.trigger("setvalue");
}
}
},
"yyyy/mm/dd": {
mask: "y/1/2",
placeholder: "yyyy/mm/dd",
alias: "mm/dd/yyyy",
leapday: "/02/29",
onKeyDown: function(e, buffer, caretPos, opts) {
var $input = $(this);
if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
var today = new Date();
$input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString()),
$input.trigger("setvalue");
}
}
},
"dd.mm.yyyy": {
mask: "1.2.y",
placeholder: "dd.mm.yyyy",
leapday: "29.02.",
separator: ".",
alias: "dd/mm/yyyy"
},
"dd-mm-yyyy": {
mask: "1-2-y",
placeholder: "dd-mm-yyyy",
leapday: "29-02-",
separator: "-",
alias: "dd/mm/yyyy"
},
"mm.dd.yyyy": {
mask: "1.2.y",
placeholder: "mm.dd.yyyy",
leapday: "02.29.",
separator: ".",
alias: "mm/dd/yyyy"
},
"mm-dd-yyyy": {
mask: "1-2-y",
placeholder: "mm-dd-yyyy",
leapday: "02-29-",
separator: "-",
alias: "mm/dd/yyyy"
},
"yyyy.mm.dd": {
mask: "y.1.2",
placeholder: "yyyy.mm.dd",
leapday: ".02.29",
separator: ".",
alias: "yyyy/mm/dd"
},
"yyyy-mm-dd": {
mask: "y-1-2",
placeholder: "yyyy-mm-dd",
leapday: "-02-29",
separator: "-",
alias: "yyyy/mm/dd"
},
datetime: {
mask: "1/2/y h:s",
placeholder: "dd/mm/yyyy hh:mm",
alias: "dd/mm/yyyy",
regex: {
hrspre: new RegExp("[012]"),
hrs24: new RegExp("2[0-4]|1[3-9]"),
hrs: new RegExp("[01][0-9]|2[0-4]"),
ampm: new RegExp("^[a|p|A|P][m|M]"),
mspre: new RegExp("[0-5]"),
ms: new RegExp("[0-5][0-9]")
},
timeseparator: ":",
hourFormat: "24",
definitions: {
h: {
validator: function(chrs, maskset, pos, strict, opts) {
if ("24" === opts.hourFormat && 24 === parseInt(chrs, 10)) return maskset.buffer[pos - 1] = "0",
maskset.buffer[pos] = "0", {
refreshFromBuffer: {
start: pos - 1,
end: pos
},
c: "0"
};
var isValid = opts.regex.hrs.test(chrs);
if (!strict && !isValid && (chrs.charAt(1) === opts.timeseparator || -1 !== "-.:".indexOf(chrs.charAt(1))) && (isValid = opts.regex.hrs.test("0" + chrs.charAt(0)))) return maskset.buffer[pos - 1] = "0",
maskset.buffer[pos] = chrs.charAt(0), pos++, {
refreshFromBuffer: {
start: pos - 2,
end: pos
},
pos: pos,
c: opts.timeseparator
};
if (isValid && "24" !== opts.hourFormat && opts.regex.hrs24.test(chrs)) {
var tmp = parseInt(chrs, 10);
return 24 === tmp ? (maskset.buffer[pos + 5] = "a", maskset.buffer[pos + 6] = "m") : (maskset.buffer[pos + 5] = "p",
maskset.buffer[pos + 6] = "m"), tmp -= 12, 10 > tmp ? (maskset.buffer[pos] = tmp.toString(),
maskset.buffer[pos - 1] = "0") : (maskset.buffer[pos] = tmp.toString().charAt(1),
maskset.buffer[pos - 1] = tmp.toString().charAt(0)), {
refreshFromBuffer: {
start: pos - 1,
end: pos + 6
},
c: maskset.buffer[pos]
};
}
return isValid;
},
cardinality: 2,
prevalidator: [ {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.regex.hrspre.test(chrs);
return strict || isValid || !(isValid = opts.regex.hrs.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
pos++, {
pos: pos
});
},
cardinality: 1
} ]
},
s: {
validator: "[0-5][0-9]",
cardinality: 2,
prevalidator: [ {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.regex.mspre.test(chrs);
return strict || isValid || !(isValid = opts.regex.ms.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
pos++, {
pos: pos
});
},
cardinality: 1
} ]
},
t: {
validator: function(chrs, maskset, pos, strict, opts) {
return opts.regex.ampm.test(chrs + "m");
},
casing: "lower",
cardinality: 1
}
},
insertMode: !1,
autoUnmask: !1
},
datetime12: {
mask: "1/2/y h:s t\\m",
placeholder: "dd/mm/yyyy hh:mm xm",
alias: "datetime",
hourFormat: "12"
},
"mm/dd/yyyy hh:mm xm": {
mask: "1/2/y h:s t\\m",
placeholder: "mm/dd/yyyy hh:mm xm",
alias: "datetime12",
regex: {
val2pre: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
},
val2: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
},
val1pre: new RegExp("[01]"),
val1: new RegExp("0[1-9]|1[012]")
},
leapday: "02/29/",
onKeyDown: function(e, buffer, caretPos, opts) {
var $input = $(this);
if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
var today = new Date();
$input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()),
$input.trigger("setvalue");
}
}
},
"hh:mm t": {
mask: "h:s t\\m",
placeholder: "hh:mm xm",
alias: "datetime",
hourFormat: "12"
},
"h:s t": {
mask: "h:s t\\m",
placeholder: "hh:mm xm",
alias: "datetime",
hourFormat: "12"
},
"hh:mm:ss": {
mask: "h:s:s",
placeholder: "hh:mm:ss",
alias: "datetime",
autoUnmask: !1
},
"hh:mm": {
mask: "h:s",
placeholder: "hh:mm",
alias: "datetime",
autoUnmask: !1
},
date: {
alias: "dd/mm/yyyy"
},
"mm/yyyy": {
mask: "1/y",
placeholder: "mm/yyyy",
leapday: "donotuse",
separator: "/",
alias: "mm/dd/yyyy"
},
shamsi: {
regex: {
val2pre: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "[0-3])");
},
val2: function(separator) {
var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[1-9]|1[012])" + escapedSeparator + "30)|((0[1-6])" + escapedSeparator + "31)");
},
val1pre: new RegExp("[01]"),
val1: new RegExp("0[1-9]|1[012]")
},
yearrange: {
minyear: 1300,
maxyear: 1499
},
mask: "y/1/2",
leapday: "/12/30",
placeholder: "yyyy/mm/dd",
alias: "mm/dd/yyyy",
clearIncomplete: !0
}
}), Inputmask;
});
@@ -0,0 +1,12 @@
/*!
* inputmask.dependencyLib.jquery.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(factory) {
"function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);
}(function($) {
return window.dependencyLib = $, $;
});
@@ -0,0 +1,98 @@
/*!
* inputmask.extensions.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(factory) {
"function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
}(function($, Inputmask) {
return Inputmask.extendDefinitions({
A: {
validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
cardinality: 1,
casing: "upper"
},
"&": {
validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
cardinality: 1,
casing: "upper"
},
"#": {
validator: "[0-9A-Fa-f]",
cardinality: 1,
casing: "upper"
}
}), Inputmask.extendAliases({
url: {
definitions: {
i: {
validator: ".",
cardinality: 1
}
},
mask: "(\\http://)|(\\http\\s://)|(ftp://)|(ftp\\s://)i{+}",
insertMode: !1,
autoUnmask: !1
},
ip: {
mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
definitions: {
i: {
validator: function(chrs, maskset, pos, strict, opts) {
return pos - 1 > -1 && "." !== maskset.buffer[pos - 1] ? (chrs = maskset.buffer[pos - 1] + chrs,
chrs = pos - 2 > -1 && "." !== maskset.buffer[pos - 2] ? maskset.buffer[pos - 2] + chrs : "0" + chrs) : chrs = "00" + chrs,
new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
},
cardinality: 1
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return maskedValue;
}
},
email: {
mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}[.-{1,63}][.-{1,63}][.-{1,63}]",
greedy: !1,
onBeforePaste: function(pastedValue, opts) {
return pastedValue = pastedValue.toLowerCase(), pastedValue.replace("mailto:", "");
},
definitions: {
"*": {
validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]",
cardinality: 1,
casing: "lower"
},
"-": {
validator: "[0-9A-Za-z-]",
cardinality: 1,
casing: "lower"
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return maskedValue;
}
},
mac: {
mask: "##:##:##:##:##:##"
},
vin: {
mask: "V{8}vV{4}9{4}",
definitions: {
V: {
validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
cardinality: 1,
casing: "upper"
},
v: {
validator: "[Xx\\d]",
cardinality: 1,
casing: "upper"
}
},
clearIncomplete: !0,
autoUnmask: !0
}
}), Inputmask;
});
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,374 @@
/*!
* inputmask.numeric.extensions.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(factory) {
"function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
}(function($, Inputmask) {
return Inputmask.extendAliases({
numeric: {
mask: function(opts) {
function autoEscape(txt) {
for (var escapedTxt = "", i = 0; i < txt.length; i++) escapedTxt += opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i) ? "\\" + txt.charAt(i) : txt.charAt(i);
return escapedTxt;
}
if (0 !== opts.repeat && isNaN(opts.integerDigits) && (opts.integerDigits = opts.repeat),
opts.repeat = 0, opts.groupSeparator === opts.radixPoint && ("." === opts.radixPoint ? opts.groupSeparator = "," : "," === opts.radixPoint ? opts.groupSeparator = "." : opts.groupSeparator = ""),
" " === opts.groupSeparator && (opts.skipOptionalPartCharacter = void 0), opts.autoGroup = opts.autoGroup && "" !== opts.groupSeparator,
opts.autoGroup && ("string" == typeof opts.groupSize && isFinite(opts.groupSize) && (opts.groupSize = parseInt(opts.groupSize)),
isFinite(opts.integerDigits))) {
var seps = Math.floor(opts.integerDigits / opts.groupSize), mod = opts.integerDigits % opts.groupSize;
opts.integerDigits = parseInt(opts.integerDigits) + (0 === mod ? seps - 1 : seps),
opts.integerDigits < 1 && (opts.integerDigits = "*");
}
opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)),
opts.radixFocus = opts.radixFocus && "" !== opts.placeholder && opts.integerOptional === !0,
opts.definitions[";"] = opts.definitions["~"], opts.definitions[";"].definitionSymbol = "~",
opts.numericInput === !0 && (opts.radixFocus = !1, opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2),
opts.decimalProtect = !1);
var mask = autoEscape(opts.prefix);
return mask += "[+]", mask += opts.integerOptional === !0 ? "~{1," + opts.integerDigits + "}" : "~{" + opts.integerDigits + "}",
void 0 !== opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (opts.decimalProtect && (opts.radixPointDefinitionSymbol = ":"),
mask += opts.digitsOptional ? "[" + (opts.decimalProtect ? ":" : opts.radixPoint) + ";{1," + opts.digits + "}]" : (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}"),
mask += "[-]", mask += "[" + autoEscape(opts.suffix) + "]", opts.greedy = !1, mask;
},
placeholder: "",
greedy: !1,
digits: "*",
digitsOptional: !0,
radixPoint: ".",
radixFocus: !0,
groupSize: 3,
groupSeparator: "",
autoGroup: !1,
allowPlus: !0,
allowMinus: !0,
negationSymbol: {
front: "-",
back: ""
},
integerDigits: "+",
integerOptional: !0,
prefix: "",
suffix: "",
rightAlign: !0,
decimalProtect: !0,
min: null,
max: null,
step: 1,
insertMode: !0,
autoUnmask: !1,
unmaskAsNumber: !1,
postFormat: function(buffer, pos, opts) {
opts.numericInput === !0 && (buffer = buffer.reverse(), isFinite(pos) && (pos = buffer.join("").length - pos - 1));
var i, l, suffixStripped = !1;
buffer.length >= opts.suffix.length && buffer.join("").indexOf(opts.suffix) === buffer.length - opts.suffix.length && (buffer.length = buffer.length - opts.suffix.length,
suffixStripped = !0), pos = pos >= buffer.length ? buffer.length - 1 : pos < opts.prefix.length ? opts.prefix.length : pos;
var needsRefresh = !1, charAtPos = buffer[pos], cbuf = buffer.slice();
charAtPos === opts.groupSeparator && (cbuf.splice(pos--, 1), charAtPos = cbuf[pos]),
charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back && (cbuf[pos] = "?");
var bufVal = cbuf.join(""), bufValOrigin = bufVal;
if (bufVal.length > 0 && opts.autoGroup || -1 !== bufVal.indexOf(opts.groupSeparator)) {
var escapedGroupSeparator = Inputmask.escapeRegex(opts.groupSeparator);
needsRefresh = 0 === bufVal.indexOf(opts.groupSeparator), bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), "");
var radixSplit = bufVal.split(opts.radixPoint);
if (bufVal = "" === opts.radixPoint ? bufVal : radixSplit[0], bufVal !== opts.prefix + "?0" && bufVal.length >= opts.groupSize + opts.prefix.length) for (var reg = new RegExp("([-+]?[\\d?]+)([\\d?]{" + opts.groupSize + "})"); reg.test(bufVal) && "" !== opts.groupSeparator; ) bufVal = bufVal.replace(reg, "$1" + opts.groupSeparator + "$2"),
bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
"" !== opts.radixPoint && radixSplit.length > 1 && (bufVal += opts.radixPoint + radixSplit[1]);
}
for (needsRefresh = bufValOrigin !== bufVal, buffer.length = bufVal.length, i = 0,
l = bufVal.length; l > i; i++) buffer[i] = bufVal.charAt(i);
var newPos = $.inArray("?", buffer);
if (-1 === newPos && (newPos = $.inArray(charAtPos, buffer)), buffer[newPos] = charAtPos,
!needsRefresh && suffixStripped) for (i = 0, l = opts.suffix.length; l > i; i++) buffer.push(opts.suffix.charAt(i));
return newPos = opts.numericInput && isFinite(pos) ? buffer.join("").length - newPos - 1 : newPos,
opts.numericInput && (buffer = buffer.reverse(), $.inArray(opts.radixPoint, buffer) < newPos && buffer.join("").length - opts.suffix.length !== newPos && (newPos -= 1)),
{
pos: newPos,
refreshFromBuffer: needsRefresh,
buffer: buffer
};
},
onBeforeWrite: function(e, buffer, caretPos, opts) {
var rslt;
if (e && ("blur" === e.type || "checkval" === e.type || "keydown" === e.type)) {
var maskedValue = opts.numericInput ? buffer.slice().reverse().join("") : buffer.join(""), processValue = maskedValue.replace(opts.prefix, "");
processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
"," === opts.radixPoint && (processValue = processValue.replace(opts.radixPoint, "."));
var isNegative = processValue.match(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"));
if (isNegative = null !== isNegative && 1 === isNegative.length, processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
processValue = processValue === opts.negationSymbol.front ? processValue + "0" : processValue,
"" !== processValue && isFinite(processValue)) {
var floatValue = parseFloat(processValue), signedFloatValue = isNegative ? -1 * floatValue : floatValue;
if (null !== opts.min && isFinite(opts.min) && signedFloatValue < parseFloat(opts.min) ? (floatValue = Math.abs(opts.min),
isNegative = opts.min < 0) : null !== opts.max && isFinite(opts.max) && signedFloatValue > parseFloat(opts.max) && (floatValue = Math.abs(opts.max),
isNegative = opts.max < 0), processValue = floatValue.toString().replace(".", opts.radixPoint).split(""),
isFinite(opts.digits)) {
var radixPosition = $.inArray(opts.radixPoint, processValue), rpb = $.inArray(opts.radixPoint, maskedValue);
-1 === radixPosition && (processValue.push(opts.radixPoint), radixPosition = processValue.length - 1);
for (var i = 1; i <= opts.digits; i++) opts.digitsOptional || void 0 !== processValue[radixPosition + i] && processValue[radixPosition + i] !== opts.placeholder.charAt(0) ? -1 !== rpb && void 0 !== maskedValue[rpb + i] && (processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i]) : processValue[radixPosition + i] = "0";
processValue[processValue.length - 1] === opts.radixPoint && delete processValue[processValue.length - 1];
}
if (floatValue.toString() !== processValue && floatValue.toString() + "." !== processValue || isNegative) return !isNegative || 0 === floatValue && "blur" === e.type || (processValue.unshift(opts.negationSymbol.front),
processValue.push(opts.negationSymbol.back)), processValue = (opts.prefix + processValue.join("")).split(""),
opts.numericInput && (processValue = processValue.reverse()), rslt = opts.postFormat(processValue, opts.numericInput ? caretPos : caretPos - 1, opts),
rslt.buffer && (rslt.refreshFromBuffer = rslt.buffer.join("") !== buffer.join("")),
rslt;
}
}
return opts.autoGroup ? (rslt = opts.postFormat(buffer, opts.numericInput ? caretPos : caretPos - 1, opts),
rslt.caret = caretPos <= opts.prefix.length ? rslt.pos : rslt.pos + 1, rslt) : void 0;
},
regex: {
integerPart: function(opts) {
return new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+");
},
integerNPart: function(opts) {
return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
}
},
signHandler: function(chrs, maskset, pos, strict, opts) {
if (!strict && opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) {
var matchRslt = maskset.buffer.join("").match(opts.regex.integerPart(opts));
if (matchRslt && matchRslt[0].length > 0) return maskset.buffer[matchRslt.index] === ("-" === chrs ? "+" : opts.negationSymbol.front) ? "-" === chrs ? "" !== opts.negationSymbol.back ? {
pos: matchRslt.index,
c: opts.negationSymbol.front,
remove: matchRslt.index,
caret: pos,
insert: {
pos: maskset.buffer.length - opts.suffix.length - 1,
c: opts.negationSymbol.back
}
} : {
pos: matchRslt.index,
c: opts.negationSymbol.front,
remove: matchRslt.index,
caret: pos
} : "" !== opts.negationSymbol.back ? {
pos: matchRslt.index,
c: "+",
remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ],
caret: pos
} : {
pos: matchRslt.index,
c: "+",
remove: matchRslt.index,
caret: pos
} : maskset.buffer[matchRslt.index] === ("-" === chrs ? opts.negationSymbol.front : "+") ? "-" === chrs && "" !== opts.negationSymbol.back ? {
remove: [ matchRslt.index, maskset.buffer.length - opts.suffix.length - 1 ],
caret: pos - 1
} : {
remove: matchRslt.index,
caret: pos - 1
} : "-" === chrs ? "" !== opts.negationSymbol.back ? {
pos: matchRslt.index,
c: opts.negationSymbol.front,
caret: pos + 1,
insert: {
pos: maskset.buffer.length - opts.suffix.length,
c: opts.negationSymbol.back
}
} : {
pos: matchRslt.index,
c: opts.negationSymbol.front,
caret: pos + 1
} : {
pos: matchRslt.index,
c: chrs,
caret: pos + 1
};
}
return !1;
},
radixHandler: function(chrs, maskset, pos, strict, opts) {
if (!strict && opts.numericInput !== !0 && (-1 !== $.inArray(chrs, [ ",", "." ]) && (chrs = opts.radixPoint),
chrs === opts.radixPoint && void 0 !== opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {
var radixPos = $.inArray(opts.radixPoint, maskset.buffer), integerValue = maskset.buffer.join("").match(opts.regex.integerPart(opts));
if (-1 !== radixPos && maskset.validPositions[radixPos]) return maskset.validPositions[radixPos - 1] ? {
caret: radixPos + 1
} : {
pos: integerValue.index,
c: integerValue[0],
caret: radixPos + 1
};
if (!integerValue || "0" === integerValue[0] && integerValue.index + 1 !== pos) return maskset.buffer[integerValue ? integerValue.index : pos] = "0",
{
pos: (integerValue ? integerValue.index : pos) + 1,
c: opts.radixPoint
};
}
return !1;
},
leadingZeroHandler: function(chrs, maskset, pos, strict, opts) {
if (!strict) if (opts.numericInput === !0) {
var buffer = maskset.buffer.slice("").reverse(), char = buffer[opts.prefix.length];
if ("0" === char) return {
pos: pos,
remove: buffer.length - opts.prefix.length - 1
};
} else {
var radixPosition = $.inArray(opts.radixPoint, maskset.buffer), matchRslt = maskset.buffer.slice(0, -1 !== radixPosition ? radixPosition : void 0).join("").match(opts.regex.integerNPart(opts));
if (matchRslt && (-1 === radixPosition || radixPosition >= pos)) {
if (0 === matchRslt[0].indexOf("" !== opts.placeholder ? opts.placeholder.charAt(0) : "0") && matchRslt.index + 1 === pos) return maskset.buffer.splice(matchRslt.index, 1),
pos = matchRslt.index, {
pos: pos,
remove: matchRslt.index
};
if ("0" === chrs && pos <= matchRslt.index && matchRslt[0] !== opts.groupSeparator) return !1;
}
}
return !0;
},
definitions: {
"~": {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
if (!isValid && (isValid = opts.radixHandler(chrs, maskset, pos, strict, opts),
!isValid && (isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs),
isValid === !0 && (isValid = opts.leadingZeroHandler(chrs, maskset, pos, strict, opts),
isValid === !0)))) {
var radixPosition = $.inArray(opts.radixPoint, maskset.buffer);
isValid = -1 !== radixPosition && (opts.digitsOptional === !1 || maskset.validPositions[pos]) && opts.numericInput !== !0 && pos > radixPosition && !strict ? {
pos: pos,
remove: pos
} : {
pos: pos
};
}
return isValid;
},
cardinality: 1
},
"+": {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
return !isValid && (strict && opts.allowMinus && chrs === opts.negationSymbol.front || opts.allowMinus && "-" === chrs || opts.allowPlus && "+" === chrs) && (isValid = strict || "-" !== chrs ? !0 : "" !== opts.negationSymbol.back ? {
pos: pos,
c: "-" === chrs ? opts.negationSymbol.front : "+",
caret: pos + 1,
insert: {
pos: maskset.buffer.length,
c: opts.negationSymbol.back
}
} : {
pos: pos,
c: "-" === chrs ? opts.negationSymbol.front : "+",
caret: pos + 1
}), isValid;
},
cardinality: 1,
placeholder: ""
},
"-": {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
return !isValid && strict && opts.allowMinus && chrs === opts.negationSymbol.back && (isValid = !0),
isValid;
},
cardinality: 1,
placeholder: ""
},
":": {
validator: function(chrs, maskset, pos, strict, opts) {
var isValid = opts.signHandler(chrs, maskset, pos, strict, opts);
if (!isValid) {
var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + ",\\.]";
isValid = new RegExp(radix).test(chrs), isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint && (isValid = {
caret: pos + 1
});
}
return isValid ? {
c: opts.radixPoint
} : isValid;
},
cardinality: 1,
placeholder: function(opts) {
return opts.radixPoint;
}
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
var processValue = maskedValue.replace(opts.prefix, "");
return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
opts.unmaskAsNumber ? ("" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")),
Number(processValue)) : processValue;
},
isComplete: function(buffer, opts) {
var maskedValue = buffer.join(""), bufClone = buffer.slice();
if (opts.postFormat(bufClone, 0, opts), bufClone.join("") !== maskedValue) return !1;
var processValue = maskedValue.replace(opts.prefix, "");
return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
"," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")),
isFinite(processValue);
},
onBeforeMask: function(initialValue, opts) {
if ("" !== opts.radixPoint && isFinite(initialValue)) initialValue = initialValue.toString().replace(".", opts.radixPoint); else {
var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""),
initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "") : initialValue = initialValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), "");
}
if (0 === opts.digits && (-1 !== initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 !== initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
"" !== opts.radixPoint && isFinite(opts.digits) && -1 !== initialValue.indexOf(opts.radixPoint)) {
var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp("\\d*"))[0];
if (parseInt(opts.digits) < decPart.toString().length) {
var digitsFactor = Math.pow(10, parseInt(opts.digits));
initialValue = initialValue.replace(Inputmask.escapeRegex(opts.radixPoint), "."),
initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor,
initialValue = initialValue.toString().replace(".", opts.radixPoint);
}
}
return initialValue.toString();
},
canClearPosition: function(maskset, position, lvp, strict, opts) {
var positionInput = maskset.validPositions[position].input, canClear = positionInput !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && opts.decimalProtect === !1 || isFinite(positionInput) || position === lvp || positionInput === opts.groupSeparator || positionInput === opts.negationSymbol.front || positionInput === opts.negationSymbol.back;
return canClear;
},
onKeyDown: function(e, buffer, caretPos, opts) {
var $input = $(this);
if (e.ctrlKey) switch (e.keyCode) {
case Inputmask.keyCode.UP:
$input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.trigger("setvalue");
break;
case Inputmask.keyCode.DOWN:
$input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.trigger("setvalue");
}
}
},
currency: {
prefix: "$ ",
groupSeparator: ",",
alias: "numeric",
placeholder: "0",
autoGroup: !0,
digits: 2,
digitsOptional: !1,
clearMaskOnLostFocus: !1
},
decimal: {
alias: "numeric"
},
integer: {
alias: "numeric",
digits: 0,
radixPoint: ""
},
percentage: {
alias: "numeric",
digits: 2,
radixPoint: ".",
placeholder: "0",
autoGroup: !1,
min: 0,
max: 100,
suffix: " %",
allowPlus: !1,
allowMinus: !1
}
}), Inputmask;
});
@@ -0,0 +1,52 @@
/*!
* inputmask.phone.extensions.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(factory) {
"function" == typeof define && define.amd ? define([ "jquery", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
}(function($, Inputmask) {
return Inputmask.extendAliases({
phone: {
url: "phone-codes/phone-codes.js",
countrycode: "",
phoneCodeCache: {},
mask: function(opts) {
if (void 0 === opts.phoneCodeCache[opts.url]) {
var maskList = [];
opts.definitions["#"] = opts.definitions[9], $.ajax({
url: opts.url,
async: !1,
type: "get",
dataType: "json",
success: function(response) {
maskList = response;
},
error: function(xhr, ajaxOptions, thrownError) {
alert(thrownError + " - " + opts.url);
}
}), opts.phoneCodeCache[opts.url] = maskList.sort(function(a, b) {
return (a.mask || a) < (b.mask || b) ? -1 : 1;
});
}
return opts.phoneCodeCache[opts.url];
},
keepStatic: !1,
nojumps: !0,
nojumpsThreshold: 1,
onBeforeMask: function(value, opts) {
var processedValue = value.replace(/^0{1,2}/, "").replace(/[\s]/g, "");
return (processedValue.indexOf(opts.countrycode) > 1 || -1 === processedValue.indexOf(opts.countrycode)) && (processedValue = "+" + opts.countrycode + processedValue),
processedValue;
}
},
phonebe: {
alias: "phone",
url: "phone-codes/phone-be.js",
countrycode: "32",
nojumpsThreshold: 4
}
}), Inputmask;
});
@@ -0,0 +1,115 @@
/*!
* inputmask.regex.extensions.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(factory) {
"function" == typeof define && define.amd ? define([ "inputmask.dependencyLib", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("./inputmask.dependencyLib.jquery"), require("./inputmask")) : factory(window.dependencyLib || jQuery, window.Inputmask);
}(function($, Inputmask) {
return Inputmask.extendAliases({
Regex: {
mask: "r",
greedy: !1,
repeat: "*",
regex: null,
regexTokens: null,
tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,
quantifierFilter: /[0-9]+[^,]/,
isComplete: function(buffer, opts) {
return new RegExp(opts.regex).test(buffer.join(""));
},
definitions: {
r: {
validator: function(chrs, maskset, pos, strict, opts) {
function RegexToken(isGroup, isQuantifier) {
this.matches = [], this.isGroup = isGroup || !1, this.isQuantifier = isQuantifier || !1,
this.quantifier = {
min: 1,
max: 1
}, this.repeaterPart = void 0;
}
function analyseRegex() {
var match, m, currentToken = new RegexToken(), opengroups = [];
for (opts.regexTokens = []; match = opts.tokenizer.exec(opts.regex); ) switch (m = match[0],
m.charAt(0)) {
case "(":
opengroups.push(new RegexToken(!0));
break;
case ")":
groupToken = opengroups.pop(), opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(groupToken) : currentToken.matches.push(groupToken);
break;
case "{":
case "+":
case "*":
var quantifierToken = new RegexToken(!1, !0);
m = m.replace(/[{}]/g, "");
var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
if (quantifierToken.quantifier = {
min: mq0,
max: mq1
}, opengroups.length > 0) {
var matches = opengroups[opengroups.length - 1].matches;
match = matches.pop(), match.isGroup || (groupToken = new RegexToken(!0), groupToken.matches.push(match),
match = groupToken), matches.push(match), matches.push(quantifierToken);
} else match = currentToken.matches.pop(), match.isGroup || (groupToken = new RegexToken(!0),
groupToken.matches.push(match), match = groupToken), currentToken.matches.push(match),
currentToken.matches.push(quantifierToken);
break;
default:
opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(m) : currentToken.matches.push(m);
}
currentToken.matches.length > 0 && opts.regexTokens.push(currentToken);
}
function validateRegexToken(token, fromGroup) {
var isvalid = !1;
fromGroup && (regexPart += "(", openGroupCount++);
for (var mndx = 0; mndx < token.matches.length; mndx++) {
var matchToken = token.matches[mndx];
if (matchToken.isGroup === !0) isvalid = validateRegexToken(matchToken, !0); else if (matchToken.isQuantifier === !0) {
var crrntndx = $.inArray(matchToken, token.matches), matchGroup = token.matches[crrntndx - 1], regexPartBak = regexPart;
if (isNaN(matchToken.quantifier.max)) {
for (;matchToken.repeaterPart && matchToken.repeaterPart !== regexPart && matchToken.repeaterPart.length > regexPart.length && !(isvalid = validateRegexToken(matchGroup, !0)); ) ;
isvalid = isvalid || validateRegexToken(matchGroup, !0), isvalid && (matchToken.repeaterPart = regexPart),
regexPart = regexPartBak + matchToken.quantifier.max;
} else {
for (var i = 0, qm = matchToken.quantifier.max - 1; qm > i && !(isvalid = validateRegexToken(matchGroup, !0)); i++) ;
regexPart = regexPartBak + "{" + matchToken.quantifier.min + "," + matchToken.quantifier.max + "}";
}
} else if (void 0 !== matchToken.matches) for (var k = 0; k < matchToken.length && !(isvalid = validateRegexToken(matchToken[k], fromGroup)); k++) ; else {
var testExp;
if ("[" == matchToken.charAt(0)) {
testExp = regexPart, testExp += matchToken;
for (var j = 0; openGroupCount > j; j++) testExp += ")";
var exp = new RegExp("^(" + testExp + ")$");
isvalid = exp.test(bufferStr);
} else for (var l = 0, tl = matchToken.length; tl > l; l++) if ("\\" !== matchToken.charAt(l)) {
testExp = regexPart, testExp += matchToken.substr(0, l + 1), testExp = testExp.replace(/\|$/, "");
for (var j = 0; openGroupCount > j; j++) testExp += ")";
var exp = new RegExp("^(" + testExp + ")$");
if (isvalid = exp.test(bufferStr)) break;
}
regexPart += matchToken;
}
if (isvalid) break;
}
return fromGroup && (regexPart += ")", openGroupCount--), isvalid;
}
var bufferStr, groupToken, cbuffer = maskset.buffer.slice(), regexPart = "", isValid = !1, openGroupCount = 0;
null === opts.regexTokens && analyseRegex(), cbuffer.splice(pos, 0, chrs), bufferStr = cbuffer.join("");
for (var i = 0; i < opts.regexTokens.length; i++) {
var regexToken = opts.regexTokens[i];
if (isValid = validateRegexToken(regexToken, regexToken.isGroup)) break;
}
return isValid;
},
cardinality: 1
}
}
}
}), Inputmask;
});
@@ -0,0 +1,60 @@
/*!
* jquery.inputmask.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(factory) {
"function" == typeof define && define.amd ? define([ "jquery", "inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery, window.Inputmask);
}(function($, Inputmask) {
return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {
var nptmask, input = this[0];
if (void 0 === options && (options = {}), "string" == typeof fn) switch (fn) {
case "unmaskedvalue":
return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
case "remove":
return this.each(function() {
this.inputmask && this.inputmask.remove();
});
case "getemptymask":
return input && input.inputmask ? input.inputmask.getemptymask() : "";
case "hasMaskedValue":
return input && input.inputmask ? input.inputmask.hasMaskedValue() : !1;
case "isComplete":
return input && input.inputmask ? input.inputmask.isComplete() : !0;
case "getmetadata":
return input && input.inputmask ? input.inputmask.getmetadata() : void 0;
case "setvalue":
$(input).val(options), input && void 0 !== input.inputmask && $(input).triggerHandler("setvalue");
break;
case "option":
if ("string" != typeof options) return this.each(function() {
return void 0 !== this.inputmask ? this.inputmask.option(options) : void 0;
});
if (input && void 0 !== input.inputmask) return input.inputmask.option(options);
break;
default:
return options.alias = fn, nptmask = new Inputmask(options), this.each(function() {
nptmask.mask(this);
});
} else {
if ("object" == typeof fn) return nptmask = new Inputmask(fn), void 0 === fn.mask && void 0 === fn.alias ? this.each(function() {
return void 0 !== this.inputmask ? this.inputmask.option(fn) : void nptmask.mask(this);
}) : this.each(function() {
nptmask.mask(this);
});
if (void 0 === fn) return this.each(function() {
nptmask = new Inputmask(options), nptmask.mask(this);
});
}
}), $.fn.inputmask;
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
/*!
* inputmask.dependencyLib.jquery.min.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return window.dependencyLib=a,a});
@@ -0,0 +1,8 @@
/*!
* inputmask.extensions.min.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(a){"function"==typeof define&&define.amd?define(["inputmask.dependencyLib","inputmask"],a):"object"==typeof exports?module.exports=a(require("./inputmask.dependencyLib.jquery"),require("./inputmask")):a(window.dependencyLib||jQuery,window.Inputmask)}(function(a,b){return b.extendDefinitions({A:{validator:"[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1,casing:"upper"},"&":{validator:"[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",cardinality:1,casing:"upper"},"#":{validator:"[0-9A-Fa-f]",cardinality:1,casing:"upper"}}),b.extendAliases({url:{definitions:{i:{validator:".",cardinality:1}},mask:"(\\http://)|(\\http\\s://)|(ftp://)|(ftp\\s://)i{+}",insertMode:!1,autoUnmask:!1},ip:{mask:"i[i[i]].i[i[i]].i[i[i]].i[i[i]]",definitions:{i:{validator:function(a,b,c,d,e){return c-1>-1&&"."!==b.buffer[c-1]?(a=b.buffer[c-1]+a,a=c-2>-1&&"."!==b.buffer[c-2]?b.buffer[c-2]+a:"0"+a):a="00"+a,new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(a)},cardinality:1}},onUnMask:function(a,b,c){return a}},email:{mask:"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}[.-{1,63}][.-{1,63}][.-{1,63}]",greedy:!1,onBeforePaste:function(a,b){return a=a.toLowerCase(),a.replace("mailto:","")},definitions:{"*":{validator:"[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]",cardinality:1,casing:"lower"},"-":{validator:"[0-9A-Za-z-]",cardinality:1,casing:"lower"}},onUnMask:function(a,b,c){return a}},mac:{mask:"##:##:##:##:##:##"},vin:{mask:"V{8}vV{4}9{4}",definitions:{V:{validator:"[A-HJ-NPR-Za-hj-npr-z\\d]",cardinality:1,casing:"upper"},v:{validator:"[Xx\\d]",cardinality:1,casing:"upper"}},clearIncomplete:!0,autoUnmask:!0}}),b});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
/*!
* inputmask.phone.extensions.min.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery","inputmask"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("./inputmask")):a(window.dependencyLib||jQuery,window.Inputmask)}(function(a,b){return b.extendAliases({phone:{url:"phone-codes/phone-codes.js",countrycode:"",phoneCodeCache:{},mask:function(b){if(void 0===b.phoneCodeCache[b.url]){var c=[];b.definitions["#"]=b.definitions[9],a.ajax({url:b.url,async:!1,type:"get",dataType:"json",success:function(a){c=a},error:function(a,c,d){alert(d+" - "+b.url)}}),b.phoneCodeCache[b.url]=c.sort(function(a,b){return(a.mask||a)<(b.mask||b)?-1:1})}return b.phoneCodeCache[b.url]},keepStatic:!1,nojumps:!0,nojumpsThreshold:1,onBeforeMask:function(a,b){var c=a.replace(/^0{1,2}/,"").replace(/[\s]/g,"");return(c.indexOf(b.countrycode)>1||-1===c.indexOf(b.countrycode))&&(c="+"+b.countrycode+c),c}},phonebe:{alias:"phone",url:"phone-codes/phone-be.js",countrycode:"32",nojumpsThreshold:4}}),b});
@@ -0,0 +1,8 @@
/*!
* inputmask.regex.extensions.min.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(a){"function"==typeof define&&define.amd?define(["inputmask.dependencyLib","inputmask"],a):"object"==typeof exports?module.exports=a(require("./inputmask.dependencyLib.jquery"),require("./inputmask")):a(window.dependencyLib||jQuery,window.Inputmask)}(function(a,b){return b.extendAliases({Regex:{mask:"r",greedy:!1,repeat:"*",regex:null,regexTokens:null,tokenizer:/\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,quantifierFilter:/[0-9]+[^,]/,isComplete:function(a,b){return new RegExp(b.regex).test(a.join(""))},definitions:{r:{validator:function(b,c,d,e,f){function g(a,b){this.matches=[],this.isGroup=a||!1,this.isQuantifier=b||!1,this.quantifier={min:1,max:1},this.repeaterPart=void 0}function h(){var a,b,c=new g,d=[];for(f.regexTokens=[];a=f.tokenizer.exec(f.regex);)switch(b=a[0],b.charAt(0)){case"(":d.push(new g(!0));break;case")":k=d.pop(),d.length>0?d[d.length-1].matches.push(k):c.matches.push(k);break;case"{":case"+":case"*":var e=new g(!1,!0);b=b.replace(/[{}]/g,"");var h=b.split(","),i=isNaN(h[0])?h[0]:parseInt(h[0]),j=1===h.length?i:isNaN(h[1])?h[1]:parseInt(h[1]);if(e.quantifier={min:i,max:j},d.length>0){var l=d[d.length-1].matches;a=l.pop(),a.isGroup||(k=new g(!0),k.matches.push(a),a=k),l.push(a),l.push(e)}else a=c.matches.pop(),a.isGroup||(k=new g(!0),k.matches.push(a),a=k),c.matches.push(a),c.matches.push(e);break;default:d.length>0?d[d.length-1].matches.push(b):c.matches.push(b)}c.matches.length>0&&f.regexTokens.push(c)}function i(b,c){var d=!1;c&&(m+="(",o++);for(var e=0;e<b.matches.length;e++){var f=b.matches[e];if(f.isGroup===!0)d=i(f,!0);else if(f.isQuantifier===!0){var g=a.inArray(f,b.matches),h=b.matches[g-1],k=m;if(isNaN(f.quantifier.max)){for(;f.repeaterPart&&f.repeaterPart!==m&&f.repeaterPart.length>m.length&&!(d=i(h,!0)););d=d||i(h,!0),d&&(f.repeaterPart=m),m=k+f.quantifier.max}else{for(var l=0,n=f.quantifier.max-1;n>l&&!(d=i(h,!0));l++);m=k+"{"+f.quantifier.min+","+f.quantifier.max+"}"}}else if(void 0!==f.matches)for(var p=0;p<f.length&&!(d=i(f[p],c));p++);else{var q;if("["==f.charAt(0)){q=m,q+=f;for(var r=0;o>r;r++)q+=")";var s=new RegExp("^("+q+")$");d=s.test(j)}else for(var t=0,u=f.length;u>t;t++)if("\\"!==f.charAt(t)){q=m,q+=f.substr(0,t+1),q=q.replace(/\|$/,"");for(var r=0;o>r;r++)q+=")";var s=new RegExp("^("+q+")$");if(d=s.test(j))break}m+=f}if(d)break}return c&&(m+=")",o--),d}var j,k,l=c.buffer.slice(),m="",n=!1,o=0;null===f.regexTokens&&h(),l.splice(d,0,b),j=l.join("");for(var p=0;p<f.regexTokens.length;p++){var q=f.regexTokens[p];if(n=i(q,q.isGroup))break}return n},cardinality:1}}}}),b});
@@ -0,0 +1,8 @@
/*!
* jquery.inputmask.min.js
* https://github.com/RobinHerbots/jquery.inputmask
* Copyright (c) 2010 - 2016 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 3.2.8-20
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery","inputmask"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("./inputmask")):a(jQuery,window.Inputmask)}(function(a,b){return void 0===a.fn.inputmask&&(a.fn.inputmask=function(c,d){var e,f=this[0];if(void 0===d&&(d={}),"string"==typeof c)switch(c){case"unmaskedvalue":return f&&f.inputmask?f.inputmask.unmaskedvalue():a(f).val();case"remove":return this.each(function(){this.inputmask&&this.inputmask.remove()});case"getemptymask":return f&&f.inputmask?f.inputmask.getemptymask():"";case"hasMaskedValue":return f&&f.inputmask?f.inputmask.hasMaskedValue():!1;case"isComplete":return f&&f.inputmask?f.inputmask.isComplete():!0;case"getmetadata":return f&&f.inputmask?f.inputmask.getmetadata():void 0;case"setvalue":a(f).val(d),f&&void 0!==f.inputmask&&a(f).triggerHandler("setvalue");break;case"option":if("string"!=typeof d)return this.each(function(){return void 0!==this.inputmask?this.inputmask.option(d):void 0});if(f&&void 0!==f.inputmask)return f.inputmask.option(d);break;default:return d.alias=c,e=new b(d),this.each(function(){e.mask(this)})}else{if("object"==typeof c)return e=new b(c),void 0===c.mask&&void 0===c.alias?this.each(function(){return void 0!==this.inputmask?this.inputmask.option(c):void e.mask(this)}):this.each(function(){e.mask(this)});if(void 0===c)return this.each(function(){e=new b(d),e.mask(this)})}}),a.fn.inputmask});
File diff suppressed because one or more lines are too long
+16
View File
@@ -0,0 +1,16 @@
.DS_Store
#### LANG
/.lein-repl-history
/repl
/node_modules
#### IDE
/.project
/.classpath
/.buildpath
/.settings/
+1
View File
@@ -0,0 +1 @@
language: node_js
+134
View File
@@ -0,0 +1,134 @@
jqModal Changes By Release
==========================
## 1.4.2 (2016.04.16 +r27)
* restore parsing and assigning closeClass behavior in ajax loaded content
* update examples/ajax.php to include a closeClass element
* linting love
## 1.4.1 (2015.09.07 +r26)
* remove legacy jquery.plugin.json
* release on npm
## 1.4.0 (2015.08.16 +r25)
* new convention: use 'e' for event, 'm' for modal element, 80 cols max.
* preventDefault to cancel click behavior in trigger functions, thanks @ayyash
* strict javascript linting, thanks @paladox
* add travis-ci integration
## 1.3.0 (2015.04.15 +r24)
* immediately show ajax modals
## 1.2.1 (2015.04.01 +r23)
* fix: allow focus in active modals
* improve example, include modal:true demo
## 1.2.0 (2015.02.26 +r22)
* new: pass event to $.jqm.focusFunc
* fix: pass active modal DOM object to $.jqm.focusFunc
## 1.1.0 (2014.07.03 +r21)
* allow modification of a signle option with subsequent $.jqm() calls -- do not extend with default $.jqm.params.
* simplify addTrigger method and ensure subsequent calls don't append additional click events to triggers.
## 1.0.3 (2014.07.02 +r20)
* subsequent calls to $.jqm() extend options as expected - thanks @earbash
* added ajax and option overriding to examples
## 1.0.2 (2014.04.10 +r19)
* fixed registration / jQuery NoConflict - thanks @mitja-p
## 1.0.1 (2014.03.27 +r18)
* strict mode fix - thanks @Piokaz
## 1.0.0 (2014.01.30 +r17)
* focus function is now overridable via $.jqm.focusFunc
* re-implement r14, r13 changes [fork rewrite was of previous version]
## r16 2014.01.28
* entirely rewritten; now human readable and compatible with latest jQuery versions (1.11.0, 2.1.0)
* bumped minimum jQuery version requirement to 1.2.3 (for jQuery.data())
* removed automatic IE6 activeX/iframe bleed-through fixes
* onShow callback is now responsible for displaying modal as well as overlay
* onHide callback is now responsible for removing the overlay as well as modal
* returning false in callbacks now halts behavior (e.g. stop the showing of a modal by returning false in onShow)
* moved to github to improve maintenance and community development
## r15 2013.08.04
* jQuery 1.9+ compatibility fix by [Yoosuf Muhammad](https://github.com/eyoosuf)
## r14 2009.03.01
* smart detection of the triggering element. The event context is now always passed to $.jqmShow() and $.jqmHide(). Makes "live querying" modal triggers easier for some.
## r13 2008.07.06
* Minor code optimizations
* Fixed potential exception in modal focus routine
* Overlays of modal dialogs are no longer automatically styled with a "wait" cursor. Use CSS to control
* Exposed overiding of default parameter values via the $.jqm.params global
## r12 2008.06.22
* Now dual licensed under the MIT and GPL licenses
* Compatibility with jQuery 1.2.6
* Removed zIndex parameter
* Subsequent $.jqm calls now update configuration
* AJAX target is now cleared before load
* Added ajaxText parameter
## r11 2007.08.17
* added toTop argument to break z-Index container restraints (<a href="toTop.html">demo</a>)
* improved focus method tolerance
* overlay now takes z-Index stacking order precedence
## r10 2007.07.30
* focus element re-calculated every modal click to prevent IE error
* ie6 sets body width to 100%
* Require fixed pushStack,$.browser.version -- jQuery 1.1.3.1 MINIMUM!
* compressible with a javascript packer
* HTTPS/SSL served iFrame content will not throw warnings in IE
## r9 2007.02.25, r8 2007.02.24
* Updated CSS, Sync up.
* Fixed IE crash when ajax loaded elements used as trigger(s)
* IE6 - overlay now covers dialog only, allowing page interaction when overlay: 0
## r7 2007.02.23
* Added $.jqmShow, $.jqmHide to manually hide/show dialogs
* Added $.jqmAddTrigger and $.jqmAddClose to bind show/hide to elements
* Added onLoad callback (called after ajax return)
* Added support for handling multiple dialogs @ once across ALL functions
* Removed auto-fire parameter, replaced via $(e).jqm().jqmShow()
* Removed $.jqmClose()
* Removed "wrapClass" parameter, updated base CSS
* CSS z-index value takes priority over "zIndex" parameter
* Triggers can hide, show, or hide AND show jqModals
* Overlays+IE6 iframe are now fixed positioned - support for ie6 quirks + standards mode
* Internal Improvements, no event data
+278
View File
@@ -0,0 +1,278 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
+20
View File
@@ -0,0 +1,20 @@
Copyright (c) 2014 Brice Burgess, http://jquery.iceburg.net/jqmodal
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.
+127
View File
@@ -0,0 +1,127 @@
jqModal
=======
jqModal is a plugin for jQuery to help you display modals, popups, and notices. It is flexible and tiny, akin to a "Swiss Army Knife", and provides a great base for your windowing needs.
Features
========
* Designer Frieldly - Use *your* HTML+CSS for Layout and Styling
* Translator/i18n friendly - No hardcoded English strings
* Developer friendly - Extensible through callbacks to make anything possible (gallery slideshows, video-conferencing, &c)
* Simple support for remotely loaded content (aka "ajax")
* Multiple Modals per page (including nested Modal-in-Modal)
* Supported by all browsers capable of running jQuery 1.2.3+
Usage
=====
markup
```html
<a
class="button"
data-modal="{{ video_id }}" href="$//www.youtube.com/embed/{{ video_id }}">
Watch</a>
<div class="modal-dialog modal-video" data-modal="{{ video_id }}">
<iframe
width="560"
height="315"
src="//www.youtube.com/embed/{{ video_id }}"
frameborder="0"
allowfullscreen></iframe>
</div>
```
script
```js
$('div.modal-dialog').each(function(){
var modal_id = this.id || $(this).data('modal');
var trigger = $('a.modal-trigger[data-modal="' + modal_id + '"]');
$(this).jqm({
toTop: true,
trigger: trigger
});
});
```
styling
```css
div.modal-dialog {
display: none;
position: absolute;
left: 50%;
margin-left: -288px;
padding: 6px 0;
position: fixed;
text-align: center;
top: 17%;
width: 576px;
background: #FFF;
}
div.modal-dialog.modal-video {
background-color: transparent;
}
div.jqmOverlay {
/* background-color: #FFF; */ /* lighten background */
background-color: #000; /* darken background */
}
```
Read the documenttion and more at http://jquery.iceburg.net/jqModal
See [Examples / Demonstration](http://jquery.iceburg.net/jqModal/#examples)
Development
=============
Development of jqModal occurs in the -master branch on [jqModal.js](https://github.com/briceburg/jqModal/blob/master/jqModal.js).
The [CHANGELOG.md](https://github.com/briceburg/jqModal/blob/master/CHANGELOG.md) is to be kept up to date with changes.
## Release Process
* Version jqModal.js header `<semver> (YYYY.MM.DD +r<revision>)`
* Update package.json, bumping <semver> version
* Ensure changelog is up to date
* Tag with <semver> : `git tag <semver> && git push origin --tags` to publish.
* add release notes via github interface
* `npm publish ./`
Get Involved
============
Report issues to the github issue tracker.
* https://github.com/briceburg/jqModal/issues
For *support*, please post to stackoverflow using the jqmodal tag:
* http://stackoverflow.com/questions/ask?tags=jqmodal
The jqModal website code is available on github -- please do contribute improvements.
* https://github.com/iceburg-net/jquery.iceburg.net/tree/master/www-1/jqModal
Author
======
Brice Burgess [@iceburgBrice](https://twitter.com/IceburgBrice)
Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
+22
View File
@@ -0,0 +1,22 @@
this message was loaded from server.
<br /><br />
<strong>Note</strong> the `closeOnEsc` parameter was passed as true,
allowing you to close this modal by pressing the <em>`Esc`</em> key.
<br /><br />
Loaded content also respects the <em>closeClass</em>, and will automatically
add classing behahvior to elements like this one: <button class="jqmClose">close me</button>
<br /><br />
<?php
echo (isset($_GET['timestamp'])) ?
'timestamp value <strong>' . (int) $_GET['timestamp'] . '</strong>' :
'no timestampe value received';
if(isset($_GET['sleep'])) {
sleep(3);
}
+168
View File
@@ -0,0 +1,168 @@
<html>
<head>
<title>simple jqModal example</title>
<!-- example page styling -->
<style>
div.middle {
width: 600px;
margin: 2em auto;
}
</style>
<!-- jqModal Dependencies -->
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="../jqModal.js"></script>
<!-- jqModal Styling -->
<link type="text/css" rel="stylesheet" media="all" href="jqModal.css" />
<!-- example page Styling -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"
type="text/css" rel="stylesheet" />
</head>
<body>
<!-- TRIGGER ELEMENTS -->
<div class="middle">
1. <em>Defaults</em> -- <a href="#" class="jqModal">show dialog</a> <br /> Out-of-box behavior. The window and its
content is taken "inline" from the element with an ID of 'dialog'. The dialog is "triggered" (shown) when element(s)
with class <i>jqModal</i> are clicked. No parameters are passed, no fancy window decorations used.
</div>
<div class="middle">
2. <em>Ajax</em> -- <a href="#" class="jqm-trigger-ajax">show dialog</a> <br /> Will open a modal that loads
content from a remote server. This page must be served through a webserver to work. <br /> &nbsp;&nbsp; (e.g.
http:// and not file://).
</div>
<div class="middle">
3. <em>Manual trigger, extend options</em> -- <a href="#" id="trigger-ajax-with-timestamp">show dialog</a> <br />
Demonstrates a manual trigger of `jqmShow` as well as updating the options object.
</div>
<div class="middle">
4. <em>Manual trigger, modal:true dialog</em> -- <a href="#" id="trigger-modal-dialog">show modal:true dialog</a> <br />
Demonstrates a manual trigger of `jqmShow` as well as updating the options object.
</div>
<div class="middle">
5. <em>Ajax Text</em> -- <a href="#" id="trigger-ajax-text">show dialog</a> <br /> Will open a modal whose contents
are immediately replaced with predefined text (e.g. a loading indicator). Predefined text is replaced when the server responds
with content. This page must be served through a webserver with php support to work. <br /> &nbsp;&nbsp; (e.g.
http:// and not file://).
</div>
<!-- MODAL MARKUP (styled via jqModal.css) -->
<div class="jqmWindow" id="dialog">
<a href="#" class="jqmClose">Close</a>
<hr>
<em>READ ME</em> --> This is a "vanilla plain" jqModal window. Behavior and appeareance extend far beyond this. <br />
<br /> Please see the <a href="http://jquery.iceburg.net/jqModal/">jqModal website</a> for more! <br /> <br /> <em>NOTE</em>;
You can close windows by clicking the tinted background known as the "overlay". Clicking the overlay will have no
effect if the "modal" parameter is passed, or if the overlay is disabled.
</div>
<div class="jqmWindow" id="ajax-dialog">
<a href="#" class="jqmClose">Close</a>
<hr />
<div class="ajax-content"><marquee>loading...</marquee></div>
</div>
<div class="jqmWindow" id="modal-dialog">
<a href="#" class="jqmClose">Close</a>
<hr />
<p>modal: true demonstration</p>
<p>Pressing `Esc` or clicking the overlay will NOT close this form</p>
<input type="text" placeholder="I get focus..." />
<br />
<select>
<option>Option 1</option>
<option>Option 2</option>
</select>
</div>
<div class="jqmWindow" id="ajax-text-dialog">
<a href="#" class="jqmClose">Close</a>
<hr />
<div class="ajax-content">I get replaced...</div>
</div>
<!-- MODAL SCRIPT -->
<script type="text/javascript">
$().ready(function() {
/* Example #1 */
$('#dialog').jqm();
/* Example #2 */
$('#ajax-dialog').jqm({
trigger: 'a.jqm-trigger-ajax',
ajax: 'ajax.php',
target: 'div.ajax-content',
closeOnEsc: true
});
/* Example #3 */
$('#trigger-ajax-with-timestamp').click(function() {
var timestamp = new Date().getTime();
$('#ajax-dialog').jqm({
// update an option
ajax: 'ajax.php?timestamp=' + timestamp
}).jqmShow(); // show modal
return false;
});
/* Example #4 */
$('#modal-dialog').jqm({
trigger: '#trigger-modal-dialog',
modal: true
});
/* Example #5 */
$('#ajax-text-dialog').jqm({
trigger: '#trigger-ajax-text',
ajax: 'ajax.php?sleep=true',
ajaxText: 'Loading ...<span class="glyphicon glyphicon-refresh glyphicon-spin"></span>',
target: 'div.ajax-content',
closeOnEsc: true
});
});
</script>
<style>
.glyphicon-spin {
-webkit-animation: spin 1000ms infinite linear;
animation: spin 1000ms infinite linear;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
</style>
</body>
</html>
@@ -0,0 +1,37 @@
/* jqModal base Styling courtesy of;
Brice Burgess <bhb@iceburg.net> */
/* The Window's CSS z-index value is respected (takes priority). If none is supplied,
the Window's z-index value will be set to 3000 by default (via jqModal.js). */
.jqmWindow {
display: none;
position: fixed;
top: 17%;
left: 50%;
margin-left: -300px;
width: 600px;
background-color: #EEE;
color: #333;
border: 1px solid black;
padding: 12px;
}
.jqmOverlay { background-color: #000; }
/* Background iframe styling for IE6. Prevents ActiveX bleed-through (<select> form elements, etc.) */
* iframe.jqm {position:absolute;top:0;left:0;z-index:-1;
width: expression(this.parentNode.offsetWidth+'px');
height: expression(this.parentNode.offsetHeight+'px');
}
/* Fixed posistioning emulation for IE6
Star selector used to hide definition from browsers other than IE6
For valid CSS, use a conditional include instead */
* html .jqmWindow {
position: absolute;
top: expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(17 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');
}
+89
View File
@@ -0,0 +1,89 @@
// Generated by typings
// Source: typings/globals/jqModal/index.d.ts
interface JQueryModalSettings {
/**
* [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay.
* @default 50 */
overlay?: number;
/**
* (String) overlayClass - Applied to the body covering overlay. Useful for controlling overlay look (tint, background-image, &c) with CSS.
* @default 'jqmOverlay'*/
overlayClass?: string;
/**
* (String) closeClass - Children of the modal element matching `closeClass` will fire the onHide event (to close the modal).
* @default 'jqmClose' */
closeClass?: string;
/**
* (Mixed) trigger - Matching elements will fire the onShow event (to display the modal). Trigger can be a selector String, a jQuery collection of elements, a DOM element, or a False boolean.
* @default '.jqModal' */
trigger?: any;
/**
* (String) ajax - URL to load content from via an AJAX request. False to disable ajax. If ajax begins with a "@", the URL is extracted from the attribute of the triggering element (e.g. use '@data-url' for; <a href="#" class="jqModal" data-url="modal.html">...)
* @default false */
ajax?: string;
/**
* (Mixed) target - Children of the modal element to load the ajax response into. If false, modal content will be overwritten by ajax response. Useful for retaining modal design.
* @default false */
target?: any;
/** Target may be a selector string, jQuery collection of elements, or a DOM element -- and MUST exist as a child of the modal element. */
/** (String) ajaxText - Text shown while waiting for ajax return. Replaces HTML content of `target` element.
* @default '' */
ajaxText?: string;
/**
* (Boolean) modal - If true, user interactivity will be locked to the modal window until closed.
* @default false*/
modal?: boolean;
/**
* (Boolean) toTop - If true, modal will be posistioned as a first child of the BODY element when opened, and its DOM posistion restored when closed. Useful for overcoming z-Index container issues.
* @default false */
toTop?: boolean;
/**
* (Function) onShow - User defined callback function fired when modal opened.
* @default onShow */
onShow?: any;
/**
* (Function) onHide - User defined callback function fired when modal closed.
* @default onHide */
onHide?: any;
/**
* (Function) onLoad - User defined callback function fired when ajax content loads.
* @default false */
onLoad?: any;
}
interface JQuery {
/**
* Initialize a set of elements as "modals". Modals typically are popup dialogs,
* notices, modal windows, &c.
*
* @name jqm
* @param options user defined options, augments defaults.
* @type jQuery
* @cat Plugins/jqModal
*/
jqm(config: JQueryModalSettings): JQuery;
/**
* Matching modals will have their jqmShow() method fired by attaching a
* onClick event to elements matching `trigger`.
*
* @name jqmAddTrigger
* @param trigger a selector String, jQuery collection of elements, or a DOM element.
*/
jqmAddTrigger(trigger: any);
/**
* Matching modals will have their jqmHide() method fired by attaching an
* onClick event to elements matching `trigger`.
*
* @name jqmAddClose
* @param trigger a selector String, jQuery collection of elements, or a DOM element.
*/
jqmAddClose(trigger: any);
/**
* Open matching modals (if not shown)
*/
jqmShow(trigger?: any): JQuery;
/**
* Close matching modals
*/
jqmHide(trigger?: any): JQuery;
}
+400
View File
@@ -0,0 +1,400 @@
/*
* jqModal - Minimalist Modaling with jQuery
*
* Copyright (c) 2007-2016 Brice Burgess @IceburgBrice
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Version: 1.4.2 (2016.04.16 +r27)
* Requires: jQuery 1.2.3+
*/
(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
/**
* Initialize elements as "modals". Modals typically are popup dialogs,
* notices, modal windows, &c.
*
* @name jqm
* @param options user defined options, augments defaults.
* @type jQuery
* @cat Plugins/jqModal
*/
$.fn.jqm=function(options){
return this.each(function(){
var jqm = $(this).data('jqm') || $.extend({ID: I++}, $.jqm.params),
o = $.extend(jqm,options);
// add/extend options to modal and mark as initialized
$(this).data('jqm',o).addClass('jqm-init')[0]._jqmID = o.ID;
// ... Attach events to trigger showing of this modal
$(this).jqmAddTrigger(o.trigger);
});
};
/**
* Matching modals will have their jqmShow() method fired by attaching a
* onClick event to elements matching `trigger`.
*
* @name jqmAddTrigger
* @param trigger a a string selector, jQuery collection, or DOM element.
*/
$.fn.jqmAddTrigger=function(trigger){
if(trigger){
return this.each(function(){
if (!addTrigger($(this), 'jqmShow', trigger)) {
err("jqmAddTrigger must be called on initialized modals");
}
});
}
};
/**
* Matching modals will have their jqmHide() method fired by attaching an
* onClick event to elements matching `trigger`.
*
* @name jqmAddClose
* @param trigger a string selector, jQuery collection, or DOM element.
*/
$.fn.jqmAddClose=function(trigger){
if(trigger){
return this.each(function(){
if(!addTrigger($(this), 'jqmHide', trigger)) {
err ("jqmAddClose must be called on initialized modals");
}
});
}
};
/**
* Open matching modals (if not shown)
*/
$.fn.jqmShow=function(trigger){
return this.each(function(){
if(!this._jqmShown) { show($(this), trigger); }
});
};
/**
* Close matching modals
*/
$.fn.jqmHide=function(trigger){
return this.each(function(){
if(this._jqmShown) { hide($(this), trigger); }
});
};
// utility functions
var
err = function(msg){
if(window.console && window.console.error) { window.console.error(msg); }
}, show = function(m, t){
/**
* m = modal element (as jQuery object)
* t = triggering element
*
* o = options
* z = z-index of modal
* v = overlay element (as jQuery object)
* h = hash (for jqModal <= r15 compatibility)
*/
t = t || window.event;
var o = m.data('jqm'),
z = (parseInt(m.css('z-index'),10)) || 3000,
v = $('<div></div>').addClass(o.overlayClass).css({
height:'100%',
width:'100%',
position:'fixed',
left:0,
top:0,
'z-index':z-1,
opacity:o.overlay/100
}),
// maintain legacy "hash" construct
h = {w: m, c: o, o: v, t: t};
m.css('z-index',z);
if(o.ajax){
var target = o.target || m,
url = o.ajax;
target = (typeof target === 'string') ? $(target,m) : $(target);
if(url.substr(0,1) === '@') {
url = $(t).attr(url.substring(1));
}
// load remote contents
target.load(url,function(){
if(o.onLoad) {
o.onLoad.call(this,h);
}
parseModalContents.call(m,o,target);
});
// show modal
if(o.ajaxText) {
target.html(o.ajaxText);
}
open(h);
}
else { open(h); }
}, hide = function(m, t){
/**
* m = modal element (as jQuery object)
* t = triggering element
*
* o = options
* h = hash (for jqModal <= r15 compatibility)
*/
t = t || window.event;
var o = m.data('jqm'),
// maintain legacy "hash" construct
h = {w: m, c: o, o: m.data('jqmv'), t: t};
close(h);
}, onShow = function(hash){
// onShow callback. Responsible for showing a modal and overlay.
// return false to stop opening modal.
// hash object;
// w: (jQuery object) The modal element
// c: (object) The modal's options object
// o: (jQuery object) The overlay element
// t: (DOM object) The triggering element
// if overlay not disabled, prepend to body
if(hash.c.overlay > 0) {
hash.o.prependTo('body');
}
// make modal visible
hash.w.show();
// call focusFunc (attempts to focus on first input in modal)
$.jqm.focusFunc(hash.w,true);
return true;
}, onHide = function(hash){
// onHide callback. Responsible for hiding a modal and overlay.
// return false to stop closing modal.
// hash object;
// w: (jQuery object) The modal element
// c: (object) The modal's options object
// o: (jQuery object) The overlay element
// t: (DOM object) The triggering element
// hide modal and if overlay, remove overlay.
if(hash.w.hide() && hash.o) {
hash.o.remove();
}
return true;
}, addTrigger = function(m, key, trigger){
// addTrigger: Adds a jqmShow/jqmHide (key) event click on modal (m)
// to all elements that match trigger string (trigger)
var jqm = m.data('jqm');
if(jqm) {
return $(trigger).each(function(){
this[key] = this[key] || [];
// register this modal with this trigger only once
if($.inArray(jqm.ID,this[key]) < 0) {
this[key].push(jqm.ID);
// register trigger click event for this modal
// allows cancellation of show/hide event from
$(this).click(function(e){
if(!e.isDefaultPrevented()) { m[key](this); }
return false;
});
}
});
}
}, open = function(h){
// open: executes the onOpen callback + performs common tasks if successful
// transform legacy hash into new var shortcuts
var m = h.w,
v = h.o,
o = h.c;
// execute onShow callback
if(o.onShow(h) !== false){
// mark modal as shown
m[0]._jqmShown = true;
// if modal:true dialog
// Bind the Keep Focus Function [F] if no other Modals are active
// else,
// trigger closing of dialog when overlay is clicked
if(o.modal){
if(!ActiveModals[0]){ F('bind'); }
ActiveModals.push(m[0]);
}
else {
m.jqmAddClose(v);
}
// parse modal contents and add behavior
parseModalContents.call(m,o);
// if toTop is true and overlay exists;
// remember modal DOM position with <span> placeholder element, and move
// the modal to a direct child of the body tag (after overlyay)
if(o.toTop && v) {
m.before('<span id="jqmP'+o.ID+'"></span>').insertAfter(v);
}
// remember overlay (for closing function)
m.data('jqmv',v);
// close modal if the esc key is pressed and closeOnEsc is set to true
m.unbind("keydown",$.jqm.closeOnEscFunc);
if(o.closeOnEsc) {
m.attr("tabindex", 0).bind("keydown",$.jqm.closeOnEscFunc).focus();
}
}
}, close = function(h){
// close: executes the onHide callback + performs common tasks if successful
// transform legacy hash into new var shortcuts
var m = h.w,
v = h.o,
o = h.c;
// execute onHide callback
if(o.onHide(h) !== false){
// mark modal as !shown
m[0]._jqmShown = false;
// If modal, remove from modal stack.
// If no modals in modal stack, unbind the Keep Focus Function
if(o.modal){
ActiveModals.pop();
if(!ActiveModals[0]) {
F('unbind');
}
}
// IF toTop was passed and an overlay exists;
// Move modal back to its "remembered" position.
if(o.toTop && v) {
$('#jqmP'+o.ID).after(m).remove();
}
}
}, F = function(t){
// F: The Keep Focus Function (for modal: true dialos)
// Binds or Unbinds (t) the Focus Examination Function (X)
$(document)[t]("keypress keydown mousedown",X);
}, X = function(e){
// X: The Focus Examination Function (for modal: true dialogs)
var targetModal = $(e.target).data('jqm') ||
$(e.target).parents('.jqm-init:first').data('jqm');
var activeModal = ActiveModals[ActiveModals.length-1];
// allow bubbling if event target is within active modal dialog
return (targetModal && targetModal.ID === activeModal._jqmID) ?
true : $.jqm.focusFunc(activeModal,e);
}, parseModalContents = function(o, context){
context = context || this;
// Attach events to elements inside the modal matching closingClass
if(o.closeClass) {
this.jqmAddClose($('.' + o.closeClass,context));
}
},
I = 0, // modal ID increment (for nested modals)
ActiveModals = []; // array of active modals
// $.jqm, overridable defaults
$.jqm = {
/**
* default options
*
* (Integer) overlay - [0-100] Translucency percentage (opacity) of the body covering overlay. Set to 0 for NO overlay, and up to 100 for a 100% opaque overlay.
* (String) overlayClass - Applied to the body covering overlay. Useful for controlling overlay look (tint, background-image, &c) with CSS.
* (String) closeClass - Children of the modal element matching `closeClass` will fire the onHide event (to close the modal).
* (Mixed) trigger - Matching elements will fire the onShow event (to display the modal). Trigger can be a selector String, a jQuery collection of elements, a DOM element, or a False boolean.
* (String) ajax - URL to load content from via an AJAX request. False to disable ajax. If ajax begins with a "@", the URL is extracted from the attribute of the triggering element (e.g. use '@data-url' for; <a href="#" class="jqModal" data-url="modal.html">...)
* (Mixed) target - Children of the modal element to load the ajax response into. If false, modal content will be overwritten by ajax response. Useful for retaining modal design.
* Target may be a selector string, jQuery collection of elements, or a DOM element -- and MUST exist as a child of the modal element.
* (String) ajaxText - Text shown while waiting for ajax return. Replaces HTML content of `target` element.
* (Boolean) modal - If true, user interactivity will be locked to the modal window until closed.
* (Boolean) toTop - If true, modal will be posistioned as a first child of the BODY element when opened, and its DOM posistion restored when closed. Useful for overcoming z-Index container issues.
* (Function) onShow - User defined callback function fired when modal opened.
* (Function) onHide - User defined callback function fired when modal closed.
* (Function) onLoad - User defined callback function fired when ajax content loads.
*/
params: {
overlay: 50,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
closeOnEsc: false,
trigger: '.jqModal',
ajax: false,
target: false,
ajaxText: '',
modal: false,
toTop: false,
onShow: onShow,
onHide: onHide,
onLoad: false
},
// focusFunc is fired:
// a) when a modal:true dialog is shown,
// b) when an event occurs outside an active modal:true dialog
// It is passed the active modal:true dialog as well as event
focusFunc: function(activeModal, e) {
// if the event occurs outside the activeModal, focus on first element
if(e) { $(':input:visible:first',activeModal).focus(); }
// lock interactions to the activeModal
return false;
},
// closeOnEscFunc is attached to modals where closeOnEsc param true.
closeOnEscFunc: function(e){
if (e.keyCode === 27) {
$(this).jqmHide();
return false;
}
}
};
return $.jqm;
}));
+13
View File
@@ -0,0 +1,13 @@
/*
* jqModal - Minimalist Modaling with jQuery
*
* Copyright (c) 2007-2016 Brice Burgess @IceburgBrice
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* $Version: 1.4.2 (2016.04.16 +r27)
* Requires: jQuery 1.2.3+
*/
!function(n){"object"==typeof module&&"object"==typeof module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){n.fn.jqm=function(o){return this.each(function(){var t=n(this).data("jqm")||n.extend({ID:m++},n.jqm.params),e=n.extend(t,o);n(this).data("jqm",e).addClass("jqm-init")[0]._jqmID=e.ID,n(this).jqmAddTrigger(e.trigger)})},n.fn.jqmAddTrigger=function(t){return t?this.each(function(){a(n(this),"jqmShow",t)||o("jqmAddTrigger must be called on initialized modals")}):void 0},n.fn.jqmAddClose=function(t){return t?this.each(function(){a(n(this),"jqmHide",t)||o("jqmAddClose must be called on initialized modals")}):void 0},n.fn.jqmShow=function(o){return this.each(function(){this._jqmShown||t(n(this),o)})},n.fn.jqmHide=function(o){return this.each(function(){this._jqmShown&&e(n(this),o)})};var o=function(n){window.console&&window.console.error&&window.console.error(n)},t=function(o,t){t=t||window.event;var e=o.data("jqm"),i=parseInt(o.css("z-index"),10)||3e3,s=n("<div></div>").addClass(e.overlayClass).css({height:"100%",width:"100%",position:"fixed",left:0,top:0,"z-index":i-1,opacity:e.overlay/100}),a={w:o,c:e,o:s,t:t};if(o.css("z-index",i),e.ajax){var d=e.target||o,c=e.ajax;d="string"==typeof d?n(d,o):n(d),"@"===c.substr(0,1)&&(c=n(t).attr(c.substring(1))),d.load(c,function(){e.onLoad&&e.onLoad.call(this,a),l.call(o,e,d)}),e.ajaxText&&d.html(e.ajaxText),r(a)}else r(a)},e=function(n,o){o=o||window.event;var t=n.data("jqm"),e={w:n,c:t,o:n.data("jqmv"),t:o};d(e)},i=function(o){return o.c.overlay>0&&o.o.prependTo("body"),o.w.show(),n.jqm.focusFunc(o.w,!0),!0},s=function(n){return n.w.hide()&&n.o&&n.o.remove(),!0},a=function(o,t,e){var i=o.data("jqm");return i?n(e).each(function(){this[t]=this[t]||[],n.inArray(i.ID,this[t])<0&&(this[t].push(i.ID),n(this).click(function(n){return n.isDefaultPrevented()||o[t](this),!1}))}):void 0},r=function(o){var t=o.w,e=o.o,i=o.c;i.onShow(o)!==!1&&(t[0]._jqmShown=!0,i.modal?(j[0]||c("bind"),j.push(t[0])):t.jqmAddClose(e),l.call(t,i),i.toTop&&e&&t.before('<span id="jqmP'+i.ID+'"></span>').insertAfter(e),t.data("jqmv",e),t.unbind("keydown",n.jqm.closeOnEscFunc),i.closeOnEsc&&t.attr("tabindex",0).bind("keydown",n.jqm.closeOnEscFunc).focus())},d=function(o){var t=o.w,e=o.o,i=o.c;i.onHide(o)!==!1&&(t[0]._jqmShown=!1,i.modal&&(j.pop(),j[0]||c("unbind")),i.toTop&&e&&n("#jqmP"+i.ID).after(t).remove())},c=function(o){n(document)[o]("keypress keydown mousedown",u)},u=function(o){var t=n(o.target).data("jqm")||n(o.target).parents(".jqm-init:first").data("jqm"),e=j[j.length-1];return t&&t.ID===e._jqmID?!0:n.jqm.focusFunc(e,o)},l=function(o,t){t=t||this,o.closeClass&&this.jqmAddClose(n("."+o.closeClass,t))},m=0,j=[];return n.jqm={params:{overlay:50,overlayClass:"jqmOverlay",closeClass:"jqmClose",closeOnEsc:!1,trigger:".jqModal",ajax:!1,target:!1,ajaxText:"",modal:!1,toTop:!1,onShow:i,onHide:s,onLoad:!1},focusFunc:function(o,t){return t&&n(":input:visible:first",o).focus(),!1},closeOnEscFunc:function(o){return 27===o.keyCode?(n(this).jqmHide(),!1):void 0}},n.jqm});

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