v2 first commit
This commit is contained in:
357
public/js/app.js
vendored
357
public/js/app.js
vendored
@ -1,357 +0,0 @@
|
||||
$(document).ready(function () {
|
||||
// Live Search
|
||||
$.fn.liveSearch = function (option) {
|
||||
return this.each(function () {
|
||||
this.timer = null;
|
||||
this.items = new Array();
|
||||
|
||||
$.extend(this, option);
|
||||
|
||||
$(this).attr('autocomplete', 'off');
|
||||
|
||||
// Blur
|
||||
$(this).on('blur', function () {
|
||||
setTimeout(function (object) {
|
||||
object.hide();
|
||||
}, 200, this);
|
||||
});
|
||||
|
||||
// Keydown
|
||||
$(this).on('input', function (event) {
|
||||
this.request();
|
||||
});
|
||||
|
||||
// Show
|
||||
this.show = function () {
|
||||
var pos = $('#live-search').position();
|
||||
|
||||
$(this).parent().parent().siblings('ul.dropdown-menu').css({
|
||||
top : pos.top + $('#live-search').height(),
|
||||
width: $('#live-search').width(),
|
||||
left: pos.left
|
||||
});
|
||||
|
||||
$(this).parent().parent().siblings('ul.dropdown-menu').show();
|
||||
};
|
||||
|
||||
// Hide
|
||||
this.hide = function () {
|
||||
$(this).parent().parent().siblings('ul.dropdown-menu').hide();
|
||||
};
|
||||
|
||||
// Request
|
||||
this.request = function () {
|
||||
clearTimeout(this.timer);
|
||||
|
||||
this.timer = setTimeout(function (object) {
|
||||
object.source($(object).val(), $.proxy(object.response, object));
|
||||
}, 200, this);
|
||||
};
|
||||
|
||||
// Response
|
||||
this.response = function (json) {
|
||||
html = '';
|
||||
|
||||
if (json.length) {
|
||||
for (i = 0; i < json.length; i++) {
|
||||
this.items[json[i]['id']] = json[i];
|
||||
}
|
||||
|
||||
var count = json.length;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
html += '<li data-value="' + json[i]['type'] + '-' + json[i]['id'] + '">';
|
||||
html += ' <a href="' + json[i]['href'] + '">';
|
||||
html += ' <div class="live-search">';
|
||||
html += ' <div class="row">';
|
||||
html += ' <div class="name" style="color: ' + json[i]['color'] + ';">' + json[i]['name'] + '</div>';
|
||||
html += ' <span class="type">' + json[i]['type'] + '</span>';
|
||||
html += ' </div>';
|
||||
html += ' </div>';
|
||||
html += ' </a>';
|
||||
html += '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
if (html) {
|
||||
this.show();
|
||||
} else {
|
||||
this.hide();
|
||||
}
|
||||
|
||||
$(this).parent().parent().siblings('ul.dropdown-menu').html(html);
|
||||
};
|
||||
|
||||
$(this).parent().parent().after('<ul class="dropdown-menu" id="result-search" style="padding:2px 2px 2px 2px;"></ul>');
|
||||
$(this).parent().parent().siblings('ul.dropdown-menu').delegate('a', 'click', $.proxy(this.click, this));
|
||||
});
|
||||
};
|
||||
|
||||
$('#live-search input[name=\'live-search\']').liveSearch({
|
||||
'source': function (request, response) {
|
||||
if (request != '' && request.length > 2) {
|
||||
$.ajax({
|
||||
url : url_search,
|
||||
type : 'GET',
|
||||
dataType: 'JSON',
|
||||
data : 'keyword=' + $(this).val(),
|
||||
success : function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
id : item.id,
|
||||
name : item.name,
|
||||
type : item.type,
|
||||
color: item.color,
|
||||
href : item.href
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('#live-search > .dropdown-menu').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
last_radio = '';
|
||||
|
||||
$('input:radio').each(function () {
|
||||
if ($(this).parent().parent().hasClass('radio-inline')) {
|
||||
input_name = $(this).attr("name");
|
||||
input_value = $(this).attr("value");
|
||||
input_text = $(this).text();
|
||||
input_checked = $(this).is(':checked');
|
||||
|
||||
enable_class = 'btn-default';
|
||||
disable_class = 'btn-default';
|
||||
|
||||
if (last_radio == input_name) {
|
||||
return;
|
||||
}
|
||||
|
||||
last_radio = input_name;
|
||||
|
||||
if ($(':radio[name="' + input_name + '"]').length != 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((input_value != 0) && (input_value != 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((input_text.localeCompare(text_yes) == 1) && (input_text.localeCompare(text_no) == 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (input_value == 1 && input_checked == true) {
|
||||
enable_class = 'btn-success active';
|
||||
} else {
|
||||
disable_class = 'btn-danger active';
|
||||
}
|
||||
|
||||
$('#' + input_name + '_1').removeClass('btn-default').addClass(enable_class);
|
||||
$('#' + input_name + '_0').removeClass('btn-default').addClass(disable_class);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-group label:not(.active)', function (e) {
|
||||
disable_label = $(this);
|
||||
disable_input = $('#' + disable_label.attr('id') + ' :input');
|
||||
|
||||
if (disable_input.attr('type') != 'radio') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!disable_input.is(':checked')) {
|
||||
enable_input = $('input[name="' + disable_input.attr('name') + '"]:checked');
|
||||
enable_label = enable_input.parent();
|
||||
|
||||
enable_label.removeClass('btn-success active');
|
||||
enable_label.removeClass('btn-danger active');
|
||||
|
||||
enable_input.removeAttr('checked');
|
||||
enable_label.addClass('btn btn-default');
|
||||
|
||||
disable_label.removeClass('btn-default');
|
||||
|
||||
if (disable_input.val() == 0) {
|
||||
disable_label.addClass('btn-danger active');
|
||||
} else {
|
||||
disable_label.addClass('btn-success active');
|
||||
}
|
||||
|
||||
disable_input.attr('checked', 'checked');
|
||||
|
||||
enable_input.trigger('change');
|
||||
disable_input.trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
if (document.getElementById('recurring_frequency')) {
|
||||
$('.input-group-recurring #recurring_frequency').select2();
|
||||
$('.input-group-recurring #recurring_frequency').trigger('change');
|
||||
}
|
||||
|
||||
$('.form-loading-button').submit(function( event ) {
|
||||
$('.button-submit').button('loading');
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
if (document.getElementsByClassName('input-group-invoice-text').length) {
|
||||
$('.input-group-invoice-text select').select2();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.popup', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#modal-popup').remove();
|
||||
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: $(element).attr('href'),
|
||||
type: 'get',
|
||||
dataType: 'html',
|
||||
success: function(data) {
|
||||
html = '<div class="modal" id="modal-popup">';
|
||||
html += ' <div class="modal-dialog">';
|
||||
html += ' <div class="modal-content">';
|
||||
html += ' <div class="modal-header">';
|
||||
html += ' <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
|
||||
html += ' <h4 class="modal-title">' + $(element).text() + '</h4>';
|
||||
html += ' </div>';
|
||||
html += ' <div class="modal-body">' + data + '</div>';
|
||||
html += ' </div';
|
||||
html += ' </div>';
|
||||
html += '</div>';
|
||||
|
||||
$('body').append(html);
|
||||
|
||||
$('#modal-popup').modal('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '.input-group-recurring #recurring_frequency', function (e) {
|
||||
var value = $(this).val();
|
||||
|
||||
var recurring_frequency = $('#recurring_frequency').parent().parent();
|
||||
var recurring_interval = $('#recurring_interval').parent();
|
||||
var recurring_custom_frequency = $('#recurring_custom_frequency').parent();
|
||||
var recurring_count = $('#recurring_count').parent();
|
||||
|
||||
if (value == 'custom') {
|
||||
recurring_frequency.removeClass('col-md-12').removeClass('col-md-12').addClass('col-md-4');
|
||||
|
||||
recurring_interval.removeClass('hidden');
|
||||
recurring_custom_frequency.removeClass('hidden');
|
||||
recurring_count.removeClass('hidden');
|
||||
|
||||
$('#recurring_custom_frequency').select2();
|
||||
} else if (value == 'no' || value == '') {
|
||||
recurring_frequency.removeClass('col-md-10').removeClass('col-md-4').addClass('col-md-12');
|
||||
|
||||
recurring_interval.addClass('hidden');
|
||||
recurring_custom_frequency.addClass('hidden');
|
||||
recurring_count.addClass('hidden');
|
||||
} else {
|
||||
recurring_frequency.removeClass('col-md-12').removeClass('col-md-4').addClass('col-md-10');
|
||||
|
||||
recurring_interval.addClass('hidden');
|
||||
recurring_custom_frequency.addClass('hidden');
|
||||
recurring_count.removeClass('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('change', '.input-group-invoice-text select', function () {
|
||||
var invoice_text_custom = $(this).parent().parent().parent().find('input');
|
||||
|
||||
if ($(this).val() == 'custom') {
|
||||
$(this).parent().parent().removeClass('col-md-12').addClass('col-md-6');
|
||||
|
||||
invoice_text_custom.parent().removeClass('hidden');
|
||||
|
||||
$(this).select2();
|
||||
} else {
|
||||
$(this).parent().parent().removeClass('col-md-6').addClass('col-md-12');
|
||||
|
||||
invoice_text_custom.parent().addClass('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
function confirmDelete(form_id, title, message, button_cancel, button_delete) {
|
||||
$('#confirm-modal').remove();
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<div class="modal fade" id="confirm-modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalLabel" aria-hidden="true">';
|
||||
html += ' <div class="modal-dialog">';
|
||||
html += ' <div class="modal-content">';
|
||||
html += ' <div class="modal-header">';
|
||||
html += ' <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
|
||||
html += ' <h4 class="modal-title" id="confirmModalLabel">' + title + '</h4>';
|
||||
html += ' </div>';
|
||||
html += ' <div class="modal-body">';
|
||||
html += ' <p>' + message + '</p>';
|
||||
html += ' <p></p>';
|
||||
html += ' </div>';
|
||||
html += ' <div class="modal-footer">';
|
||||
html += ' <div class="pull-left">';
|
||||
html += ' <button type="button" class="btn btn-danger" onclick="$(\'' + form_id + '\').submit();">' + button_delete + '</button>';
|
||||
html += ' <button type="button" class="btn btn-default" data-dismiss="modal">' + button_cancel + '</button>';
|
||||
html += ' </div>';
|
||||
html += ' </div>';
|
||||
html += ' </div>';
|
||||
html += ' </div>';
|
||||
html += '</div>';
|
||||
|
||||
$('body').append(html);
|
||||
|
||||
$('#confirm-modal').modal('show');
|
||||
}
|
||||
|
||||
function convertDateFormat(date, split_character) {
|
||||
var result = [];
|
||||
var formats = {
|
||||
'd': 'DD',
|
||||
'M': 'MMM',
|
||||
'Y': 'YYYY',
|
||||
'F': 'MMMM',
|
||||
'm': 'MM'
|
||||
};
|
||||
|
||||
dates = date.split(split_character);
|
||||
|
||||
dates.forEach(function(value) {
|
||||
result.push(formats[value]);
|
||||
});
|
||||
|
||||
return result.join(split_character);
|
||||
}
|
||||
|
||||
function itemTableResize() {
|
||||
colspan = $('#items.table.table-bordered thead tr th').length - 1;
|
||||
|
||||
$('#items.table.table-bordered tbody #addItem .text-right').attr('colspan', colspan);
|
||||
$('#items.table.table-bordered tbody #tr-subtotal .text-right:first').attr('colspan', colspan);
|
||||
$('#items.table.table-bordered tbody #tr-discount .text-right:first').attr('colspan', colspan);
|
||||
$('#items.table.table-bordered tbody #tr-tax .text-right:first').attr('colspan', colspan);
|
||||
$('#items.table.table-bordered tbody #tr-total .text-right:first').attr('colspan', colspan);
|
||||
}
|
||||
|
||||
function notificationHide(path, id, token) {
|
||||
$.ajax({
|
||||
url: app_url + '/common/notifications/disable',
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
data: {path: path, id: id},
|
||||
headers: { 'X-CSRF-TOKEN': token },
|
||||
success: function(json) {
|
||||
if (json['success']) {
|
||||
$('#notification-' + id).remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
89868
public/js/auth/forgot.js
vendored
Normal file
89868
public/js/auth/forgot.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89883
public/js/auth/login.js
vendored
Normal file
89883
public/js/auth/login.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/auth/permissions.js
vendored
Normal file
89868
public/js/auth/permissions.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89867
public/js/auth/reset.js
vendored
Normal file
89867
public/js/auth/reset.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89941
public/js/auth/roles.js
vendored
Normal file
89941
public/js/auth/roles.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/auth/users.js
vendored
Normal file
89868
public/js/auth/users.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89885
public/js/banking/accounts.js
vendored
Normal file
89885
public/js/banking/accounts.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/banking/reconciliations.js
vendored
Normal file
89868
public/js/banking/reconciliations.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89865
public/js/banking/transactions.js
vendored
Normal file
89865
public/js/banking/transactions.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/banking/transfers.js
vendored
Normal file
89868
public/js/banking/transfers.js
vendored
Normal file
File diff suppressed because one or more lines are too long
130
public/js/bootstrap-fancyfile.js
vendored
130
public/js/bootstrap-fancyfile.js
vendored
@ -1,130 +0,0 @@
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
/* FANCYFILE CLASS DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var fancyfile = '[data-toggle=fancyfile]'
|
||||
, FancyFile = function (element, options) {
|
||||
var $el = $(element);
|
||||
this.options = $.extend({}, $.fn.fancyfile.defaults, options);
|
||||
this.makeFancy($el);
|
||||
};
|
||||
|
||||
FancyFile.prototype = {
|
||||
constructor: FancyFile,
|
||||
makeFancy : function (element) {
|
||||
var $fancy = $(this.options.container);
|
||||
var $clone = element.clone( true );
|
||||
var classes = $clone.attr('class');
|
||||
var $aLink = $(this.options.fakeButton);
|
||||
var $fakeInput = $(this.options.fakeInput);
|
||||
var colorized = false;
|
||||
if(classes) {
|
||||
classes.split(' ').forEach(function(bc){
|
||||
if(/input|span/i.test(bc)) {
|
||||
$fancy.find('div').addClass(bc);
|
||||
}
|
||||
if(/primary|info|success|warning|danger|inverse/.test(bc)) {
|
||||
colorized = true;
|
||||
$aLink.addClass(bc);
|
||||
}
|
||||
});
|
||||
}
|
||||
var buttonText = element.attr('data-text');
|
||||
if(buttonText) {
|
||||
this.options.text = buttonText === 'false' ? '' : buttonText;
|
||||
}
|
||||
var buttonIcon = element.attr('data-icon');
|
||||
if(buttonIcon) {
|
||||
this.options.icon = buttonIcon === 'false' ? '' : '<i class="' + buttonIcon + '"></i>';
|
||||
}
|
||||
var buttonStyle = element.attr('data-style');
|
||||
if(buttonStyle) {
|
||||
colorized = buttonStyle === 'false' ? false : true ;
|
||||
this.options.style = buttonStyle === 'false' ? '' : buttonStyle;
|
||||
}
|
||||
var icon = this.options.icon ? this.options.icon + ' ' : '';
|
||||
$aLink.html(icon + this.options.text);
|
||||
if(colorized || /primary|info|success|warning|danger|inverse/.test(this.options.style)) {
|
||||
$aLink.find('i').addClass('icon-white');
|
||||
}
|
||||
if(this.options.style !== '') {
|
||||
$aLink.addClass(this.options.style);
|
||||
}
|
||||
var buttonPlaceholder = element.attr('data-placeholder');
|
||||
if(buttonPlaceholder) {
|
||||
this.options.placeholder = buttonPlaceholder === 'false' ? '' : buttonPlaceholder;
|
||||
}
|
||||
$fakeInput.attr('placeholder', this.options.placeholder);
|
||||
$fancy.insertBefore(element);
|
||||
$clone.attr('type','file');
|
||||
$fancy.append($clone);
|
||||
$fancy.find('div').append($fakeInput).append($aLink);
|
||||
var nW = $fancy.find('div').width();
|
||||
$clone.width(nW);
|
||||
element.remove();
|
||||
$fakeInput.width((nW - $aLink.width()) - 41).height(20);
|
||||
$aLink.height(20);
|
||||
|
||||
$clone.hover(function(e){
|
||||
$(this).parent().find('.fake-input').addClass('active');
|
||||
$(this).parent().find('.btn').addClass('active');
|
||||
}, function(e){
|
||||
$(this).parent().find('.fake-input').removeClass('active');
|
||||
$(this).parent().find('.btn').removeClass('active');
|
||||
});
|
||||
$clone.on('change.fancyfile.data-api', FancyFile.prototype.change);
|
||||
},
|
||||
change: function (e) {
|
||||
var file = this.files[0],
|
||||
name = file.name;
|
||||
$(this).parent().find('.fake-input').val(name);
|
||||
}
|
||||
};
|
||||
|
||||
/* FANCYFILE PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.fancyfile;
|
||||
|
||||
$.fn.fancyfile = function (options) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('fancyfile');
|
||||
if (!data) $this.data('fancyfile', (data = new FancyFile(this, options)));
|
||||
if (typeof options === 'string') data[options].call($this);
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.fancyfile.defaults = {
|
||||
container : '<div class="fancy-file"><div class="fake-file"></div></div>',
|
||||
fakeInput : '<input class="fake-input form-control" type="text" />',
|
||||
fakeButton : '<button type="button" class="btn"></button>',
|
||||
text : 'Select File',
|
||||
icon : '<i class="icon-file glyphicon glyphicon-file"></i>',
|
||||
style : '',
|
||||
placeholder : 'Select File…'
|
||||
};
|
||||
|
||||
$.fn.fancyfile.Constructor = FancyFile;
|
||||
|
||||
/* FANCYFILE NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.fancyfile.noConflict = function () {
|
||||
$.fn.fancyfile = old;
|
||||
return this;
|
||||
};
|
||||
|
||||
/* DATA-API APPLY TO STANDARD FANCYFILE ELEMENTS
|
||||
* ============== */
|
||||
|
||||
$(window).on('load', function () {
|
||||
$(fancyfile).each(function () {
|
||||
$(this).fancyfile();
|
||||
});
|
||||
});
|
||||
|
||||
}(window.jQuery);
|
10
public/js/chartjs/Chart.min.js
vendored
10
public/js/chartjs/Chart.min.js
vendored
File diff suppressed because one or more lines are too long
89868
public/js/common/companies.js
vendored
Normal file
89868
public/js/common/companies.js
vendored
Normal file
File diff suppressed because one or more lines are too long
91262
public/js/common/dashboard.js
vendored
Normal file
91262
public/js/common/dashboard.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/common/items.js
vendored
Normal file
89868
public/js/common/items.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89894
public/js/common/reports.js
vendored
Normal file
89894
public/js/common/reports.js
vendored
Normal file
File diff suppressed because one or more lines are too long
44501
public/js/common/search.js
vendored
Normal file
44501
public/js/common/search.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1653
public/js/daterangepicker/daterangepicker.js
vendored
1653
public/js/daterangepicker/daterangepicker.js
vendored
File diff suppressed because it is too large
Load Diff
90068
public/js/expenses/bills.js
vendored
Normal file
90068
public/js/expenses/bills.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/expenses/payments.js
vendored
Normal file
89868
public/js/expenses/payments.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/expenses/vendors.js
vendored
Normal file
89868
public/js/expenses/vendors.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8457
public/js/highchart/highcharts.js
vendored
8457
public/js/highchart/highcharts.js
vendored
File diff suppressed because it is too large
Load Diff
89926
public/js/incomes/customers.js
vendored
Normal file
89926
public/js/incomes/customers.js
vendored
Normal file
File diff suppressed because one or more lines are too long
90068
public/js/incomes/invoices.js
vendored
Normal file
90068
public/js/incomes/invoices.js
vendored
Normal file
File diff suppressed because one or more lines are too long
89868
public/js/incomes/revenues.js
vendored
Normal file
89868
public/js/incomes/revenues.js
vendored
Normal file
File diff suppressed because one or more lines are too long
76304
public/js/install.js
vendored
Normal file
76304
public/js/install.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Arabic (عربي) initialisation for the jQuery countdown extension
|
||||
Translated by Talal Al Asmari (talal@psdgroups.com), April 2009. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ar = {
|
||||
labels: ['سنوات','أشهر','أسابيع','أيام','ساعات','دقائق','ثواني'],
|
||||
labels1: ['سنة','شهر','أسبوع','يوم','ساعة','دقيقة','ثانية'],
|
||||
compactLabels: ['س','ش','أ','ي'],
|
||||
whichLabels: null,
|
||||
digits: ['٠','١','٢','٣','٤','٥','٦','٧','٨','٩'],
|
||||
timeSeparator: ':',
|
||||
isRTL: true
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ar);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Bulgarian initialisation for the jQuery countdown extension
|
||||
* Written by Manol Trendafilov manol@rastermania.com (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.bg = {
|
||||
labels: ['Години','Месеца','Седмица','Дни','Часа','Минути','Секунди'],
|
||||
labels1: ['Година','Месец','Седмица','Ден','Час','Минута','Секунда'],
|
||||
compactLabels: ['l','m','n','d'],
|
||||
compactLabels1: ['g','m','n','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.bg);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Bengali/Bangla initialisation for the jQuery countdown extension
|
||||
* Written by Mohammed Tajuddin (tajuddin@chittagong-it.com) Jan 2011. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.bn = {
|
||||
labels: ['বছর','মাস','সপ্তাহ','দিন','ঘন্টা','মিনিট','সেকেন্ড'],
|
||||
labels1: ['বছর','মাস','সপ্তাহ','দিন','ঘন্টা','মিনিট','সেকেন্ড'],
|
||||
compactLabels: ['ব','মা','স','দি'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.bn);
|
||||
})(jQuery);
|
@ -1,19 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Bosnian Latin initialisation for the jQuery countdown extension
|
||||
* Written by Miralem Mehic miralem@mehic.info (2011) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.bs = {
|
||||
labels: ['Godina','Mjeseci','Sedmica','Dana','Sati','Minuta','Sekundi'],
|
||||
labels1: ['Godina','Mjesec','Sedmica','Dan','Sat','Minuta','Sekunda'],
|
||||
labels2: ['Godine','Mjeseca','Sedmica','Dana','Sata','Minute','Sekunde'],
|
||||
compactLabels: ['g','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.bs);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Catalan initialisation for the jQuery countdown extension
|
||||
Written by Amanida Media www.amanidamedia.com (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ca = {
|
||||
labels: ['Anys','Mesos','Setmanes','Dies','Hores','Minuts','Segons'],
|
||||
labels1: ['Anys','Mesos','Setmanes','Dies','Hores','Minuts','Segons'],
|
||||
compactLabels: ['a','m','s','g'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ca);
|
||||
})(jQuery);
|
@ -1,19 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Czech initialisation for the jQuery countdown extension
|
||||
* Written by Roman Chlebec (creamd@c64.sk) (2008) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.cs = {
|
||||
labels: ['Roků','Měsíců','Týdnů','Dní','Hodin','Minut','Sekund'],
|
||||
labels1: ['Rok','Měsíc','Týden','Den','Hodina','Minuta','Sekunda'],
|
||||
labels2: ['Roky','Měsíce','Týdny','Dny','Hodiny','Minuty','Sekundy'],
|
||||
compactLabels: ['r','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.cs);
|
||||
})(jQuery);
|
@ -1,2 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Welsh initialisation for the jQuery countdown extension
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Danish initialisation for the jQuery countdown extension
|
||||
Written by Buch (admin@buch90.dk). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.da = {
|
||||
labels: ['År','Måneder','Uger','Dage','Timer','Minutter','Sekunder'],
|
||||
labels1: ['År','Måned','Uge','Dag','Time','Minut','Sekund'],
|
||||
compactLabels: ['Å','M','U','D'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.da);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
German initialisation for the jQuery countdown extension
|
||||
Written by Samuel Wulf. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.de = {
|
||||
labels: ['Jahre','Monate','Wochen','Tage','Stunden','Minuten','Sekunden'],
|
||||
labels1: ['Jahr','Monat','Woche','Tag','Stunde','Minute','Sekunde'],
|
||||
compactLabels: ['J','M','W','T'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.de);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Greek initialisation for the jQuery countdown extension
|
||||
Written by Philip. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.el = {
|
||||
labels: ['Χρόνια','Μήνες','Εβδομάδες','Μέρες','Ώρες','Λεπτά','Δευτερόλεπτα'],
|
||||
labels1: ['Χρόνος','Μήνας','Εβδομάδα','Ημέρα','Ώρα','Λεπτό','Δευτερόλεπτο'],
|
||||
compactLabels: ['Χρ.','Μην.','Εβδ.','Ημ.'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.el);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Spanish initialisation for the jQuery countdown extension
|
||||
* Written by Sergio Carracedo Martinez webmaster@neodisenoweb.com (2008) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.es = {
|
||||
labels: ['Años','Meses','Semanas','Días','Horas','Minutos','Segundos'],
|
||||
labels1: ['Año','Mes','Semana','Día','Hora','Minuto','Segundo'],
|
||||
compactLabels: ['a','m','s','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.es);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Estonian initialisation for the jQuery countdown extension
|
||||
Written by Helmer <helmer{at}city.ee> */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.et = {
|
||||
labels: ['Aastat','Kuud','Nädalat','Päeva','Tundi','Minutit','Sekundit'],
|
||||
labels1: ['Aasta','Kuu','Nädal','Päev','Tund','Minut','Sekund'],
|
||||
compactLabels: ['a','k','n','p'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.et);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Persian (فارسی) initialisation for the jQuery countdown extension
|
||||
Written by Alireza Ziaie (ziai@magfa.com) Oct 2008.
|
||||
Digits corrected by Hamed Ramezanian Feb 2013. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.fa = {
|
||||
labels: ['سال','ماه','هفته','روز','ساعت','دقیقه','ثانیه'],
|
||||
labels1: ['سال','ماه','هفته','روز','ساعت','دقیقه','ثانیه'],
|
||||
compactLabels: ['س','م','ه','ر'],
|
||||
whichLabels: null,
|
||||
digits: ['۰','۱','۲','۳','۴','۵','۶','۷','۸','۹'],
|
||||
timeSeparator: ':',
|
||||
isRTL: true
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.fa);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Finnish initialisation for the jQuery countdown extension
|
||||
Written by Kalle Vänskä and Juha Suni (juhis.suni@gmail.com). Corrected by Olli. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.fi = {
|
||||
labels: ['vuotta','kuukautta','viikkoa','päivää','tuntia','minuuttia','sekuntia'],
|
||||
labels1: ['vuosi','kuukausi','viikko','päivä','tunti','minuutti','sekunti'],
|
||||
compactLabels: ['v','kk','vk','pv'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.fi);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Faroese initialisation for the jQuery countdown extension
|
||||
Written by Kasper Friis Christensen (kasper@friischristensen.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.fo = {
|
||||
labels: ['Ár','Mánaðir','Vikur','Dagar','Tímar','Minuttir','Sekund'],
|
||||
labels1: ['Ár','Mánaður','Vika','Dagur','Tími','Minuttur','Sekund'],
|
||||
compactLabels: ['Á','M','V','D'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.fo);
|
||||
})(jQuery);
|
@ -1,18 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
French initialisation for the jQuery countdown extension
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) Jan 2008. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.fr = {
|
||||
labels: ['Années','Mois','Semaines','Jours','Heures','Minutes','Secondes'],
|
||||
labels1: ['Année','Mois','Semaine','Jour','Heure','Minute','Seconde'],
|
||||
compactLabels: ['a','m','s','j'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount > 1 ? 0 : 1);
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.fr);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Galician initialisation for the jQuery countdown extension
|
||||
* Written by Moncho Pena ramon.pena.rodriguez@gmail.com (2009) and Angel Farrapeira */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.gl = {
|
||||
labels: ['Anos','Meses','Semanas','Días','Horas','Minutos','Segundos'],
|
||||
labels1: ['Ano','Mes','Semana','Día','Hora','Minuto','Segundo'],
|
||||
compactLabels: ['a','m','s','g'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.gl);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Gujarati initialization for the jQuery countdown extension
|
||||
* Written by Sahil Jariwala jariwala.sahil@gmail.com (2012) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.gu = {
|
||||
labels: ['વર્ષ','મહિનો','અઠવાડિયા','દિવસ','કલાક','મિનિટ','સેકન્ડ'],
|
||||
labels1: ['વર્ષ','મહિનો','અઠવાડિયા','દિવસ','કલાક','મિનિટ','સેકન્ડ'],
|
||||
compactLabels: ['વ','મ','અ','દિ'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.gu);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Hebrew initialisation for the jQuery countdown extension
|
||||
* Translated by Nir Livne, Dec 2008 */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.he = {
|
||||
labels: ['שנים','חודשים','שבועות','ימים','שעות','דקות','שניות'],
|
||||
labels1: ['שנה','חודש','שבוע','יום','שעה','דקה','שנייה'],
|
||||
compactLabels: ['שנ','ח','שב','י'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: true
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.he);
|
||||
})(jQuery);
|
@ -1,27 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Croatian l10n for the jQuery countdown plugin
|
||||
* Written by Dejan Broz info@hqfactory.com (2011)
|
||||
* Improved by zytzagoo (2014) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.hr = {
|
||||
labels: ['Godina','Mjeseci','Tjedana','Dana','Sati','Minuta','Sekundi'], // plurals
|
||||
labels1: ['Godina','Mjesec','Tjedan','Dan','Sat','Minutu','Sekundu'], // singles
|
||||
labels2: ['Godine','Mjeseca','Tjedana','Dana','Sata','Minute','Sekunde'], // paucals
|
||||
compactLabels: ['g','m','t','d'],
|
||||
whichLabels: function(amount){
|
||||
amount = parseInt(amount, 10);
|
||||
if (amount % 10 === 1 && amount % 100 !== 11) {
|
||||
return 1; // singles (/.*1$/ && ! /.*11$/)
|
||||
}
|
||||
if (amount % 10 >= 2 && amount % 10 <= 4 && (amount % 100 < 10 || amount % 100 >= 20)) {
|
||||
return 2; // paucals (/.*[234]$/ && ! /.*1[234]$/
|
||||
}
|
||||
return 0; // default plural (most common case)
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.hr);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Hungarian initialisation for the jQuery countdown extension
|
||||
* Written by Edmond L. (webmond@gmail.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.hu = {
|
||||
labels: ['Év','Hónap','Hét','Nap','Óra','Perc','Másodperc'],
|
||||
labels1: ['Év','Hónap','Hét','Nap','Óra','Perc','Másodperc'],
|
||||
compactLabels: ['É','H','Hé','N'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.hu);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Armenian initialisation for the jQuery countdown extension
|
||||
* Written by Artur Martirosyan. (artur{at}zoom.am) October 2011. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.hy = {
|
||||
labels: ['Տարի','Ամիս','Շաբաթ','Օր','Ժամ','Րոպե','Վարկյան'],
|
||||
labels1: ['Տարի','Ամիս','Շաբաթ','Օր','Ժամ','Րոպե','Վարկյան'],
|
||||
compactLabels: ['տ','ա','շ','օ'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.hy);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Indonesian initialisation for the jQuery countdown extension
|
||||
Written by Erwin Yonathan Jan 2009. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.id = {
|
||||
labels: ['tahun','bulan','minggu','hari','jam','menit','detik'],
|
||||
labels1: ['tahun','bulan','minggu','hari','jam','menit','detik'],
|
||||
compactLabels: ['t','b','m','h'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.id);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Icelandic initialisation for the jQuery countdown extension
|
||||
Written by Róbert K. L. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.is = {
|
||||
labels: ['Ár','Mánuðir','Vikur','Dagar','Klukkustundir','Mínútur','Sekúndur'],
|
||||
labels1: ['Ár','Mánuður','Vika','Dagur','Klukkustund','Mínúta','Sekúnda'],
|
||||
compactLabels: ['ár.','mán.','vik.','dag.','klst.','mín.','sek.'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.is);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Italian initialisation for the jQuery countdown extension
|
||||
* Written by Davide Bellettini (davide.bellettini@gmail.com) and Roberto Chiaveri Feb 2008. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.it = {
|
||||
labels: ['Anni','Mesi','Settimane','Giorni','Ore','Minuti','Secondi'],
|
||||
labels1: ['Anno','Mese','Settimana','Giorno','Ora','Minuto','Secondo'],
|
||||
compactLabels: ['a','m','s','g'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.it);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Japanese initialisation for the jQuery countdown extension
|
||||
Written by Ken Ishimoto (ken@ksroom.com) Aug 2009. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ja = {
|
||||
labels: ['年','月','週','日','時','分','秒'],
|
||||
labels1: ['年','月','週','日','時','分','秒'],
|
||||
compactLabels: ['年','月','週','日'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ja);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Kannada initialization for the jQuery countdown extension
|
||||
* Written by Guru Chaturvedi guru@gangarasa.com (2011) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.kn = {
|
||||
labels: ['ವರ್ಷಗಳು','ತಿಂಗಳು','ವಾರಗಳು','ದಿನಗಳು','ಘಂಟೆಗಳು','ನಿಮಿಷಗಳು','ಕ್ಷಣಗಳು'],
|
||||
labels1: ['ವರ್ಷ','ತಿಂಗಳು','ವಾರ','ದಿನ','ಘಂಟೆ','ನಿಮಿಷ','ಕ್ಷಣ'],
|
||||
compactLabels: ['ವ','ತಿ','ವಾ','ದಿ'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.kn);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Korean initialisation for the jQuery countdown extension
|
||||
Written by Ryan Yu (ryanyu79@gmail.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ko = {
|
||||
labels: ['년','월','주','일','시','분','초'],
|
||||
labels1: ['년','월','주','일','시','분','초'],
|
||||
compactLabels: ['년','월','주','일'],
|
||||
compactLabels1: ['년','월','주','일'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ko);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Lithuanian localisation for the jQuery countdown extension
|
||||
* Written by Moacir P. de Sá Pereira (moacir{at}gmail.com) (2009) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.lt = {
|
||||
labels: ['Metų','Mėnesių','Savaičių','Dienų','Valandų','Minučių','Sekundžių'],
|
||||
labels1: ['Metai','Mėnuo','Savaitė','Diena','Valanda','Minutė','Sekundė'],
|
||||
compactLabels: ['m','m','s','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.lt);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Latvian initialisation for the jQuery countdown extension
|
||||
* Written by Jānis Peisenieks janis.peisenieks@gmail.com (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.lv = {
|
||||
labels: ['Gadi','Mēneši','Nedēļas','Dienas','Stundas','Minūtes','Sekundes'],
|
||||
labels1: ['Gads','Mēnesis','Nedēļa','Diena','Stunda','Minūte','Sekunde'],
|
||||
compactLabels: ['l','m','n','d'],
|
||||
compactLabels1: ['g','m','n','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.lv);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Macedonian initialisation for the jQuery countdown extension
|
||||
* Written by Gorast Cvetkovski cvetkovski@gorast.com (2016) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.mk = {
|
||||
labels: ['Години','Месеци','Недели','Дена','Часа','Минути','Секунди'],
|
||||
labels1: ['Година','Месец','Недела','Ден','Час','Минута','Секунда'],
|
||||
compactLabels: ['l','m','n','d'],
|
||||
compactLabels1: ['g','m','n','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.mk);
|
||||
})(jQuery);
|
@ -1,18 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Malayalam/(Indian>>Kerala) initialisation for the jQuery countdown extension
|
||||
* Written by Harilal.B (harilal1234@gmail.com) Feb 2013. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
/* jshint -W100 */
|
||||
$.countdown.regionalOptions.ml = {
|
||||
labels: ['വര്ഷങ്ങള്','മാസങ്ങള്','ആഴ്ചകള്','ദിവസങ്ങള്','മണിക്കൂറുകള്','മിനിറ്റുകള്','സെക്കന്റുകള്'],
|
||||
labels1: ['വര്ഷം','മാസം','ആഴ്ച','ദിവസം','മണിക്കൂര്','മിനിറ്റ്','സെക്കന്റ്'],
|
||||
compactLabels: ['വ','മ','ആ','ദി'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
// digits: ['൦','൧','൨','൩','൪','൫','൬','൭','൮','൯'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ml);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Malay initialisation for the jQuery countdown extension
|
||||
Written by Jason Ong (jason{at}portalgroove.com) May 2010. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ms = {
|
||||
labels: ['Tahun','Bulan','Minggu','Hari','Jam','Minit','Saat'],
|
||||
labels1: ['Tahun','Bulan','Minggu','Hari','Jam','Minit','Saat'],
|
||||
compactLabels: ['t','b','m','h'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ms);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Burmese initialisation for the jQuery countdown extension
|
||||
Written by Win Lwin Moe (winnlwinmoe@gmail.com) Dec 2009. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.my = {
|
||||
labels: ['နွစ္','လ','ရက္သတဿတပတ္','ရက္','နာရီ','မိနစ္','စကဿကန့္'],
|
||||
labels1: ['နွစ္','လ','ရက္သတဿတပတ္','ရက္','နာရီ','မိနစ္','စကဿကန့္'],
|
||||
compactLabels: ['နွစ္','လ','ရက္သတဿတပတ္','ရက္'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.my);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Norwegian Bokmål translation
|
||||
Written by Kristian Ravnevand */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.nb = {
|
||||
labels: ['År','Måneder','Uker','Dager','Timer','Minutter','Sekunder'],
|
||||
labels1: ['År','Måned','Uke','Dag','Time','Minutt','Sekund'],
|
||||
compactLabels: ['Å','M','U','D'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.nb);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Dutch initialisation for the jQuery countdown extension
|
||||
Written by Mathias Bynens <http://mathiasbynens.be/> Mar 2008. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.nl = {
|
||||
labels: ['Jaren','Maanden','Weken','Dagen','Uren','Minuten','Seconden'],
|
||||
labels1: ['Jaar','Maand','Week','Dag','Uur','Minuut','Seconde'],
|
||||
compactLabels: ['j','m','w','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.nl);
|
||||
})(jQuery);
|
@ -1,22 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Polish initialisation for the jQuery countdown extension
|
||||
* Written by Pawel Lewtak lewtak@gmail.com (2008) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.pl = {
|
||||
labels: ['lat','miesięcy','tygodni','dni','godzin','minut','sekund'],
|
||||
labels1: ['rok','miesiąc','tydzień','dzień','godzina','minuta','sekunda'],
|
||||
labels2: ['lata','miesiące','tygodnie','dni','godziny','minuty','sekundy'],
|
||||
compactLabels: ['l','m','t','d'],
|
||||
compactLabels1: ['r','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
var units = amount % 10;
|
||||
var tens = Math.floor((amount % 100) / 10);
|
||||
return (amount === 1 ? 1 : (units >= 2 && units <= 4 && tens !== 1 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.pl);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Brazilian initialisation for the jQuery countdown extension
|
||||
Translated by Marcelo Pellicano de Oliveira (pellicano@gmail.com) Feb 2008.
|
||||
and Juan Roldan (juan.roldan[at]relayweb.com.br) Mar 2012. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions['pt-BR'] = {
|
||||
labels: ['Anos','Meses','Semanas','Dias','Horas','Minutos','Segundos'],
|
||||
labels1: ['Ano','Mês','Semana','Dia','Hora','Minuto','Segundo'],
|
||||
compactLabels: ['a','m','s','d'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions['pt-BR']);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Romanian initialisation for the jQuery countdown extension
|
||||
* Written by Edmond L. (webmond@gmail.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ro = {
|
||||
labels: ['Ani','Luni','Saptamani','Zile','Ore','Minute','Secunde'],
|
||||
labels1: ['An','Luna','Saptamana','Ziua','Ora','Minutul','Secunda'],
|
||||
compactLabels: ['A','L','S','Z'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ro);
|
||||
})(jQuery);
|
@ -1,23 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Russian initialisation for the jQuery countdown extension
|
||||
* Written by Sergey K. (xslade{at}gmail.com) June 2010. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ru = {
|
||||
labels: ['Лет','Месяцев','Недель','Дней','Часов','Минут','Секунд'],
|
||||
labels1: ['Год','Месяц','Неделя','День','Час','Минута','Секунда'],
|
||||
labels2: ['Года','Месяца','Недели','Дня','Часа','Минуты','Секунды'],
|
||||
compactLabels: ['л','м','н','д'],
|
||||
compactLabels1: ['г','м','н','д'],
|
||||
whichLabels: function(amount) {
|
||||
var units = amount % 10;
|
||||
var tens = Math.floor((amount % 100) / 10);
|
||||
return (amount === 1 ? 1 : (units >= 2 && units <= 4 && tens !== 1 ? 2 :
|
||||
(units === 1 && tens !== 1 ? 1 : 0)));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ru);
|
||||
})(jQuery);
|
@ -1,19 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Slovak initialisation for the jQuery countdown extension
|
||||
* Written by Roman Chlebec (creamd@c64.sk) (2008) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.sk = {
|
||||
labels: ['Rokov','Mesiacov','Týždňov','Dní','Hodín','Minút','Sekúnd'],
|
||||
labels1: ['Rok','Mesiac','Týždeň','Deň','Hodina','Minúta','Sekunda'],
|
||||
labels2: ['Roky','Mesiace','Týždne','Dni','Hodiny','Minúty','Sekundy'],
|
||||
compactLabels: ['r','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.sk);
|
||||
})(jQuery);
|
@ -1,22 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Slovenian localisation for the jQuery countdown extension
|
||||
* Written by Borut Tomažin (debijan{at}gmail.com) (2011)
|
||||
* updated by Jan Zavrl (jan@iuvo.si) (2015) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.sl = {
|
||||
labels: ['Let','Mesecev','Tednov','Dni','Ur','Minut','Sekund'], // Plurals
|
||||
labels1: ['Leto','Mesec','Teden','Dan','Ura','Minuta','Sekunda'], // Singles
|
||||
labels2: ['Leti','Meseca','Tedna','Dneva','Uri','Minuti','Sekundi'], // Doubles
|
||||
labels3: ['Leta','Meseci','Tedni','Dnevi','Ure','Minute','Sekunde'], // 3's
|
||||
labels4: ['Leta','Meseci','Tedni','Dnevi','Ure','Minute','Sekunde'], // 4's
|
||||
compactLabels: ['l','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount > 4 ? 0 : amount);
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.sl);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Albanian initialisation for the jQuery countdown extension
|
||||
Written by Erzen Komoni. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.sq = {
|
||||
labels: ['Vite','Muaj','Javë','Ditë','Orë','Minuta','Sekonda'],
|
||||
labels1: ['Vit','Muaj','Javë','Dit','Orë','Minutë','Sekond'],
|
||||
compactLabels: ['V','M','J','D'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.sq);
|
||||
})(jQuery);
|
@ -1,19 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Serbian Latin initialisation for the jQuery countdown extension
|
||||
* Written by Predrag Leka lp@lemurcake.com (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions['sr-SR'] = {
|
||||
labels: ['Godina','Meseci','Nedelja','Dana','Časova','Minuta','Sekundi'],
|
||||
labels1: ['Godina','Mesec','Nedelja','Dan','Čas','Minut','Sekunda'],
|
||||
labels2: ['Godine','Meseca','Nedelje','Dana','Časa','Minuta','Sekunde'],
|
||||
compactLabels: ['g','m','n','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions['sr-SR']);
|
||||
})(jQuery);
|
@ -1,19 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Serbian Cyrillic initialisation for the jQuery countdown extension
|
||||
* Written by Predrag Leka lp@lemurcake.com (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.sr = {
|
||||
labels: ['Година','Месеци','Недеља','Дана','Часова','Минута','Секунди'],
|
||||
labels1: ['Година','месец','Недеља','Дан','Час','Минут','Секунда'],
|
||||
labels2: ['Године','Месеца','Недеље','Дана','Часа','Минута','Секунде'],
|
||||
compactLabels: ['г','м','н','д'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.sr);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Swedish initialisation for the jQuery countdown extension
|
||||
Written by Carl (carl@nordenfelt.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.sv = {
|
||||
labels: ['År','Månader','Veckor','Dagar','Timmar','Minuter','Sekunder'],
|
||||
labels1: ['År','Månad','Vecka','Dag','Timme','Minut','Sekund'],
|
||||
compactLabels: ['Å','M','V','D'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.sv);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Thai initialisation for the jQuery countdown extension
|
||||
Written by Pornchai Sakulsrimontri (li_sin_th@yahoo.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.th = {
|
||||
labels: ['ปี','เดือน','สัปดาห์','วัน','ชั่วโมง','นาที','วินาที'],
|
||||
labels1: ['ปี','เดือน','สัปดาห์','วัน','ชั่วโมง','นาที','วินาที'],
|
||||
compactLabels: ['ปี','เดือน','สัปดาห์','วัน'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.th);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Turkish initialisation for the jQuery countdown extension
|
||||
* Written by Bekir Ahmetoğlu (bekir@cerek.com) Aug 2008. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.tr = {
|
||||
labels: ['Yıl','Ay','Hafta','Gün','Saat','Dakika','Saniye'],
|
||||
labels1: ['Yıl','Ay','Hafta','Gün','Saat','Dakika','Saniye'],
|
||||
compactLabels: ['y','a','h','g'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.tr);
|
||||
})(jQuery);
|
@ -1,19 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Ukrainian initialisation for the jQuery countdown extension
|
||||
* Written by Goloborodko M misha.gm@gmail.com (2009), corrections by Iгор Kоновал */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.uk = {
|
||||
labels: ['Років','Місяців','Тижнів','Днів','Годин','Хвилин','Секунд'],
|
||||
labels1: ['Рік','Місяць','Тиждень','День','Година','Хвилина','Секунда'],
|
||||
labels2: ['Роки','Місяці','Тижні','Дні','Години','Хвилини','Секунди'],
|
||||
compactLabels: ['r','m','t','d'],
|
||||
whichLabels: function(amount) {
|
||||
return (amount === 1 ? 1 : (amount >=2 && amount <= 4 ? 2 : 0));
|
||||
},
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.uk);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Urdu (اردو) initialisation for the jQuery countdown extension
|
||||
Translated by Azhar Rasheed (azhar.rasheed19@gmail.com), November 2013. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.ur = {
|
||||
labels: ['سال','مہينے','ہفتے','دن','گھنٹے','منٹس','سيکنڑز'],
|
||||
labels1: ['سال','ماہ','ہفتہ','دن','گھنٹہ','منٹ','سیکنڈز'],
|
||||
compactLabels: ['(ق)','سینٹ','ایک','J'],
|
||||
whichLabels: null,
|
||||
digits: ['٠','١','٢','٣','۴','۵','۶','۷','٨','٩'],
|
||||
timeSeparator: ':',
|
||||
isRTL: true
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.ur);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Uzbek initialisation for the jQuery countdown extension
|
||||
* Written by Alisher U. (ulugbekov{at}gmail.com) August 2012. */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.uz = {
|
||||
labels: ['Yil','Oy','Hafta','Kun','Soat','Daqiqa','Soniya'],
|
||||
labels1: ['Yil','Oy','Hafta','Kun','Soat','Daqiqa','Soniya'],
|
||||
compactLabels: ['y','o','h','k'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.uz);
|
||||
})(jQuery);
|
@ -1,16 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
* Vietnamese initialisation for the jQuery countdown extension
|
||||
* Written by Pham Tien Hung phamtienhung@gmail.com (2010) */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions.vi = {
|
||||
labels: ['Năm','Tháng','Tuần','Ngày','Giờ','Phút','Giây'],
|
||||
labels1: ['Năm','Tháng','Tuần','Ngày','Giờ','Phút','Giây'],
|
||||
compactLabels: ['năm','th','tu','ng'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions.vi);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Simplified Chinese initialisation for the jQuery countdown extension
|
||||
Written by Cloudream (cloudream@gmail.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions['zh-CN'] = {
|
||||
labels: ['年','月','周','天','时','分','秒'],
|
||||
labels1: ['年','月','周','天','时','分','秒'],
|
||||
compactLabels: ['年','月','周','天'],
|
||||
compactLabels1: ['年','月','周','天'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions['zh-CN']);
|
||||
})(jQuery);
|
@ -1,17 +0,0 @@
|
||||
/* http://keith-wood.name/countdown.html
|
||||
Traditional Chinese initialisation for the jQuery countdown extension
|
||||
Written by Cloudream (cloudream@gmail.com). */
|
||||
(function($) {
|
||||
'use strict';
|
||||
$.countdown.regionalOptions['zh-TW'] = {
|
||||
labels: ['年','月','周','天','時','分','秒'],
|
||||
labels1: ['年','月','周','天','時','分','秒'],
|
||||
compactLabels: ['年','月','周','天'],
|
||||
compactLabels1: ['年','月','周','天'],
|
||||
whichLabels: null,
|
||||
digits: ['0','1','2','3','4','5','6','7','8','9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
};
|
||||
$.countdown.setDefaults($.countdown.regionalOptions['zh-TW']);
|
||||
})(jQuery);
|
964
public/js/jquery/countdown/jquery.countdown.js
vendored
964
public/js/jquery/countdown/jquery.countdown.js
vendored
@ -1,964 +0,0 @@
|
||||
/*! http://keith-wood.name/countdown.html
|
||||
Countdown for jQuery v2.1.0.
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) January 2008.
|
||||
Available under the MIT (http://keith-wood.name/licence.html) license.
|
||||
Please attribute the author if you use it. */
|
||||
|
||||
(function($) { // Hide scope, no $ conflict
|
||||
'use strict';
|
||||
|
||||
var pluginName = 'countdown';
|
||||
|
||||
var Y = 0; // Years
|
||||
var O = 1; // Months
|
||||
var W = 2; // Weeks
|
||||
var D = 3; // Days
|
||||
var H = 4; // Hours
|
||||
var M = 5; // Minutes
|
||||
var S = 6; // Seconds
|
||||
|
||||
/** Create the countdown plugin.
|
||||
<p>Sets an element to show the time remaining until a given instant.</p>
|
||||
<p>Expects HTML like:</p>
|
||||
<pre><div></div></pre>
|
||||
<p>Provide inline configuration like:</p>
|
||||
<pre><div data-countdown="name: 'value', ..."></div></pre>
|
||||
@module Countdown
|
||||
@augments JQPlugin
|
||||
@example $(selector).countdown({until: +300}) */
|
||||
$.JQPlugin.createPlugin({
|
||||
|
||||
/** The name of the plugin.
|
||||
@default 'countdown' */
|
||||
name: pluginName,
|
||||
|
||||
/** Countdown expiry callback.
|
||||
Used with the {@linkcode module:Countdown~defaultOptions|onExpiry} option and
|
||||
triggered when the countdown expires.
|
||||
@global
|
||||
@callback CountdownExpiryCallback
|
||||
@this <code>Element</code>
|
||||
@example onExpiry: function() {
|
||||
alert('Done');
|
||||
} */
|
||||
|
||||
/** Countdown server synchronisation callback.
|
||||
Used with the {@linkcode module:Countdown~defaultOptions|serverSync} option and
|
||||
triggered when the countdown is initialised.
|
||||
@global
|
||||
@callback CountdownServerSyncCallback
|
||||
@return {Date} The current date/time on the server as expressed in the local timezone.
|
||||
@this <code>$.countdown</code>
|
||||
@example serverSync: function() {
|
||||
var time = null;
|
||||
$.ajax({url: 'http://myserver.com/serverTime.php',
|
||||
async: false, dataType: 'text',
|
||||
success: function(text) {
|
||||
time = new Date(text);
|
||||
}, error: function(http, message, exc) {
|
||||
time = new Date();
|
||||
});
|
||||
return time;
|
||||
} */
|
||||
|
||||
/** Countdown tick callback.
|
||||
Used with the {@linkcode module:Countdown~defaultOptions|onTick} option and
|
||||
triggered on every {@linkcode module:Countdown~defaultOptions|tickInterval} ticks of the countdown.
|
||||
@global
|
||||
@callback CountdownTickCallback
|
||||
@this <code>Element</code>
|
||||
@param {number[]} periods The breakdown by period (years, months, weeks, days,
|
||||
hours, minutes, seconds) of the time remaining/passed.
|
||||
@example onTick: function(periods) {
|
||||
$('#altTime').text(periods[4] + ':' + twoDigits(periods[5]) +
|
||||
':' + twoDigits(periods[6]));
|
||||
} */
|
||||
|
||||
/** Countdown which labels callback.
|
||||
Used with the {@linkcode module:Countdown~regionalOptions|whichLabels} option and
|
||||
triggered when the countdown is being display to determine which set of labels
|
||||
(<code>labels</code>, <code>labels1</code>, ...) are to be used for the current period value.
|
||||
@global
|
||||
@callback CountdownWhichLabelsCallback
|
||||
@param {number} num The current period value.
|
||||
@return {number} The suffix for the label set to use, or zero for the default labels.
|
||||
@example whichLabels: function(num) {
|
||||
return (num === 1 ? 1 : (num >= 2 && num <= 4 ? 2 : 0));
|
||||
} */
|
||||
|
||||
/** Default settings for the plugin.
|
||||
@property {Date|number|string} [until] The date/time to count down to, or number of seconds
|
||||
offset from now, or string of amounts and units for offset(s) from now:
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
One of <code>until</code> or <code>since</code> must be specified.
|
||||
If both are given <code>since</code> takes precedence.
|
||||
@example until: new Date(2013, 12-1, 25, 13, 30)
|
||||
until: +300
|
||||
until: '+1O -2D'
|
||||
@property {Date|number|string} [since] The date/time to count up from, or number of seconds
|
||||
offset from now, or string of amounts and units for offset(s) from now:
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
One of <code>until</code> or <code>since</code> must be specified.
|
||||
If both are given <code>since</code> takes precedence.
|
||||
@example since: new Date(2013, 1-1, 1)
|
||||
since: -300
|
||||
since: '-1O +2D'
|
||||
@property {number} [timezone=null] The timezone (hours or minutes from GMT) for the target times,
|
||||
or <code>null</code> for client local timezone.
|
||||
@example timezone: +10
|
||||
timezone: -60
|
||||
@property {CountdownServerSyncCallback} [serverSync=null] A function to retrieve the current server time
|
||||
for synchronisation.
|
||||
@property {string} [format='dHMS'] The format for display - upper case to always show,
|
||||
lower case to show only if non-zero,
|
||||
'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds.
|
||||
@property {string} [layout=''] <p>Build your own layout for the countdown.</p>
|
||||
<p>Indicate substitution points with '{desc}' for the description, '{sep}' for the time separator,
|
||||
'{pv}' where p is 'y' for years, 'o' for months, 'w' for weeks, 'd' for days,
|
||||
'h' for hours, 'm' for minutes, or 's' for seconds and v is 'n' for the period value,
|
||||
'nn' for the period value with a minimum of two digits,
|
||||
'nnn' for the period value with a minimum of three digits, or
|
||||
'l' for the period label (long or short form depending on the compact setting), or
|
||||
'{pd}' where p is as above and d is '1' for the units digit, '10' for the tens digit,
|
||||
'100' for the hundreds digit, or '1000' for the thousands digit.</p>
|
||||
<p>If you need to exclude entire sections when the period value is zero and
|
||||
you have specified the period as optional, surround these sections with
|
||||
'{p<}' and '{p>}', where p is the same as above.</p>
|
||||
<p>Your layout can just be simple text, or can contain HTML markup as well.</p>
|
||||
@example layout: '{d<}{dn} {dl}{d>} {hnn}:{mnn}:{snn}'
|
||||
@property {boolean} [compact=false] <code>true</code> to display in a compact format,
|
||||
<code>false</code> for an expanded one.
|
||||
@property {boolean} [padZeroes=false] <code>true</code> to add leading zeroes.
|
||||
@property {number} [significant=0] The maximum number of periods with non-zero values to show, zero for all.
|
||||
@property {string} [description=''] The description displayed for the countdown.
|
||||
@property {string} [expiryUrl=''] A URL to load upon expiry, replacing the current page.
|
||||
@property {string} [expiryText=''] Text to display upon expiry, replacing the countdown. This may be HTML.
|
||||
@property {boolean} [alwaysExpire=false] <code>true</code> to trigger <code>onExpiry</code>
|
||||
even if the target time has passed.
|
||||
@property {CountdownExpiryCallback} [onExpiry=null] Callback when the countdown expires -
|
||||
receives no parameters and <code>this</code> is the containing element.
|
||||
@example onExpiry: function() {
|
||||
...
|
||||
}
|
||||
@property {CountdownTickCallback} [onTick=null] Callback when the countdown is updated -
|
||||
receives <code>number[7]</code> being the breakdown by period
|
||||
(years, months, weeks, days, hours, minutes, seconds - based on
|
||||
<code>format</code>) and <code>this</code> is the containing element.
|
||||
@example onTick: function(periods) {
|
||||
var secs = $.countdown.periodsToSeconds(periods);
|
||||
if (secs < 300) { // Last five minutes
|
||||
...
|
||||
}
|
||||
}
|
||||
@property {number} [tickInterval=1] The interval (seconds) between <code>onTick</code> callbacks. */
|
||||
defaultOptions: {
|
||||
until: null,
|
||||
since: null,
|
||||
timezone: null,
|
||||
serverSync: null,
|
||||
format: 'dHMS',
|
||||
layout: '',
|
||||
compact: false,
|
||||
padZeroes: false,
|
||||
significant: 0,
|
||||
description: '',
|
||||
expiryUrl: '',
|
||||
expiryText: '',
|
||||
alwaysExpire: false,
|
||||
onExpiry: null,
|
||||
onTick: null,
|
||||
tickInterval: 1
|
||||
},
|
||||
|
||||
/** Localisations for the plugin.
|
||||
Entries are objects indexed by the language code ('' being the default US/English).
|
||||
Each object has the following attributes.
|
||||
@property {string[]} [labels=['Years','Months','Weeks','Days','Hours','Minutes','Seconds']]
|
||||
The display texts for the counter periods.
|
||||
@property {string[]} [labels1=['Year','Month','Week','Day','Hour','Minute','Second']]
|
||||
The display texts for the counter periods if they have a value of 1.
|
||||
Add other <code>labels<em>n</em></code> attributes as necessary to
|
||||
cater for other numeric idiosyncrasies of the localisation.
|
||||
@property {string[]}[compactLabels=['y','m','w','d']] The compact texts for the counter periods.
|
||||
@property {CountdownWhichLabelsCallback} [whichLabels=null] A function to determine which
|
||||
<code>labels<em>n</em></code> to use.
|
||||
@example whichLabels: function(num) {
|
||||
return (num > 1 ? 0 : 1);
|
||||
}
|
||||
@property {string[]} [digits=['0','1',...,'9']] The digits to display (0-9).
|
||||
@property {string} [timeSeparator=':'] Separator for time periods in the compact layout.
|
||||
@property {boolean} [isRTL=false] <code>true</code> for right-to-left languages,
|
||||
<code>false</code> for left-to-right. */
|
||||
regionalOptions: { // Available regional settings, indexed by language/country code
|
||||
'': { // Default regional settings - English/US
|
||||
labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
|
||||
labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
|
||||
compactLabels: ['y', 'm', 'w', 'd'],
|
||||
whichLabels: null,
|
||||
digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
timeSeparator: ':',
|
||||
isRTL: false
|
||||
}
|
||||
},
|
||||
|
||||
/* Class name for the right-to-left marker. */
|
||||
_rtlClass: pluginName + '-rtl',
|
||||
/* Class name for the countdown section marker. */
|
||||
_sectionClass: pluginName + '-section',
|
||||
/* Class name for the period amount marker. */
|
||||
_amountClass: pluginName + '-amount',
|
||||
/* Class name for the period name marker. */
|
||||
_periodClass: pluginName + '-period',
|
||||
/* Class name for the countdown row marker. */
|
||||
_rowClass: pluginName + '-row',
|
||||
/* Class name for the holding countdown marker. */
|
||||
_holdingClass: pluginName + '-holding',
|
||||
/* Class name for the showing countdown marker. */
|
||||
_showClass: pluginName + '-show',
|
||||
/* Class name for the description marker. */
|
||||
_descrClass: pluginName + '-descr',
|
||||
|
||||
/* List of currently active countdown elements. */
|
||||
_timerElems: [],
|
||||
|
||||
/** Additional setup for the countdown.
|
||||
Apply default localisations.
|
||||
Create the timer.
|
||||
@private */
|
||||
_init: function() {
|
||||
var self = this;
|
||||
this._super();
|
||||
this._serverSyncs = [];
|
||||
var now = (typeof Date.now === 'function' ? Date.now : function() { return new Date().getTime(); });
|
||||
var perfAvail = (window.performance && typeof window.performance.now === 'function');
|
||||
// Shared timer for all countdowns
|
||||
function timerCallBack(timestamp) {
|
||||
var drawStart = (timestamp < 1e12 ? // New HTML5 high resolution timer
|
||||
(perfAvail ? (window.performance.now() + window.performance.timing.navigationStart) : now()) :
|
||||
// Integer milliseconds since unix epoch
|
||||
timestamp || now());
|
||||
if (drawStart - animationStartTime >= 1000) {
|
||||
self._updateElems();
|
||||
animationStartTime = drawStart;
|
||||
}
|
||||
requestAnimationFrame(timerCallBack);
|
||||
}
|
||||
var requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame || window.msRequestAnimationFrame || null;
|
||||
// This is when we expect a fall-back to setInterval as it's much more fluid
|
||||
var animationStartTime = 0;
|
||||
if (!requestAnimationFrame || $.noRequestAnimationFrame) {
|
||||
$.noRequestAnimationFrame = null;
|
||||
// Fall back to good old setInterval
|
||||
$.countdown._timer = setInterval(function() { self._updateElems(); }, 1000);
|
||||
}
|
||||
else {
|
||||
animationStartTime = window.animationStartTime ||
|
||||
window.webkitAnimationStartTime || window.mozAnimationStartTime ||
|
||||
window.oAnimationStartTime || window.msAnimationStartTime || now();
|
||||
requestAnimationFrame(timerCallBack);
|
||||
}
|
||||
},
|
||||
|
||||
/** Convert a date/time to UTC.
|
||||
@param {number} tz The hour or minute offset from GMT, e.g. +9, -360.
|
||||
@param {Date|number} year the date/time in that timezone or the year in that timezone.
|
||||
@param {number} [month] The month (0 - 11) (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [day] The day (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [hours] The hour (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [mins] The minute (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [secs] The second (omit if <code>year</code> is a <code>Date</code>).
|
||||
@param {number} [ms] The millisecond (omit if <code>year</code> is a <code>Date</code>).
|
||||
@return {Date} The equivalent UTC date/time.
|
||||
@example $.countdown.UTCDate(+10, 2013, 12-1, 25, 12, 0)
|
||||
$.countdown.UTCDate(-7, new Date(2013, 12-1, 25, 12, 0)) */
|
||||
UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
|
||||
if (typeof year === 'object' && year instanceof Date) {
|
||||
ms = year.getMilliseconds();
|
||||
secs = year.getSeconds();
|
||||
mins = year.getMinutes();
|
||||
hours = year.getHours();
|
||||
day = year.getDate();
|
||||
month = year.getMonth();
|
||||
year = year.getFullYear();
|
||||
}
|
||||
var d = new Date();
|
||||
d.setUTCFullYear(year);
|
||||
d.setUTCDate(1);
|
||||
d.setUTCMonth(month || 0);
|
||||
d.setUTCDate(day || 1);
|
||||
d.setUTCHours(hours || 0);
|
||||
d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
|
||||
d.setUTCSeconds(secs || 0);
|
||||
d.setUTCMilliseconds(ms || 0);
|
||||
return d;
|
||||
},
|
||||
|
||||
/** Convert a set of periods into seconds.
|
||||
Averaged for months and years.
|
||||
@param {number[]} periods The periods per year/month/week/day/hour/minute/second.
|
||||
@return {number} The corresponding number of seconds.
|
||||
@example var secs = $.countdown.periodsToSeconds(periods) */
|
||||
periodsToSeconds: function(periods) {
|
||||
return periods[0] * 31557600 + periods[1] * 2629800 + periods[2] * 604800 +
|
||||
periods[3] * 86400 + periods[4] * 3600 + periods[5] * 60 + periods[6];
|
||||
},
|
||||
|
||||
/** Resynchronise the countdowns with the server.
|
||||
@example $.countdown.resync() */
|
||||
resync: function() {
|
||||
var self = this;
|
||||
$('.' + this._getMarker()).each(function() { // Each countdown
|
||||
var inst = $.data(this, self.name);
|
||||
if (inst.options.serverSync) { // If synced
|
||||
var serverSync = null;
|
||||
for (var i = 0; i < self._serverSyncs.length; i++) {
|
||||
if (self._serverSyncs[i][0] === inst.options.serverSync) { // Find sync details
|
||||
serverSync = self._serverSyncs[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (self._eqNull(serverSync[2])) { // Recalculate if missing
|
||||
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
||||
inst.options.serverSync.apply(this, []) : null);
|
||||
serverSync[2] =
|
||||
(serverResult ? new Date().getTime() - serverResult.getTime() : 0) - serverSync[1];
|
||||
}
|
||||
if (inst._since) { // Apply difference
|
||||
inst._since.setMilliseconds(inst._since.getMilliseconds() + serverSync[2]);
|
||||
}
|
||||
inst._until.setMilliseconds(inst._until.getMilliseconds() + serverSync[2]);
|
||||
}
|
||||
});
|
||||
for (var i = 0; i < self._serverSyncs.length; i++) { // Update sync details
|
||||
if (!self._eqNull(self._serverSyncs[i][2])) {
|
||||
self._serverSyncs[i][1] += self._serverSyncs[i][2];
|
||||
delete self._serverSyncs[i][2];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_instSettings: function(elem, options) { // jshint unused:false
|
||||
return {_periods: [0, 0, 0, 0, 0, 0, 0]};
|
||||
},
|
||||
|
||||
/** Add an element to the list of active ones.
|
||||
@private
|
||||
@param {Element} elem The countdown element. */
|
||||
_addElem: function(elem) {
|
||||
if (!this._hasElem(elem)) {
|
||||
this._timerElems.push(elem);
|
||||
}
|
||||
},
|
||||
|
||||
/** See if an element is in the list of active ones.
|
||||
@private
|
||||
@param {Element} elem The countdown element.
|
||||
@return {boolean} <code>true</code> if present, <code>false</code> if not. */
|
||||
_hasElem: function(elem) {
|
||||
return ($.inArray(elem, this._timerElems) > -1);
|
||||
},
|
||||
|
||||
/** Remove an element from the list of active ones.
|
||||
@private
|
||||
@param {Element} elem The countdown element. */
|
||||
_removeElem: function(elem) {
|
||||
this._timerElems = $.map(this._timerElems,
|
||||
function(value) { return (value === elem ? null : value); }); // delete entry
|
||||
},
|
||||
|
||||
/** Update each active timer element.
|
||||
@private */
|
||||
_updateElems: function() {
|
||||
for (var i = this._timerElems.length - 1; i >= 0; i--) {
|
||||
this._updateCountdown(this._timerElems[i]);
|
||||
}
|
||||
},
|
||||
|
||||
_optionsChanged: function(elem, inst, options) {
|
||||
if (options.layout) {
|
||||
options.layout = options.layout.replace(/</g, '<').replace(/>/g, '>');
|
||||
}
|
||||
this._resetExtraLabels(inst.options, options);
|
||||
var timezoneChanged = (inst.options.timezone !== options.timezone);
|
||||
$.extend(inst.options, options);
|
||||
this._adjustSettings(elem, inst,
|
||||
!this._eqNull(options.until) || !this._eqNull(options.since) || timezoneChanged);
|
||||
var now = new Date();
|
||||
if ((inst._since && inst._since < now) || (inst._until && inst._until > now)) {
|
||||
this._addElem(elem[0]);
|
||||
}
|
||||
this._updateCountdown(elem, inst);
|
||||
},
|
||||
|
||||
/** Redisplay the countdown with an updated display.
|
||||
@private
|
||||
@param {Element|jQuery} elem The containing element.
|
||||
@param {object} inst The current settings for this instance. */
|
||||
_updateCountdown: function(elem, inst) {
|
||||
elem = elem.jquery ? elem : $(elem);
|
||||
inst = inst || this._getInst(elem);
|
||||
if (!inst) {
|
||||
return;
|
||||
}
|
||||
elem.html(this._generateHTML(inst)).toggleClass(this._rtlClass, inst.options.isRTL);
|
||||
if (inst._hold !== 'pause' && $.isFunction(inst.options.onTick)) {
|
||||
var periods = inst._hold !== 'lap' ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date());
|
||||
if (inst.options.tickInterval === 1 ||
|
||||
this.periodsToSeconds(periods) % inst.options.tickInterval === 0) {
|
||||
inst.options.onTick.apply(elem[0], [periods]);
|
||||
}
|
||||
}
|
||||
var expired = inst._hold !== 'pause' &&
|
||||
(inst._since ? inst._now.getTime() < inst._since.getTime() :
|
||||
inst._now.getTime() >= inst._until.getTime());
|
||||
if (expired && !inst._expiring) {
|
||||
inst._expiring = true;
|
||||
if (this._hasElem(elem[0]) || inst.options.alwaysExpire) {
|
||||
this._removeElem(elem[0]);
|
||||
if ($.isFunction(inst.options.onExpiry)) {
|
||||
inst.options.onExpiry.apply(elem[0], []);
|
||||
}
|
||||
if (inst.options.expiryText) {
|
||||
var layout = inst.options.layout;
|
||||
inst.options.layout = inst.options.expiryText;
|
||||
this._updateCountdown(elem[0], inst);
|
||||
inst.options.layout = layout;
|
||||
}
|
||||
if (inst.options.expiryUrl) {
|
||||
window.location = inst.options.expiryUrl;
|
||||
}
|
||||
}
|
||||
inst._expiring = false;
|
||||
}
|
||||
else if (inst._hold === 'pause') {
|
||||
this._removeElem(elem[0]);
|
||||
}
|
||||
},
|
||||
|
||||
/** Reset any extra labelsn and compactLabelsn entries if changing labels.
|
||||
@private
|
||||
@param {object} base The options to be updated.
|
||||
@param {object} options The new option values. */
|
||||
_resetExtraLabels: function(base, options) {
|
||||
var n = null;
|
||||
for (n in options) {
|
||||
if (n.match(/[Ll]abels[02-9]|compactLabels1/)) {
|
||||
base[n] = options[n];
|
||||
}
|
||||
}
|
||||
for (n in base) { // Remove custom numbered labels
|
||||
if (n.match(/[Ll]abels[02-9]|compactLabels1/) && typeof options[n] === 'undefined') {
|
||||
base[n] = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/** Determine whether or not a value is equivalent to <code>null</code>.
|
||||
@private
|
||||
@param {object} value The value to test.
|
||||
@return {boolean} <code>true</code> if equivalent to <code>null</code>, <code>false</code> if not. */
|
||||
_eqNull: function(value) {
|
||||
return typeof value === 'undefined' || value === null;
|
||||
},
|
||||
|
||||
|
||||
/** Calculate internal settings for an instance.
|
||||
@private
|
||||
@param {jQuery} elem The containing element.
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {boolean} recalc <code>true</code> if until or since are set. */
|
||||
_adjustSettings: function(elem, inst, recalc) {
|
||||
var serverEntry = null;
|
||||
for (var i = 0; i < this._serverSyncs.length; i++) {
|
||||
if (this._serverSyncs[i][0] === inst.options.serverSync) {
|
||||
serverEntry = this._serverSyncs[i][1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
var now = null;
|
||||
var serverOffset = null;
|
||||
if (!this._eqNull(serverEntry)) {
|
||||
now = new Date();
|
||||
serverOffset = (inst.options.serverSync ? serverEntry : 0);
|
||||
}
|
||||
else {
|
||||
var serverResult = ($.isFunction(inst.options.serverSync) ?
|
||||
inst.options.serverSync.apply(elem[0], []) : null);
|
||||
now = new Date();
|
||||
serverOffset = (serverResult ? now.getTime() - serverResult.getTime() : 0);
|
||||
this._serverSyncs.push([inst.options.serverSync, serverOffset]);
|
||||
}
|
||||
var timezone = inst.options.timezone;
|
||||
timezone = (this._eqNull(timezone) ? -now.getTimezoneOffset() : timezone);
|
||||
if (recalc || (!recalc && this._eqNull(inst._until) && this._eqNull(inst._since))) {
|
||||
inst._since = inst.options.since;
|
||||
if (!this._eqNull(inst._since)) {
|
||||
inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
|
||||
if (inst._since && serverOffset) {
|
||||
inst._since.setMilliseconds(inst._since.getMilliseconds() + serverOffset);
|
||||
}
|
||||
}
|
||||
inst._until = this.UTCDate(timezone, this._determineTime(inst.options.until, now));
|
||||
if (serverOffset) {
|
||||
inst._until.setMilliseconds(inst._until.getMilliseconds() + serverOffset);
|
||||
}
|
||||
}
|
||||
inst._show = this._determineShow(inst);
|
||||
},
|
||||
|
||||
/** Remove the countdown widget from an element.
|
||||
@private
|
||||
@param {jQuery} elem The containing element.
|
||||
@param {object} inst The current instance object. */
|
||||
_preDestroy: function(elem, inst) { // jshint unused:false
|
||||
this._removeElem(elem[0]);
|
||||
elem.empty();
|
||||
},
|
||||
|
||||
/** Pause a countdown widget at the current time.
|
||||
Stop it running but remember and display the current time.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('pause') */
|
||||
pause: function(elem) {
|
||||
this._hold(elem, 'pause');
|
||||
},
|
||||
|
||||
/** Pause a countdown widget at the current time.
|
||||
Stop the display but keep the countdown running.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('lap') */
|
||||
lap: function(elem) {
|
||||
this._hold(elem, 'lap');
|
||||
},
|
||||
|
||||
/** Resume a paused countdown widget.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('resume') */
|
||||
resume: function(elem) {
|
||||
this._hold(elem, null);
|
||||
},
|
||||
|
||||
/** Toggle a paused countdown widget.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('toggle') */
|
||||
toggle: function(elem) {
|
||||
var inst = $.data(elem, this.name) || {};
|
||||
this[!inst._hold ? 'pause' : 'resume'](elem);
|
||||
},
|
||||
|
||||
/** Toggle a lapped countdown widget.
|
||||
@param {Element} elem The containing element.
|
||||
@example $(selector).countdown('toggleLap') */
|
||||
toggleLap: function(elem) {
|
||||
var inst = $.data(elem, this.name) || {};
|
||||
this[!inst._hold ? 'lap' : 'resume'](elem);
|
||||
},
|
||||
|
||||
/** Pause or resume a countdown widget.
|
||||
@private
|
||||
@param {Element} elem The containing element.
|
||||
@param {string} hold The new hold setting. */
|
||||
_hold: function(elem, hold) {
|
||||
var inst = $.data(elem, this.name);
|
||||
if (inst) {
|
||||
if (inst._hold === 'pause' && !hold) {
|
||||
inst._periods = inst._savePeriods;
|
||||
var sign = (inst._since ? '-' : '+');
|
||||
inst[inst._since ? '_since' : '_until'] =
|
||||
this._determineTime(sign + inst._periods[0] + 'y' +
|
||||
sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
|
||||
sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' +
|
||||
sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
|
||||
this._addElem(elem);
|
||||
}
|
||||
inst._hold = hold;
|
||||
inst._savePeriods = (hold === 'pause' ? inst._periods : null);
|
||||
$.data(elem, this.name, inst);
|
||||
this._updateCountdown(elem, inst);
|
||||
}
|
||||
},
|
||||
|
||||
/** Return the current time periods, broken down by years, months, weeks, days, hours, minutes, and seconds.
|
||||
@param {Element} elem The containing element.
|
||||
@return {number[]} The current periods for the countdown.
|
||||
@example var periods = $(selector).countdown('getTimes') */
|
||||
getTimes: function(elem) {
|
||||
var inst = $.data(elem, this.name);
|
||||
return (!inst ? null : (inst._hold === 'pause' ? inst._savePeriods : (!inst._hold ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()))));
|
||||
},
|
||||
|
||||
/** A time may be specified as an exact value or a relative one.
|
||||
@private
|
||||
@param {string|number|Date} setting The date/time value as a relative or absolute value.
|
||||
@param {Date} defaultTime The date/time to use if no other is supplied.
|
||||
@return {Date} The corresponding date/time. */
|
||||
_determineTime: function(setting, defaultTime) {
|
||||
var self = this;
|
||||
var offsetNumeric = function(offset) { // e.g. +300, -2
|
||||
var time = new Date();
|
||||
time.setTime(time.getTime() + offset * 1000);
|
||||
return time;
|
||||
};
|
||||
var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
|
||||
offset = offset.toLowerCase();
|
||||
var time = new Date();
|
||||
var year = time.getFullYear();
|
||||
var month = time.getMonth();
|
||||
var day = time.getDate();
|
||||
var hour = time.getHours();
|
||||
var minute = time.getMinutes();
|
||||
var second = time.getSeconds();
|
||||
var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
|
||||
var matches = pattern.exec(offset);
|
||||
while (matches) {
|
||||
switch (matches[2] || 's') {
|
||||
case 's':
|
||||
second += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'm':
|
||||
minute += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'h':
|
||||
hour += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'd':
|
||||
day += parseInt(matches[1], 10);
|
||||
break;
|
||||
case 'w':
|
||||
day += parseInt(matches[1], 10) * 7;
|
||||
break;
|
||||
case 'o':
|
||||
month += parseInt(matches[1], 10);
|
||||
day = Math.min(day, self._getDaysInMonth(year, month));
|
||||
break;
|
||||
case 'y':
|
||||
year += parseInt(matches[1], 10);
|
||||
day = Math.min(day, self._getDaysInMonth(year, month));
|
||||
break;
|
||||
}
|
||||
matches = pattern.exec(offset);
|
||||
}
|
||||
return new Date(year, month, day, hour, minute, second, 0);
|
||||
};
|
||||
var time = (this._eqNull(setting) ? defaultTime :
|
||||
(typeof setting === 'string' ? offsetString(setting) :
|
||||
(typeof setting === 'number' ? offsetNumeric(setting) : setting)));
|
||||
if (time) {
|
||||
time.setMilliseconds(0);
|
||||
}
|
||||
return time;
|
||||
},
|
||||
|
||||
/** Determine the number of days in a month.
|
||||
@private
|
||||
@param {number} year The year.
|
||||
@param {number} month The month.
|
||||
@return {number} The days in that month. */
|
||||
_getDaysInMonth: function(year, month) {
|
||||
return 32 - new Date(year, month, 32).getDate();
|
||||
},
|
||||
|
||||
/** Default implementation to determine which set of labels should be used for an amount.
|
||||
Use the <code>labels</code> attribute with the same numeric suffix (if it exists).
|
||||
@private
|
||||
@param {number} num The amount to be displayed.
|
||||
@return {number} The set of labels to be used for this amount. */
|
||||
_normalLabels: function(num) {
|
||||
return num;
|
||||
},
|
||||
|
||||
/** Generate the HTML to display the countdown widget.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@return {string} The new HTML for the countdown display. */
|
||||
_generateHTML: function(inst) {
|
||||
var self = this;
|
||||
// Determine what to show
|
||||
inst._periods = (inst._hold ? inst._periods :
|
||||
this._calculatePeriods(inst, inst._show, inst.options.significant, new Date()));
|
||||
// Show all 'asNeeded' after first non-zero value
|
||||
var shownNonZero = false;
|
||||
var showCount = 0;
|
||||
var sigCount = inst.options.significant;
|
||||
var show = $.extend({}, inst._show);
|
||||
var period = null;
|
||||
for (period = Y; period <= S; period++) {
|
||||
shownNonZero = shownNonZero || (inst._show[period] === '?' && inst._periods[period] > 0);
|
||||
show[period] = (inst._show[period] === '?' && !shownNonZero ? null : inst._show[period]);
|
||||
showCount += (show[period] ? 1 : 0);
|
||||
sigCount -= (inst._periods[period] > 0 ? 1 : 0);
|
||||
}
|
||||
var showSignificant = [false, false, false, false, false, false, false];
|
||||
for (period = S; period >= Y; period--) { // Determine significant periods
|
||||
if (inst._show[period]) {
|
||||
if (inst._periods[period]) {
|
||||
showSignificant[period] = true;
|
||||
}
|
||||
else {
|
||||
showSignificant[period] = sigCount > 0;
|
||||
sigCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
var labels = (inst.options.compact ? inst.options.compactLabels : inst.options.labels);
|
||||
var whichLabels = inst.options.whichLabels || this._normalLabels;
|
||||
var showCompact = function(period) {
|
||||
var labelsNum = inst.options['compactLabels' + whichLabels(inst._periods[period])];
|
||||
return (show[period] ? self._translateDigits(inst, inst._periods[period]) +
|
||||
(labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
|
||||
};
|
||||
var minDigits = (inst.options.padZeroes ? 2 : 1);
|
||||
var showFull = function(period) {
|
||||
var labelsNum = inst.options['labels' + whichLabels(inst._periods[period])];
|
||||
return ((!inst.options.significant && show[period]) ||
|
||||
(inst.options.significant && showSignificant[period]) ?
|
||||
'<span class="' + self._sectionClass + '">' +
|
||||
'<span class="' + self._amountClass + '">' +
|
||||
self._minDigits(inst, inst._periods[period], minDigits) + '</span>' +
|
||||
'<span class="' + self._periodClass + '">' +
|
||||
(labelsNum ? labelsNum[period] : labels[period]) + '</span></span>' : '');
|
||||
};
|
||||
return (inst.options.layout ? this._buildLayout(inst, show, inst.options.layout,
|
||||
inst.options.compact, inst.options.significant, showSignificant) :
|
||||
((inst.options.compact ? // Compact version
|
||||
'<span class="' + this._rowClass + ' ' + this._amountClass +
|
||||
(inst._hold ? ' ' + this._holdingClass : '') + '">' +
|
||||
showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) +
|
||||
(show[H] ? this._minDigits(inst, inst._periods[H], 2) : '') +
|
||||
(show[M] ? (show[H] ? inst.options.timeSeparator : '') +
|
||||
this._minDigits(inst, inst._periods[M], 2) : '') +
|
||||
(show[S] ? (show[H] || show[M] ? inst.options.timeSeparator : '') +
|
||||
this._minDigits(inst, inst._periods[S], 2) : '') :
|
||||
// Full version
|
||||
'<span class="' + this._rowClass + ' ' + this._showClass + (inst.options.significant || showCount) +
|
||||
(inst._hold ? ' ' + this._holdingClass : '') + '">' +
|
||||
showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
|
||||
showFull(H) + showFull(M) + showFull(S)) + '</span>' +
|
||||
(inst.options.description ? '<span class="' + this._rowClass + ' ' + this._descrClass + '">' +
|
||||
inst.options.description + '</span>' : '')));
|
||||
},
|
||||
|
||||
/** Construct a custom layout.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {boolean[]} show Flags indicating which periods are requested.
|
||||
@param {string} layout The customised layout.
|
||||
@param {boolean} compact <code>true</code> if using compact labels.
|
||||
@param {number} significant The number of periods with values to show, zero for all.
|
||||
@param {boolean[]} showSignificant Other periods to show for significance.
|
||||
@return {string} The custom HTML. */
|
||||
_buildLayout: function(inst, show, layout, compact, significant, showSignificant) {
|
||||
var labels = inst.options[compact ? 'compactLabels' : 'labels'];
|
||||
var whichLabels = inst.options.whichLabels || this._normalLabels;
|
||||
var labelFor = function(index) {
|
||||
return (inst.options[(compact ? 'compactLabels' : 'labels') +
|
||||
whichLabels(inst._periods[index])] || labels)[index];
|
||||
};
|
||||
var digit = function(value, position) {
|
||||
return inst.options.digits[Math.floor(value / position) % 10];
|
||||
};
|
||||
var subs = {desc: inst.options.description, sep: inst.options.timeSeparator,
|
||||
yl: labelFor(Y), yn: this._minDigits(inst, inst._periods[Y], 1),
|
||||
ynn: this._minDigits(inst, inst._periods[Y], 2),
|
||||
ynnn: this._minDigits(inst, inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
|
||||
y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
|
||||
y1000: digit(inst._periods[Y], 1000),
|
||||
ol: labelFor(O), on: this._minDigits(inst, inst._periods[O], 1),
|
||||
onn: this._minDigits(inst, inst._periods[O], 2),
|
||||
onnn: this._minDigits(inst, inst._periods[O], 3), o1: digit(inst._periods[O], 1),
|
||||
o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
|
||||
o1000: digit(inst._periods[O], 1000),
|
||||
wl: labelFor(W), wn: this._minDigits(inst, inst._periods[W], 1),
|
||||
wnn: this._minDigits(inst, inst._periods[W], 2),
|
||||
wnnn: this._minDigits(inst, inst._periods[W], 3), w1: digit(inst._periods[W], 1),
|
||||
w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
|
||||
w1000: digit(inst._periods[W], 1000),
|
||||
dl: labelFor(D), dn: this._minDigits(inst, inst._periods[D], 1),
|
||||
dnn: this._minDigits(inst, inst._periods[D], 2),
|
||||
dnnn: this._minDigits(inst, inst._periods[D], 3), d1: digit(inst._periods[D], 1),
|
||||
d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
|
||||
d1000: digit(inst._periods[D], 1000),
|
||||
hl: labelFor(H), hn: this._minDigits(inst, inst._periods[H], 1),
|
||||
hnn: this._minDigits(inst, inst._periods[H], 2),
|
||||
hnnn: this._minDigits(inst, inst._periods[H], 3), h1: digit(inst._periods[H], 1),
|
||||
h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
|
||||
h1000: digit(inst._periods[H], 1000),
|
||||
ml: labelFor(M), mn: this._minDigits(inst, inst._periods[M], 1),
|
||||
mnn: this._minDigits(inst, inst._periods[M], 2),
|
||||
mnnn: this._minDigits(inst, inst._periods[M], 3), m1: digit(inst._periods[M], 1),
|
||||
m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
|
||||
m1000: digit(inst._periods[M], 1000),
|
||||
sl: labelFor(S), sn: this._minDigits(inst, inst._periods[S], 1),
|
||||
snn: this._minDigits(inst, inst._periods[S], 2),
|
||||
snnn: this._minDigits(inst, inst._periods[S], 3), s1: digit(inst._periods[S], 1),
|
||||
s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100),
|
||||
s1000: digit(inst._periods[S], 1000)};
|
||||
var html = layout;
|
||||
// Replace period containers: {p<}...{p>}
|
||||
for (var i = Y; i <= S; i++) {
|
||||
var period = 'yowdhms'.charAt(i);
|
||||
var re = new RegExp('\\{' + period + '<\\}([\\s\\S]*)\\{' + period + '>\\}', 'g');
|
||||
html = html.replace(re, ((!significant && show[i]) ||
|
||||
(significant && showSignificant[i]) ? '$1' : ''));
|
||||
}
|
||||
// Replace period values: {pn}
|
||||
$.each(subs, function(n, v) {
|
||||
var re = new RegExp('\\{' + n + '\\}', 'g');
|
||||
html = html.replace(re, v);
|
||||
});
|
||||
return html;
|
||||
},
|
||||
|
||||
/** Ensure a numeric value has at least n digits for display.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {number} value The value to display.
|
||||
@param {number} len The minimum length.
|
||||
@return {string} The display text. */
|
||||
_minDigits: function(inst, value, len) {
|
||||
value = '' + value;
|
||||
if (value.length >= len) {
|
||||
return this._translateDigits(inst, value);
|
||||
}
|
||||
value = '0000000000' + value;
|
||||
return this._translateDigits(inst, value.substr(value.length - len));
|
||||
},
|
||||
|
||||
/** Translate digits into other representations.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {string} value The text to translate.
|
||||
@return {string} The translated text. */
|
||||
_translateDigits: function(inst, value) {
|
||||
return ('' + value).replace(/[0-9]/g, function(digit) {
|
||||
return inst.options.digits[digit];
|
||||
});
|
||||
},
|
||||
|
||||
/** Translate the format into flags for each period.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@return {string[]} Flags indicating which periods are requested (?) or
|
||||
required (!) by year, month, week, day, hour, minute, second. */
|
||||
_determineShow: function(inst) {
|
||||
var format = inst.options.format;
|
||||
var show = [];
|
||||
show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
|
||||
show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
|
||||
show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
|
||||
show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
|
||||
show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
|
||||
show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
|
||||
show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
|
||||
return show;
|
||||
},
|
||||
|
||||
/** Calculate the requested periods between now and the target time.
|
||||
@private
|
||||
@param {object} inst The current settings for this instance.
|
||||
@param {string[]} show Flags indicating which periods are requested/required.
|
||||
@param {number} significant The number of periods with values to show, zero for all.
|
||||
@param {Date} now The current date and time.
|
||||
@return {number[]} The current time periods (always positive)
|
||||
by year, month, week, day, hour, minute, second. */
|
||||
_calculatePeriods: function(inst, show, significant, now) {
|
||||
// Find endpoints
|
||||
inst._now = now;
|
||||
inst._now.setMilliseconds(0);
|
||||
var until = new Date(inst._now.getTime());
|
||||
if (inst._since) {
|
||||
if (now.getTime() < inst._since.getTime()) {
|
||||
inst._now = now = until;
|
||||
}
|
||||
else {
|
||||
now = inst._since;
|
||||
}
|
||||
}
|
||||
else {
|
||||
until.setTime(inst._until.getTime());
|
||||
if (now.getTime() > inst._until.getTime()) {
|
||||
inst._now = now = until;
|
||||
}
|
||||
}
|
||||
// Calculate differences by period
|
||||
var periods = [0, 0, 0, 0, 0, 0, 0];
|
||||
if (show[Y] || show[O]) {
|
||||
// Treat end of months as the same
|
||||
var lastNow = this._getDaysInMonth(now.getFullYear(), now.getMonth());
|
||||
var lastUntil = this._getDaysInMonth(until.getFullYear(), until.getMonth());
|
||||
var sameDay = (until.getDate() === now.getDate() ||
|
||||
(until.getDate() >= Math.min(lastNow, lastUntil) &&
|
||||
now.getDate() >= Math.min(lastNow, lastUntil)));
|
||||
var getSecs = function(date) {
|
||||
return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
|
||||
};
|
||||
var months = Math.max(0,
|
||||
(until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
|
||||
((until.getDate() < now.getDate() && !sameDay) ||
|
||||
(sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
|
||||
periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
|
||||
periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
|
||||
// Adjust for months difference and end of month if necessary
|
||||
now = new Date(now.getTime());
|
||||
var wasLastDay = (now.getDate() === lastNow);
|
||||
var lastDay = this._getDaysInMonth(now.getFullYear() + periods[Y],
|
||||
now.getMonth() + periods[O]);
|
||||
if (now.getDate() > lastDay) {
|
||||
now.setDate(lastDay);
|
||||
}
|
||||
now.setFullYear(now.getFullYear() + periods[Y]);
|
||||
now.setMonth(now.getMonth() + periods[O]);
|
||||
if (wasLastDay) {
|
||||
now.setDate(lastDay);
|
||||
}
|
||||
}
|
||||
var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
|
||||
var period = null;
|
||||
var extractPeriod = function(period, numSecs) {
|
||||
periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
|
||||
diff -= periods[period] * numSecs;
|
||||
};
|
||||
extractPeriod(W, 604800);
|
||||
extractPeriod(D, 86400);
|
||||
extractPeriod(H, 3600);
|
||||
extractPeriod(M, 60);
|
||||
extractPeriod(S, 1);
|
||||
if (diff > 0 && !inst._since) { // Round up if left overs
|
||||
var multiplier = [1, 12, 4.3482, 7, 24, 60, 60];
|
||||
var lastShown = S;
|
||||
var max = 1;
|
||||
for (period = S; period >= Y; period--) {
|
||||
if (show[period]) {
|
||||
if (periods[lastShown] >= max) {
|
||||
periods[lastShown] = 0;
|
||||
diff = 1;
|
||||
}
|
||||
if (diff > 0) {
|
||||
periods[period]++;
|
||||
diff = 0;
|
||||
lastShown = period;
|
||||
max = 1;
|
||||
}
|
||||
}
|
||||
max *= multiplier[period];
|
||||
}
|
||||
}
|
||||
if (significant) { // Zero out insignificant periods
|
||||
for (period = Y; period <= S; period++) {
|
||||
if (significant && periods[period]) {
|
||||
significant--;
|
||||
}
|
||||
else if (!significant) {
|
||||
periods[period] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return periods;
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
388
public/js/jquery/countdown/jquery.plugin.js
vendored
388
public/js/jquery/countdown/jquery.plugin.js
vendored
@ -1,388 +0,0 @@
|
||||
/* globals JQClass */
|
||||
/*! Simple JavaScript Inheritance
|
||||
* By John Resig http://ejohn.org/
|
||||
* MIT Licensed.
|
||||
*/
|
||||
// Inspired by base2 and Prototype
|
||||
(function(){
|
||||
'use strict';
|
||||
var initializing = false;
|
||||
|
||||
// The base JQClass implementation (does nothing)
|
||||
window.JQClass = function(){};
|
||||
|
||||
// Collection of derived classes
|
||||
JQClass.classes = {};
|
||||
|
||||
// Create a new JQClass that inherits from this class
|
||||
JQClass.extend = function extender(prop) {
|
||||
var base = this.prototype;
|
||||
|
||||
// Instantiate a base class (but only create the instance, don't run the init constructor)
|
||||
initializing = true;
|
||||
var prototype = new this();
|
||||
initializing = false;
|
||||
|
||||
// Copy the properties over onto the new prototype
|
||||
for (var name in prop) { // jshint loopfunc:true
|
||||
// Check if we're overwriting an existing function
|
||||
if (typeof prop[name] === 'function' && typeof base[name] === 'function') {
|
||||
prototype[name] = (function (name, fn) {
|
||||
return function () {
|
||||
var __super = this._super;
|
||||
// Add a new ._super() method that is the same method but on the super-class
|
||||
this._super = function (args) {
|
||||
return base[name].apply(this, args || []);
|
||||
};
|
||||
var ret = fn.apply(this, arguments);
|
||||
// The method only needs to be bound temporarily, so we remove it when we're done executing
|
||||
this._super = __super;
|
||||
return ret;
|
||||
};
|
||||
})(name, prop[name]);
|
||||
// Check if we're overwriting existing default options.
|
||||
} else if (typeof prop[name] === 'object' && typeof base[name] === 'object' && name === 'defaultOptions') {
|
||||
var obj1 = base[name];
|
||||
var obj2 = prop[name];
|
||||
var obj3 = {};
|
||||
var key;
|
||||
for (key in obj1) { // jshint forin:false
|
||||
obj3[key] = obj1[key];
|
||||
}
|
||||
for (key in obj2) { // jshint forin:false
|
||||
obj3[key] = obj2[key];
|
||||
}
|
||||
prototype[name] = obj3;
|
||||
} else {
|
||||
prototype[name] = prop[name];
|
||||
}
|
||||
}
|
||||
|
||||
// The dummy class constructor
|
||||
function JQClass() {
|
||||
// All construction is actually done in the init method
|
||||
if (!initializing && this._init) {
|
||||
this._init.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
// Populate our constructed prototype object
|
||||
JQClass.prototype = prototype;
|
||||
|
||||
// Enforce the constructor to be what we expect
|
||||
JQClass.prototype.constructor = JQClass;
|
||||
|
||||
// And make this class extendable
|
||||
JQClass.extend = extender;
|
||||
|
||||
return JQClass;
|
||||
};
|
||||
})();
|
||||
/*! Abstract base class for collection plugins v1.0.2.
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.
|
||||
Licensed under the MIT license (http://keith-wood.name/licence.html). */
|
||||
(function($) { // Ensure $, encapsulate
|
||||
'use strict';
|
||||
|
||||
/** <p>Abstract base class for collection plugins v1.0.2.</p>
|
||||
<p>Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.</p>
|
||||
<p>Licensed under the MIT license (http://keith-wood.name/licence.html).</p>
|
||||
<p>Use {@link $.JQPlugin.createPlugin} to create new plugins using this framework.</p>
|
||||
<p>This base class provides common functionality such as:</p>
|
||||
<ul>
|
||||
<li>Creates jQuery bridge - allowing you to invoke your plugin on a collection of elements.</li>
|
||||
<li>Handles initialisation including reading settings from metadata -
|
||||
an instance object is attached to the affected element(s) containing all the necessary data.</li>
|
||||
<li>Handles option retrieval and update - options can be set through default values,
|
||||
through inline metadata, or through instantiation settings.<br>
|
||||
Metadata is specified as an attribute on the element:
|
||||
<code>data-<pluginName>="<option name>: '<value>', ..."</code>.
|
||||
Dates should be specified as strings in this format: <code>'new Date(y, m-1, d)'</code>.</li>
|
||||
<li>Handles method calling - inner functions starting with '_'are inaccessible,
|
||||
whereas others can be called via <code>$(selector).pluginName('functionName')</code>.</li>
|
||||
<li>Handles plugin destruction - removing all trace of the plugin.</li>
|
||||
</ul>
|
||||
@module JQPlugin
|
||||
@abstract */
|
||||
JQClass.classes.JQPlugin = JQClass.extend({
|
||||
|
||||
/** Name to identify this plugin.
|
||||
@example name: 'tabs' */
|
||||
name: 'plugin',
|
||||
|
||||
/** Default options for instances of this plugin (default: {}).
|
||||
@example defaultOptions: {
|
||||
selectedClass: 'selected',
|
||||
triggers: 'click'
|
||||
} */
|
||||
defaultOptions: {},
|
||||
|
||||
/** Options dependent on the locale.
|
||||
Indexed by language and (optional) country code, with '' denoting the default language (English/US).
|
||||
Normally additional languages would be provided as separate files to all them to be included as needed.
|
||||
@example regionalOptions: {
|
||||
'': {
|
||||
greeting: 'Hi'
|
||||
}
|
||||
} */
|
||||
regionalOptions: {},
|
||||
|
||||
/** Whether or not a deep merge should be performed when accumulating options.
|
||||
The default is <code>true</code> but can be overridden in a sub-class. */
|
||||
deepMerge: true,
|
||||
|
||||
/** Retrieve a marker class for affected elements.
|
||||
In the format: <code>is-<pluginName></code>.
|
||||
@protected
|
||||
@return {string} The marker class. */
|
||||
_getMarker: function() {
|
||||
return 'is-' + this.name;
|
||||
},
|
||||
|
||||
/** Initialise the plugin.
|
||||
Create the jQuery bridge - plugin name <code>xyz</code>
|
||||
produces singleton <code>$.xyz</code> and collection function <code>$.fn.xyz</code>.
|
||||
@protected */
|
||||
_init: function() {
|
||||
// Apply default localisations
|
||||
$.extend(this.defaultOptions, (this.regionalOptions && this.regionalOptions['']) || {});
|
||||
// Camel-case the name
|
||||
var jqName = camelCase(this.name);
|
||||
// Expose jQuery singleton manager
|
||||
$[jqName] = this;
|
||||
// Expose jQuery collection plugin
|
||||
$.fn[jqName] = function(options) {
|
||||
var otherArgs = Array.prototype.slice.call(arguments, 1);
|
||||
var inst = this;
|
||||
var returnValue = this;
|
||||
this.each(function () {
|
||||
if (typeof options === 'string') {
|
||||
if (options[0] === '_' || !$[jqName][options]) {
|
||||
throw 'Unknown method: ' + options;
|
||||
}
|
||||
var methodValue = $[jqName][options].apply($[jqName], [this].concat(otherArgs));
|
||||
if (methodValue !== inst && methodValue !== undefined) {
|
||||
returnValue = methodValue;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$[jqName]._attach(this, options);
|
||||
}
|
||||
});
|
||||
return returnValue;
|
||||
};
|
||||
},
|
||||
|
||||
/** Set default options for all subsequent instances.
|
||||
@param {object} options The new default options.
|
||||
@example $.pluginName.setDefaults({name: value, ...}) */
|
||||
setDefaults: function(options) {
|
||||
$.extend(this.defaultOptions, options || {});
|
||||
},
|
||||
|
||||
/** Initialise an element. Called internally only.
|
||||
Adds an instance object as data named for the plugin.
|
||||
Override {@linkcode module:JQPlugin~_postAttach|_postAttach} for plugin-specific processing.
|
||||
@private
|
||||
@param {Element} elem The element to enhance.
|
||||
@param {object} options Overriding settings. */
|
||||
_attach: function(elem, options) {
|
||||
elem = $(elem);
|
||||
if (elem.hasClass(this._getMarker())) {
|
||||
return;
|
||||
}
|
||||
elem.addClass(this._getMarker());
|
||||
options = $.extend(this.deepMerge, {}, this.defaultOptions, this._getMetadata(elem), options || {});
|
||||
var inst = $.extend({name: this.name, elem: elem, options: options}, this._instSettings(elem, options));
|
||||
elem.data(this.name, inst); // Save instance against element
|
||||
this._postAttach(elem, inst);
|
||||
this.option(elem, options);
|
||||
},
|
||||
|
||||
/** Retrieve additional instance settings.
|
||||
Override this in a sub-class to provide extra settings.
|
||||
These are added directly to the instance object.
|
||||
Default attributes of an instance object are shown as properties below:
|
||||
@protected
|
||||
@param {jQuery} elem The current jQuery element.
|
||||
@param {object} options The instance options.
|
||||
@return {object} Any extra instance values.
|
||||
@property {Element} elem The element to which this instance applies.
|
||||
@property {string} name The name of this plugin.
|
||||
@property {object} options The accumulated options for this instance.
|
||||
@example _instSettings: function(elem, options) {
|
||||
return {nav: elem.find(options.navSelector)};
|
||||
} */
|
||||
_instSettings: function(elem, options) { // jshint unused:false
|
||||
return {};
|
||||
},
|
||||
|
||||
/** Plugin specific post initialisation.
|
||||
Override this in a sub-class to perform extra activities.
|
||||
This is where you would implement your plugin's main functionality.
|
||||
@protected
|
||||
@param {jQuery} elem The current jQuery element.
|
||||
@param {object} inst The instance settings.
|
||||
@example _postAttach: function(elem, inst) {
|
||||
elem.on('click.' + this.name, function() {
|
||||
...
|
||||
});
|
||||
} */
|
||||
_postAttach: function(elem, inst) { // jshint unused:false
|
||||
},
|
||||
|
||||
/** Retrieve metadata configuration from the element.
|
||||
Metadata is specified as an attribute:
|
||||
<code>data-<pluginName>="<option name>: '<value>', ..."</code>.
|
||||
Dates should be specified as strings in this format: <code>'new Date(y, m-1, d)'</code>.
|
||||
@private
|
||||
@param {jQuery} elem The source element.
|
||||
@return {object} The inline configuration or {}. */
|
||||
_getMetadata: function(elem) {
|
||||
try {
|
||||
var data = elem.data(this.name.toLowerCase()) || '';
|
||||
data = data.replace(/(\\?)'/g, function(e, t) {
|
||||
return t ? '\'' : '"';
|
||||
}).replace(/([a-zA-Z0-9]+):/g, function(match, group, i) {
|
||||
var count = data.substring(0, i).match(/"/g); // Handle embedded ':'
|
||||
return (!count || count.length % 2 === 0 ? '"' + group + '":' : group + ':');
|
||||
}).replace(/\\:/g, ':');
|
||||
data = $.parseJSON('{' + data + '}');
|
||||
for (var key in data) {
|
||||
if (data.hasOwnProperty(key)) {
|
||||
var value = data[key];
|
||||
if (typeof value === 'string' && value.match(/^new Date\(([-0-9,\s]*)\)$/)) { // Convert dates
|
||||
data[key] = eval(value); // jshint ignore:line
|
||||
}
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
catch (e) {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
|
||||
/** Retrieve the instance data for element.
|
||||
@protected
|
||||
@param {Element} elem The source element.
|
||||
@return {object} The instance data or <code>{}</code> if none. */
|
||||
_getInst: function(elem) {
|
||||
return $(elem).data(this.name) || {};
|
||||
},
|
||||
|
||||
/** Retrieve or reconfigure the settings for a plugin.
|
||||
If new settings are provided they are applied to the instance options.
|
||||
If an option name only is provided the value of that option is returned.
|
||||
If no name or value is provided, all options are returned.
|
||||
Override {@linkcode module:JQPlugin~_optionsChanged|_optionsChanged}
|
||||
for plugin-specific processing when option values change.
|
||||
@param {Element} elem The source element.
|
||||
@param {object|string} [name] The collection of new option values or the name of a single option.
|
||||
@param {any} [value] The value for a single named option.
|
||||
@return {any|object} If retrieving a single value or all options.
|
||||
@example $(selector).plugin('option', 'name', value) // Set one option
|
||||
$(selector).plugin('option', {name: value, ...}) // Set multiple options
|
||||
var value = $(selector).plugin('option', 'name') // Get one option
|
||||
var options = $(selector).plugin('option') // Get all options */
|
||||
option: function(elem, name, value) {
|
||||
elem = $(elem);
|
||||
var inst = elem.data(this.name);
|
||||
var options = name || {};
|
||||
if (!name || (typeof name === 'string' && typeof value === 'undefined')) {
|
||||
options = (inst || {}).options;
|
||||
return (options && name ? options[name] : options);
|
||||
}
|
||||
if (!elem.hasClass(this._getMarker())) {
|
||||
return;
|
||||
}
|
||||
if (typeof name === 'string') {
|
||||
options = {};
|
||||
options[name] = value;
|
||||
}
|
||||
this._optionsChanged(elem, inst, options);
|
||||
$.extend(inst.options, options);
|
||||
},
|
||||
|
||||
/** Plugin specific options processing.
|
||||
Old value available in <code>inst.options[name]</code>, new value in <code>options[name]</code>.
|
||||
Override this in a sub-class to perform extra activities.
|
||||
@protected
|
||||
@param {jQuery} elem The current jQuery element.
|
||||
@param {object} inst The instance settings.
|
||||
@param {object} options The new options.
|
||||
@example _optionsChanged: function(elem, inst, options) {
|
||||
if (options.name != inst.options.name) {
|
||||
elem.removeClass(inst.options.name).addClass(options.name);
|
||||
}
|
||||
} */
|
||||
_optionsChanged: function(elem, inst, options) { // jshint unused:false
|
||||
},
|
||||
|
||||
/** Remove all trace of the plugin.
|
||||
Override {@linkcode module:JQPlugin~_preDestroy|_preDestroy} for plugin-specific processing.
|
||||
@param {Element} elem The source element.
|
||||
@example $(selector).plugin('destroy') */
|
||||
destroy: function(elem) {
|
||||
elem = $(elem);
|
||||
if (!elem.hasClass(this._getMarker())) {
|
||||
return;
|
||||
}
|
||||
this._preDestroy(elem, this._getInst(elem));
|
||||
elem.removeData(this.name).removeClass(this._getMarker());
|
||||
},
|
||||
|
||||
/** Plugin specific pre destruction.
|
||||
It is invoked as part of the {@linkcode module:JQPlugin~destroy|destroy} processing.
|
||||
Override this in a sub-class to perform extra activities and undo everything that was
|
||||
done in the {@linkcode module:JQPlugin~_postAttach|_postAttach} or
|
||||
{@linkcode module:JQPlugin~_optionsChanged|_optionsChanged} functions.
|
||||
@protected
|
||||
@param {jQuery} elem The current jQuery element.
|
||||
@param {object} inst The instance settings.
|
||||
@example _preDestroy: function(elem, inst) {
|
||||
elem.off('.' + this.name);
|
||||
} */
|
||||
_preDestroy: function(elem, inst) { // jshint unused:false
|
||||
}
|
||||
});
|
||||
|
||||
/** Convert names from hyphenated to camel-case.
|
||||
@private
|
||||
@param {string} value The original hyphenated name.
|
||||
@return {string} The camel-case version. */
|
||||
function camelCase(name) {
|
||||
return name.replace(/-([a-z])/g, function(match, group) {
|
||||
return group.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
/** Expose the plugin base.
|
||||
@namespace $.JQPlugin */
|
||||
$.JQPlugin = {
|
||||
|
||||
/** Create a new collection plugin.
|
||||
@memberof $.JQPlugin
|
||||
@param {string} [superClass='JQPlugin'] The name of the parent class to inherit from.
|
||||
@param {object} overrides The property/function overrides for the new class.
|
||||
See {@link module:JQPlugin|JQPlugin} for the base functionality.
|
||||
@example $.JQPlugin.createPlugin({ // Define the plugin
|
||||
name: 'tabs',
|
||||
defaultOptions: {selectedClass: 'selected'},
|
||||
_initSettings: function(elem, options) { return {...}; },
|
||||
_postAttach: function(elem, inst) { ... }
|
||||
});
|
||||
$('selector').tabs(); // And instantiate it */
|
||||
createPlugin: function(superClass, overrides) {
|
||||
if (typeof superClass === 'object') {
|
||||
overrides = superClass;
|
||||
superClass = 'JQPlugin';
|
||||
}
|
||||
superClass = camelCase(superClass);
|
||||
var className = camelCase(overrides.name);
|
||||
JQClass.classes[className] = JQClass.classes[superClass].extend(overrides);
|
||||
new JQClass.classes[className](); // jshint ignore:line
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
@ -1,9 +0,0 @@
|
||||
/*! Simple JavaScript Inheritance
|
||||
* By John Resig http://ejohn.org/
|
||||
* MIT Licensed.
|
||||
*/
|
||||
!function(){"use strict";var a=!1;window.JQClass=function(){},JQClass.classes={},JQClass.extend=function b(c){function d(){!a&&this._init&&this._init.apply(this,arguments)}var e=this.prototype;a=!0;var f=new this;a=!1;for(var g in c)if("function"==typeof c[g]&&"function"==typeof e[g])f[g]=function(a,b){return function(){var c=this._super;this._super=function(b){return e[a].apply(this,b||[])};var d=b.apply(this,arguments);return this._super=c,d}}(g,c[g]);else if("object"==typeof c[g]&&"object"==typeof e[g]&&"defaultOptions"===g){var h,i=e[g],j=c[g],k={};for(h in i)k[h]=i[h];for(h in j)k[h]=j[h];f[g]=k}else f[g]=c[g];return d.prototype=f,d.prototype.constructor=d,d.extend=b,d}}(),/*! Abstract base class for collection plugins v1.0.2.
|
||||
Written by Keith Wood (wood.keith{at}optusnet.com.au) December 2013.
|
||||
Licensed under the MIT license (http://keith-wood.name/licence.html). */
|
||||
function($){"use strict";function camelCase(a){return a.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()})}JQClass.classes.JQPlugin=JQClass.extend({name:"plugin",defaultOptions:{},regionalOptions:{},deepMerge:!0,_getMarker:function(){return"is-"+this.name},_init:function(){$.extend(this.defaultOptions,this.regionalOptions&&this.regionalOptions[""]||{});var a=camelCase(this.name);$[a]=this,$.fn[a]=function(b){var c=Array.prototype.slice.call(arguments,1),d=this,e=this;return this.each(function(){if("string"==typeof b){if("_"===b[0]||!$[a][b])throw"Unknown method: "+b;var f=$[a][b].apply($[a],[this].concat(c));if(f!==d&&void 0!==f)return e=f,!1}else $[a]._attach(this,b)}),e}},setDefaults:function(a){$.extend(this.defaultOptions,a||{})},_attach:function(a,b){if(a=$(a),!a.hasClass(this._getMarker())){a.addClass(this._getMarker()),b=$.extend(this.deepMerge,{},this.defaultOptions,this._getMetadata(a),b||{});var c=$.extend({name:this.name,elem:a,options:b},this._instSettings(a,b));a.data(this.name,c),this._postAttach(a,c),this.option(a,b)}},_instSettings:function(a,b){return{}},_postAttach:function(a,b){},_getMetadata:function(elem){try{var data=elem.data(this.name.toLowerCase())||"";data=data.replace(/(\\?)'/g,function(a,b){return b?"'":'"'}).replace(/([a-zA-Z0-9]+):/g,function(a,b,c){var d=data.substring(0,c).match(/"/g);return d&&d.length%2!==0?b+":":'"'+b+'":'}).replace(/\\:/g,":"),data=$.parseJSON("{"+data+"}");for(var key in data)if(data.hasOwnProperty(key)){var value=data[key];"string"==typeof value&&value.match(/^new Date\(([-0-9,\s]*)\)$/)&&(data[key]=eval(value))}return data}catch(a){return{}}},_getInst:function(a){return $(a).data(this.name)||{}},option:function(a,b,c){a=$(a);var d=a.data(this.name),e=b||{};return!b||"string"==typeof b&&"undefined"==typeof c?(e=(d||{}).options,e&&b?e[b]:e):void(a.hasClass(this._getMarker())&&("string"==typeof b&&(e={},e[b]=c),this._optionsChanged(a,d,e),$.extend(d.options,e)))},_optionsChanged:function(a,b,c){},destroy:function(a){a=$(a),a.hasClass(this._getMarker())&&(this._preDestroy(a,this._getInst(a)),a.removeData(this.name).removeClass(this._getMarker()))},_preDestroy:function(a,b){}}),$.JQPlugin={createPlugin:function(a,b){"object"==typeof a&&(b=a,a="JQPlugin"),a=camelCase(a);var c=camelCase(b.name);JQClass.classes[c]=JQClass.classes[a].extend(b),new JQClass.classes[c]}}}(jQuery);
|
||||
//# sourceMappingURL=jquery.plugin.min.map
|
@ -1 +0,0 @@
|
||||
{"version":3,"sources":["..\\..\\src\\js\\jquery.plugin.js"],"names":["initializing","window","JQClass","classes","extend","extender","prop","this","_init","apply","arguments","base","prototype","name","fn","__super","_super","args","ret","key","obj1","obj2","obj3","constructor","$","camelCase","replace","match","group","toUpperCase","JQPlugin","defaultOptions","regionalOptions","deepMerge","_getMarker","jqName","options","otherArgs","Array","slice","call","inst","returnValue","each","methodValue","concat","undefined","_attach","setDefaults","elem","hasClass","addClass","_getMetadata","_instSettings","data","_postAttach","option","toLowerCase","e","t","i","count","substring","length","parseJSON","hasOwnProperty","value","eval","_getInst","_optionsChanged","destroy","_preDestroy","removeData","removeClass","createPlugin","superClass","overrides","className","jQuery"],"mappings":";;;;CAMA,WACC,YACA,IAAIA,IAAe,CAGnBC,QAAOC,QAAU,aAGjBA,QAAQC,WAGRD,QAAQE,OAAS,QAASC,GAASC,GA4ClC,QAASJ,MAEHF,GAAgBO,KAAKC,OACzBD,KAAKC,MAAMC,MAAMF,KAAMG,WA9CzB,GAAIC,GAAOJ,KAAKK,SAGhBZ,IAAe,CACf,IAAIY,GAAY,GAAIL,KACpBP,IAAe,CAGf,KAAK,GAAIa,KAAQP,GAEhB,GAA0B,kBAAfA,GAAKO,IAA8C,kBAAfF,GAAKE,GACnDD,EAAUC,GAAQ,SAAWA,EAAMC,GAClC,MAAO,YACN,GAAIC,GAAUR,KAAKS,MAEnBT,MAAKS,OAAS,SAAUC,GACvB,MAAON,GAAKE,GAAMJ,MAAMF,KAAMU,OAE/B,IAAIC,GAAMJ,EAAGL,MAAMF,KAAMG,UAGzB,OADAH,MAAKS,OAASD,EACPG,IAENL,EAAMP,EAAKO,QAER,IAA0B,gBAAfP,GAAKO,IAA4C,gBAAfF,GAAKE,IAA+B,mBAATA,EAA2B,CACzG,GAGIM,GAHAC,EAAOT,EAAKE,GACZQ,EAAOf,EAAKO,GACZS,IAEJ,KAAKH,IAAOC,GACXE,EAAKH,GAAOC,EAAKD,EAElB,KAAKA,IAAOE,GACXC,EAAKH,GAAOE,EAAKF,EAElBP,GAAUC,GAAQS,MAElBV,GAAUC,GAAQP,EAAKO,EAqBzB,OARAX,GAAQU,UAAYA,EAGpBV,EAAQU,UAAUW,YAAcrB,EAGhCA,EAAQE,OAASC,EAEVH;;;AAMT,SAAUsB,GACT,YA6QA,SAASC,WAAUZ,GAClB,MAAOA,GAAKa,QAAQ,YAAa,SAASC,EAAOC,GAChD,MAAOA,GAAMC,gBAzPf3B,QAAQC,QAAQ2B,SAAW5B,QAAQE,QAIlCS,KAAM,SAONkB,kBAUAC,mBAIAC,WAAW,EAMXC,WAAY,WACX,MAAO,MAAQ3B,KAAKM,MAOrBL,MAAO,WAENgB,EAAEpB,OAAOG,KAAKwB,eAAiBxB,KAAKyB,iBAAmBzB,KAAKyB,gBAAgB,QAE5E,IAAIG,GAASV,UAAUlB,KAAKM,KAE5BW,GAAEW,GAAU5B,KAEZiB,EAAEV,GAAGqB,GAAU,SAASC,GACvB,GAAIC,GAAYC,MAAM1B,UAAU2B,MAAMC,KAAK9B,UAAW,GAClD+B,EAAOlC,KACPmC,EAAcnC,IAelB,OAdAA,MAAKoC,KAAK,WACT,GAAuB,gBAAZP,GAAsB,CAChC,GAAmB,MAAfA,EAAQ,KAAeZ,EAAEW,GAAQC,GACpC,KAAM,mBAAqBA,CAE5B,IAAIQ,GAAcpB,EAAEW,GAAQC,GAAS3B,MAAMe,EAAEW,IAAU5B,MAAMsC,OAAOR,GACpE,IAAIO,IAAgBH,GAAwBK,SAAhBF,EAE3B,MADAF,GAAcE,GACP,MAGRpB,GAAEW,GAAQY,QAAQxC,KAAM6B,KAGnBM,IAOTM,YAAa,SAASZ,GACrBZ,EAAEpB,OAAOG,KAAKwB,eAAgBK,QAS/BW,QAAS,SAASE,EAAMb,GAEvB,GADAa,EAAOzB,EAAEyB,IACLA,EAAKC,SAAS3C,KAAK2B,cAAvB,CAGAe,EAAKE,SAAS5C,KAAK2B,cACnBE,EAAUZ,EAAEpB,OAAOG,KAAK0B,aAAe1B,KAAKwB,eAAgBxB,KAAK6C,aAAaH,GAAOb,MACrF,IAAIK,GAAOjB,EAAEpB,QAAQS,KAAMN,KAAKM,KAAMoC,KAAMA,EAAMb,QAASA,GAAU7B,KAAK8C,cAAcJ,EAAMb,GAC9Fa,GAAKK,KAAK/C,KAAKM,KAAM4B,GACrBlC,KAAKgD,YAAYN,EAAMR,GACvBlC,KAAKiD,OAAOP,EAAMb,KAiBnBiB,cAAe,SAASJ,EAAMb,GAC7B,UAcDmB,YAAa,SAASN,EAAMR,KAU5BW,aAAc,SAASH,MACtB,IACC,GAAIK,MAAOL,KAAKK,KAAK/C,KAAKM,KAAK4C,gBAAkB,EACjDH,MAAOA,KAAK5B,QAAQ,UAAW,SAASgC,EAAGC,GAC1C,MAAOA,GAAI,IAAO,MAChBjC,QAAQ,mBAAoB,SAASC,EAAOC,EAAOgC,GACrD,GAAIC,GAAQP,KAAKQ,UAAU,EAAGF,GAAGjC,MAAM,KACvC,OAASkC,IAASA,EAAME,OAAS,IAAM,EAAyBnC,EAAQ,IAA7B,IAAMA,EAAQ,OACvDF,QAAQ,OAAQ,KACnB4B,KAAO9B,EAAEwC,UAAU,IAAMV,KAAO,IAChC,KAAK,GAAInC,OAAOmC,MACf,GAAIA,KAAKW,eAAe9C,KAAM,CAC7B,GAAI+C,OAAQZ,KAAKnC,IACI,iBAAV+C,QAAsBA,MAAMvC,MAAM,gCAC5C2B,KAAKnC,KAAOgD,KAAKD,QAIpB,MAAOZ,MAER,MAAOI,GACN,WAQFU,SAAU,SAASnB,GAClB,MAAOzB,GAAEyB,GAAMK,KAAK/C,KAAKM,WAiB1B2C,OAAQ,SAASP,EAAMpC,EAAMqD,GAC5BjB,EAAOzB,EAAEyB,EACT,IAAIR,GAAOQ,EAAKK,KAAK/C,KAAKM,MACtBuB,EAAUvB,KACd,QAAMA,GAAyB,gBAATA,IAAsC,mBAAVqD,IACjD9B,GAAWK,OAAYL,QACfA,GAAWvB,EAAOuB,EAAQvB,GAAQuB,QAEtCa,EAAKC,SAAS3C,KAAK2B,gBAGJ,gBAATrB,KACVuB,KACAA,EAAQvB,GAAQqD,GAEjB3D,KAAK8D,gBAAgBpB,EAAMR,EAAML,GACjCZ,EAAEpB,OAAOqC,EAAKL,QAASA,MAexBiC,gBAAiB,SAASpB,EAAMR,EAAML,KAOtCkC,QAAS,SAASrB,GACjBA,EAAOzB,EAAEyB,GACJA,EAAKC,SAAS3C,KAAK2B,gBAGxB3B,KAAKgE,YAAYtB,EAAM1C,KAAK6D,SAASnB,IACrCA,EAAKuB,WAAWjE,KAAKM,MAAM4D,YAAYlE,KAAK2B,gBAc7CqC,YAAa,SAAStB,EAAMR,OAgB7BjB,EAAEM,UAcD4C,aAAc,SAASC,EAAYC,GACR,gBAAfD,KACVC,EAAYD,EACZA,EAAa,YAEdA,EAAalD,UAAUkD,EACvB,IAAIE,GAAYpD,UAAUmD,EAAU/D,KACpCX,SAAQC,QAAQ0E,GAAa3E,QAAQC,QAAQwE,GAAYvE,OAAOwE,GAChE,GAAI1E,SAAQC,QAAQ0E,MAIpBC","file":"jquery.plugin.min.js"}
|
720
public/js/jquery/jquery.maskMoney.js
vendored
720
public/js/jquery/jquery.maskMoney.js
vendored
@ -1,720 +0,0 @@
|
||||
(function ($) {
|
||||
"use strict";
|
||||
if (!$.browser) {
|
||||
$.browser = {};
|
||||
$.browser.mozilla = /mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase());
|
||||
$.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase());
|
||||
$.browser.opera = /opera/.test(navigator.userAgent.toLowerCase());
|
||||
$.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());
|
||||
$.browser.device = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());
|
||||
}
|
||||
|
||||
var defaultOptions = {
|
||||
prefix: "",
|
||||
suffix: "",
|
||||
affixesStay: true,
|
||||
thousands: ",",
|
||||
decimal: ".",
|
||||
precision: 2,
|
||||
allowZero: false,
|
||||
allowNegative: false,
|
||||
doubleClickSelection: true,
|
||||
allowEmpty: false,
|
||||
bringCaretAtEndOnFocus: true
|
||||
},
|
||||
methods = {
|
||||
destroy: function () {
|
||||
$(this).unbind(".maskMoney");
|
||||
|
||||
if ($.browser.msie) {
|
||||
this.onpaste = null;
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
applyMask: function (value) {
|
||||
var $input = $(this);
|
||||
|
||||
// data-* api
|
||||
var settings = $input.data("settings");
|
||||
|
||||
return maskValue(value, settings);
|
||||
},
|
||||
mask: function (value) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
|
||||
if (typeof value === "number") {
|
||||
$this.val(value);
|
||||
}
|
||||
|
||||
return $this.trigger("mask");
|
||||
});
|
||||
},
|
||||
unmasked: function () {
|
||||
return this.map(function () {
|
||||
var value = ($(this).val() || "0"),
|
||||
isNegative = value.indexOf("-") !== -1,
|
||||
decimalPart;
|
||||
|
||||
// get the last position of the array that is a number(coercion makes "" to be evaluated as false)
|
||||
$(value.split(/\D/).reverse()).each(function (index, element) {
|
||||
if (element) {
|
||||
decimalPart = element;
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
value = value.replace(/\D/g, "");
|
||||
value = value.replace(new RegExp(decimalPart + "$"), "." + decimalPart);
|
||||
|
||||
if (isNegative) {
|
||||
value = "-" + value;
|
||||
}
|
||||
|
||||
return parseFloat(value);
|
||||
});
|
||||
},
|
||||
unmaskedWithOptions: function () {
|
||||
return this.map(function () {
|
||||
var value = ($(this).val() || "0"),
|
||||
settings = $(this).data("settings") || defaultOptions,
|
||||
regExp = new RegExp((settings.thousandsForUnmasked || settings.thousands), "g");
|
||||
|
||||
value = value.replace(regExp, "");
|
||||
|
||||
return parseFloat(value);
|
||||
});
|
||||
},
|
||||
init: function (parameters) {
|
||||
// the default options should not be shared with others
|
||||
parameters = $.extend($.extend({}, defaultOptions), parameters);
|
||||
|
||||
return this.each(function () {
|
||||
var $input = $(this), settings,
|
||||
onFocusValue;
|
||||
|
||||
// data-* api
|
||||
settings = $.extend({}, parameters);
|
||||
settings = $.extend(settings, $input.data());
|
||||
|
||||
// Store settings for use with the applyMask method.
|
||||
$input.data("settings", settings);
|
||||
|
||||
function getInputSelection() {
|
||||
var el = $input.get(0),
|
||||
start = 0,
|
||||
end = 0,
|
||||
normalizedValue,
|
||||
range,
|
||||
textInputRange,
|
||||
len,
|
||||
endRange;
|
||||
|
||||
if (typeof el.selectionStart === "number" && typeof el.selectionEnd === "number") {
|
||||
start = el.selectionStart;
|
||||
end = el.selectionEnd;
|
||||
} else {
|
||||
range = document.selection.createRange();
|
||||
|
||||
if (range && range.parentElement() === el) {
|
||||
len = el.value.length;
|
||||
normalizedValue = el.value.replace(/\r\n/g, "\n");
|
||||
|
||||
// Create a working TextRange that lives only in the input
|
||||
textInputRange = el.createTextRange();
|
||||
textInputRange.moveToBookmark(range.getBookmark());
|
||||
|
||||
// Check if the start and end of the selection are at the very end
|
||||
// of the input, since moveStart/moveEnd doesn't return what we want
|
||||
// in those cases
|
||||
endRange = el.createTextRange();
|
||||
endRange.collapse(false);
|
||||
|
||||
if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
|
||||
start = end = len;
|
||||
} else {
|
||||
start = -textInputRange.moveStart("character", -len);
|
||||
start += normalizedValue.slice(0, start).split("\n").length - 1;
|
||||
|
||||
if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
|
||||
end = len;
|
||||
} else {
|
||||
end = -textInputRange.moveEnd("character", -len);
|
||||
end += normalizedValue.slice(0, end).split("\n").length - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
start: start,
|
||||
end: end
|
||||
};
|
||||
} // getInputSelection
|
||||
|
||||
function canInputMoreNumbers() {
|
||||
var haventReachedMaxLength = !($input.val().length >= $input.attr("maxlength") && $input.attr("maxlength") >= 0),
|
||||
selection = getInputSelection(),
|
||||
start = selection.start,
|
||||
end = selection.end,
|
||||
haveNumberSelected = (selection.start !== selection.end && $input.val().substring(start, end).match(/\d/)) ? true : false,
|
||||
startWithZero = ($input.val().substring(0, 1) === "0");
|
||||
|
||||
return haventReachedMaxLength || haveNumberSelected || startWithZero;
|
||||
}
|
||||
|
||||
function setCursorPosition(pos) {
|
||||
// Do not set the position if
|
||||
// the we're formatting on blur.
|
||||
// This is because we do not want
|
||||
// to refocus on the control after
|
||||
// the blur.
|
||||
if (!!settings.formatOnBlur) {
|
||||
return;
|
||||
}
|
||||
|
||||
$input.each(function (index, elem) {
|
||||
if (elem.setSelectionRange) {
|
||||
elem.focus();
|
||||
|
||||
elem.setSelectionRange(pos, pos);
|
||||
} else if (elem.createTextRange) {
|
||||
var range = elem.createTextRange();
|
||||
|
||||
range.collapse(true);
|
||||
|
||||
range.moveEnd("character", pos);
|
||||
range.moveStart("character", pos);
|
||||
|
||||
range.select();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function maskAndPosition(startPos) {
|
||||
var originalLen = $input.val().length,
|
||||
newLen;
|
||||
|
||||
//$input.val(maskValue($input.val(), settings));
|
||||
|
||||
newLen = $input.val().length;
|
||||
|
||||
// If the we're using the reverse option,
|
||||
// do not put the cursor at the end of
|
||||
// the input. The reverse option allows
|
||||
// the user to input text from left to right.
|
||||
if (!settings.reverse) {
|
||||
startPos = startPos - (originalLen - newLen);
|
||||
}
|
||||
|
||||
setCursorPosition(startPos);
|
||||
}
|
||||
|
||||
function mask() {
|
||||
var value = $input.val();
|
||||
|
||||
if (settings.allowEmpty && value === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
var isNumber = !isNaN(value);
|
||||
var decimalPointIndex = isNumber ? value.indexOf(".") : value.indexOf(settings.decimal);
|
||||
|
||||
if (settings.precision > 0) {
|
||||
if (decimalPointIndex < 0) {
|
||||
value += settings.decimal + new Array(settings.precision + 1).join(0);
|
||||
} else {
|
||||
// If the following decimal part dosen't have enough length against the precision, it needs to be filled with zeros.
|
||||
var integerPart = value.slice(0, decimalPointIndex),
|
||||
decimalPart = value.slice(decimalPointIndex + 1);
|
||||
|
||||
var decimalPartLength = decimalPart.length;
|
||||
|
||||
if (decimalPartLength > settings.precision) {
|
||||
decimalPartLength = settings.precision;
|
||||
}
|
||||
|
||||
value = integerPart + settings.decimal + decimalPart +
|
||||
new Array((settings.precision + 1) - decimalPartLength).join(0);
|
||||
}
|
||||
} else if (decimalPointIndex > 0) {
|
||||
// if the precision is 0, discard the decimal part
|
||||
value = value.slice(0, decimalPointIndex);
|
||||
}
|
||||
|
||||
$input.val(maskValue(value, settings));
|
||||
}
|
||||
|
||||
function changeSign() {
|
||||
var inputValue = $input.val();
|
||||
|
||||
if (settings.allowNegative) {
|
||||
if (inputValue !== "" && inputValue.charAt(0) === "-") {
|
||||
return inputValue.replace("-", "");
|
||||
} else {
|
||||
return "-" + inputValue;
|
||||
}
|
||||
} else {
|
||||
return inputValue;
|
||||
}
|
||||
}
|
||||
|
||||
function preventDefault(e) {
|
||||
if (e.preventDefault) { //standard browsers
|
||||
e.preventDefault();
|
||||
} else { // old internet explorer
|
||||
e.returnValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
function fixMobile() {
|
||||
if ($.browser.device) {
|
||||
$input.attr("type", "tel");
|
||||
}
|
||||
}
|
||||
|
||||
function keypressEvent(e) {
|
||||
e = e || window.event;
|
||||
|
||||
var key = e.which || e.charCode || e.keyCode,
|
||||
decimalKeyCode = settings.decimal.charCodeAt(0);
|
||||
|
||||
//added to handle an IE "special" event
|
||||
if (key === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// any key except the numbers 0-9. if we're using settings.reverse,
|
||||
// allow the user to input the decimal key
|
||||
if ((key != decimalKeyCode) && (key < 48 || key > 57) && (key !== decimalKeyCode || !settings.reverse)) {
|
||||
return handleAllKeysExceptNumericalDigits(key, e);
|
||||
} else if (!canInputMoreNumbers()) {
|
||||
return false;
|
||||
} else {
|
||||
if (key === decimalKeyCode && shouldPreventDecimalKey()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (settings.formatOnBlur) {
|
||||
return true;
|
||||
}
|
||||
|
||||
preventDefault(e);
|
||||
|
||||
applyMask(e);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function shouldPreventDecimalKey() {
|
||||
// If all text is selected, we can accept the decimal
|
||||
// key because it will replace everything.
|
||||
if (isAllTextSelected()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return alreadyContainsDecimal();
|
||||
}
|
||||
|
||||
function isAllTextSelected() {
|
||||
var length = $input.val().length;
|
||||
var selection = getInputSelection();
|
||||
|
||||
// This should if all text is selected or if the
|
||||
// input is empty.
|
||||
return selection.start === 0 && selection.end === length;
|
||||
}
|
||||
|
||||
function alreadyContainsDecimal() {
|
||||
return $input.val().indexOf(settings.decimal) > -1;
|
||||
}
|
||||
|
||||
function applyMask(e) {
|
||||
e = e || window.event;
|
||||
|
||||
decimalKeyCode = settings.decimal.charCodeAt(0);
|
||||
|
||||
var key = e.which || e.charCode || e.keyCode,
|
||||
keyPressedChar = "",
|
||||
selection,
|
||||
startPos,
|
||||
endPos,
|
||||
value,
|
||||
decimalKeyCode = settings.decimal.charCodeAt(0);
|
||||
|
||||
if (key == decimalKeyCode) {
|
||||
keyPressedChar = String.fromCharCode(key);
|
||||
}
|
||||
|
||||
if (key >= 48 && key <= 57) {
|
||||
keyPressedChar = String.fromCharCode(key);
|
||||
}
|
||||
|
||||
selection = getInputSelection();
|
||||
|
||||
startPos = selection.start;
|
||||
endPos = selection.end;
|
||||
|
||||
value = $input.val();
|
||||
|
||||
$input.val(value.substring(0, startPos) + keyPressedChar + value.substring(endPos, value.length));
|
||||
|
||||
maskAndPosition(startPos + 1);
|
||||
}
|
||||
|
||||
function handleAllKeysExceptNumericalDigits(key, e) {
|
||||
var decimalKeyCode = settings.decimal.charCodeAt(0);
|
||||
|
||||
// -(minus) key
|
||||
if (key === 45) {
|
||||
$input.val(changeSign());
|
||||
|
||||
return false;
|
||||
// +(plus) key
|
||||
} else if (key === 43) {
|
||||
$input.val($input.val().replace("-", ""));
|
||||
|
||||
return false;
|
||||
// enter key or tab key
|
||||
} else if (key === 13 || key === 9) {
|
||||
return true;
|
||||
} else if ($.browser.mozilla && (key === 37 || key === 39) && e.charCode === 0) {
|
||||
// needed for left arrow key or right arrow key with firefox
|
||||
// the charCode part is to avoid allowing "%"(e.charCode 0, e.keyCode 37)
|
||||
return true;
|
||||
} else if (key == decimalKeyCode) {
|
||||
preventDefault(e);
|
||||
|
||||
return false;
|
||||
} else { // any other key with keycode less than 48 and greater than 57
|
||||
preventDefault(e);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function keydownEvent(e) {
|
||||
e = e || window.event;
|
||||
|
||||
var key = e.which || e.charCode || e.keyCode,
|
||||
selection,
|
||||
startPos,
|
||||
endPos,
|
||||
value,
|
||||
lastNumber;
|
||||
|
||||
//needed to handle an IE "special" event
|
||||
if (key === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
selection = getInputSelection();
|
||||
|
||||
startPos = selection.start;
|
||||
endPos = selection.end;
|
||||
|
||||
if (key === 8 || key === 46 || key === 63272) { // backspace or delete key (with special case for safari)
|
||||
preventDefault(e);
|
||||
|
||||
value = $input.val();
|
||||
|
||||
// not a selection
|
||||
if (startPos === endPos) {
|
||||
// backspace
|
||||
if (key === 8) {
|
||||
if (settings.suffix === "") {
|
||||
startPos -= 1;
|
||||
} else {
|
||||
// needed to find the position of the last number to be erased
|
||||
lastNumber = value.split("").reverse().join("").search(/\d/);
|
||||
startPos = value.length - lastNumber - 1;
|
||||
endPos = startPos + 1;
|
||||
}
|
||||
//delete
|
||||
} else {
|
||||
endPos += 1;
|
||||
}
|
||||
}
|
||||
|
||||
$input.val(value.substring(0, startPos) + value.substring(endPos, value.length));
|
||||
|
||||
maskAndPosition(startPos);
|
||||
|
||||
return false;
|
||||
} else if (key === 9) { // tab key
|
||||
return true;
|
||||
} else { // any other key
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function focusEvent() {
|
||||
onFocusValue = $input.val();
|
||||
|
||||
mask();
|
||||
|
||||
var input = $input.get(0),
|
||||
textRange;
|
||||
|
||||
if (!!settings.selectAllOnFocus) {
|
||||
input.select();
|
||||
} else if (input.createTextRange && settings.bringCaretAtEndOnFocus) {
|
||||
textRange = input.createTextRange();
|
||||
|
||||
textRange.collapse(false); // set the cursor at the end of the input
|
||||
textRange.select();
|
||||
}
|
||||
}
|
||||
|
||||
function focusoutEvent() {
|
||||
onFocusValue = $input.val();
|
||||
|
||||
mask();
|
||||
|
||||
var input = $input.get(0),
|
||||
textRange;
|
||||
|
||||
if (!!settings.selectAllOnFocus) {
|
||||
input.select();
|
||||
} else if (input.createTextRange && settings.bringCaretAtEndOnFocus) {
|
||||
textRange = input.createTextRange();
|
||||
|
||||
textRange.collapse(false); // set the cursor at the end of the input
|
||||
textRange.select();
|
||||
}
|
||||
}
|
||||
|
||||
function cutPasteEvent() {
|
||||
setTimeout(function () {
|
||||
mask();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function getDefaultMask() {
|
||||
var n = parseFloat("0") / Math.pow(10, settings.precision);
|
||||
|
||||
return (n.toFixed(settings.precision)).replace(new RegExp("\\.", "g"), settings.decimal);
|
||||
}
|
||||
|
||||
function blurEvent(e) {
|
||||
if ($.browser.msie) {
|
||||
keypressEvent(e);
|
||||
}
|
||||
|
||||
if (!!settings.formatOnBlur && $input.val() !== onFocusValue) {
|
||||
applyMask(e);
|
||||
}
|
||||
|
||||
if ($input.val() === "" && settings.allowEmpty) {
|
||||
$input.val("");
|
||||
} else if ($input.val() === "" || $input.val() === setSymbol(getDefaultMask(), settings)) {
|
||||
if (!settings.allowZero) {
|
||||
$input.val("");
|
||||
} else if (!settings.affixesStay) {
|
||||
$input.val(getDefaultMask());
|
||||
} else {
|
||||
$input.val(setSymbol(getDefaultMask(), settings));
|
||||
}
|
||||
} else {
|
||||
if (!settings.affixesStay) {
|
||||
var newValue = $input.val().replace(settings.prefix, "").replace(settings.suffix, "");
|
||||
|
||||
$input.val(newValue);
|
||||
}
|
||||
}
|
||||
|
||||
if ($input.val() !== onFocusValue) {
|
||||
$input.change();
|
||||
}
|
||||
}
|
||||
|
||||
function clickEvent() {
|
||||
var input = $input.get(0),
|
||||
length;
|
||||
|
||||
if (!!settings.selectAllOnFocus) {
|
||||
// selectAllOnFocus will be handled by
|
||||
// the focus event. The focus event is
|
||||
// also fired when the input is clicked.
|
||||
return;
|
||||
} else if (input.setSelectionRange && settings.bringCaretAtEndOnFocus) {
|
||||
length = $input.val().length;
|
||||
|
||||
//input.setSelectionRange(length, length);
|
||||
} else {
|
||||
$input.val($input.val());
|
||||
}
|
||||
}
|
||||
|
||||
function doubleClickEvent() {
|
||||
var input = $input.get(0),
|
||||
start,
|
||||
length;
|
||||
|
||||
if (input.setSelectionRange && settings.bringCaretAtEndOnFocus) {
|
||||
length = $input.val().length;
|
||||
|
||||
start = settings.doubleClickSelection ? 0 : length;
|
||||
|
||||
//input.setSelectionRange(start, length);
|
||||
} else {
|
||||
$input.val($input.val());
|
||||
}
|
||||
}
|
||||
|
||||
fixMobile();
|
||||
|
||||
$input.unbind(".maskMoney");
|
||||
$input.bind("keypress.maskMoney", keypressEvent);
|
||||
$input.bind("keydown.maskMoney", keydownEvent);
|
||||
$input.bind("blur.maskMoney", blurEvent);
|
||||
$input.bind("focus.maskMoney", focusEvent);
|
||||
$input.bind("focusout.maskMoney", focusoutEvent);
|
||||
$input.bind("click.maskMoney", clickEvent);
|
||||
$input.bind("dblclick.maskMoney", doubleClickEvent);
|
||||
$input.bind("cut.maskMoney", cutPasteEvent);
|
||||
$input.bind("paste.maskMoney", cutPasteEvent);
|
||||
$input.bind("mask.maskMoney", mask);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function setSymbol(value, settings) {
|
||||
var operator = "";
|
||||
|
||||
if (value.indexOf("-") > -1) {
|
||||
value = value.replace("-", "");
|
||||
operator = "-";
|
||||
}
|
||||
|
||||
if (value.indexOf(settings.prefix) > -1) {
|
||||
value = value.replace(settings.prefix, "");
|
||||
}
|
||||
|
||||
if (value.indexOf(settings.suffix) > -1) {
|
||||
value = value.replace(settings.suffix, "");
|
||||
}
|
||||
|
||||
return operator + settings.prefix + value + settings.suffix;
|
||||
}
|
||||
|
||||
function maskValue(value, settings) {
|
||||
if (settings.allowEmpty && value === "") {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (!!settings.reverse) {
|
||||
return maskValueReverse(value, settings);
|
||||
}
|
||||
|
||||
return maskValueStandard(value, settings);
|
||||
}
|
||||
|
||||
function maskValueStandard(value, settings) {
|
||||
var negative = (value.indexOf("-") > -1 && settings.allowNegative) ? "-" : "",
|
||||
onlyNumbers = value.replace(/[^0-9]/g, ""),
|
||||
valueWithoutSymbol = value.replace(settings.prefix, "").replace(settings.suffix, "");
|
||||
|
||||
var input_precision = value.length - value.lastIndexOf(settings.decimal) - 1;
|
||||
|
||||
if (settings.precision == 0) {
|
||||
input_precision = 0;
|
||||
}
|
||||
|
||||
var integerPart = onlyNumbers.slice(0, onlyNumbers.length - input_precision),
|
||||
newValue,
|
||||
decimalPart,
|
||||
leadingZeros;
|
||||
|
||||
if (settings.suffix != '' && value.length != valueWithoutSymbol.length) {
|
||||
input_precision = valueWithoutSymbol.length - valueWithoutSymbol.lastIndexOf(settings.decimal) - 1;
|
||||
|
||||
if (settings.precision == 0) {
|
||||
input_precision = 0;
|
||||
}
|
||||
|
||||
integerPart = onlyNumbers.slice(0, onlyNumbers.length - input_precision);
|
||||
}
|
||||
|
||||
newValue = buildIntegerPart(integerPart, negative, settings);
|
||||
|
||||
if (settings.precision > 0) {
|
||||
if(!isNaN(value) && value.indexOf(".")){
|
||||
var precision = value.substr(value.indexOf(".") + 1);
|
||||
|
||||
onlyNumbers += new Array((settings.precision + 1) - precision.length).join(0);
|
||||
|
||||
integerPart = onlyNumbers.slice(0, onlyNumbers.length - input_precision);
|
||||
|
||||
newValue = buildIntegerPart(integerPart, negative, settings);
|
||||
}
|
||||
|
||||
decimalPart = onlyNumbers.slice(onlyNumbers.length - input_precision, (onlyNumbers.length - input_precision) + settings.precision);
|
||||
|
||||
leadingZeros = new Array((settings.precision + 1) - decimalPart.length).join(0);
|
||||
|
||||
newValue += settings.decimal + leadingZeros + decimalPart;
|
||||
}
|
||||
|
||||
return setSymbol(newValue, settings);
|
||||
}
|
||||
|
||||
function maskValueReverse(value, settings) {
|
||||
var negative = (value.indexOf("-") > -1 && settings.allowNegative) ? "-" : "",
|
||||
valueWithoutSymbol = value.replace(settings.prefix, "").replace(settings.suffix, ""),
|
||||
integerPart = valueWithoutSymbol.split(settings.decimal)[0],
|
||||
newValue,
|
||||
decimalPart = "";
|
||||
|
||||
if (integerPart === "") {
|
||||
integerPart = "0";
|
||||
}
|
||||
|
||||
newValue = buildIntegerPart(integerPart, negative, settings);
|
||||
|
||||
if (settings.precision > 0) {
|
||||
var arr = valueWithoutSymbol.split(settings.decimal);
|
||||
|
||||
if (arr.length > 1) {
|
||||
decimalPart = arr[1];
|
||||
}
|
||||
|
||||
newValue += settings.decimal + decimalPart;
|
||||
|
||||
var rounded = Number.parseFloat((integerPart + "." + decimalPart)).toFixed(settings.precision);
|
||||
|
||||
var roundedDecimalPart = rounded.toString().split(settings.decimal)[1];
|
||||
|
||||
newValue = newValue.split(settings.decimal)[0] + "." + roundedDecimalPart;
|
||||
}
|
||||
|
||||
return setSymbol(newValue, settings);
|
||||
}
|
||||
|
||||
function buildIntegerPart(integerPart, negative, settings) {
|
||||
// remove initial zeros
|
||||
integerPart = integerPart.replace(/^0*/g, "");
|
||||
|
||||
// put settings.thousands every 3 chars
|
||||
integerPart = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, settings.thousands);
|
||||
|
||||
if (integerPart === "") {
|
||||
integerPart = "0";
|
||||
}
|
||||
|
||||
return negative + integerPart;
|
||||
}
|
||||
|
||||
$.fn.maskMoney = function (method) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
} else if (typeof method === "object" || !method) {
|
||||
return methods.init.apply(this, arguments);
|
||||
} else {
|
||||
$.error("Method " + method + " does not exist on jQuery.maskMoney");
|
||||
}
|
||||
};
|
||||
})(window.jQuery || window.Zepto);
|
694
public/js/lightbox/ekko-lightbox.js
vendored
694
public/js/lightbox/ekko-lightbox.js
vendored
@ -1,694 +0,0 @@
|
||||
/*!
|
||||
* Lightbox for Bootstrap by @ashleydw
|
||||
* https://github.com/ashleydw/lightbox
|
||||
*
|
||||
* License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
|
||||
*/
|
||||
+function ($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
var Lightbox = (function ($) {
|
||||
|
||||
var NAME = 'ekkoLightbox';
|
||||
var JQUERY_NO_CONFLICT = $.fn[NAME];
|
||||
|
||||
var Default = {
|
||||
title: '',
|
||||
footer: '',
|
||||
maxWidth: 9999,
|
||||
maxHeight: 9999,
|
||||
showArrows: true, //display the left / right arrows or not
|
||||
wrapping: true, //if true, gallery loops infinitely
|
||||
type: null, //force the lightbox into image / youtube mode. if null, or not image|youtube|vimeo; detect it
|
||||
alwaysShowClose: false, //always show the close button, even if there is no title
|
||||
loadingMessage: '<div class="ekko-lightbox-loader"><div><div></div><div></div></div></div>', // http://tobiasahlin.com/spinkit/
|
||||
leftArrow: '<span>❮</span>',
|
||||
rightArrow: '<span>❯</span>',
|
||||
strings: {
|
||||
close: 'Close',
|
||||
fail: 'Failed to load image:',
|
||||
type: 'Could not detect remote target type. Force the type using data-type'
|
||||
},
|
||||
doc: document, // if in an iframe can specify top.document
|
||||
onShow: function onShow() {},
|
||||
onShown: function onShown() {},
|
||||
onHide: function onHide() {},
|
||||
onHidden: function onHidden() {},
|
||||
onNavigate: function onNavigate() {},
|
||||
onContentLoaded: function onContentLoaded() {}
|
||||
};
|
||||
|
||||
var Lightbox = (function () {
|
||||
_createClass(Lightbox, null, [{
|
||||
key: 'Default',
|
||||
|
||||
/**
|
||||
Class properties:
|
||||
_$element: null -> the <a> element currently being displayed
|
||||
_$modal: The bootstrap modal generated
|
||||
_$modalDialog: The .modal-dialog
|
||||
_$modalContent: The .modal-content
|
||||
_$modalBody: The .modal-body
|
||||
_$modalHeader: The .modal-header
|
||||
_$modalFooter: The .modal-footer
|
||||
_$lightboxContainerOne: Container of the first lightbox element
|
||||
_$lightboxContainerTwo: Container of the second lightbox element
|
||||
_$lightboxBody: First element in the container
|
||||
_$modalArrows: The overlayed arrows container
|
||||
_$galleryItems: Other <a>'s available for this gallery
|
||||
_galleryName: Name of the current data('gallery') showing
|
||||
_galleryIndex: The current index of the _$galleryItems being shown
|
||||
_config: {} the options for the modal
|
||||
_modalId: unique id for the current lightbox
|
||||
_padding / _border: CSS properties for the modal container; these are used to calculate the available space for the content
|
||||
*/
|
||||
|
||||
get: function get() {
|
||||
return Default;
|
||||
}
|
||||
}]);
|
||||
|
||||
function Lightbox($element, config) {
|
||||
var _this = this;
|
||||
|
||||
_classCallCheck(this, Lightbox);
|
||||
|
||||
this._config = $.extend({}, Default, config);
|
||||
this._$modalArrows = null;
|
||||
this._galleryIndex = 0;
|
||||
this._galleryName = null;
|
||||
this._padding = null;
|
||||
this._border = null;
|
||||
this._titleIsShown = false;
|
||||
this._footerIsShown = false;
|
||||
this._wantedWidth = 0;
|
||||
this._wantedHeight = 0;
|
||||
this._touchstartX = 0;
|
||||
this._touchendX = 0;
|
||||
|
||||
this._modalId = 'ekkoLightbox-' + Math.floor(Math.random() * 1000 + 1);
|
||||
this._$element = $element instanceof jQuery ? $element : $($element);
|
||||
|
||||
this._isBootstrap3 = $.fn.modal.Constructor.VERSION[0] == 3;
|
||||
|
||||
var h4 = '<h4 class="modal-title">' + (this._config.title || " ") + '</h4>';
|
||||
var btn = '<button type="button" class="close" data-dismiss="modal" aria-label="' + this._config.strings.close + '"><span aria-hidden="true">×</span></button>';
|
||||
|
||||
var header = '<div class="modal-header' + (this._config.title || this._config.alwaysShowClose ? '' : ' hide') + '">' + (this._isBootstrap3 ? btn + h4 : h4 + btn) + '</div>';
|
||||
var footer = '<div class="modal-footer' + (this._config.footer ? '' : ' hide') + '">' + (this._config.footer || " ") + '</div>';
|
||||
var body = '<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in show"></div><div class="ekko-lightbox-item fade"></div></div></div>';
|
||||
var dialog = '<div class="modal-dialog" role="document"><div class="modal-content">' + header + body + footer + '</div></div>';
|
||||
$(this._config.doc.body).append('<div id="' + this._modalId + '" class="ekko-lightbox modal fade" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">' + dialog + '</div>');
|
||||
|
||||
this._$modal = $('#' + this._modalId, this._config.doc);
|
||||
this._$modalDialog = this._$modal.find('.modal-dialog').first();
|
||||
this._$modalContent = this._$modal.find('.modal-content').first();
|
||||
this._$modalBody = this._$modal.find('.modal-body').first();
|
||||
this._$modalHeader = this._$modal.find('.modal-header').first();
|
||||
this._$modalFooter = this._$modal.find('.modal-footer').first();
|
||||
|
||||
this._$lightboxContainer = this._$modalBody.find('.ekko-lightbox-container').first();
|
||||
this._$lightboxBodyOne = this._$lightboxContainer.find('> div:first-child').first();
|
||||
this._$lightboxBodyTwo = this._$lightboxContainer.find('> div:last-child').first();
|
||||
|
||||
this._border = this._calculateBorders();
|
||||
this._padding = this._calculatePadding();
|
||||
|
||||
this._galleryName = this._$element.data('gallery');
|
||||
if (this._galleryName) {
|
||||
this._$galleryItems = $(document.body).find('*[data-gallery="' + this._galleryName + '"]');
|
||||
this._galleryIndex = this._$galleryItems.index(this._$element);
|
||||
$(document).on('keydown.ekkoLightbox', this._navigationalBinder.bind(this));
|
||||
|
||||
// add the directional arrows to the modal
|
||||
if (this._config.showArrows && this._$galleryItems.length > 1) {
|
||||
this._$lightboxContainer.append('<div class="ekko-lightbox-nav-overlay"><a href="#">' + this._config.leftArrow + '</a><a href="#">' + this._config.rightArrow + '</a></div>');
|
||||
this._$modalArrows = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay').first();
|
||||
this._$lightboxContainer.on('click', 'a:first-child', function (event) {
|
||||
event.preventDefault();
|
||||
return _this.navigateLeft();
|
||||
});
|
||||
this._$lightboxContainer.on('click', 'a:last-child', function (event) {
|
||||
event.preventDefault();
|
||||
return _this.navigateRight();
|
||||
});
|
||||
this.updateNavigation();
|
||||
}
|
||||
}
|
||||
|
||||
this._$modal.on('show.bs.modal', this._config.onShow.bind(this)).on('shown.bs.modal', function () {
|
||||
_this._toggleLoading(true);
|
||||
_this._handle();
|
||||
return _this._config.onShown.call(_this);
|
||||
}).on('hide.bs.modal', this._config.onHide.bind(this)).on('hidden.bs.modal', function () {
|
||||
if (_this._galleryName) {
|
||||
$(document).off('keydown.ekkoLightbox');
|
||||
$(window).off('resize.ekkoLightbox');
|
||||
}
|
||||
_this._$modal.remove();
|
||||
return _this._config.onHidden.call(_this);
|
||||
}).modal(this._config);
|
||||
|
||||
$(window).on('resize.ekkoLightbox', function () {
|
||||
_this._resize(_this._wantedWidth, _this._wantedHeight);
|
||||
});
|
||||
this._$lightboxContainer.on('touchstart', function () {
|
||||
_this._touchstartX = event.changedTouches[0].screenX;
|
||||
}).on('touchend', function () {
|
||||
_this._touchendX = event.changedTouches[0].screenX;
|
||||
_this._swipeGesure();
|
||||
});
|
||||
}
|
||||
|
||||
_createClass(Lightbox, [{
|
||||
key: 'element',
|
||||
value: function element() {
|
||||
return this._$element;
|
||||
}
|
||||
}, {
|
||||
key: 'modal',
|
||||
value: function modal() {
|
||||
return this._$modal;
|
||||
}
|
||||
}, {
|
||||
key: 'navigateTo',
|
||||
value: function navigateTo(index) {
|
||||
|
||||
if (index < 0 || index > this._$galleryItems.length - 1) return this;
|
||||
|
||||
this._galleryIndex = index;
|
||||
|
||||
this.updateNavigation();
|
||||
|
||||
this._$element = $(this._$galleryItems.get(this._galleryIndex));
|
||||
this._handle();
|
||||
}
|
||||
}, {
|
||||
key: 'navigateLeft',
|
||||
value: function navigateLeft() {
|
||||
|
||||
if (!this._$galleryItems) return;
|
||||
|
||||
if (this._$galleryItems.length === 1) return;
|
||||
|
||||
if (this._galleryIndex === 0) {
|
||||
if (this._config.wrapping) this._galleryIndex = this._$galleryItems.length - 1;else return;
|
||||
} else //circular
|
||||
this._galleryIndex--;
|
||||
|
||||
this._config.onNavigate.call(this, 'left', this._galleryIndex);
|
||||
return this.navigateTo(this._galleryIndex);
|
||||
}
|
||||
}, {
|
||||
key: 'navigateRight',
|
||||
value: function navigateRight() {
|
||||
|
||||
if (!this._$galleryItems) return;
|
||||
|
||||
if (this._$galleryItems.length === 1) return;
|
||||
|
||||
if (this._galleryIndex === this._$galleryItems.length - 1) {
|
||||
if (this._config.wrapping) this._galleryIndex = 0;else return;
|
||||
} else //circular
|
||||
this._galleryIndex++;
|
||||
|
||||
this._config.onNavigate.call(this, 'right', this._galleryIndex);
|
||||
return this.navigateTo(this._galleryIndex);
|
||||
}
|
||||
}, {
|
||||
key: 'updateNavigation',
|
||||
value: function updateNavigation() {
|
||||
if (!this._config.wrapping) {
|
||||
var $nav = this._$lightboxContainer.find('div.ekko-lightbox-nav-overlay');
|
||||
if (this._galleryIndex === 0) $nav.find('a:first-child').addClass('disabled');else $nav.find('a:first-child').removeClass('disabled');
|
||||
|
||||
if (this._galleryIndex === this._$galleryItems.length - 1) $nav.find('a:last-child').addClass('disabled');else $nav.find('a:last-child').removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'close',
|
||||
value: function close() {
|
||||
return this._$modal.modal('hide');
|
||||
}
|
||||
|
||||
// helper private methods
|
||||
}, {
|
||||
key: '_navigationalBinder',
|
||||
value: function _navigationalBinder(event) {
|
||||
event = event || window.event;
|
||||
if (event.keyCode === 39) return this.navigateRight();
|
||||
if (event.keyCode === 37) return this.navigateLeft();
|
||||
}
|
||||
|
||||
// type detection private methods
|
||||
}, {
|
||||
key: '_detectRemoteType',
|
||||
value: function _detectRemoteType(src, type) {
|
||||
|
||||
type = type || false;
|
||||
|
||||
if (!type && this._isImage(src)) type = 'image';
|
||||
if (!type && this._getYoutubeId(src)) type = 'youtube';
|
||||
if (!type && this._getVimeoId(src)) type = 'vimeo';
|
||||
if (!type && this._getInstagramId(src)) type = 'instagram';
|
||||
if (type == 'audio' || type == 'video' || !type && this._isMedia(src)) type = 'media';
|
||||
if (!type || ['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(type) < 0) type = 'url';
|
||||
|
||||
return type;
|
||||
}
|
||||
}, {
|
||||
key: '_getRemoteContentType',
|
||||
value: function _getRemoteContentType(src) {
|
||||
var response = $.ajax({
|
||||
type: 'HEAD',
|
||||
url: src,
|
||||
async: false
|
||||
});
|
||||
var contentType = response.getResponseHeader('Content-Type');
|
||||
return contentType;
|
||||
}
|
||||
}, {
|
||||
key: '_isImage',
|
||||
value: function _isImage(string) {
|
||||
return string && string.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
|
||||
}
|
||||
}, {
|
||||
key: '_isMedia',
|
||||
value: function _isMedia(string) {
|
||||
return string && string.match(/(\.(mp3|mp4|ogg|webm|wav)((\?|#).*)?$)/i);
|
||||
}
|
||||
}, {
|
||||
key: '_containerToUse',
|
||||
value: function _containerToUse() {
|
||||
var _this2 = this;
|
||||
|
||||
// if currently showing an image, fade it out and remove
|
||||
var $toUse = this._$lightboxBodyTwo;
|
||||
var $current = this._$lightboxBodyOne;
|
||||
|
||||
if (this._$lightboxBodyTwo.hasClass('in')) {
|
||||
$toUse = this._$lightboxBodyOne;
|
||||
$current = this._$lightboxBodyTwo;
|
||||
}
|
||||
|
||||
$current.removeClass('in show');
|
||||
setTimeout(function () {
|
||||
if (!_this2._$lightboxBodyTwo.hasClass('in')) _this2._$lightboxBodyTwo.empty();
|
||||
if (!_this2._$lightboxBodyOne.hasClass('in')) _this2._$lightboxBodyOne.empty();
|
||||
}, 500);
|
||||
|
||||
$toUse.addClass('in show');
|
||||
return $toUse;
|
||||
}
|
||||
}, {
|
||||
key: '_handle',
|
||||
value: function _handle() {
|
||||
|
||||
var $toUse = this._containerToUse();
|
||||
this._updateTitleAndFooter();
|
||||
|
||||
var currentRemote = this._$element.attr('data-remote') || this._$element.attr('href');
|
||||
var currentType = this._detectRemoteType(currentRemote, this._$element.attr('data-type') || false);
|
||||
|
||||
if (['image', 'youtube', 'vimeo', 'instagram', 'media', 'url'].indexOf(currentType) < 0) return this._error(this._config.strings.type);
|
||||
|
||||
switch (currentType) {
|
||||
case 'image':
|
||||
this._preloadImage(currentRemote, $toUse);
|
||||
this._preloadImageByIndex(this._galleryIndex, 3);
|
||||
break;
|
||||
case 'youtube':
|
||||
this._showYoutubeVideo(currentRemote, $toUse);
|
||||
break;
|
||||
case 'vimeo':
|
||||
this._showVimeoVideo(this._getVimeoId(currentRemote), $toUse);
|
||||
break;
|
||||
case 'instagram':
|
||||
this._showInstagramVideo(this._getInstagramId(currentRemote), $toUse);
|
||||
break;
|
||||
case 'media':
|
||||
this._showHtml5Media(currentRemote, $toUse);
|
||||
break;
|
||||
default:
|
||||
// url
|
||||
this._loadRemoteContent(currentRemote, $toUse);
|
||||
break;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_getYoutubeId',
|
||||
value: function _getYoutubeId(string) {
|
||||
if (!string) return false;
|
||||
var matches = string.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);
|
||||
return matches && matches[2].length === 11 ? matches[2] : false;
|
||||
}
|
||||
}, {
|
||||
key: '_getVimeoId',
|
||||
value: function _getVimeoId(string) {
|
||||
return string && string.indexOf('vimeo') > 0 ? string : false;
|
||||
}
|
||||
}, {
|
||||
key: '_getInstagramId',
|
||||
value: function _getInstagramId(string) {
|
||||
return string && string.indexOf('instagram') > 0 ? string : false;
|
||||
}
|
||||
|
||||
// layout private methods
|
||||
}, {
|
||||
key: '_toggleLoading',
|
||||
value: function _toggleLoading(show) {
|
||||
show = show || false;
|
||||
if (show) {
|
||||
this._$modalDialog.css('display', 'none');
|
||||
this._$modal.removeClass('in show');
|
||||
$('.modal-backdrop').append(this._config.loadingMessage);
|
||||
} else {
|
||||
this._$modalDialog.css('display', 'block');
|
||||
this._$modal.addClass('in show');
|
||||
$('.modal-backdrop').find('.ekko-lightbox-loader').remove();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_calculateBorders',
|
||||
value: function _calculateBorders() {
|
||||
return {
|
||||
top: this._totalCssByAttribute('border-top-width'),
|
||||
right: this._totalCssByAttribute('border-right-width'),
|
||||
bottom: this._totalCssByAttribute('border-bottom-width'),
|
||||
left: this._totalCssByAttribute('border-left-width')
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: '_calculatePadding',
|
||||
value: function _calculatePadding() {
|
||||
return {
|
||||
top: this._totalCssByAttribute('padding-top'),
|
||||
right: this._totalCssByAttribute('padding-right'),
|
||||
bottom: this._totalCssByAttribute('padding-bottom'),
|
||||
left: this._totalCssByAttribute('padding-left')
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: '_totalCssByAttribute',
|
||||
value: function _totalCssByAttribute(attribute) {
|
||||
return parseInt(this._$modalDialog.css(attribute), 10) + parseInt(this._$modalContent.css(attribute), 10) + parseInt(this._$modalBody.css(attribute), 10);
|
||||
}
|
||||
}, {
|
||||
key: '_updateTitleAndFooter',
|
||||
value: function _updateTitleAndFooter() {
|
||||
var title = this._$element.data('title') || "";
|
||||
var caption = this._$element.data('footer') || "";
|
||||
|
||||
this._titleIsShown = false;
|
||||
if (title || this._config.alwaysShowClose) {
|
||||
this._titleIsShown = true;
|
||||
this._$modalHeader.css('display', '').find('.modal-title').html(title || " ");
|
||||
} else this._$modalHeader.css('display', 'none');
|
||||
|
||||
this._footerIsShown = false;
|
||||
if (caption) {
|
||||
this._footerIsShown = true;
|
||||
this._$modalFooter.css('display', '').html(caption);
|
||||
} else this._$modalFooter.css('display', 'none');
|
||||
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_showYoutubeVideo',
|
||||
value: function _showYoutubeVideo(remote, $containerForElement) {
|
||||
var id = this._getYoutubeId(remote);
|
||||
var query = remote.indexOf('&') > 0 ? remote.substr(remote.indexOf('&')) : '';
|
||||
var width = this._$element.data('width') || 560;
|
||||
var height = this._$element.data('height') || width / (560 / 315);
|
||||
return this._showVideoIframe('//www.youtube.com/embed/' + id + '?badge=0&autoplay=1&html5=1' + query, width, height, $containerForElement);
|
||||
}
|
||||
}, {
|
||||
key: '_showVimeoVideo',
|
||||
value: function _showVimeoVideo(id, $containerForElement) {
|
||||
var width = this._$element.data('width') || 500;
|
||||
var height = this._$element.data('height') || width / (560 / 315);
|
||||
return this._showVideoIframe(id + '?autoplay=1', width, height, $containerForElement);
|
||||
}
|
||||
}, {
|
||||
key: '_showInstagramVideo',
|
||||
value: function _showInstagramVideo(id, $containerForElement) {
|
||||
// instagram load their content into iframe's so this can be put straight into the element
|
||||
var width = this._$element.data('width') || 612;
|
||||
var height = width + 80;
|
||||
id = id.substr(-1) !== '/' ? id + '/' : id; // ensure id has trailing slash
|
||||
$containerForElement.html('<iframe width="' + width + '" height="' + height + '" src="' + id + 'embed/" frameborder="0" allowfullscreen></iframe>');
|
||||
this._resize(width, height);
|
||||
this._config.onContentLoaded.call(this);
|
||||
if (this._$modalArrows) //hide the arrows when showing video
|
||||
this._$modalArrows.css('display', 'none');
|
||||
this._toggleLoading(false);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_showVideoIframe',
|
||||
value: function _showVideoIframe(url, width, height, $containerForElement) {
|
||||
// should be used for videos only. for remote content use loadRemoteContent (data-type=url)
|
||||
height = height || width; // default to square
|
||||
$containerForElement.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="' + width + '" height="' + height + '" src="' + url + '" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>');
|
||||
this._resize(width, height);
|
||||
this._config.onContentLoaded.call(this);
|
||||
if (this._$modalArrows) this._$modalArrows.css('display', 'none'); //hide the arrows when showing video
|
||||
this._toggleLoading(false);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_showHtml5Media',
|
||||
value: function _showHtml5Media(url, $containerForElement) {
|
||||
// should be used for videos only. for remote content use loadRemoteContent (data-type=url)
|
||||
var contentType = this._getRemoteContentType(url);
|
||||
if (!contentType) {
|
||||
return this._error(this._config.strings.type);
|
||||
}
|
||||
var mediaType = '';
|
||||
if (contentType.indexOf('audio') > 0) {
|
||||
mediaType = 'audio';
|
||||
} else {
|
||||
mediaType = 'video';
|
||||
}
|
||||
var width = this._$element.data('width') || 560;
|
||||
var height = this._$element.data('height') || width / (560 / 315);
|
||||
$containerForElement.html('<div class="embed-responsive embed-responsive-16by9"><' + mediaType + ' width="' + width + '" height="' + height + '" preload="auto" autoplay controls class="embed-responsive-item"><source src="' + url + '" type="' + contentType + '">' + this._config.strings.type + '</' + mediaType + '></div>');
|
||||
this._resize(width, height);
|
||||
this._config.onContentLoaded.call(this);
|
||||
if (this._$modalArrows) this._$modalArrows.css('display', 'none'); //hide the arrows when showing video
|
||||
this._toggleLoading(false);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_loadRemoteContent',
|
||||
value: function _loadRemoteContent(url, $containerForElement) {
|
||||
var _this3 = this;
|
||||
|
||||
var width = this._$element.data('width') || 560;
|
||||
var height = this._$element.data('height') || 560;
|
||||
|
||||
var disableExternalCheck = this._$element.data('disableExternalCheck') || false;
|
||||
this._toggleLoading(false);
|
||||
|
||||
// external urls are loading into an iframe
|
||||
// local ajax can be loaded into the container itself
|
||||
if (!disableExternalCheck && !this._isExternal(url)) {
|
||||
$containerForElement.load(url, $.proxy(function () {
|
||||
return _this3._$element.trigger('loaded.bs.modal');l;
|
||||
}));
|
||||
} else {
|
||||
$containerForElement.html('<iframe src="' + url + '" frameborder="0" allowfullscreen></iframe>');
|
||||
this._config.onContentLoaded.call(this);
|
||||
}
|
||||
|
||||
if (this._$modalArrows) //hide the arrows when remote content
|
||||
this._$modalArrows.css('display', 'none');
|
||||
|
||||
this._resize(width, height);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_isExternal',
|
||||
value: function _isExternal(url) {
|
||||
var match = url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);
|
||||
if (typeof match[1] === "string" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol) return true;
|
||||
|
||||
if (typeof match[2] === "string" && match[2].length > 0 && match[2].replace(new RegExp(':(' + ({
|
||||
"http:": 80,
|
||||
"https:": 443
|
||||
})[location.protocol] + ')?$'), "") !== location.host) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}, {
|
||||
key: '_error',
|
||||
value: function _error(message) {
|
||||
console.error(message);
|
||||
this._containerToUse().html(message);
|
||||
this._resize(300, 300);
|
||||
return this;
|
||||
}
|
||||
}, {
|
||||
key: '_preloadImageByIndex',
|
||||
value: function _preloadImageByIndex(startIndex, numberOfTimes) {
|
||||
|
||||
if (!this._$galleryItems) return;
|
||||
|
||||
var next = $(this._$galleryItems.get(startIndex), false);
|
||||
if (typeof next == 'undefined') return;
|
||||
|
||||
var src = next.attr('data-remote') || next.attr('href');
|
||||
if (next.attr('data-type') === 'image' || this._isImage(src)) this._preloadImage(src, false);
|
||||
|
||||
if (numberOfTimes > 0) return this._preloadImageByIndex(startIndex + 1, numberOfTimes - 1);
|
||||
}
|
||||
}, {
|
||||
key: '_preloadImage',
|
||||
value: function _preloadImage(src, $containerForImage) {
|
||||
var _this4 = this;
|
||||
|
||||
$containerForImage = $containerForImage || false;
|
||||
|
||||
var img = new Image();
|
||||
if ($containerForImage) {
|
||||
(function () {
|
||||
|
||||
// if loading takes > 200ms show a loader
|
||||
var loadingTimeout = setTimeout(function () {
|
||||
$containerForImage.append(_this4._config.loadingMessage);
|
||||
}, 200);
|
||||
|
||||
img.onload = function () {
|
||||
if (loadingTimeout) clearTimeout(loadingTimeout);
|
||||
loadingTimeout = null;
|
||||
var image = $('<img />');
|
||||
image.attr('src', img.src);
|
||||
image.addClass('img-fluid');
|
||||
|
||||
// backward compatibility for bootstrap v3
|
||||
image.css('width', '100%');
|
||||
|
||||
$containerForImage.html(image);
|
||||
if (_this4._$modalArrows) _this4._$modalArrows.css('display', ''); // remove display to default to css property
|
||||
|
||||
_this4._resize(img.width, img.height);
|
||||
_this4._toggleLoading(false);
|
||||
return _this4._config.onContentLoaded.call(_this4);
|
||||
};
|
||||
img.onerror = function () {
|
||||
_this4._toggleLoading(false);
|
||||
return _this4._error(_this4._config.strings.fail + (' ' + src));
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
||||
img.src = src;
|
||||
return img;
|
||||
}
|
||||
}, {
|
||||
key: '_swipeGesure',
|
||||
value: function _swipeGesure() {
|
||||
if (this._touchendX < this._touchstartX) {
|
||||
return this.navigateRight();
|
||||
}
|
||||
if (this._touchendX > this._touchstartX) {
|
||||
return this.navigateLeft();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: '_resize',
|
||||
value: function _resize(width, height) {
|
||||
|
||||
height = height || width;
|
||||
this._wantedWidth = width;
|
||||
this._wantedHeight = height;
|
||||
|
||||
var imageAspecRatio = width / height;
|
||||
|
||||
// if width > the available space, scale down the expected width and height
|
||||
var widthBorderAndPadding = this._padding.left + this._padding.right + this._border.left + this._border.right;
|
||||
|
||||
// force 10px margin if window size > 575px
|
||||
var addMargin = this._config.doc.body.clientWidth > 575 ? 20 : 0;
|
||||
var discountMargin = this._config.doc.body.clientWidth > 575 ? 0 : 20;
|
||||
|
||||
var maxWidth = Math.min(width + widthBorderAndPadding, this._config.doc.body.clientWidth - addMargin, this._config.maxWidth);
|
||||
|
||||
if (width + widthBorderAndPadding > maxWidth) {
|
||||
height = (maxWidth - widthBorderAndPadding - discountMargin) / imageAspecRatio;
|
||||
width = maxWidth;
|
||||
} else width = width + widthBorderAndPadding;
|
||||
|
||||
var headerHeight = 0,
|
||||
footerHeight = 0;
|
||||
|
||||
// as the resize is performed the modal is show, the calculate might fail
|
||||
// if so, default to the default sizes
|
||||
if (this._footerIsShown) footerHeight = this._$modalFooter.outerHeight(true) || 55;
|
||||
|
||||
if (this._titleIsShown) headerHeight = this._$modalHeader.outerHeight(true) || 67;
|
||||
|
||||
var borderPadding = this._padding.top + this._padding.bottom + this._border.bottom + this._border.top;
|
||||
|
||||
//calculated each time as resizing the window can cause them to change due to Bootstraps fluid margins
|
||||
var margins = parseFloat(this._$modalDialog.css('margin-top')) + parseFloat(this._$modalDialog.css('margin-bottom'));
|
||||
|
||||
var maxHeight = Math.min(height, $(window).height() - borderPadding - margins - headerHeight - footerHeight, this._config.maxHeight - borderPadding - headerHeight - footerHeight);
|
||||
|
||||
if (height > maxHeight) {
|
||||
// if height > the available height, scale down the width
|
||||
width = Math.ceil(maxHeight * imageAspecRatio) + widthBorderAndPadding;
|
||||
}
|
||||
|
||||
this._$lightboxContainer.css('height', maxHeight);
|
||||
this._$modalDialog.css('flex', 1).css('maxWidth', width);
|
||||
|
||||
var modal = this._$modal.data('bs.modal');
|
||||
if (modal) {
|
||||
// v4 method is mistakenly protected
|
||||
try {
|
||||
modal._handleUpdate();
|
||||
} catch (Exception) {
|
||||
modal.handleUpdate();
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}], [{
|
||||
key: '_jQueryInterface',
|
||||
value: function _jQueryInterface(config) {
|
||||
var _this5 = this;
|
||||
|
||||
config = config || {};
|
||||
return this.each(function () {
|
||||
var $this = $(_this5);
|
||||
var _config = $.extend({}, Lightbox.Default, $this.data(), typeof config === 'object' && config);
|
||||
|
||||
new Lightbox(_this5, _config);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return Lightbox;
|
||||
})();
|
||||
|
||||
$.fn[NAME] = Lightbox._jQueryInterface;
|
||||
$.fn[NAME].Constructor = Lightbox;
|
||||
$.fn[NAME].noConflict = function () {
|
||||
$.fn[NAME] = JQUERY_NO_CONFLICT;
|
||||
return Lightbox._jQueryInterface;
|
||||
};
|
||||
|
||||
return Lightbox;
|
||||
})(jQuery);
|
||||
//# sourceMappingURL=ekko-lightbox.js.map
|
||||
|
||||
}(jQuery);
|
2
public/js/lightbox/ekko-lightbox.min.js
vendored
2
public/js/lightbox/ekko-lightbox.min.js
vendored
File diff suppressed because one or more lines are too long
88810
public/js/modules/item.js
vendored
Normal file
88810
public/js/modules/item.js
vendored
Normal file
File diff suppressed because one or more lines are too long
73
public/js/moment/locale/af.js
vendored
73
public/js/moment/locale/af.js
vendored
@ -1,73 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Afrikaans [af]
|
||||
//! author : Werner Mollentze : https://github.com/wernerm
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var af = moment.defineLocale('af', {
|
||||
months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
|
||||
monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
|
||||
weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
|
||||
weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
|
||||
weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
|
||||
meridiemParse: /vm|nm/i,
|
||||
isPM : function (input) {
|
||||
return /^nm$/i.test(input);
|
||||
},
|
||||
meridiem : function (hours, minutes, isLower) {
|
||||
if (hours < 12) {
|
||||
return isLower ? 'vm' : 'VM';
|
||||
} else {
|
||||
return isLower ? 'nm' : 'NM';
|
||||
}
|
||||
},
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'DD/MM/YYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd, D MMMM YYYY HH:mm'
|
||||
},
|
||||
calendar : {
|
||||
sameDay : '[Vandag om] LT',
|
||||
nextDay : '[Môre om] LT',
|
||||
nextWeek : 'dddd [om] LT',
|
||||
lastDay : '[Gister om] LT',
|
||||
lastWeek : '[Laas] dddd [om] LT',
|
||||
sameElse : 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : 'oor %s',
|
||||
past : '%s gelede',
|
||||
s : '\'n paar sekondes',
|
||||
m : '\'n minuut',
|
||||
mm : '%d minute',
|
||||
h : '\'n uur',
|
||||
hh : '%d ure',
|
||||
d : '\'n dag',
|
||||
dd : '%d dae',
|
||||
M : '\'n maand',
|
||||
MM : '%d maande',
|
||||
y : '\'n jaar',
|
||||
yy : '%d jaar'
|
||||
},
|
||||
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
|
||||
ordinal : function (number) {
|
||||
return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
|
||||
},
|
||||
week : {
|
||||
dow : 1, // Maandag is die eerste dag van die week.
|
||||
doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
|
||||
}
|
||||
});
|
||||
|
||||
return af;
|
||||
|
||||
})));
|
59
public/js/moment/locale/ar-dz.js
vendored
59
public/js/moment/locale/ar-dz.js
vendored
@ -1,59 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Arabic (Algeria) [ar-dz]
|
||||
//! author : Noureddine LOUAHEDJ : https://github.com/noureddineme
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var arDz = moment.defineLocale('ar-dz', {
|
||||
months : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
monthsShort : 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort : 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin : 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'DD/MM/YYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
calendar : {
|
||||
sameDay: '[اليوم على الساعة] LT',
|
||||
nextDay: '[غدا على الساعة] LT',
|
||||
nextWeek: 'dddd [على الساعة] LT',
|
||||
lastDay: '[أمس على الساعة] LT',
|
||||
lastWeek: 'dddd [على الساعة] LT',
|
||||
sameElse: 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : 'في %s',
|
||||
past : 'منذ %s',
|
||||
s : 'ثوان',
|
||||
m : 'دقيقة',
|
||||
mm : '%d دقائق',
|
||||
h : 'ساعة',
|
||||
hh : '%d ساعات',
|
||||
d : 'يوم',
|
||||
dd : '%d أيام',
|
||||
M : 'شهر',
|
||||
MM : '%d أشهر',
|
||||
y : 'سنة',
|
||||
yy : '%d سنوات'
|
||||
},
|
||||
week : {
|
||||
dow : 0, // Sunday is the first day of the week.
|
||||
doy : 4 // The week that contains Jan 1st is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return arDz;
|
||||
|
||||
})));
|
59
public/js/moment/locale/ar-kw.js
vendored
59
public/js/moment/locale/ar-kw.js
vendored
@ -1,59 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Arabic (Kuwait) [ar-kw]
|
||||
//! author : Nusret Parlak: https://github.com/nusretparlak
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var arKw = moment.defineLocale('ar-kw', {
|
||||
months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'DD/MM/YYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
calendar : {
|
||||
sameDay: '[اليوم على الساعة] LT',
|
||||
nextDay: '[غدا على الساعة] LT',
|
||||
nextWeek: 'dddd [على الساعة] LT',
|
||||
lastDay: '[أمس على الساعة] LT',
|
||||
lastWeek: 'dddd [على الساعة] LT',
|
||||
sameElse: 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : 'في %s',
|
||||
past : 'منذ %s',
|
||||
s : 'ثوان',
|
||||
m : 'دقيقة',
|
||||
mm : '%d دقائق',
|
||||
h : 'ساعة',
|
||||
hh : '%d ساعات',
|
||||
d : 'يوم',
|
||||
dd : '%d أيام',
|
||||
M : 'شهر',
|
||||
MM : '%d أشهر',
|
||||
y : 'سنة',
|
||||
yy : '%d سنوات'
|
||||
},
|
||||
week : {
|
||||
dow : 0, // Sunday is the first day of the week.
|
||||
doy : 12 // The week that contains Jan 1st is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return arKw;
|
||||
|
||||
})));
|
126
public/js/moment/locale/ar-ly.js
vendored
126
public/js/moment/locale/ar-ly.js
vendored
@ -1,126 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Arabic (Lybia) [ar-ly]
|
||||
//! author : Ali Hmer: https://github.com/kikoanis
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var symbolMap = {
|
||||
'1': '1',
|
||||
'2': '2',
|
||||
'3': '3',
|
||||
'4': '4',
|
||||
'5': '5',
|
||||
'6': '6',
|
||||
'7': '7',
|
||||
'8': '8',
|
||||
'9': '9',
|
||||
'0': '0'
|
||||
};
|
||||
var pluralForm = function (n) {
|
||||
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
|
||||
};
|
||||
var plurals = {
|
||||
s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
|
||||
m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
|
||||
h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
|
||||
d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
|
||||
M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
|
||||
y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
|
||||
};
|
||||
var pluralize = function (u) {
|
||||
return function (number, withoutSuffix, string, isFuture) {
|
||||
var f = pluralForm(number),
|
||||
str = plurals[u][pluralForm(number)];
|
||||
if (f === 2) {
|
||||
str = str[withoutSuffix ? 0 : 1];
|
||||
}
|
||||
return str.replace(/%d/i, number);
|
||||
};
|
||||
};
|
||||
var months = [
|
||||
'يناير',
|
||||
'فبراير',
|
||||
'مارس',
|
||||
'أبريل',
|
||||
'مايو',
|
||||
'يونيو',
|
||||
'يوليو',
|
||||
'أغسطس',
|
||||
'سبتمبر',
|
||||
'أكتوبر',
|
||||
'نوفمبر',
|
||||
'ديسمبر'
|
||||
];
|
||||
|
||||
var arLy = moment.defineLocale('ar-ly', {
|
||||
months : months,
|
||||
monthsShort : months,
|
||||
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'D/\u200FM/\u200FYYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiemParse: /ص|م/,
|
||||
isPM : function (input) {
|
||||
return 'م' === input;
|
||||
},
|
||||
meridiem : function (hour, minute, isLower) {
|
||||
if (hour < 12) {
|
||||
return 'ص';
|
||||
} else {
|
||||
return 'م';
|
||||
}
|
||||
},
|
||||
calendar : {
|
||||
sameDay: '[اليوم عند الساعة] LT',
|
||||
nextDay: '[غدًا عند الساعة] LT',
|
||||
nextWeek: 'dddd [عند الساعة] LT',
|
||||
lastDay: '[أمس عند الساعة] LT',
|
||||
lastWeek: 'dddd [عند الساعة] LT',
|
||||
sameElse: 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : 'بعد %s',
|
||||
past : 'منذ %s',
|
||||
s : pluralize('s'),
|
||||
m : pluralize('m'),
|
||||
mm : pluralize('m'),
|
||||
h : pluralize('h'),
|
||||
hh : pluralize('h'),
|
||||
d : pluralize('d'),
|
||||
dd : pluralize('d'),
|
||||
M : pluralize('M'),
|
||||
MM : pluralize('M'),
|
||||
y : pluralize('y'),
|
||||
yy : pluralize('y')
|
||||
},
|
||||
preparse: function (string) {
|
||||
return string.replace(/،/g, ',');
|
||||
},
|
||||
postformat: function (string) {
|
||||
return string.replace(/\d/g, function (match) {
|
||||
return symbolMap[match];
|
||||
}).replace(/,/g, '،');
|
||||
},
|
||||
week : {
|
||||
dow : 6, // Saturday is the first day of the week.
|
||||
doy : 12 // The week that contains Jan 1st is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return arLy;
|
||||
|
||||
})));
|
60
public/js/moment/locale/ar-ma.js
vendored
60
public/js/moment/locale/ar-ma.js
vendored
@ -1,60 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Arabic (Morocco) [ar-ma]
|
||||
//! author : ElFadili Yassine : https://github.com/ElFadiliY
|
||||
//! author : Abdel Said : https://github.com/abdelsaid
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var arMa = moment.defineLocale('ar-ma', {
|
||||
months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
|
||||
weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'DD/MM/YYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
calendar : {
|
||||
sameDay: '[اليوم على الساعة] LT',
|
||||
nextDay: '[غدا على الساعة] LT',
|
||||
nextWeek: 'dddd [على الساعة] LT',
|
||||
lastDay: '[أمس على الساعة] LT',
|
||||
lastWeek: 'dddd [على الساعة] LT',
|
||||
sameElse: 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : 'في %s',
|
||||
past : 'منذ %s',
|
||||
s : 'ثوان',
|
||||
m : 'دقيقة',
|
||||
mm : '%d دقائق',
|
||||
h : 'ساعة',
|
||||
hh : '%d ساعات',
|
||||
d : 'يوم',
|
||||
dd : '%d أيام',
|
||||
M : 'شهر',
|
||||
MM : '%d أشهر',
|
||||
y : 'سنة',
|
||||
yy : '%d سنوات'
|
||||
},
|
||||
week : {
|
||||
dow : 6, // Saturday is the first day of the week.
|
||||
doy : 12 // The week that contains Jan 1st is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return arMa;
|
||||
|
||||
})));
|
105
public/js/moment/locale/ar-sa.js
vendored
105
public/js/moment/locale/ar-sa.js
vendored
@ -1,105 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Arabic (Saudi Arabia) [ar-sa]
|
||||
//! author : Suhail Alkowaileet : https://github.com/xsoh
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var symbolMap = {
|
||||
'1': '١',
|
||||
'2': '٢',
|
||||
'3': '٣',
|
||||
'4': '٤',
|
||||
'5': '٥',
|
||||
'6': '٦',
|
||||
'7': '٧',
|
||||
'8': '٨',
|
||||
'9': '٩',
|
||||
'0': '٠'
|
||||
};
|
||||
var numberMap = {
|
||||
'١': '1',
|
||||
'٢': '2',
|
||||
'٣': '3',
|
||||
'٤': '4',
|
||||
'٥': '5',
|
||||
'٦': '6',
|
||||
'٧': '7',
|
||||
'٨': '8',
|
||||
'٩': '9',
|
||||
'٠': '0'
|
||||
};
|
||||
|
||||
var arSa = moment.defineLocale('ar-sa', {
|
||||
months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'DD/MM/YYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiemParse: /ص|م/,
|
||||
isPM : function (input) {
|
||||
return 'م' === input;
|
||||
},
|
||||
meridiem : function (hour, minute, isLower) {
|
||||
if (hour < 12) {
|
||||
return 'ص';
|
||||
} else {
|
||||
return 'م';
|
||||
}
|
||||
},
|
||||
calendar : {
|
||||
sameDay: '[اليوم على الساعة] LT',
|
||||
nextDay: '[غدا على الساعة] LT',
|
||||
nextWeek: 'dddd [على الساعة] LT',
|
||||
lastDay: '[أمس على الساعة] LT',
|
||||
lastWeek: 'dddd [على الساعة] LT',
|
||||
sameElse: 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : 'في %s',
|
||||
past : 'منذ %s',
|
||||
s : 'ثوان',
|
||||
m : 'دقيقة',
|
||||
mm : '%d دقائق',
|
||||
h : 'ساعة',
|
||||
hh : '%d ساعات',
|
||||
d : 'يوم',
|
||||
dd : '%d أيام',
|
||||
M : 'شهر',
|
||||
MM : '%d أشهر',
|
||||
y : 'سنة',
|
||||
yy : '%d سنوات'
|
||||
},
|
||||
preparse: function (string) {
|
||||
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
|
||||
return numberMap[match];
|
||||
}).replace(/،/g, ',');
|
||||
},
|
||||
postformat: function (string) {
|
||||
return string.replace(/\d/g, function (match) {
|
||||
return symbolMap[match];
|
||||
}).replace(/,/g, '،');
|
||||
},
|
||||
week : {
|
||||
dow : 0, // Sunday is the first day of the week.
|
||||
doy : 6 // The week that contains Jan 1st is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return arSa;
|
||||
|
||||
})));
|
59
public/js/moment/locale/ar-tn.js
vendored
59
public/js/moment/locale/ar-tn.js
vendored
@ -1,59 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Arabic (Tunisia) [ar-tn]
|
||||
//! author : Nader Toukabri : https://github.com/naderio
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var arTn = moment.defineLocale('ar-tn', {
|
||||
months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
|
||||
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat: {
|
||||
LT: 'HH:mm',
|
||||
LTS: 'HH:mm:ss',
|
||||
L: 'DD/MM/YYYY',
|
||||
LL: 'D MMMM YYYY',
|
||||
LLL: 'D MMMM YYYY HH:mm',
|
||||
LLLL: 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
calendar: {
|
||||
sameDay: '[اليوم على الساعة] LT',
|
||||
nextDay: '[غدا على الساعة] LT',
|
||||
nextWeek: 'dddd [على الساعة] LT',
|
||||
lastDay: '[أمس على الساعة] LT',
|
||||
lastWeek: 'dddd [على الساعة] LT',
|
||||
sameElse: 'L'
|
||||
},
|
||||
relativeTime: {
|
||||
future: 'في %s',
|
||||
past: 'منذ %s',
|
||||
s: 'ثوان',
|
||||
m: 'دقيقة',
|
||||
mm: '%d دقائق',
|
||||
h: 'ساعة',
|
||||
hh: '%d ساعات',
|
||||
d: 'يوم',
|
||||
dd: '%d أيام',
|
||||
M: 'شهر',
|
||||
MM: '%d أشهر',
|
||||
y: 'سنة',
|
||||
yy: '%d سنوات'
|
||||
},
|
||||
week: {
|
||||
dow: 1, // Monday is the first day of the week.
|
||||
doy: 4 // The week that contains Jan 4th is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return arTn;
|
||||
|
||||
})));
|
142
public/js/moment/locale/ar.js
vendored
142
public/js/moment/locale/ar.js
vendored
@ -1,142 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Arabic [ar]
|
||||
//! author : Abdel Said: https://github.com/abdelsaid
|
||||
//! author : Ahmed Elkhatib
|
||||
//! author : forabi https://github.com/forabi
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var symbolMap = {
|
||||
'1': '١',
|
||||
'2': '٢',
|
||||
'3': '٣',
|
||||
'4': '٤',
|
||||
'5': '٥',
|
||||
'6': '٦',
|
||||
'7': '٧',
|
||||
'8': '٨',
|
||||
'9': '٩',
|
||||
'0': '٠'
|
||||
};
|
||||
var numberMap = {
|
||||
'١': '1',
|
||||
'٢': '2',
|
||||
'٣': '3',
|
||||
'٤': '4',
|
||||
'٥': '5',
|
||||
'٦': '6',
|
||||
'٧': '7',
|
||||
'٨': '8',
|
||||
'٩': '9',
|
||||
'٠': '0'
|
||||
};
|
||||
var pluralForm = function (n) {
|
||||
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
|
||||
};
|
||||
var plurals = {
|
||||
s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
|
||||
m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
|
||||
h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
|
||||
d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
|
||||
M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
|
||||
y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
|
||||
};
|
||||
var pluralize = function (u) {
|
||||
return function (number, withoutSuffix, string, isFuture) {
|
||||
var f = pluralForm(number),
|
||||
str = plurals[u][pluralForm(number)];
|
||||
if (f === 2) {
|
||||
str = str[withoutSuffix ? 0 : 1];
|
||||
}
|
||||
return str.replace(/%d/i, number);
|
||||
};
|
||||
};
|
||||
var months = [
|
||||
'كانون الثاني يناير',
|
||||
'شباط فبراير',
|
||||
'آذار مارس',
|
||||
'نيسان أبريل',
|
||||
'أيار مايو',
|
||||
'حزيران يونيو',
|
||||
'تموز يوليو',
|
||||
'آب أغسطس',
|
||||
'أيلول سبتمبر',
|
||||
'تشرين الأول أكتوبر',
|
||||
'تشرين الثاني نوفمبر',
|
||||
'كانون الأول ديسمبر'
|
||||
];
|
||||
|
||||
var ar = moment.defineLocale('ar', {
|
||||
months : months,
|
||||
monthsShort : months,
|
||||
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
||||
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
||||
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'D/\u200FM/\u200FYYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd D MMMM YYYY HH:mm'
|
||||
},
|
||||
meridiemParse: /ص|م/,
|
||||
isPM : function (input) {
|
||||
return 'م' === input;
|
||||
},
|
||||
meridiem : function (hour, minute, isLower) {
|
||||
if (hour < 12) {
|
||||
return 'ص';
|
||||
} else {
|
||||
return 'م';
|
||||
}
|
||||
},
|
||||
calendar : {
|
||||
sameDay: '[اليوم عند الساعة] LT',
|
||||
nextDay: '[غدًا عند الساعة] LT',
|
||||
nextWeek: 'dddd [عند الساعة] LT',
|
||||
lastDay: '[أمس عند الساعة] LT',
|
||||
lastWeek: 'dddd [عند الساعة] LT',
|
||||
sameElse: 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : 'بعد %s',
|
||||
past : 'منذ %s',
|
||||
s : pluralize('s'),
|
||||
m : pluralize('m'),
|
||||
mm : pluralize('m'),
|
||||
h : pluralize('h'),
|
||||
hh : pluralize('h'),
|
||||
d : pluralize('d'),
|
||||
dd : pluralize('d'),
|
||||
M : pluralize('M'),
|
||||
MM : pluralize('M'),
|
||||
y : pluralize('y'),
|
||||
yy : pluralize('y')
|
||||
},
|
||||
preparse: function (string) {
|
||||
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
|
||||
return numberMap[match];
|
||||
}).replace(/،/g, ',');
|
||||
},
|
||||
postformat: function (string) {
|
||||
return string.replace(/\d/g, function (match) {
|
||||
return symbolMap[match];
|
||||
}).replace(/,/g, '،');
|
||||
},
|
||||
week : {
|
||||
dow : 6, // Saturday is the first day of the week.
|
||||
doy : 12 // The week that contains Jan 1st is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return ar;
|
||||
|
||||
})));
|
105
public/js/moment/locale/az.js
vendored
105
public/js/moment/locale/az.js
vendored
@ -1,105 +0,0 @@
|
||||
//! moment.js locale configuration
|
||||
//! locale : Azerbaijani [az]
|
||||
//! author : topchiyev : https://github.com/topchiyev
|
||||
|
||||
;(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined'
|
||||
&& typeof require === 'function' ? factory(require('../moment')) :
|
||||
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
||||
factory(global.moment)
|
||||
}(this, (function (moment) { 'use strict';
|
||||
|
||||
|
||||
var suffixes = {
|
||||
1: '-inci',
|
||||
5: '-inci',
|
||||
8: '-inci',
|
||||
70: '-inci',
|
||||
80: '-inci',
|
||||
2: '-nci',
|
||||
7: '-nci',
|
||||
20: '-nci',
|
||||
50: '-nci',
|
||||
3: '-üncü',
|
||||
4: '-üncü',
|
||||
100: '-üncü',
|
||||
6: '-ncı',
|
||||
9: '-uncu',
|
||||
10: '-uncu',
|
||||
30: '-uncu',
|
||||
60: '-ıncı',
|
||||
90: '-ıncı'
|
||||
};
|
||||
|
||||
var az = moment.defineLocale('az', {
|
||||
months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
|
||||
monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
|
||||
weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
|
||||
weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
|
||||
weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
|
||||
weekdaysParseExact : true,
|
||||
longDateFormat : {
|
||||
LT : 'HH:mm',
|
||||
LTS : 'HH:mm:ss',
|
||||
L : 'DD.MM.YYYY',
|
||||
LL : 'D MMMM YYYY',
|
||||
LLL : 'D MMMM YYYY HH:mm',
|
||||
LLLL : 'dddd, D MMMM YYYY HH:mm'
|
||||
},
|
||||
calendar : {
|
||||
sameDay : '[bugün saat] LT',
|
||||
nextDay : '[sabah saat] LT',
|
||||
nextWeek : '[gələn həftə] dddd [saat] LT',
|
||||
lastDay : '[dünən] LT',
|
||||
lastWeek : '[keçən həftə] dddd [saat] LT',
|
||||
sameElse : 'L'
|
||||
},
|
||||
relativeTime : {
|
||||
future : '%s sonra',
|
||||
past : '%s əvvəl',
|
||||
s : 'birneçə saniyyə',
|
||||
m : 'bir dəqiqə',
|
||||
mm : '%d dəqiqə',
|
||||
h : 'bir saat',
|
||||
hh : '%d saat',
|
||||
d : 'bir gün',
|
||||
dd : '%d gün',
|
||||
M : 'bir ay',
|
||||
MM : '%d ay',
|
||||
y : 'bir il',
|
||||
yy : '%d il'
|
||||
},
|
||||
meridiemParse: /gecə|səhər|gündüz|axşam/,
|
||||
isPM : function (input) {
|
||||
return /^(gündüz|axşam)$/.test(input);
|
||||
},
|
||||
meridiem : function (hour, minute, isLower) {
|
||||
if (hour < 4) {
|
||||
return 'gecə';
|
||||
} else if (hour < 12) {
|
||||
return 'səhər';
|
||||
} else if (hour < 17) {
|
||||
return 'gündüz';
|
||||
} else {
|
||||
return 'axşam';
|
||||
}
|
||||
},
|
||||
dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
|
||||
ordinal : function (number) {
|
||||
if (number === 0) { // special case for zero
|
||||
return number + '-ıncı';
|
||||
}
|
||||
var a = number % 10,
|
||||
b = number % 100 - a,
|
||||
c = number >= 100 ? 100 : null;
|
||||
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
|
||||
},
|
||||
week : {
|
||||
dow : 1, // Monday is the first day of the week.
|
||||
doy : 7 // The week that contains Jan 1st is the first week of the year.
|
||||
}
|
||||
});
|
||||
|
||||
return az;
|
||||
|
||||
})));
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user