change template subdirs
This commit is contained in:
6632
templates/backOffice/default/assets/js/bootstrap-editable/bootstrap-editable.js
vendored
Normal file
6632
templates/backOffice/default/assets/js/bootstrap-editable/bootstrap-editable.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
709
templates/backOffice/default/assets/js/bootstrap-select/bootstrap-select.js
vendored
Normal file
709
templates/backOffice/default/assets/js/bootstrap-select/bootstrap-select.js
vendored
Normal file
@@ -0,0 +1,709 @@
|
||||
/*!
|
||||
* bootstrap-select v1.3.1
|
||||
* http://silviomoreto.github.io/bootstrap-select/
|
||||
*
|
||||
* Copyright 2013 bootstrap-select
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
|
||||
!function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
$.expr[":"].icontains = $.expr.createPseudo(function(arg) {
|
||||
return function( elem ) {
|
||||
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
|
||||
};
|
||||
});
|
||||
|
||||
var Selectpicker = function(element, options, e) {
|
||||
if (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}
|
||||
this.$element = $(element);
|
||||
this.$newElement = null;
|
||||
this.$button = null;
|
||||
this.$menu = null;
|
||||
|
||||
//Merge defaults, options and data-attributes to make our options
|
||||
this.options = $.extend({}, $.fn.selectpicker.defaults, this.$element.data(), typeof options == 'object' && options);
|
||||
|
||||
//If we have no title yet, check the attribute 'title' (this is missed by jq as its not a data-attribute
|
||||
if (this.options.title == null) {
|
||||
this.options.title = this.$element.attr('title');
|
||||
}
|
||||
|
||||
//Expose public methods
|
||||
this.val = Selectpicker.prototype.val;
|
||||
this.render = Selectpicker.prototype.render;
|
||||
this.refresh = Selectpicker.prototype.refresh;
|
||||
this.setStyle = Selectpicker.prototype.setStyle;
|
||||
this.selectAll = Selectpicker.prototype.selectAll;
|
||||
this.deselectAll = Selectpicker.prototype.deselectAll;
|
||||
this.init();
|
||||
};
|
||||
|
||||
Selectpicker.prototype = {
|
||||
|
||||
constructor: Selectpicker,
|
||||
|
||||
init: function(e) {
|
||||
this.$element.hide();
|
||||
this.multiple = this.$element.prop('multiple');
|
||||
var id = this.$element.attr('id');
|
||||
this.$newElement = this.createView();
|
||||
this.$element.after(this.$newElement);
|
||||
this.$menu = this.$newElement.find('> .dropdown-menu');
|
||||
this.$button = this.$newElement.find('> button');
|
||||
this.$searchbox = this.$newElement.find('input');
|
||||
|
||||
if (id !== undefined) {
|
||||
var that = this;
|
||||
this.$button.attr('data-id', id);
|
||||
$('label[for="' + id + '"]').click(function(e) {
|
||||
e.preventDefault();
|
||||
that.$button.focus();
|
||||
});
|
||||
}
|
||||
|
||||
this.checkDisabled();
|
||||
this.checkTabIndex();
|
||||
this.clickListener();
|
||||
this.liveSearchListener();
|
||||
this.render();
|
||||
this.liHeight();
|
||||
this.setStyle();
|
||||
this.setWidth();
|
||||
if (this.options.container) {
|
||||
this.selectPosition();
|
||||
}
|
||||
this.$menu.data('this', this);
|
||||
this.$newElement.data('this', this);
|
||||
},
|
||||
|
||||
createDropdown: function() {
|
||||
//If we are multiple, then add the show-tick class by default
|
||||
var multiple = this.multiple ? ' show-tick' : '';
|
||||
var header = this.options.header ? '<h3 class="popover-title">' + this.options.header + '<button type="button" class="close" aria-hidden="true">×</button></h3>' : '';
|
||||
var searchbox = this.options.liveSearch ? '<div class="bootstrap-select-searchbox"><input type="text" class="input-block-level form-control" /></div>' : '';
|
||||
var drop =
|
||||
"<div class='btn-group bootstrap-select" + multiple + "'>" +
|
||||
"<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'>" +
|
||||
"<div class='filter-option pull-left'></div> " +
|
||||
"<div class='caret'></div>" +
|
||||
"</button>" +
|
||||
"<div class='dropdown-menu open'>" +
|
||||
header +
|
||||
searchbox +
|
||||
"<ul class='dropdown-menu inner' role='menu'>" +
|
||||
"</ul>" +
|
||||
"</div>" +
|
||||
"</div>";
|
||||
|
||||
return $(drop);
|
||||
},
|
||||
|
||||
createView: function() {
|
||||
var $drop = this.createDropdown();
|
||||
var $li = this.createLi();
|
||||
$drop.find('ul').append($li);
|
||||
return $drop;
|
||||
},
|
||||
|
||||
reloadLi: function() {
|
||||
//Remove all children.
|
||||
this.destroyLi();
|
||||
//Re build
|
||||
var $li = this.createLi();
|
||||
this.$menu.find('ul').append( $li );
|
||||
},
|
||||
|
||||
destroyLi: function() {
|
||||
this.$menu.find('li').remove();
|
||||
},
|
||||
|
||||
createLi: function() {
|
||||
var that = this,
|
||||
_liA = [],
|
||||
_liHtml = '';
|
||||
|
||||
this.$element.find('option').each(function(index) {
|
||||
var $this = $(this);
|
||||
|
||||
//Get the class and text for the option
|
||||
var optionClass = $this.attr("class") || '';
|
||||
var inline = $this.attr("style") || '';
|
||||
var text = $this.data('content') ? $this.data('content') : $this.html();
|
||||
var subtext = $this.data('subtext') !== undefined ? '<small class="muted">' + $this.data('subtext') + '</small>' : '';
|
||||
var icon = $this.data('icon') !== undefined ? '<i class="glyphicon '+$this.data('icon')+'"></i> ' : '';
|
||||
if (icon !== '' && ($this.is(':disabled') || $this.parent().is(':disabled'))) {
|
||||
icon = '<span>'+icon+'</span>';
|
||||
}
|
||||
|
||||
if (!$this.data('content')) {
|
||||
//Prepend any icon and append any subtext to the main text.
|
||||
text = icon + '<span class="text">' + text + subtext + '</span>';
|
||||
}
|
||||
|
||||
if (that.options.hideDisabled && ($this.is(':disabled') || $this.parent().is(':disabled'))) {
|
||||
_liA.push('<a style="min-height: 0; padding: 0"></a>');
|
||||
} else if ($this.parent().is('optgroup') && $this.data('divider') != true) {
|
||||
if ($this.index() == 0) {
|
||||
//Get the opt group label
|
||||
var label = $this.parent().attr('label');
|
||||
var labelSubtext = $this.parent().data('subtext') !== undefined ? '<small class="muted">'+$this.parent().data('subtext')+'</small>' : '';
|
||||
var labelIcon = $this.parent().data('icon') ? '<i class="'+$this.parent().data('icon')+'"></i> ' : '';
|
||||
label = labelIcon + '<span class="text">' + label + labelSubtext + '</span>';
|
||||
|
||||
if ($this[0].index != 0) {
|
||||
_liA.push(
|
||||
'<div class="div-contain"><div class="divider"></div></div>'+
|
||||
'<dt>'+label+'</dt>'+
|
||||
that.createA(text, "opt " + optionClass, inline )
|
||||
);
|
||||
} else {
|
||||
_liA.push(
|
||||
'<dt>'+label+'</dt>'+
|
||||
that.createA(text, "opt " + optionClass, inline ));
|
||||
}
|
||||
} else {
|
||||
_liA.push(that.createA(text, "opt " + optionClass, inline ));
|
||||
}
|
||||
} else if ($this.data('divider') == true) {
|
||||
_liA.push('<div class="div-contain"><div class="divider"></div></div>');
|
||||
} else if ($(this).data('hidden') == true) {
|
||||
_liA.push('');
|
||||
} else {
|
||||
_liA.push(that.createA(text, optionClass, inline ));
|
||||
}
|
||||
});
|
||||
|
||||
$.each(_liA, function(i, item) {
|
||||
_liHtml += "<li rel=" + i + ">" + item + "</li>";
|
||||
});
|
||||
|
||||
//If we are not multiple, and we dont have a selected item, and we dont have a title, select the first element so something is set in the button
|
||||
if (!this.multiple && this.$element.find('option:selected').length==0 && !this.options.title) {
|
||||
this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected');
|
||||
}
|
||||
|
||||
return $(_liHtml);
|
||||
},
|
||||
|
||||
createA: function(text, classes, inline) {
|
||||
return '<a tabindex="0" class="'+classes+'" style="'+inline+'">' +
|
||||
text +
|
||||
'<i class="glyphicon glyphicon-ok icon-ok check-mark"></i>' +
|
||||
'</a>';
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var that = this;
|
||||
|
||||
//Update the LI to match the SELECT
|
||||
this.$element.find('option').each(function(index) {
|
||||
that.setDisabled(index, $(this).is(':disabled') || $(this).parent().is(':disabled') );
|
||||
that.setSelected(index, $(this).is(':selected') );
|
||||
});
|
||||
|
||||
var selectedItems = this.$element.find('option:selected').map(function(index,value) {
|
||||
var $this = $(this);
|
||||
var icon = $this.data('icon') && that.options.showIcon ? '<i class="glyphicon ' + $this.data('icon') + '"></i> ' : '';
|
||||
var subtext;
|
||||
if (that.options.showSubtext && $this.attr('data-subtext') && !that.multiple) {
|
||||
subtext = ' <small class="muted">'+$this.data('subtext') +'</small>';
|
||||
} else {
|
||||
subtext = '';
|
||||
}
|
||||
if ($this.data('content') && that.options.showContent) {
|
||||
return $this.data('content');
|
||||
} else if ($this.attr('title') != undefined) {
|
||||
return $this.attr('title');
|
||||
} else {
|
||||
return icon + $this.html() + subtext;
|
||||
}
|
||||
}).toArray();
|
||||
|
||||
//Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled
|
||||
//Convert all the values into a comma delimited string
|
||||
var title = !this.multiple ? selectedItems[0] : selectedItems.join(", ");
|
||||
|
||||
//If this is multi select, and the selectText type is count, the show 1 of 2 selected etc..
|
||||
if (this.multiple && this.options.selectedTextFormat.indexOf('count') > -1) {
|
||||
var max = this.options.selectedTextFormat.split(">");
|
||||
var notDisabled = this.options.hideDisabled ? ':not([disabled])' : '';
|
||||
if ( (max.length>1 && selectedItems.length > max[1]) || (max.length==1 && selectedItems.length>=2)) {
|
||||
title = this.options.countSelectedText.replace('{0}', selectedItems.length).replace('{1}', this.$element.find('option:not([data-divider="true"]):not([data-hidden="true"])'+notDisabled).length);
|
||||
}
|
||||
}
|
||||
|
||||
//If we dont have a title, then use the default, or if nothing is set at all, use the not selected text
|
||||
if (!title) {
|
||||
title = this.options.title != undefined ? this.options.title : this.options.noneSelectedText;
|
||||
}
|
||||
|
||||
this.$newElement.find('.filter-option').html(title);
|
||||
},
|
||||
|
||||
setStyle: function(style, status) {
|
||||
if (this.$element.attr('class')) {
|
||||
this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device/gi, ''));
|
||||
}
|
||||
|
||||
var buttonClass = style ? style : this.options.style;
|
||||
|
||||
if (status == 'add') {
|
||||
this.$button.addClass(buttonClass);
|
||||
} else if (status == 'remove') {
|
||||
this.$button.removeClass(buttonClass);
|
||||
} else {
|
||||
this.$button.removeClass(this.options.style);
|
||||
this.$button.addClass(buttonClass);
|
||||
}
|
||||
},
|
||||
|
||||
liHeight: function() {
|
||||
var selectClone = this.$newElement.clone();
|
||||
selectClone.appendTo('body');
|
||||
var $menuClone = selectClone.addClass('open').find('> .dropdown-menu');
|
||||
var liHeight = $menuClone.find('li > a').outerHeight();
|
||||
var headerHeight = this.options.header ? $menuClone.find('.popover-title').outerHeight() : 0;
|
||||
selectClone.remove();
|
||||
this.$newElement.data('liHeight', liHeight).data('headerHeight', headerHeight);
|
||||
},
|
||||
|
||||
setSize: function() {
|
||||
var that = this,
|
||||
menu = this.$menu,
|
||||
menuInner = menu.find('.inner'),
|
||||
menuA = menuInner.find('li > a'),
|
||||
selectHeight = this.$newElement.outerHeight(),
|
||||
liHeight = this.$newElement.data('liHeight'),
|
||||
headerHeight = this.$newElement.data('headerHeight'),
|
||||
divHeight = menu.find('li .divider').outerHeight(true),
|
||||
menuPadding = parseInt(menu.css('padding-top')) +
|
||||
parseInt(menu.css('padding-bottom')) +
|
||||
parseInt(menu.css('border-top-width')) +
|
||||
parseInt(menu.css('border-bottom-width')),
|
||||
notDisabled = this.options.hideDisabled ? ':not(.disabled)' : '',
|
||||
$window = $(window),
|
||||
menuExtras = menuPadding + parseInt(menu.css('margin-top')) + parseInt(menu.css('margin-bottom')) + 2,
|
||||
menuHeight,
|
||||
selectOffsetTop,
|
||||
selectOffsetBot,
|
||||
posVert = function() {
|
||||
selectOffsetTop = that.$newElement.offset().top - $window.scrollTop();
|
||||
selectOffsetBot = $window.height() - selectOffsetTop - selectHeight;
|
||||
};
|
||||
posVert();
|
||||
if (this.options.header) menu.css('padding-top', 0);
|
||||
|
||||
if (this.options.size == 'auto') {
|
||||
var getSize = function() {
|
||||
var minHeight;
|
||||
posVert();
|
||||
menuHeight = selectOffsetBot - menuExtras;
|
||||
that.$newElement.toggleClass('dropup', (selectOffsetTop > selectOffsetBot) && (menuHeight - menuExtras) < menu.height() && that.options.dropupAuto);
|
||||
if (that.$newElement.hasClass('dropup')) {
|
||||
menuHeight = selectOffsetTop - menuExtras;
|
||||
}
|
||||
if ((menu.find('li').length + menu.find('dt').length) > 3) {
|
||||
minHeight = liHeight*3 + menuExtras - 2;
|
||||
} else {
|
||||
minHeight = 0;
|
||||
}
|
||||
menu.css({'max-height' : menuHeight + 'px', 'overflow' : 'hidden', 'min-height' : minHeight + 'px'});
|
||||
menuInner.css({'max-height' : menuHeight - headerHeight- menuPadding + 'px', 'overflow-y' : 'auto', 'min-height' : minHeight - menuPadding + 'px'});
|
||||
}
|
||||
getSize();
|
||||
$(window).resize(getSize);
|
||||
$(window).scroll(getSize);
|
||||
} else if (this.options.size && this.options.size != 'auto' && menu.find('li'+notDisabled).length > this.options.size) {
|
||||
var optIndex = menu.find("li"+notDisabled+" > *").filter(':not(.div-contain)').slice(0,this.options.size).last().parent().index();
|
||||
var divLength = menu.find("li").slice(0,optIndex + 1).find('.div-contain').length;
|
||||
menuHeight = liHeight*this.options.size + divLength*divHeight + menuPadding;
|
||||
this.$newElement.toggleClass('dropup', (selectOffsetTop > selectOffsetBot) && menuHeight < menu.height() && this.options.dropupAuto);
|
||||
menu.css({'max-height' : menuHeight + headerHeight + 'px', 'overflow' : 'hidden'});
|
||||
menuInner.css({'max-height' : menuHeight - menuPadding + 'px', 'overflow-y' : 'auto'});
|
||||
}
|
||||
},
|
||||
|
||||
setWidth: function() {
|
||||
if (this.options.width == 'auto') {
|
||||
this.$menu.css('min-width', '0');
|
||||
|
||||
// Get correct width if element hidden
|
||||
var selectClone = this.$newElement.clone().appendTo('body');
|
||||
var ulWidth = selectClone.find('> .dropdown-menu').css('width');
|
||||
selectClone.remove();
|
||||
|
||||
this.$newElement.css('width', ulWidth);
|
||||
} else if (this.options.width == 'fit') {
|
||||
// Remove inline min-width so width can be changed from 'auto'
|
||||
this.$menu.css('min-width', '');
|
||||
this.$newElement.css('width', '').addClass('fit-width');
|
||||
} else if (this.options.width) {
|
||||
// Remove inline min-width so width can be changed from 'auto'
|
||||
this.$menu.css('min-width', '');
|
||||
this.$newElement.css('width', this.options.width);
|
||||
} else {
|
||||
// Remove inline min-width/width so width can be changed
|
||||
this.$menu.css('min-width', '');
|
||||
this.$newElement.css('width', '');
|
||||
}
|
||||
// Remove fit-width class if width is changed programmatically
|
||||
if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') {
|
||||
this.$newElement.removeClass('fit-width');
|
||||
}
|
||||
},
|
||||
|
||||
selectPosition: function() {
|
||||
var that = this,
|
||||
drop = "<div />",
|
||||
$drop = $(drop),
|
||||
pos,
|
||||
actualHeight,
|
||||
getPlacement = function($element) {
|
||||
$drop.addClass($element.attr('class')).toggleClass('dropup', $element.hasClass('dropup'));
|
||||
pos = $element.offset();
|
||||
actualHeight = $element.hasClass('dropup') ? 0 : $element[0].offsetHeight;
|
||||
$drop.css({'top' : pos.top + actualHeight, 'left' : pos.left, 'width' : $element[0].offsetWidth, 'position' : 'absolute'});
|
||||
};
|
||||
this.$newElement.on('click', function(e) {
|
||||
getPlacement($(this));
|
||||
$drop.appendTo(that.options.container);
|
||||
$drop.toggleClass('open', !$(this).hasClass('open'));
|
||||
$drop.append(that.$menu);
|
||||
});
|
||||
$(window).resize(function() {
|
||||
getPlacement(that.$newElement);
|
||||
});
|
||||
$(window).on('scroll', function(e) {
|
||||
getPlacement(that.$newElement);
|
||||
});
|
||||
$('html').on('click', function(e) {
|
||||
if ($(e.target).closest(that.$newElement).length < 1) {
|
||||
$drop.removeClass('open');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
mobile: function() {
|
||||
this.$element.addClass('mobile-device').appendTo(this.$newElement);
|
||||
if (this.options.container) this.$menu.hide();
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
this.reloadLi();
|
||||
this.render();
|
||||
this.setWidth();
|
||||
this.setStyle();
|
||||
this.checkDisabled();
|
||||
this.liHeight();
|
||||
},
|
||||
|
||||
setSelected: function(index, selected) {
|
||||
this.$menu.find('li').eq(index).toggleClass('selected', selected);
|
||||
},
|
||||
|
||||
setDisabled: function(index, disabled) {
|
||||
if (disabled) {
|
||||
this.$menu.find('li').eq(index).addClass('disabled').find('a').attr('href','#').attr('tabindex',-1);
|
||||
} else {
|
||||
this.$menu.find('li').eq(index).removeClass('disabled').find('a').removeAttr('href').attr('tabindex',0);
|
||||
}
|
||||
},
|
||||
|
||||
isDisabled: function() {
|
||||
return this.$element.is(':disabled');
|
||||
},
|
||||
|
||||
checkDisabled: function() {
|
||||
var that = this;
|
||||
if (this.isDisabled()) {
|
||||
this.$button.addClass('disabled');
|
||||
this.$button.attr('tabindex','-1');
|
||||
} else if (this.$button.hasClass('disabled')) {
|
||||
this.$button.removeClass('disabled');
|
||||
this.$button.removeAttr('tabindex');
|
||||
}
|
||||
this.$button.click(function() {
|
||||
return !that.isDisabled();
|
||||
});
|
||||
},
|
||||
|
||||
checkTabIndex: function() {
|
||||
if (this.$element.is('[tabindex]')) {
|
||||
var tabindex = this.$element.attr("tabindex");
|
||||
this.$button.attr('tabindex', tabindex);
|
||||
}
|
||||
},
|
||||
|
||||
clickListener: function() {
|
||||
var that = this;
|
||||
|
||||
$('body').on('touchstart.dropdown', '.dropdown-menu', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
this.$newElement.on('click', function() {
|
||||
that.setSize();
|
||||
});
|
||||
|
||||
this.$menu.on('click', 'li a', function(e) {
|
||||
var clickedIndex = $(this).parent().index(),
|
||||
$this = $(this).parent(),
|
||||
prevValue = that.$element.val();
|
||||
|
||||
//Dont close on multi choice menu
|
||||
if (that.multiple) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
//Dont run if we have been disabled
|
||||
if (!that.isDisabled() && !$(this).parent().hasClass('disabled')) {
|
||||
var $options = that.$element.find('option');
|
||||
var $option = $options.eq(clickedIndex);
|
||||
|
||||
//Deselect all others if not multi select box
|
||||
if (!that.multiple) {
|
||||
$options.prop('selected', false);
|
||||
$option.prop('selected', true);
|
||||
}
|
||||
//Else toggle the one we have chosen if we are multi select.
|
||||
else {
|
||||
var state = $option.prop('selected');
|
||||
|
||||
$option.prop('selected', !state);
|
||||
}
|
||||
|
||||
that.$button.focus();
|
||||
|
||||
// Trigger select 'change'
|
||||
if (prevValue != that.$element.val()) {
|
||||
that.$element.change();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.$menu.on('click', 'li.disabled a, li dt, li .div-contain, h3.popover-title', function(e) {
|
||||
if (e.target == this) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
that.$button.focus();
|
||||
}
|
||||
});
|
||||
|
||||
this.$searchbox.on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
this.$element.change(function() {
|
||||
that.render()
|
||||
});
|
||||
},
|
||||
|
||||
liveSearchListener: function() {
|
||||
var that = this;
|
||||
|
||||
this.$newElement.on('click.dropdown.data-api', function(e){
|
||||
if(that.options.liveSearch) {
|
||||
setTimeout(function() {
|
||||
that.$searchbox.focus();
|
||||
}, 10);
|
||||
}
|
||||
});
|
||||
|
||||
this.$searchbox.on('input', function() {
|
||||
that.$newElement.find('li').show().not(':icontains(' + that.$searchbox.val() + ')').hide();
|
||||
});
|
||||
},
|
||||
|
||||
val: function(value) {
|
||||
|
||||
if (value != undefined) {
|
||||
this.$element.val( value );
|
||||
|
||||
this.$element.change();
|
||||
return this.$element;
|
||||
} else {
|
||||
return this.$element.val();
|
||||
}
|
||||
},
|
||||
|
||||
selectAll: function() {
|
||||
this.$element.find('option').prop('selected', true).attr('selected', 'selected');
|
||||
this.render();
|
||||
},
|
||||
|
||||
deselectAll: function() {
|
||||
this.$element.find('option').prop('selected', false).removeAttr('selected');
|
||||
this.render();
|
||||
},
|
||||
|
||||
keydown: function(e) {
|
||||
var $this,
|
||||
$items,
|
||||
$parent,
|
||||
index,
|
||||
next,
|
||||
first,
|
||||
last,
|
||||
prev,
|
||||
nextPrev,
|
||||
that;
|
||||
|
||||
$this = $(this);
|
||||
|
||||
$parent = $this.parent();
|
||||
|
||||
that = $parent.data('this');
|
||||
|
||||
if (that.options.container) $parent = that.$menu;
|
||||
|
||||
$items = $('[role=menu] li:not(.divider):visible a', $parent);
|
||||
|
||||
if (!$items.length) return;
|
||||
|
||||
if (/(38|40)/.test(e.keyCode)) {
|
||||
|
||||
index = $items.index($items.filter(':focus'));
|
||||
first = $items.parent(':not(.disabled)').first().index();
|
||||
last = $items.parent(':not(.disabled)').last().index();
|
||||
next = $items.eq(index).parent().nextAll(':not(.disabled)').eq(0).index();
|
||||
prev = $items.eq(index).parent().prevAll(':not(.disabled)').eq(0).index();
|
||||
nextPrev = $items.eq(next).parent().prevAll(':not(.disabled)').eq(0).index();
|
||||
|
||||
if (e.keyCode == 38) {
|
||||
if (index != nextPrev && index > prev) index = prev;
|
||||
if (index < first) index = first;
|
||||
}
|
||||
|
||||
if (e.keyCode == 40) {
|
||||
if (index != nextPrev && index < next) index = next;
|
||||
if (index > last) index = last;
|
||||
if (index == -1) index = 0;
|
||||
}
|
||||
|
||||
$items.eq(index).focus();
|
||||
} else {
|
||||
var keyCodeMap = {
|
||||
48:"0", 49:"1", 50:"2", 51:"3", 52:"4", 53:"5", 54:"6", 55:"7", 56:"8", 57:"9", 59:";",
|
||||
65:"a", 66:"b", 67:"c", 68:"d", 69:"e", 70:"f", 71:"g", 72:"h", 73:"i", 74:"j", 75:"k", 76:"l",
|
||||
77:"m", 78:"n", 79:"o", 80:"p", 81:"q", 82:"r", 83:"s", 84:"t", 85:"u", 86:"v", 87:"w", 88:"x", 89:"y", 90:"z",
|
||||
96:"0", 97:"1", 98:"2", 99:"3", 100:"4", 101:"5", 102:"6", 103:"7", 104:"8", 105:"9"
|
||||
}
|
||||
|
||||
var keyIndex = [];
|
||||
|
||||
$items.each(function() {
|
||||
if ($(this).parent().is(':not(.disabled)')) {
|
||||
if ($.trim($(this).text().toLowerCase()).substring(0,1) == keyCodeMap[e.keyCode]) {
|
||||
keyIndex.push($(this).parent().index());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var count = $(document).data('keycount');
|
||||
count++;
|
||||
$(document).data('keycount',count);
|
||||
|
||||
var prevKey = $.trim($(':focus').text().toLowerCase()).substring(0,1);
|
||||
|
||||
if (prevKey != keyCodeMap[e.keyCode]) {
|
||||
count = 1;
|
||||
$(document).data('keycount',count);
|
||||
} else if (count >= keyIndex.length) {
|
||||
$(document).data('keycount',0);
|
||||
}
|
||||
|
||||
$items.eq(keyIndex[count - 1]).focus();
|
||||
}
|
||||
|
||||
// select focused option if "Enter" or "Spacebar" are pressed
|
||||
if (/(13|32)/.test(e.keyCode)) {
|
||||
e.preventDefault();
|
||||
$(':focus').click();
|
||||
$(document).data('keycount',0);
|
||||
}
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.$newElement.hide();
|
||||
},
|
||||
|
||||
show: function() {
|
||||
this.$newElement.show();
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.$newElement.remove();
|
||||
this.$element.remove();
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.selectpicker = function(option, event) {
|
||||
//get the args of the outer function..
|
||||
var args = arguments;
|
||||
var value;
|
||||
var chain = this.each(function() {
|
||||
if ($(this).is('select')) {
|
||||
var $this = $(this),
|
||||
data = $this.data('selectpicker'),
|
||||
options = typeof option == 'object' && option;
|
||||
|
||||
if (!data) {
|
||||
$this.data('selectpicker', (data = new Selectpicker(this, options, event)));
|
||||
} else if (options) {
|
||||
for(var i in options) {
|
||||
data.options[i] = options[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof option == 'string') {
|
||||
//Copy the value of option, as once we shift the arguments
|
||||
//it also shifts the value of option.
|
||||
var property = option;
|
||||
if (data[property] instanceof Function) {
|
||||
[].shift.apply(args);
|
||||
value = data[property].apply(data, args);
|
||||
} else {
|
||||
value = data.options[property];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (value != undefined) {
|
||||
return value;
|
||||
} else {
|
||||
return chain;
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.selectpicker.defaults = {
|
||||
style: 'btn-default',
|
||||
size: 'auto',
|
||||
title: null,
|
||||
selectedTextFormat : 'values',
|
||||
noneSelectedText : 'Nothing selected',
|
||||
countSelectedText: '{0} of {1} selected',
|
||||
width: false,
|
||||
container: false,
|
||||
hideDisabled: false,
|
||||
showSubtext: false,
|
||||
showIcon: true,
|
||||
showContent: true,
|
||||
dropupAuto: true,
|
||||
header: false,
|
||||
liveSearch: false
|
||||
}
|
||||
|
||||
$(document)
|
||||
.data('keycount', 0)
|
||||
.on('keydown', '[data-toggle=dropdown], [role=menu]' , Selectpicker.prototype.keydown)
|
||||
|
||||
}(window.jQuery);
|
||||
382
templates/backOffice/default/assets/js/bootstrap-switch/bootstrap-switch.js
vendored
Normal file
382
templates/backOffice/default/assets/js/bootstrap-switch/bootstrap-switch.js
vendored
Normal file
@@ -0,0 +1,382 @@
|
||||
/*! ============================================================
|
||||
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
|
||||
* http://www.larentis.eu/
|
||||
*
|
||||
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
|
||||
* http://www.bdmdesign.org/
|
||||
*
|
||||
* Project site:
|
||||
* http://www.larentis.eu/switch/
|
||||
* ============================================================
|
||||
* Licensed under the Apache License, Version 2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* ============================================================ */
|
||||
|
||||
!function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn['bootstrapSwitch'] = function (method) {
|
||||
var inputSelector = 'input[type!="hidden"]';
|
||||
var methods = {
|
||||
init: function () {
|
||||
return this.each(function () {
|
||||
var $element = $(this)
|
||||
, $div
|
||||
, $switchLeft
|
||||
, $switchRight
|
||||
, $label
|
||||
, $form = $element.closest('form')
|
||||
, myClasses = ""
|
||||
, classes = $element.attr('class')
|
||||
, color
|
||||
, moving
|
||||
, onLabel = "ON"
|
||||
, offLabel = "OFF"
|
||||
, icon = false
|
||||
, textLabel = false;
|
||||
|
||||
$.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
|
||||
if (classes.indexOf(el) >= 0)
|
||||
myClasses = el;
|
||||
});
|
||||
|
||||
$element.addClass('has-switch');
|
||||
|
||||
if ($element.data('on') !== undefined)
|
||||
color = "switch-" + $element.data('on');
|
||||
|
||||
if ($element.data('on-label') !== undefined)
|
||||
onLabel = $element.data('on-label');
|
||||
|
||||
if ($element.data('off-label') !== undefined)
|
||||
offLabel = $element.data('off-label');
|
||||
|
||||
if ($element.data('label-icon') !== undefined)
|
||||
icon = $element.data('label-icon');
|
||||
|
||||
if ($element.data('text-label') !== undefined)
|
||||
textLabel = $element.data('text-label');
|
||||
|
||||
$switchLeft = $('<span>')
|
||||
.addClass("switch-left")
|
||||
.addClass(myClasses)
|
||||
.addClass(color)
|
||||
.html(onLabel);
|
||||
|
||||
color = '';
|
||||
if ($element.data('off') !== undefined)
|
||||
color = "switch-" + $element.data('off');
|
||||
|
||||
$switchRight = $('<span>')
|
||||
.addClass("switch-right")
|
||||
.addClass(myClasses)
|
||||
.addClass(color)
|
||||
.html(offLabel);
|
||||
|
||||
$label = $('<label>')
|
||||
.html(" ")
|
||||
.addClass(myClasses)
|
||||
.attr('for', $element.find(inputSelector).attr('id'));
|
||||
|
||||
if (icon) {
|
||||
$label.html('<i class="icon ' + icon + '"></i>');
|
||||
}
|
||||
|
||||
if (textLabel) {
|
||||
$label.html('' + textLabel + '');
|
||||
}
|
||||
|
||||
$div = $element.find(inputSelector).wrap($('<div>')).parent().data('animated', false);
|
||||
|
||||
if ($element.data('animated') !== false)
|
||||
$div.addClass('switch-animate').data('animated', true);
|
||||
|
||||
$div
|
||||
.append($switchLeft)
|
||||
.append($label)
|
||||
.append($switchRight);
|
||||
|
||||
$element.find('>div').addClass(
|
||||
$element.find(inputSelector).is(':checked') ? 'switch-on' : 'switch-off'
|
||||
);
|
||||
|
||||
if ($element.find(inputSelector).is(':disabled'))
|
||||
$(this).addClass('deactivate');
|
||||
|
||||
var changeStatus = function ($this) {
|
||||
if ($element.parent('label').is('.label-change-switch')) {
|
||||
|
||||
} else {
|
||||
$this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
|
||||
}
|
||||
};
|
||||
|
||||
$element.on('keydown', function (e) {
|
||||
if (e.keyCode === 32) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
changeStatus($(e.target).find('span:first'));
|
||||
}
|
||||
});
|
||||
|
||||
$switchLeft.on('click', function (e) {
|
||||
changeStatus($(this));
|
||||
});
|
||||
|
||||
$switchRight.on('click', function (e) {
|
||||
changeStatus($(this));
|
||||
});
|
||||
|
||||
$element.find(inputSelector).on('change', function (e, skipOnChange) {
|
||||
var $this = $(this)
|
||||
, $element = $this.parent()
|
||||
, thisState = $this.is(':checked')
|
||||
, state = $element.is('.switch-off');
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$element.css('left', '');
|
||||
|
||||
if (state === thisState) {
|
||||
|
||||
if (thisState)
|
||||
$element.removeClass('switch-off').addClass('switch-on');
|
||||
else $element.removeClass('switch-on').addClass('switch-off');
|
||||
|
||||
if ($element.data('animated') !== false)
|
||||
$element.addClass("switch-animate");
|
||||
|
||||
if (typeof skipOnChange === 'boolean' && skipOnChange)
|
||||
return;
|
||||
|
||||
$element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
|
||||
}
|
||||
});
|
||||
|
||||
$element.find('label').on('mousedown touchstart', function (e) {
|
||||
var $this = $(this);
|
||||
moving = false;
|
||||
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
$this.closest('div').removeClass('switch-animate');
|
||||
|
||||
if ($this.closest('.has-switch').is('.deactivate')) {
|
||||
$this.unbind('click');
|
||||
} else if ($this.closest('.switch-on').parent().is('.radio-no-uncheck')) {
|
||||
$this.unbind('click');
|
||||
} else {
|
||||
$this.on('mousemove touchmove', function (e) {
|
||||
var $element = $(this).closest('.make-switch')
|
||||
, relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
|
||||
, percent = (relativeX / $element.width()) * 100
|
||||
, left = 25
|
||||
, right = 75;
|
||||
|
||||
moving = true;
|
||||
|
||||
if (percent < left)
|
||||
percent = left;
|
||||
else if (percent > right)
|
||||
percent = right;
|
||||
|
||||
$element.find('>div').css('left', (percent - right) + "%")
|
||||
});
|
||||
|
||||
$this.on('click touchend', function (e) {
|
||||
var $this = $(this)
|
||||
, $myInputBox = $this.siblings('input');
|
||||
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
$this.unbind('mouseleave');
|
||||
|
||||
if (moving)
|
||||
$myInputBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
|
||||
else
|
||||
$myInputBox.prop("checked", !$myInputBox.is(":checked"));
|
||||
|
||||
moving = false;
|
||||
$myInputBox.trigger('change');
|
||||
});
|
||||
|
||||
$this.on('mouseleave', function (e) {
|
||||
var $this = $(this)
|
||||
, $myInputBox = $this.siblings('input');
|
||||
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
$this.unbind('mouseleave mousemove');
|
||||
$this.trigger('mouseup');
|
||||
|
||||
$myInputBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
|
||||
});
|
||||
|
||||
$this.on('mouseup', function (e) {
|
||||
e.stopImmediatePropagation();
|
||||
e.preventDefault();
|
||||
|
||||
$(this).trigger('mouseleave');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if ($form.data('bootstrapSwitch') !== 'injected') {
|
||||
$form.bind('reset', function () {
|
||||
setTimeout(function () {
|
||||
$form.find('.make-switch').each(function () {
|
||||
var $input = $(this).find(inputSelector);
|
||||
|
||||
$input.prop('checked', $input.is(':checked')).trigger('change');
|
||||
});
|
||||
}, 1);
|
||||
});
|
||||
$form.data('bootstrapSwitch', 'injected');
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
toggleActivation: function () {
|
||||
var $this = $(this);
|
||||
|
||||
$this.toggleClass('deactivate');
|
||||
$this.find(inputSelector).prop('disabled', $this.is('.deactivate'));
|
||||
},
|
||||
isActive: function () {
|
||||
return !$(this).hasClass('deactivate');
|
||||
},
|
||||
setActive: function (active) {
|
||||
var $this = $(this);
|
||||
|
||||
if (active) {
|
||||
$this.removeClass('deactivate');
|
||||
$this.find(inputSelector).removeAttr('disabled');
|
||||
}
|
||||
else {
|
||||
$this.addClass('deactivate');
|
||||
$this.find(inputSelector).attr('disabled', 'disabled');
|
||||
}
|
||||
},
|
||||
toggleState: function (skipOnChange) {
|
||||
var $input = $(this).find(':checkbox');
|
||||
$input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
|
||||
},
|
||||
toggleRadioState: function (skipOnChange) {
|
||||
var $radioinput = $(this).find(':radio');
|
||||
$radioinput.not(':checked').prop('checked', !$radioinput.is(':checked')).trigger('change', skipOnChange);
|
||||
},
|
||||
toggleRadioStateAllowUncheck: function (uncheck, skipOnChange) {
|
||||
var $radioinput = $(this).find(':radio');
|
||||
if (uncheck) {
|
||||
$radioinput.not(':checked').trigger('change', skipOnChange);
|
||||
}
|
||||
else {
|
||||
$radioinput.not(':checked').prop('checked', !$radioinput.is(':checked')).trigger('change', skipOnChange);
|
||||
}
|
||||
},
|
||||
setState: function (value, skipOnChange) {
|
||||
$(this).find(inputSelector).prop('checked', value).trigger('change', skipOnChange);
|
||||
},
|
||||
setOnLabel: function (value) {
|
||||
var $switchLeft = $(this).find(".switch-left");
|
||||
$switchLeft.html(value);
|
||||
},
|
||||
setOffLabel: function (value) {
|
||||
var $switchRight = $(this).find(".switch-right");
|
||||
$switchRight.html(value);
|
||||
},
|
||||
setOnClass: function (value) {
|
||||
var $switchLeft = $(this).find(".switch-left");
|
||||
var color = '';
|
||||
if (value !== undefined) {
|
||||
if ($(this).attr('data-on') !== undefined) {
|
||||
color = "switch-" + $(this).attr('data-on')
|
||||
}
|
||||
$switchLeft.removeClass(color);
|
||||
color = "switch-" + value;
|
||||
$switchLeft.addClass(color);
|
||||
}
|
||||
},
|
||||
setOffClass: function (value) {
|
||||
var $switchRight = $(this).find(".switch-right");
|
||||
var color = '';
|
||||
if (value !== undefined) {
|
||||
if ($(this).attr('data-off') !== undefined) {
|
||||
color = "switch-" + $(this).attr('data-off')
|
||||
}
|
||||
$switchRight.removeClass(color);
|
||||
color = "switch-" + value;
|
||||
$switchRight.addClass(color);
|
||||
}
|
||||
},
|
||||
setAnimated: function (value) {
|
||||
var $element = $(this).find(inputSelector).parent();
|
||||
if (value === undefined) value = false;
|
||||
$element.data('animated', value);
|
||||
$element.attr('data-animated', value);
|
||||
|
||||
if ($element.data('animated') !== false) {
|
||||
$element.addClass("switch-animate");
|
||||
} else {
|
||||
$element.removeClass("switch-animate");
|
||||
}
|
||||
},
|
||||
setSizeClass: function (value) {
|
||||
var $element = $(this);
|
||||
var $switchLeft = $element.find(".switch-left");
|
||||
var $switchRight = $element.find(".switch-right");
|
||||
var $label = $element.find("label");
|
||||
$.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
|
||||
if (el !== value) {
|
||||
$switchLeft.removeClass(el);
|
||||
$switchRight.removeClass(el);
|
||||
$label.removeClass(el);
|
||||
} else {
|
||||
$switchLeft.addClass(el);
|
||||
$switchRight.addClass(el);
|
||||
$label.addClass(el);
|
||||
}
|
||||
});
|
||||
},
|
||||
status: function () {
|
||||
return $(this).find(inputSelector).is(':checked');
|
||||
},
|
||||
destroy: function () {
|
||||
var $element = $(this)
|
||||
, $div = $element.find('div')
|
||||
, $form = $element.closest('form')
|
||||
, $inputbox;
|
||||
|
||||
$div.find(':not(input)').remove();
|
||||
|
||||
$inputbox = $div.children();
|
||||
$inputbox.unwrap().unwrap();
|
||||
|
||||
$inputbox.unbind('change');
|
||||
|
||||
if ($form) {
|
||||
$form.unbind('reset');
|
||||
$form.removeData('bootstrapSwitch');
|
||||
}
|
||||
|
||||
return $inputbox;
|
||||
}
|
||||
};
|
||||
|
||||
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!');
|
||||
};
|
||||
}(jQuery);
|
||||
|
||||
(function ($) {
|
||||
$(function () {
|
||||
$('.make-switch')['bootstrapSwitch']();
|
||||
});
|
||||
})(jQuery);
|
||||
1999
templates/backOffice/default/assets/js/bootstrap/bootstrap.js
vendored
Normal file
1999
templates/backOffice/default/assets/js/bootstrap/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
182
templates/backOffice/default/assets/js/coupon.js
Normal file
182
templates/backOffice/default/assets/js/coupon.js
Normal file
@@ -0,0 +1,182 @@
|
||||
$(function($){
|
||||
|
||||
// Manage how coupon and conditions are saved
|
||||
$.couponManager = {};
|
||||
// Condition to be saved
|
||||
$.couponManager.conditionToSave = {};
|
||||
$.couponManager.conditionToSave.serviceId = false;
|
||||
$.couponManager.conditionToSave.operators = {};
|
||||
$.couponManager.conditionToSave.values = {};
|
||||
// Conditions payload to save
|
||||
$.couponManager.conditionsToSave = [];
|
||||
// Condition being updated id
|
||||
$.couponManager.conditionToUpdateId = false;
|
||||
|
||||
// Clean array from deleteValue (undefined) keys
|
||||
Array.prototype.clean = function(deleteValue) {
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this[i] == deleteValue) {
|
||||
this.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
// Remove 1 Condition then Save Conditions AJAX
|
||||
$.couponManager.removeConditionAjax = function(id) {
|
||||
// Delete condition in temporary array
|
||||
delete $.couponManager.conditionsToSave[id];
|
||||
$.couponManager.conditionsToSave.clean(undefined);
|
||||
|
||||
// Save
|
||||
$.couponManager.saveConditionAjax();
|
||||
};
|
||||
|
||||
// Add 1 Condition / or update the temporary Conditions array then Save Conditions via AJAX
|
||||
$.couponManager.createOrUpdateConditionAjax = function() {
|
||||
var id = $.couponManager.conditionToUpdateId;
|
||||
// If create
|
||||
if(!id) {
|
||||
$.couponManager.conditionsToSave.push($.couponManager.conditionToSave);
|
||||
} else { // else update
|
||||
$.couponManager.conditionsToSave[id] = $.couponManager.conditionToSave;
|
||||
// reset edit mode to off
|
||||
$.couponManager.conditionToUpdateId = false;
|
||||
}
|
||||
|
||||
// Save
|
||||
$.couponManager.saveConditionAjax();
|
||||
};
|
||||
|
||||
// Set condition inputs to allow editing
|
||||
$.couponManager.updateConditionSelectAjax = function(id) {
|
||||
$.couponManager.conditionToUpdateId = id;
|
||||
$.couponManager.conditionToSave = $.couponManager.conditionsToSave[id];
|
||||
|
||||
// Set the condition selector
|
||||
$("#category-condition option").filter(function() {
|
||||
return $(this).val() == $.couponManager.conditionToSave.serviceId;
|
||||
}).prop('selected', true);
|
||||
|
||||
// Force condition input refresh
|
||||
$.couponManager.loadConditionInputs($.couponManager.conditionToSave.serviceId, function() {
|
||||
$.couponManager.fillInConditionInputs();
|
||||
});
|
||||
};
|
||||
|
||||
// Fill in condition inputs
|
||||
$.couponManager.fillInConditionInputs = function() {
|
||||
var operatorId = null;
|
||||
var valueId = null;
|
||||
var idName = null;
|
||||
|
||||
var id = $.couponManager.conditionToUpdateId;
|
||||
if(id) {
|
||||
$.couponManager.conditionToSave = $.couponManager.conditionsToSave[id];
|
||||
}
|
||||
|
||||
for (idName in $.couponManager.conditionToSave.operators) {
|
||||
// Setting idName operator select
|
||||
operatorId = idName + '-operator';
|
||||
$('#' + operatorId).val($.couponManager.conditionToSave.operators[idName]);
|
||||
|
||||
// Setting idName value input
|
||||
valueId = idName + '-value';
|
||||
$('#' + valueId).val($.couponManager.conditionToSave.values[idName]);
|
||||
}
|
||||
};
|
||||
|
||||
// Save conditions on click
|
||||
$.couponManager.onClickSaveCondition = function() {
|
||||
$('#condition-save-btn').on('click', function () {
|
||||
if($('#category-condition').val() == 'thelia.condition.match_for_everyone') {
|
||||
// // @todo translate message + put it in modal
|
||||
var r = confirm("Do you really want to set this coupon available to everyone ?");
|
||||
if (r == true) {
|
||||
$.couponManager.createOrUpdateConditionAjax();
|
||||
}
|
||||
} else {
|
||||
$.couponManager.createOrUpdateConditionAjax();
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
$.couponManager.onClickSaveCondition();
|
||||
|
||||
// Remove condition on click
|
||||
$.couponManager.onClickDeleteCondition = function() {
|
||||
$('.condition-delete-btn').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
$.couponManager.removeConditionAjax($this.attr('data-int'));
|
||||
});
|
||||
};
|
||||
$.couponManager.onClickDeleteCondition();
|
||||
|
||||
// Update condition on click
|
||||
$.couponManager.onClickUpdateCondition = function() {
|
||||
$('.condition-update-btn').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
$.couponManager.updateConditionSelectAjax($this.attr('data-int'));
|
||||
|
||||
// Hide row being updated
|
||||
$this.parent().parent().remove();
|
||||
});
|
||||
};
|
||||
$.couponManager.onClickUpdateCondition();
|
||||
|
||||
// Reload effect inputs when changing effect
|
||||
$.couponManager.onEffectChange = function() {
|
||||
var optionSelected = $("option:selected", this);
|
||||
$('#effectToolTip').html(optionSelected.attr("data-description"));
|
||||
$('#effect').on('change', function () {
|
||||
var optionSelected = $("option:selected", this);
|
||||
$('#effectToolTip').html(optionSelected.attr("data-description"));
|
||||
});
|
||||
};
|
||||
$.couponManager.onEffectChange();
|
||||
|
||||
// Reload condition inputs when changing effect
|
||||
$.couponManager.onConditionChange = function() {
|
||||
$('#category-condition').on('change', function () {
|
||||
$.couponManager.loadConditionInputs($(this).val(), function() {});
|
||||
});
|
||||
};
|
||||
$.couponManager.onConditionChange();
|
||||
|
||||
// Fill in ready to be saved condition array
|
||||
// var onInputsChange = function()
|
||||
// In AJAX response
|
||||
|
||||
// Set max usage to unlimited or not
|
||||
$.couponManager.onUsageUnlimitedChange = function() {
|
||||
var $isUnlimited = $('#is-unlimited');
|
||||
if ($('#max-usage').val() == -1) {
|
||||
$isUnlimited.prop('checked', true);
|
||||
$('#max-usage').hide();
|
||||
$('#max-usage-label').hide();
|
||||
} else {
|
||||
$isUnlimited.prop('checked', false);
|
||||
$('#max-usage').show();
|
||||
$('#max-usage-label').show();
|
||||
}
|
||||
|
||||
$isUnlimited.change(function(){
|
||||
var $this = $(this);
|
||||
if ($this.is(':checked')) {
|
||||
$('#max-usage').hide().val('-1');
|
||||
$('#max-usage-label').hide();
|
||||
} else {
|
||||
$('#max-usage').show().val('');
|
||||
$('#max-usage-label').show();
|
||||
}
|
||||
});
|
||||
};
|
||||
$.couponManager.onUsageUnlimitedChange();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
100
templates/backOffice/default/assets/js/document-upload.js
Normal file
100
templates/backOffice/default/assets/js/document-upload.js
Normal file
@@ -0,0 +1,100 @@
|
||||
$(function($){
|
||||
// Manage document upload
|
||||
$.documentUploadManager = {};
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
|
||||
|
||||
// Remove image on click
|
||||
$.documentUploadManager.initDocumentDropZone = function() {
|
||||
$.documentUploadManager.onClickDeleteDocument();
|
||||
|
||||
var documentDropzone = new Dropzone("#documents-dropzone", {
|
||||
dictDefaultMessage : $('.btn-browse').html(),
|
||||
uploadMultiple: false,
|
||||
maxFilesize: 8
|
||||
});
|
||||
|
||||
var totalFiles = 0,
|
||||
completedFiles = 0;
|
||||
|
||||
documentDropzone.on("addedfile", function(file){
|
||||
totalFiles += 1;
|
||||
|
||||
if(totalFiles == 1){
|
||||
$('.dz-message').hide();
|
||||
}
|
||||
});
|
||||
|
||||
documentDropzone.on("complete", function(file){
|
||||
completedFiles += 1;
|
||||
|
||||
if (completedFiles === totalFiles){
|
||||
$('.dz-message').slideDown();
|
||||
}
|
||||
});
|
||||
|
||||
documentDropzone.on("success", function(file) {
|
||||
documentDropzone.removeFile(file);
|
||||
$.documentUploadManager.updateDocumentListAjax();
|
||||
$.documentUploadManager.onClickDeleteDocument();
|
||||
});
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
// Update picture list via AJAX call
|
||||
$.documentUploadManager.updateDocumentListAjax = function() {
|
||||
var $documentListArea = $(".document-manager .existing-document");
|
||||
$documentListArea.html('<div class="loading" ></div>');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: documentListUrl,
|
||||
statusCode: {
|
||||
404: function() {
|
||||
$documentListArea.html(
|
||||
documentListErrorMessage
|
||||
);
|
||||
}
|
||||
}
|
||||
}).done(function(data) {
|
||||
$documentListArea.html(
|
||||
data
|
||||
);
|
||||
$.documentUploadManager.onClickDeleteDocument();
|
||||
});
|
||||
};
|
||||
|
||||
// Remove image on click
|
||||
$.documentUploadManager.onClickDeleteDocument = function() {
|
||||
$('.document-manager .document-delete-btn').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
var $parent = $this.parent();
|
||||
$parent.find('a').remove();
|
||||
$parent.append('<div class="loading" ></div>');
|
||||
var $url = $this.attr("href");
|
||||
var errorMessage = $this.attr("data-error-message");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: $url,
|
||||
statusCode: {
|
||||
404: function() {
|
||||
$(".document-manager .message").html(
|
||||
errorMessage
|
||||
);
|
||||
}
|
||||
}
|
||||
}).done(function(data) {
|
||||
$parent.parents('tr').remove();
|
||||
|
||||
$(".document-manager .message").html(
|
||||
data
|
||||
);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
};
|
||||
});
|
||||
1758
templates/backOffice/default/assets/js/dropzone.js
Normal file
1758
templates/backOffice/default/assets/js/dropzone.js
Normal file
File diff suppressed because it is too large
Load Diff
102
templates/backOffice/default/assets/js/image-upload.js
Normal file
102
templates/backOffice/default/assets/js/image-upload.js
Normal file
@@ -0,0 +1,102 @@
|
||||
$(function($){
|
||||
// Manage picture upload
|
||||
$.imageUploadManager = {};
|
||||
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
|
||||
|
||||
// Remove image on click
|
||||
$.imageUploadManager.initImageDropZone = function() {
|
||||
$.imageUploadManager.onClickDeleteImage();
|
||||
|
||||
var imageDropzone = new Dropzone("#images-dropzone", {
|
||||
dictDefaultMessage : $('.btn-browse').html(),
|
||||
uploadMultiple: false,
|
||||
maxFilesize: 8,
|
||||
acceptedFiles: 'image/png, image/gif, image/jpeg'
|
||||
});
|
||||
|
||||
var totalFiles = 0,
|
||||
completedFiles = 0;
|
||||
|
||||
imageDropzone.on("addedfile", function(file){
|
||||
totalFiles += 1;
|
||||
|
||||
if(totalFiles == 1){
|
||||
$('.dz-message').hide();
|
||||
}
|
||||
});
|
||||
|
||||
imageDropzone.on("complete", function(file){
|
||||
completedFiles += 1;
|
||||
|
||||
if (completedFiles === totalFiles){
|
||||
$('.dz-message').slideDown();
|
||||
}
|
||||
});
|
||||
|
||||
imageDropzone.on("success", function(file) {
|
||||
imageDropzone.removeFile(file);
|
||||
$.imageUploadManager.updateImageListAjax();
|
||||
$.imageUploadManager.onClickDeleteImage();
|
||||
});
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
// Update picture list via AJAX call
|
||||
$.imageUploadManager.updateImageListAjax = function() {
|
||||
var $imageListArea = $(".image-manager .existing-image");
|
||||
$imageListArea.html('<div class="loading" ></div>');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: imageListUrl,
|
||||
statusCode: {
|
||||
404: function() {
|
||||
$imageListArea.html(
|
||||
imageListErrorMessage
|
||||
);
|
||||
}
|
||||
}
|
||||
}).done(function(data) {
|
||||
$imageListArea.html(
|
||||
data
|
||||
);
|
||||
$.imageUploadManager.onClickDeleteImage();
|
||||
});
|
||||
};
|
||||
|
||||
// Remove image on click
|
||||
$.imageUploadManager.onClickDeleteImage = function() {
|
||||
$('.image-manager .image-delete-btn').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this);
|
||||
var $parent = $this.parent();
|
||||
var $greatParent = $parent.parent();
|
||||
|
||||
$greatParent.append('<div class="loading" ></div>');
|
||||
$greatParent.find('.btn-group').remove();
|
||||
var $url = $this.attr("href");
|
||||
var errorMessage = $this.attr("data-error-message");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: $url,
|
||||
statusCode: {
|
||||
404: function() {
|
||||
$(".image-manager .message").html(
|
||||
errorMessage
|
||||
);
|
||||
}
|
||||
}
|
||||
}).done(function(data) {
|
||||
$greatParent.remove();
|
||||
$(".image-manager .message").html(
|
||||
data
|
||||
);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
};
|
||||
});
|
||||
3
templates/backOffice/default/assets/js/jqplot/jquery.jqplot.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/jquery.jqplot.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.BezierCurveRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.BezierCurveRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.barRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.barRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.blockRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.blockRenderer.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(a){a.jqplot.BlockRenderer=function(){a.jqplot.LineRenderer.call(this)};a.jqplot.BlockRenderer.prototype=new a.jqplot.LineRenderer();a.jqplot.BlockRenderer.prototype.constructor=a.jqplot.BlockRenderer;a.jqplot.BlockRenderer.prototype.init=function(b){this.css={padding:"2px",border:"1px solid #999",textAlign:"center"};this.escapeHtml=false;this.insertBreaks=true;this.varyBlockColors=false;a.extend(true,this,b);if(this.css.backgroundColor){this.color=this.css.backgroundColor}else{if(this.css.background){this.color=this.css.background}else{if(!this.varyBlockColors){this.css.background=this.color}}}this.canvas=new a.jqplot.BlockCanvas();this.shadowCanvas=new a.jqplot.BlockCanvas();this.canvas._plotDimensions=this._plotDimensions;this.shadowCanvas._plotDimensions=this._plotDimensions;this._type="block";this.moveBlock=function(l,j,i,e){var c=this.canvas._elem.children(":eq("+l+")");this.data[l][0]=j;this.data[l][1]=i;this._plotData[l][0]=j;this._plotData[l][1]=i;this._stackData[l][0]=j;this._stackData[l][1]=i;this.gridData[l][0]=this._xaxis.series_u2p(j);this.gridData[l][1]=this._yaxis.series_u2p(i);var k=c.outerWidth();var f=c.outerHeight();var d=this.gridData[l][0]-k/2+"px";var g=this.gridData[l][1]-f/2+"px";if(e){if(parseInt(e,10)){e=parseInt(e,10)}c.animate({left:d,top:g},e)}else{c.css({left:d,top:g})}c=null}};a.jqplot.BlockRenderer.prototype.draw=function(q,o,r){if(this.plugins.pointLabels){this.plugins.pointLabels.show=false}var f,c,l,o,p,k,n,g,e,m;var b=(r!=undefined)?r:{};var j=new a.jqplot.ColorGenerator(this.seriesColors);this.canvas._elem.empty();for(f=0;f<this.gridData.length;f++){l=this.data[f];o=this.gridData[f];p="";k={};if(typeof l[2]=="string"){p=l[2]}else{if(typeof l[2]=="object"){k=l[2]}}if(typeof l[3]=="object"){k=l[3]}if(this.insertBreaks){p=p.replace(/ /g,"<br />")}k=a.extend(true,{},this.css,k);c=a('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');this.canvas._elem.append(c);this.escapeHtml?c.text(p):c.html(p);delete k.position;delete k.marginRight;delete k.marginLeft;if(!k.background&&!k.backgroundColor&&!k.backgroundImage){k.background=j.next()}c.css(k);n=c.outerWidth();g=c.outerHeight();e=o[0]-n/2+"px";m=o[1]-g/2+"px";c.css({left:e,top:m});c=null}};a.jqplot.BlockCanvas=function(){a.jqplot.ElemContainer.call(this);this._ctx};a.jqplot.BlockCanvas.prototype=new a.jqplot.ElemContainer();a.jqplot.BlockCanvas.prototype.constructor=a.jqplot.BlockCanvas;a.jqplot.BlockCanvas.prototype.createElement=function(i,e,c){this._offsets=i;var b="jqplot-blockCanvas";if(e!=undefined){b=e}var g;if(this._elem){g=this._elem.get(0)}else{g=document.createElement("div")}if(c!=undefined){this._plotDimensions=c}var d=this._plotDimensions.width-this._offsets.left-this._offsets.right+"px";var f=this._plotDimensions.height-this._offsets.top-this._offsets.bottom+"px";this._elem=a(g);this._elem.css({position:"absolute",width:d,height:f,left:this._offsets.left,top:this._offsets.top});this._elem.addClass(b);return this._elem};a.jqplot.BlockCanvas.prototype.setContext=function(){this._ctx={canvas:{width:0,height:0},clearRect:function(){return null}};return this._ctx}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.bubbleRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.bubbleRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(a){a.jqplot.CanvasAxisLabelRenderer=function(b){this.angle=0;this.axis;this.show=true;this.showLabel=true;this.label="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);if(b.angle==null&&this.axis!="xaxis"&&this.axis!="x2axis"){this.angle=-90}var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisLabelRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(c,f){if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css({position:"absolute"});this._elem.addClass("jqplot-"+this.axis+"-label");e=null;return this._elem};a.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(a){a.jqplot.CanvasAxisTickRenderer=function(b){this.mark="outside";this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.angle=0;this.markSize=4;this.show=true;this.showLabel=true;this.labelPosition="auto";this.label="";this.value=null;this._styles={};this.formatter=a.jqplot.DefaultTickFormatter;this.formatString="";this.prefix="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="10pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisTickRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getTop=function(b){if(this._elem){return this._elem.position().top}else{return null}};a.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(b,d,c){this.value=b;if(c){this.isMinorTick=true}return this};a.jqplot.CanvasAxisTickRenderer.prototype.draw=function(c,f){if(!this.label){this.label=this.prefix+this.formatter(this.formatString,this.value)}if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e.style.textAlign="left";e.style.position="absolute";e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css(this._styles);this._elem.addClass("jqplot-"+this.axis+"-tick");e=null;return this._elem};a.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasOverlay.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasOverlay.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasTextRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.canvasTextRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.categoryAxisRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.categoryAxisRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.ciParser.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.ciParser.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(a){a.jqplot.ciParser=function(g,l){var m=[],o,n,h,f,e,c;if(typeof(g)=="string"){g=a.jqplot.JSON.parse(g,d)}else{if(typeof(g)=="object"){for(e in g){for(h=0;h<g[e].length;h++){for(c in g[e][h]){g[e][h][c]=d(c,g[e][h][c])}}}}else{return null}}function d(j,k){var i;if(k!=null){if(k.toString().indexOf("Date")>=0){i=/^\/Date\((-?[0-9]+)\)\/$/.exec(k);if(i){return parseInt(i[1],10)}}return k}}for(var b in g){o=[];n=g[b];switch(b){case"PriceTicks":for(h=0;h<n.length;h++){o.push([n[h]["TickDate"],n[h]["Price"]])}break;case"PriceBars":for(h=0;h<n.length;h++){o.push([n[h]["BarDate"],n[h]["Open"],n[h]["High"],n[h]["Low"],n[h]["Close"]])}break}m.push(o)}return m}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.cursor.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.cursor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.dateAxisRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.dateAxisRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.donutRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.donutRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.dragable.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.dragable.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(d){d.jqplot.Dragable=function(g){this.markerRenderer=new d.jqplot.MarkerRenderer({shadow:false});this.shapeRenderer=new d.jqplot.ShapeRenderer();this.isDragging=false;this.isOver=false;this._ctx;this._elem;this._point;this._gridData;this.color;this.constrainTo="none";d.extend(true,this,g)};function b(){d.jqplot.GenericCanvas.call(this);this.isDragging=false;this.isOver=false;this._neighbor;this._cursors=[]}b.prototype=new d.jqplot.GenericCanvas();b.prototype.constructor=b;d.jqplot.Dragable.parseOptions=function(i,h){var g=h||{};this.plugins.dragable=new d.jqplot.Dragable(g.dragable);this.isDragable=d.jqplot.config.enablePlugins};d.jqplot.Dragable.postPlotDraw=function(){if(this.plugins.dragable&&this.plugins.dragable.highlightCanvas){this.plugins.dragable.highlightCanvas.resetCanvas();this.plugins.dragable.highlightCanvas=null}this.plugins.dragable={previousCursor:"auto",isOver:false};this.plugins.dragable.dragCanvas=new b();this.eventCanvas._elem.before(this.plugins.dragable.dragCanvas.createElement(this._gridPadding,"jqplot-dragable-canvas",this._plotDimensions,this));var g=this.plugins.dragable.dragCanvas.setContext()};d.jqplot.preParseSeriesOptionsHooks.push(d.jqplot.Dragable.parseOptions);d.jqplot.postDrawHooks.push(d.jqplot.Dragable.postPlotDraw);d.jqplot.eventListenerHooks.push(["jqplotMouseMove",e]);d.jqplot.eventListenerHooks.push(["jqplotMouseDown",c]);d.jqplot.eventListenerHooks.push(["jqplotMouseUp",a]);function f(n,p){var q=n.series[p.seriesIndex];var m=q.plugins.dragable;var h=q.markerRenderer;var i=m.markerRenderer;i.style=h.style;i.lineWidth=h.lineWidth+2.5;i.size=h.size+5;if(!m.color){var l=d.jqplot.getColorComponents(h.color);var o=[l[0],l[1],l[2]];var k=(l[3]>=0.6)?l[3]*0.6:l[3]*(2-l[3]);m.color="rgba("+o[0]+","+o[1]+","+o[2]+","+k+")"}i.color=m.color;i.init();var g=(p.pointIndex>0)?p.pointIndex-1:0;var j=p.pointIndex+2;m._gridData=q.gridData.slice(g,j)}function e(o,l,h,t,m){if(m.plugins.dragable.dragCanvas.isDragging){var u=m.plugins.dragable.dragCanvas;var i=u._neighbor;var w=m.series[i.seriesIndex];var k=w.plugins.dragable;var r=w.gridData;var p=(k.constrainTo=="y")?i.gridData[0]:l.x;var n=(k.constrainTo=="x")?i.gridData[1]:l.y;var g=w._xaxis.series_p2u(p);var q=w._yaxis.series_p2u(n);var v=u._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height);if(i.pointIndex>0){k._gridData[1]=[p,n]}else{k._gridData[0]=[p,n]}m.series[i.seriesIndex].draw(u._ctx,{gridData:k._gridData,shadow:false,preventJqPlotSeriesDrawTrigger:true,color:k.color,markerOptions:{color:k.color,shadow:false},trendline:{show:false}});m.target.trigger("jqplotSeriesPointChange",[i.seriesIndex,i.pointIndex,[g,q],[p,n]])}else{if(t!=null){var j=m.series[t.seriesIndex];if(j.isDragable){var u=m.plugins.dragable.dragCanvas;if(!u.isOver){u._cursors.push(o.target.style.cursor);o.target.style.cursor="pointer"}u.isOver=true}}else{if(t==null){var u=m.plugins.dragable.dragCanvas;if(u.isOver){o.target.style.cursor=u._cursors.pop();u.isOver=false}}}}}function c(k,i,g,l,j){var m=j.plugins.dragable.dragCanvas;m._cursors.push(k.target.style.cursor);if(l!=null){var o=j.series[l.seriesIndex];var h=o.plugins.dragable;if(o.isDragable&&!m.isDragging){m._neighbor=l;m.isDragging=true;f(j,l);h.markerRenderer.draw(o.gridData[l.pointIndex][0],o.gridData[l.pointIndex][1],m._ctx);k.target.style.cursor="move";j.target.trigger("jqplotDragStart",[l.seriesIndex,l.pointIndex,i,g])}}else{var n=m._ctx;n.clearRect(0,0,n.canvas.width,n.canvas.height);m.isDragging=false}}function a(m,j,g,o,k){if(k.plugins.dragable.dragCanvas.isDragging){var p=k.plugins.dragable.dragCanvas;var q=p._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);p.isDragging=false;var h=p._neighbor;var r=k.series[h.seriesIndex];var i=r.plugins.dragable;var n=(i.constrainTo=="y")?h.data[0]:g[r.xaxis];var l=(i.constrainTo=="x")?h.data[1]:g[r.yaxis];r.data[h.pointIndex][0]=n;r.data[h.pointIndex][1]=l;k.drawSeries({preventJqPlotSeriesDrawTrigger:true},h.seriesIndex);p._neighbor=null;m.target.style.cursor=p._cursors.pop();k.target.trigger("jqplotDragStop",[j,g])}}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(c){c.jqplot.EnhancedLegendRenderer=function(){c.jqplot.TableLegendRenderer.call(this)};c.jqplot.EnhancedLegendRenderer.prototype=new c.jqplot.TableLegendRenderer();c.jqplot.EnhancedLegendRenderer.prototype.constructor=c.jqplot.EnhancedLegendRenderer;c.jqplot.EnhancedLegendRenderer.prototype.init=function(d){this.numberRows=null;this.numberColumns=null;this.seriesToggle="normal";this.seriesToggleReplot=false;this.disableIEFading=true;c.extend(true,this,d);if(this.seriesToggle){c.jqplot.postDrawHooks.push(b)}};c.jqplot.EnhancedLegendRenderer.prototype.draw=function(m,y){var f=this;if(this.show){var r=this._series;var u;var w="position:absolute;";w+=(this.background)?"background:"+this.background+";":"";w+=(this.border)?"border:"+this.border+";":"";w+=(this.fontSize)?"font-size:"+this.fontSize+";":"";w+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";w+=(this.textColor)?"color:"+this.textColor+";":"";w+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";w+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";w+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";w+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=c('<table class="jqplot-table-legend" style="'+w+'"></table>');if(this.seriesToggle){this._elem.css("z-index","3")}var C=false,q=false,d,o;if(this.numberRows){d=this.numberRows;if(!this.numberColumns){o=Math.ceil(r.length/d)}else{o=this.numberColumns}}else{if(this.numberColumns){o=this.numberColumns;d=Math.ceil(r.length/this.numberColumns)}else{d=r.length;o=1}}var B,z,e,l,k,n,p,t,h,g;var v=0;for(B=r.length-1;B>=0;B--){if(o==1&&r[B]._stack||r[B].renderer.constructor==c.jqplot.BezierCurveRenderer){q=true}}for(B=0;B<d;B++){e=c(document.createElement("tr"));e.addClass("jqplot-table-legend");if(q){e.prependTo(this._elem)}else{e.appendTo(this._elem)}for(z=0;z<o;z++){if(v<r.length&&(r[v].show||r[v].showLabel)){u=r[v];n=this.labels[v]||u.label.toString();if(n){var x=u.color;if(!q){if(B>0){C=true}else{C=false}}else{if(B==d-1){C=false}else{C=true}}p=(C)?this.rowSpacing:"0";l=c(document.createElement("td"));l.addClass("jqplot-table-legend jqplot-table-legend-swatch");l.css({textAlign:"center",paddingTop:p});h=c(document.createElement("div"));h.addClass("jqplot-table-legend-swatch-outline");g=c(document.createElement("div"));g.addClass("jqplot-table-legend-swatch");g.css({backgroundColor:x,borderColor:x});l.append(h.append(g));k=c(document.createElement("td"));k.addClass("jqplot-table-legend jqplot-table-legend-label");k.css("paddingTop",p);if(this.escapeHtml){k.text(n)}else{k.html(n)}if(q){if(this.showLabels){k.prependTo(e)}if(this.showSwatches){l.prependTo(e)}}else{if(this.showSwatches){l.appendTo(e)}if(this.showLabels){k.appendTo(e)}}if(this.seriesToggle){var A;if(typeof(this.seriesToggle)==="string"||typeof(this.seriesToggle)==="number"){if(!c.jqplot.use_excanvas||!this.disableIEFading){A=this.seriesToggle}}if(this.showSwatches){l.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);l.addClass("jqplot-seriesToggle")}if(this.showLabels){k.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);k.addClass("jqplot-seriesToggle")}if(!u.show&&u.showLabel){l.addClass("jqplot-series-hidden");k.addClass("jqplot-series-hidden")}}C=true}}v++}l=k=h=g=null}}return this._elem};var a=function(j){var i=j.data,m=i.series,k=i.replot,h=i.plot,f=i.speed,l=m.index,g=false;if(m.canvas._elem.is(":hidden")||!m.show){g=true}var e=function(){if(k){var n={};if(c.isPlainObject(k)){c.extend(true,n,k)}h.replot(n);if(g&&f){var d=h.series[l];if(d.shadowCanvas._elem){d.shadowCanvas._elem.hide().fadeIn(f)}d.canvas._elem.hide().fadeIn(f);d.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+d.index).hide().fadeIn(f)}}else{var d=h.series[l];if(d.canvas._elem.is(":hidden")||!d.show){if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).addClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).addClass("jqplot-series-hidden")}}else{if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).removeClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).removeClass("jqplot-series-hidden")}}}};m.toggleDisplay(j,e)};var b=function(){if(this.legend.renderer.constructor==c.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var d=this.legend._elem.detach();this.eventCanvas._elem.after(d)}}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.funnelRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.funnelRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.highlighter.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.highlighter.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.json2.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.json2.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function($){$.jqplot.JSON=window.JSON;if(!window.JSON){$.jqplot.JSON={}}function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof $.jqplot.JSON.stringify!=="function"){$.jqplot.JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("$.jqplot.JSON.stringify")}return str("",{"":value})}}if(typeof $.jqplot.JSON.parse!=="function"){$.jqplot.JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("$.jqplot.JSON.parse")}}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.logAxisRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.logAxisRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.mekkoAxisRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.mekkoAxisRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.mekkoRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.mekkoRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.meterGaugeRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.meterGaugeRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.mobile.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.mobile.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(b){function a(e,d,c){this.bindCustomEvents=function(){this.eventCanvas._elem.bind("vclick",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("taphold",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("vmousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("vmousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave);if(this.captureRightClick){this.eventCanvas._elem.bind("vmouseup",{plot:this},this.onRightClick);this.eventCanvas._elem.get(0).oncontextmenu=function(){return false}}else{this.eventCanvas._elem.bind("vmouseup",{plot:this},this.onMouseUp)}};this.plugins.mobile=true}b.jqplot.postInitHooks.push(a)})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.ohlcRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.ohlcRenderer.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(a){a.jqplot.OHLCRenderer=function(){a.jqplot.LineRenderer.call(this);this.candleStick=false;this.tickLength="auto";this.bodyWidth="auto";this.openColor=null;this.closeColor=null;this.wickColor=null;this.fillUpBody=false;this.fillDownBody=true;this.upBodyColor=null;this.downBodyColor=null;this.hlc=false;this.lineWidth=1.5;this._tickLength;this._bodyWidth};a.jqplot.OHLCRenderer.prototype=new a.jqplot.LineRenderer();a.jqplot.OHLCRenderer.prototype.constructor=a.jqplot.OHLCRenderer;a.jqplot.OHLCRenderer.prototype.init=function(e){e=e||{};this.lineWidth=e.lineWidth||1.5;a.jqplot.LineRenderer.prototype.init.call(this,e);this._type="ohlc";var b=this._yaxis._dataBounds;var f=this._plotData;if(f[0].length<5){this.renderer.hlc=true;for(var c=0;c<f.length;c++){if(f[c][2]<b.min||b.min==null){b.min=f[c][2]}if(f[c][1]>b.max||b.max==null){b.max=f[c][1]}}}else{for(var c=0;c<f.length;c++){if(f[c][3]<b.min||b.min==null){b.min=f[c][3]}if(f[c][2]>b.max||b.max==null){b.max=f[c][2]}}}};a.jqplot.OHLCRenderer.prototype.draw=function(A,N,j){var J=this.data;var v=this._xaxis.min;var z=this._xaxis.max;var l=0;var K=J.length;var p=this._xaxis.series_u2p;var G=this._yaxis.series_u2p;var D,E,f,M,F,n,O,C;var y;var u=this.renderer;var s=(j!=undefined)?j:{};var k=(s.shadow!=undefined)?s.shadow:this.shadow;var B=(s.fill!=undefined)?s.fill:this.fill;var c=(s.fillAndStroke!=undefined)?s.fillAndStroke:this.fillAndStroke;u.bodyWidth=(s.bodyWidth!=undefined)?s.bodyWidth:u.bodyWidth;u.tickLength=(s.tickLength!=undefined)?s.tickLength:u.tickLength;A.save();if(this.show){var m,q,g,Q,t;for(var D=0;D<J.length;D++){if(J[D][0]<v){l=D}else{if(J[D][0]<z){K=D+1}}}var I=this.gridData[K-1][0]-this.gridData[l][0];var L=K-l;try{var P=Math.abs(this._xaxis.series_u2p(parseInt(this._xaxis._intervalStats[0].sortedIntervals[0].interval,10))-this._xaxis.series_u2p(0))}catch(H){var P=I/L}if(u.candleStick){if(typeof(u.bodyWidth)=="number"){u._bodyWidth=u.bodyWidth}else{u._bodyWidth=Math.min(20,P/1.65)}}else{if(typeof(u.tickLength)=="number"){u._tickLength=u.tickLength}else{u._tickLength=Math.min(10,P/3.5)}}for(var D=l;D<K;D++){m=p(J[D][0]);if(u.hlc){q=null;g=G(J[D][1]);Q=G(J[D][2]);t=G(J[D][3])}else{q=G(J[D][1]);g=G(J[D][2]);Q=G(J[D][3]);t=G(J[D][4])}y={};if(u.candleStick&&!u.hlc){n=u._bodyWidth;O=m-n/2;if(t<q){if(u.wickColor){y.color=u.wickColor}else{if(u.downBodyColor){y.color=u.upBodyColor}}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,[[m,g],[m,t]],f);u.shapeRenderer.draw(A,[[m,q],[m,Q]],f);y={};M=t;F=q-t;if(u.fillUpBody){y.fillRect=true}else{y.strokeRect=true;n=n-this.lineWidth;O=m-n/2}if(u.upBodyColor){y.color=u.upBodyColor;y.fillStyle=u.upBodyColor}C=[O,M,n,F]}else{if(t>q){if(u.wickColor){y.color=u.wickColor}else{if(u.downBodyColor){y.color=u.downBodyColor}}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,[[m,g],[m,q]],f);u.shapeRenderer.draw(A,[[m,t],[m,Q]],f);y={};M=q;F=t-q;if(u.fillDownBody){y.fillRect=true}else{y.strokeRect=true;n=n-this.lineWidth;O=m-n/2}if(u.downBodyColor){y.color=u.downBodyColor;y.fillStyle=u.downBodyColor}C=[O,M,n,F]}else{if(u.wickColor){y.color=u.wickColor}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,[[m,g],[m,Q]],f);y={};y.fillRect=false;y.strokeRect=false;O=[m-n/2,q];M=[m+n/2,t];n=null;F=null;C=[O,M]}}f=a.extend(true,{},s,y);u.shapeRenderer.draw(A,C,f)}else{E=s.color;if(u.openColor){s.color=u.openColor}if(!u.hlc){u.shapeRenderer.draw(A,[[m-u._tickLength,q],[m,q]],s)}s.color=E;if(u.wickColor){s.color=u.wickColor}u.shapeRenderer.draw(A,[[m,g],[m,Q]],s);s.color=E;if(u.closeColor){s.color=u.closeColor}u.shapeRenderer.draw(A,[[m,t],[m+u._tickLength,t]],s);s.color=E}}}A.restore()};a.jqplot.OHLCRenderer.prototype.drawShadow=function(b,d,c){};a.jqplot.OHLCRenderer.checkOptions=function(d,c,b){if(!b.highlighter){b.highlighter={showMarker:false,tooltipAxes:"y",yvalues:4,formatString:'<table class="jqplot-highlighter"><tr><td>date:</td><td>%s</td></tr><tr><td>open:</td><td>%s</td></tr><tr><td>hi:</td><td>%s</td></tr><tr><td>low:</td><td>%s</td></tr><tr><td>close:</td><td>%s</td></tr></table>'}}}})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pieRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pieRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pointLabels.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pointLabels.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(c){c.jqplot.PointLabels=function(e){this.show=c.jqplot.config.enablePlugins;this.location="n";this.labelsFromSeries=false;this.seriesLabelIndex=null;this.labels=[];this._labels=[];this.stackedValue=false;this.ypadding=6;this.xpadding=6;this.escapeHTML=true;this.edgeTolerance=-5;this.formatter=c.jqplot.DefaultTickFormatter;this.formatString="";this.hideZeros=false;this._elems=[];c.extend(true,this,e)};var a=["nw","n","ne","e","se","s","sw","w"];var d={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7};var b=["se","s","sw","w","nw","n","ne","e"];c.jqplot.PointLabels.init=function(j,h,f,g,i){var e=c.extend(true,{},f,g);e.pointLabels=e.pointLabels||{};if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"&&!e.pointLabels.location){e.pointLabels.location="e"}this.plugins.pointLabels=new c.jqplot.PointLabels(e.pointLabels);this.plugins.pointLabels.setLabels.call(this)};c.jqplot.PointLabels.prototype.setLabels=function(){var f=this.plugins.pointLabels;var h;if(f.seriesLabelIndex!=null){h=f.seriesLabelIndex}else{if(this.renderer.constructor===c.jqplot.BarRenderer&&this.barDirection==="horizontal"){h=(this._plotData[0].length<3)?0:this._plotData[0].length-1}else{h=(this._plotData.length===0)?0:this._plotData[0].length-1}}f._labels=[];if(f.labels.length===0||f.labelsFromSeries){if(f.stackedValue){if(this._plotData.length&&this._plotData[0].length){for(var e=0;e<this._plotData.length;e++){f._labels.push(this._plotData[e][h])}}}else{var g=this.data;if(this.renderer.constructor===c.jqplot.BarRenderer&&this.waterfall){g=this._data}if(g.length&&g[0].length){for(var e=0;e<g.length;e++){f._labels.push(g[e][h])}}g=null}}else{if(f.labels.length){f._labels=f.labels}}};c.jqplot.PointLabels.prototype.xOffset=function(f,e,g){e=e||this.location;g=g||this.xpadding;var h;switch(e){case"nw":h=-f.outerWidth(true)-this.xpadding;break;case"n":h=-f.outerWidth(true)/2;break;case"ne":h=this.xpadding;break;case"e":h=this.xpadding;break;case"se":h=this.xpadding;break;case"s":h=-f.outerWidth(true)/2;break;case"sw":h=-f.outerWidth(true)-this.xpadding;break;case"w":h=-f.outerWidth(true)-this.xpadding;break;default:h=-f.outerWidth(true)-this.xpadding;break}return h};c.jqplot.PointLabels.prototype.yOffset=function(f,e,g){e=e||this.location;g=g||this.xpadding;var h;switch(e){case"nw":h=-f.outerHeight(true)-this.ypadding;break;case"n":h=-f.outerHeight(true)-this.ypadding;break;case"ne":h=-f.outerHeight(true)-this.ypadding;break;case"e":h=-f.outerHeight(true)/2;break;case"se":h=this.ypadding;break;case"s":h=this.ypadding;break;case"sw":h=this.ypadding;break;case"w":h=-f.outerHeight(true)/2;break;default:h=-f.outerHeight(true)-this.ypadding;break}return h};c.jqplot.PointLabels.draw=function(x,j,v){var t=this.plugins.pointLabels;t.setLabels.call(this);for(var w=0;w<t._elems.length;w++){t._elems[w].emptyForce()}t._elems.splice(0,t._elems.length);if(t.show){var r="_"+this._stackAxis+"axis";if(!t.formatString){t.formatString=this[r]._ticks[0].formatString;t.formatter=this[r]._ticks[0].formatter}var E=this._plotData;var D=this._prevPlotData;var A=this._xaxis;var q=this._yaxis;var z,f;for(var w=0,u=t._labels.length;w<u;w++){var o=t._labels[w];if(o==null||(t.hideZeros&&parseInt(o,10)==0)){continue}o=t.formatter(t.formatString,o);f=document.createElement("div");t._elems[w]=c(f);z=t._elems[w];z.addClass("jqplot-point-label jqplot-series-"+this.index+" jqplot-point-"+w);z.css("position","absolute");z.insertAfter(x.canvas);if(t.escapeHTML){z.text(o)}else{z.html(o)}var g=t.location;if((this.fillToZero&&E[w][1]<0)||(this.fillToZero&&this._type==="bar"&&this.barDirection==="horizontal"&&E[w][0]<0)||(this.waterfall&&parseInt(o,10))<0){g=b[d[g]]}var n=A.u2p(E[w][0])+t.xOffset(z,g);var h=q.u2p(E[w][1])+t.yOffset(z,g);if(this._stack&&!t.stackedValue){if(this.barDirection==="vertical"){h=(this._barPoints[w][0][1]+this._barPoints[w][1][1])/2+v._gridPadding.top-0.5*z.outerHeight(true)}else{n=(this._barPoints[w][2][0]+this._barPoints[w][0][0])/2+v._gridPadding.left-0.5*z.outerWidth(true)}}if(this.renderer.constructor==c.jqplot.BarRenderer){if(this.barDirection=="vertical"){n+=this._barNudge}else{h-=this._barNudge}}z.css("left",n);z.css("top",h);var k=n+z.width();var s=h+z.height();var C=t.edgeTolerance;var e=c(x.canvas).position().left;var y=c(x.canvas).position().top;var B=x.canvas.width+e;var m=x.canvas.height+y;if(n-C<e||h-C<y||k+C>B||s+C>m){z.remove()}z=null;f=null}}};c.jqplot.postSeriesInitHooks.push(c.jqplot.PointLabels.init);c.jqplot.postDrawSeriesHooks.push(c.jqplot.PointLabels.draw)})(jQuery);
|
||||
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pyramidAxisRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pyramidAxisRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pyramidGridRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pyramidGridRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pyramidRenderer.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.pyramidRenderer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.trendline.min.js
vendored
Normal file
3
templates/backOffice/default/assets/js/jqplot/plugins/jqplot.trendline.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
|
||||
jsDate | (c) 2010-2013 Chris Leonello
|
||||
*/(function(f){f.jqplot.Trendline=function(){this.show=f.jqplot.config.enablePlugins;this.color="#666666";this.renderer=new f.jqplot.LineRenderer();this.rendererOptions={marker:{show:false}};this.label="";this.type="linear";this.shadow=true;this.markerRenderer={show:false};this.lineWidth=1.5;this.shadowAngle=45;this.shadowOffset=1;this.shadowAlpha=0.07;this.shadowDepth=3;this.isTrendline=true};f.jqplot.postSeriesInitHooks.push(e);f.jqplot.postDrawSeriesHooks.push(g);f.jqplot.addLegendRowHooks.push(a);function a(k){var j=null;if(k.trendline&&k.trendline.show){var i=k.trendline.label.toString();if(i){j={label:i,color:k.trendline.color}}}return j}function e(m,k,j,i,l){if(this._type&&(this._type==="line"||this._type=="bar")){this.trendline=new f.jqplot.Trendline();i=i||{};f.extend(true,this.trendline,{color:this.color},j.trendline,i.trendline);this.trendline.renderer.init.call(this.trendline,null)}}function g(m,i){i=f.extend(true,{},this.trendline,i);if(this.trendline&&i.show){var k;var l=i.data||this.data;k=c(l,this.trendline.type);var j=i.gridData||this.renderer.makeGridData.call(this,k.data);this.trendline.renderer.draw.call(this.trendline,m,j,{showLine:true,shadow:this.trendline.shadow})}}function b(w,v,n){var u=(n==null)?"linear":n;var s=w.length;var t;var z;var o=0;var m=0;var r=0;var q=0;var l=0;var j=[];var k=[];if(u=="linear"){k=w;j=v}else{if(u=="exp"||u=="exponential"){for(var p=0;p<v.length;p++){if(v[p]<=0){s--}else{k.push(w[p]);j.push(Math.log(v[p]))}}}}for(var p=0;p<s;p++){o=o+k[p];m=m+j[p];q=q+k[p]*j[p];r=r+k[p]*k[p];l=l+j[p]*j[p]}t=(s*q-o*m)/(s*r-o*o);z=(m-t*o)/s;return[t,z]}function h(k,j){var i;i=b(k,j,"linear");return[i[0],i[1]]}function d(o,m){var k;var i=o;var n=m;k=b(i,n,"exp");var l=Math.exp(k[0]);var j=Math.exp(k[1]);return[l,j]}function c(l,j){var p=(j==null)?"linear":j;var n;var o;var r=[];var q=[];var m=[];for(k=0;k<l.length;k++){if(l[k]!=null&&l[k][0]!=null&&l[k][1]!=null){r.push(l[k][0]);q.push(l[k][1])}}if(p=="linear"){n=h(r,q);for(var k=0;k<r.length;k++){o=n[0]*r[k]+n[1];m.push([r[k],o])}}else{if(p=="exp"||p=="exponential"){n=d(r,q);for(var k=0;k<r.length;k++){o=n[1]*Math.pow(n[0],r[k]);m.push([r[k],o])}}}return{data:m,slope:n[0],intercept:n[1]}}})(jQuery);
|
||||
6
templates/backOffice/default/assets/js/jquery.min.js
vendored
Executable file
6
templates/backOffice/default/assets/js/jquery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
94
templates/backOffice/default/assets/js/jquery.typewatch.js
Normal file
94
templates/backOffice/default/assets/js/jquery.typewatch.js
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* TypeWatch 2.2
|
||||
*
|
||||
* Examples/Docs: github.com/dennyferra/TypeWatch
|
||||
*
|
||||
* Copyright(c) 2013
|
||||
* Denny Ferrassoli - dennyferra.com
|
||||
* Charles Christolini
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
(function(jQuery) {
|
||||
jQuery.fn.typeWatch = function(o) {
|
||||
// The default input types that are supported
|
||||
var _supportedInputTypes =
|
||||
['TEXT', 'TEXTAREA', 'PASSWORD', 'TEL', 'SEARCH', 'URL', 'EMAIL', 'DATETIME', 'DATE', 'MONTH', 'WEEK', 'TIME', 'DATETIME-LOCAL', 'NUMBER', 'RANGE'];
|
||||
|
||||
// Options
|
||||
var options = jQuery.extend({
|
||||
wait: 750,
|
||||
callback: function() { },
|
||||
highlight: true,
|
||||
captureLength: 2,
|
||||
inputTypes: _supportedInputTypes
|
||||
}, o);
|
||||
|
||||
function checkElement(timer, override) {
|
||||
var value = jQuery(timer.el).val();
|
||||
|
||||
// Fire if text >= options.captureLength AND text != saved text OR if override AND text >= options.captureLength
|
||||
if ((value.length >= options.captureLength && value.toUpperCase() != timer.text)
|
||||
|| (override && value.length >= options.captureLength))
|
||||
{
|
||||
timer.text = value.toUpperCase();
|
||||
timer.cb.call(timer.el, value);
|
||||
}
|
||||
};
|
||||
|
||||
function watchElement(elem) {
|
||||
var elementType = elem.type.toUpperCase();
|
||||
if (jQuery.inArray(elementType, options.inputTypes) >= 0) {
|
||||
|
||||
// Allocate timer element
|
||||
var timer = {
|
||||
timer: null,
|
||||
text: jQuery(elem).val().toUpperCase(),
|
||||
cb: options.callback,
|
||||
el: elem,
|
||||
wait: options.wait
|
||||
};
|
||||
|
||||
// Set focus action (highlight)
|
||||
if (options.highlight) {
|
||||
jQuery(elem).focus(
|
||||
function() {
|
||||
this.select();
|
||||
});
|
||||
}
|
||||
|
||||
// Key watcher / clear and reset the timer
|
||||
var startWatch = function(evt) {
|
||||
var timerWait = timer.wait;
|
||||
var overrideBool = false;
|
||||
var evtElementType = this.type.toUpperCase();
|
||||
|
||||
// If enter key is pressed and not a TEXTAREA and matched inputTypes
|
||||
if (typeof evt.keyCode != 'undefined' && evt.keyCode == 13 && evtElementType != 'TEXTAREA' && jQuery.inArray(evtElementType, options.inputTypes) >= 0) {
|
||||
timerWait = 1;
|
||||
overrideBool = true;
|
||||
}
|
||||
|
||||
var timerCallbackFx = function() {
|
||||
checkElement(timer, overrideBool)
|
||||
}
|
||||
|
||||
// Clear timer
|
||||
clearTimeout(timer.timer);
|
||||
timer.timer = setTimeout(timerCallbackFx, timerWait);
|
||||
};
|
||||
|
||||
jQuery(elem).on('keydown paste cut input', startWatch);
|
||||
}
|
||||
};
|
||||
|
||||
// Watch Each Element
|
||||
return this.each(function() {
|
||||
watchElement(this);
|
||||
});
|
||||
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,23 @@
|
||||
/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
|
||||
/* Traducido por Vester (xvester@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['es_ES'] = {
|
||||
closeText: 'Cerrar',
|
||||
prevText: '<Ant',
|
||||
nextText: 'Sig>',
|
||||
currentText: 'Hoy',
|
||||
monthNames: ['enero','febrero','marzo','abril','mayo','junio',
|
||||
'julio','agosto','septiembre','octubre','noviembre','diciembre'],
|
||||
monthNamesShort: ['ene','feb','mar','abr','may','jun',
|
||||
'jul','ogo','sep','oct','nov','dic'],
|
||||
dayNames: ['domingo','lunes','martes','miércoles','jueves','viernes','sábado'],
|
||||
dayNamesShort: ['dom','lun','mar','mié','juv','vie','sáb'],
|
||||
dayNamesMin: ['D','L','M','X','J','V','S'],
|
||||
weekHeader: 'Sm',
|
||||
dateFormat: 'dd/mm/yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['es_ES']);
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
/* French initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Keith Wood (kbwood{at}iinet.com.au),
|
||||
Stéphane Nahmani (sholby@sholby.net),
|
||||
Stéphane Raimbault <stephane.raimbault@gmail.com> */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['fr_FR'] = {
|
||||
closeText: 'Fermer',
|
||||
prevText: 'Précédent',
|
||||
nextText: 'Suivant',
|
||||
currentText: 'Aujourd\'hui',
|
||||
monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
|
||||
'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
|
||||
monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin',
|
||||
'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
|
||||
dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
|
||||
dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
|
||||
dayNamesMin: ['D','L','M','M','J','V','S'],
|
||||
weekHeader: 'Sem.',
|
||||
dateFormat: 'dd/mm/yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['fr_FR']);
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
/* Italian initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Antonello Pasella (antonello.pasella@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['it_IT'] = {
|
||||
closeText: 'Chiudi',
|
||||
prevText: '<Prec',
|
||||
nextText: 'Succ>',
|
||||
currentText: 'Oggi',
|
||||
monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
|
||||
'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
|
||||
monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
|
||||
'Lug','Ago','Set','Ott','Nov','Dic'],
|
||||
dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
|
||||
dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
|
||||
dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
|
||||
weekHeader: 'Sm',
|
||||
dateFormat: 'dd/mm/yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['it_IT']);
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
JQuery UI datepicker localization files were found here : https://github.com/jquery/jquery-ui/tree/master/ui/i18n
|
||||
|
||||
Warning : You must change file name an localization array key declaration in file to match thelia lang locale.
|
||||
|
||||
Exemple : change fr with fr_FR
|
||||
175
templates/backOffice/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.css
vendored
Normal file
175
templates/backOffice/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.css
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
/*!
|
||||
* jQuery UI Datepicker @VERSION
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/datepicker/#theming
|
||||
*/
|
||||
.ui-datepicker {
|
||||
width: 17em;
|
||||
padding: .2em .2em 0;
|
||||
display: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-header {
|
||||
position: relative;
|
||||
padding: .2em 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
width: 1.8em;
|
||||
height: 1.8em;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover,
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
top: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev {
|
||||
left: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
right: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover {
|
||||
left: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
right: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev span,
|
||||
.ui-datepicker .ui-datepicker-next span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title {
|
||||
margin: 0 2.3em;
|
||||
line-height: 1.8em;
|
||||
text-align: center;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title select {
|
||||
font-size: 1em;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year {
|
||||
width: 49%;
|
||||
}
|
||||
.ui-datepicker table {
|
||||
width: 100%;
|
||||
font-size: .9em;
|
||||
border-collapse: collapse;
|
||||
margin: 0 0 .4em;
|
||||
}
|
||||
.ui-datepicker th {
|
||||
padding: .7em .3em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
border: 0;
|
||||
}
|
||||
.ui-datepicker td {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a {
|
||||
display: block;
|
||||
padding: .2em;
|
||||
text-align: right;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane {
|
||||
background-image: none;
|
||||
margin: .7em 0 0 0;
|
||||
padding: 0 .2em;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button {
|
||||
float: right;
|
||||
margin: .5em .2em .4em;
|
||||
cursor: pointer;
|
||||
padding: .2em .6em .3em .6em;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi {
|
||||
width: auto;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group table {
|
||||
width: 95%;
|
||||
margin: 0 auto .4em;
|
||||
}
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group {
|
||||
width: 50%;
|
||||
}
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group {
|
||||
width: 33.3%;
|
||||
}
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group {
|
||||
width: 25%;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-left-width: 0;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
||||
clear: left;
|
||||
}
|
||||
.ui-datepicker-row-break {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev {
|
||||
right: 2px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next {
|
||||
left: 2px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
||||
right: 1px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
||||
left: 1px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
||||
clear: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
||||
.ui-datepicker-rtl .ui-datepicker-group {
|
||||
float: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-right-width: 0;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
2059
templates/backOffice/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.js
vendored
Normal file
2059
templates/backOffice/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
410
templates/backOffice/default/assets/js/jquery.ui/jquery.ui.theme.css
vendored
Normal file
410
templates/backOffice/default/assets/js/jquery.ui/jquery.ui.theme.css
vendored
Normal file
@@ -0,0 +1,410 @@
|
||||
/*!
|
||||
* jQuery UI CSS Framework @VERSION
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/category/theming/
|
||||
*
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/
|
||||
*/
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget {
|
||||
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
|
||||
font-size: 1.1em/*{fsDefault}*/;
|
||||
}
|
||||
.ui-widget .ui-widget {
|
||||
font-size: 1em;
|
||||
}
|
||||
.ui-widget input,
|
||||
.ui-widget select,
|
||||
.ui-widget textarea,
|
||||
.ui-widget button {
|
||||
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
|
||||
font-size: 1em;
|
||||
}
|
||||
.ui-widget-content {
|
||||
border: 1px solid #aaaaaa/*{borderColorContent}*/;
|
||||
background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
|
||||
color: #222222/*{fcContent}*/;
|
||||
}
|
||||
.ui-widget-content a {
|
||||
color: #222222/*{fcContent}*/;
|
||||
}
|
||||
.ui-widget-header {
|
||||
border: 1px solid #aaaaaa/*{borderColorHeader}*/;
|
||||
background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
|
||||
color: #222222/*{fcHeader}*/;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ui-widget-header a {
|
||||
color: #222222/*{fcHeader}*/;
|
||||
}
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default,
|
||||
.ui-widget-content .ui-state-default,
|
||||
.ui-widget-header .ui-state-default {
|
||||
border: 1px solid #d3d3d3/*{borderColorDefault}*/;
|
||||
background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/;
|
||||
font-weight: normal/*{fwDefault}*/;
|
||||
color: #555555/*{fcDefault}*/;
|
||||
}
|
||||
.ui-state-default a,
|
||||
.ui-state-default a:link,
|
||||
.ui-state-default a:visited {
|
||||
color: #555555/*{fcDefault}*/;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-state-hover,
|
||||
.ui-widget-content .ui-state-hover,
|
||||
.ui-widget-header .ui-state-hover,
|
||||
.ui-state-focus,
|
||||
.ui-widget-content .ui-state-focus,
|
||||
.ui-widget-header .ui-state-focus {
|
||||
border: 1px solid #999999/*{borderColorHover}*/;
|
||||
background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/;
|
||||
font-weight: normal/*{fwDefault}*/;
|
||||
color: #212121/*{fcHover}*/;
|
||||
}
|
||||
.ui-state-hover a,
|
||||
.ui-state-hover a:hover,
|
||||
.ui-state-hover a:link,
|
||||
.ui-state-hover a:visited,
|
||||
.ui-state-focus a,
|
||||
.ui-state-focus a:hover,
|
||||
.ui-state-focus a:link,
|
||||
.ui-state-focus a:visited {
|
||||
color: #212121/*{fcHover}*/;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-state-active,
|
||||
.ui-widget-content .ui-state-active,
|
||||
.ui-widget-header .ui-state-active {
|
||||
border: 1px solid #aaaaaa/*{borderColorActive}*/;
|
||||
background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/;
|
||||
font-weight: normal/*{fwDefault}*/;
|
||||
color: #212121/*{fcActive}*/;
|
||||
}
|
||||
.ui-state-active a,
|
||||
.ui-state-active a:link,
|
||||
.ui-state-active a:visited {
|
||||
color: #212121/*{fcActive}*/;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight,
|
||||
.ui-widget-content .ui-state-highlight,
|
||||
.ui-widget-header .ui-state-highlight {
|
||||
border: 1px solid #fcefa1/*{borderColorHighlight}*/;
|
||||
background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/;
|
||||
color: #363636/*{fcHighlight}*/;
|
||||
}
|
||||
.ui-state-highlight a,
|
||||
.ui-widget-content .ui-state-highlight a,
|
||||
.ui-widget-header .ui-state-highlight a {
|
||||
color: #363636/*{fcHighlight}*/;
|
||||
}
|
||||
.ui-state-error,
|
||||
.ui-widget-content .ui-state-error,
|
||||
.ui-widget-header .ui-state-error {
|
||||
border: 1px solid #cd0a0a/*{borderColorError}*/;
|
||||
background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/;
|
||||
color: #cd0a0a/*{fcError}*/;
|
||||
}
|
||||
.ui-state-error a,
|
||||
.ui-widget-content .ui-state-error a,
|
||||
.ui-widget-header .ui-state-error a {
|
||||
color: #cd0a0a/*{fcError}*/;
|
||||
}
|
||||
.ui-state-error-text,
|
||||
.ui-widget-content .ui-state-error-text,
|
||||
.ui-widget-header .ui-state-error-text {
|
||||
color: #cd0a0a/*{fcError}*/;
|
||||
}
|
||||
.ui-priority-primary,
|
||||
.ui-widget-content .ui-priority-primary,
|
||||
.ui-widget-header .ui-priority-primary {
|
||||
font-weight: bold;
|
||||
}
|
||||
.ui-priority-secondary,
|
||||
.ui-widget-content .ui-priority-secondary,
|
||||
.ui-widget-header .ui-priority-secondary {
|
||||
opacity: .7;
|
||||
filter:Alpha(Opacity=70);
|
||||
font-weight: normal;
|
||||
}
|
||||
.ui-state-disabled,
|
||||
.ui-widget-content .ui-state-disabled,
|
||||
.ui-widget-header .ui-state-disabled {
|
||||
opacity: .35;
|
||||
filter:Alpha(Opacity=35);
|
||||
background-image: none;
|
||||
}
|
||||
.ui-state-disabled .ui-icon {
|
||||
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
|
||||
}
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.ui-icon,
|
||||
.ui-widget-content .ui-icon {
|
||||
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/;
|
||||
}
|
||||
.ui-widget-header .ui-icon {
|
||||
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/;
|
||||
}
|
||||
.ui-state-default .ui-icon {
|
||||
background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/;
|
||||
}
|
||||
.ui-state-hover .ui-icon,
|
||||
.ui-state-focus .ui-icon {
|
||||
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/;
|
||||
}
|
||||
.ui-state-active .ui-icon {
|
||||
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/;
|
||||
}
|
||||
.ui-state-highlight .ui-icon {
|
||||
background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/;
|
||||
}
|
||||
.ui-state-error .ui-icon,
|
||||
.ui-state-error-text .ui-icon {
|
||||
background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/;
|
||||
}
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-blank { background-position: 16px 16px; }
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all,
|
||||
.ui-corner-top,
|
||||
.ui-corner-left,
|
||||
.ui-corner-tl {
|
||||
border-top-left-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-top,
|
||||
.ui-corner-right,
|
||||
.ui-corner-tr {
|
||||
border-top-right-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-bottom,
|
||||
.ui-corner-left,
|
||||
.ui-corner-bl {
|
||||
border-bottom-left-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-bottom,
|
||||
.ui-corner-right,
|
||||
.ui-corner-br {
|
||||
border-bottom-right-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay {
|
||||
background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/;
|
||||
opacity: .3/*{opacityOverlay}*/;
|
||||
filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/;
|
||||
}
|
||||
.ui-widget-shadow {
|
||||
margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/;
|
||||
padding: 8px/*{thicknessShadow}*/;
|
||||
background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
|
||||
opacity: .3/*{opacityShadow}*/;
|
||||
filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/;
|
||||
border-radius: 8px/*{cornerRadiusShadow}*/;
|
||||
}
|
||||
486
templates/backOffice/default/assets/js/json2.js
Normal file
486
templates/backOffice/default/assets/js/json2.js
Normal file
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
json2.js
|
||||
2013-05-26
|
||||
|
||||
Public Domain.
|
||||
|
||||
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
See http://www.JSON.org/js.html
|
||||
|
||||
|
||||
This code should be minified before deployment.
|
||||
See http://javascript.crockford.com/jsmin.html
|
||||
|
||||
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
||||
NOT CONTROL.
|
||||
|
||||
|
||||
This file creates a global JSON object containing two methods: stringify
|
||||
and parse.
|
||||
|
||||
JSON.stringify(value, replacer, space)
|
||||
value any JavaScript value, usually an object or array.
|
||||
|
||||
replacer an optional parameter that determines how object
|
||||
values are stringified for objects. It can be a
|
||||
function or an array of strings.
|
||||
|
||||
space an optional parameter that specifies the indentation
|
||||
of nested structures. If it is omitted, the text will
|
||||
be packed without extra whitespace. If it is a number,
|
||||
it will specify the number of spaces to indent at each
|
||||
level. If it is a string (such as '\t' or ' '),
|
||||
it contains the characters used to indent at each level.
|
||||
|
||||
This method produces a JSON text from a JavaScript value.
|
||||
|
||||
When an object value is found, if the object contains a toJSON
|
||||
method, its toJSON method will be called and the result will be
|
||||
stringified. A toJSON method does not serialize: it returns the
|
||||
value represented by the name/value pair that should be serialized,
|
||||
or undefined if nothing should be serialized. The toJSON method
|
||||
will be passed the key associated with the value, and this will be
|
||||
bound to the value
|
||||
|
||||
For example, this would serialize Dates as ISO strings.
|
||||
|
||||
Date.prototype.toJSON = function (key) {
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
return this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z';
|
||||
};
|
||||
|
||||
You can provide an optional replacer method. It will be passed the
|
||||
key and value of each member, with this bound to the containing
|
||||
object. The value that is returned from your method will be
|
||||
serialized. If your method returns undefined, then the member will
|
||||
be excluded from the serialization.
|
||||
|
||||
If the replacer parameter is an array of strings, then it will be
|
||||
used to select the members to be serialized. It filters the results
|
||||
such that only members with keys listed in the replacer array are
|
||||
stringified.
|
||||
|
||||
Values that do not have JSON representations, such as undefined or
|
||||
functions, will not be serialized. Such values in objects will be
|
||||
dropped; in arrays they will be replaced with null. You can use
|
||||
a replacer function to replace those with JSON values.
|
||||
JSON.stringify(undefined) returns undefined.
|
||||
|
||||
The optional space parameter produces a stringification of the
|
||||
value that is filled with line breaks and indentation to make it
|
||||
easier to read.
|
||||
|
||||
If the space parameter is a non-empty string, then that string will
|
||||
be used for indentation. If the space parameter is a number, then
|
||||
the indentation will be that many spaces.
|
||||
|
||||
Example:
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}]);
|
||||
// text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
|
||||
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
||||
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
text = JSON.stringify([new Date()], function (key, value) {
|
||||
return this[key] instanceof Date ?
|
||||
'Date(' + this[key] + ')' : value;
|
||||
});
|
||||
// text is '["Date(---current time---)"]'
|
||||
|
||||
|
||||
JSON.parse(text, reviver)
|
||||
This method parses a JSON text to produce an object or array.
|
||||
It can throw a SyntaxError exception.
|
||||
|
||||
The optional reviver parameter is a function that can filter and
|
||||
transform the results. It receives each of the keys and values,
|
||||
and its return value is used instead of the original value.
|
||||
If it returns what it received, then the structure is not modified.
|
||||
If it returns undefined then the member is deleted.
|
||||
|
||||
Example:
|
||||
|
||||
// Parse the text. Values that look like ISO date strings will
|
||||
// be converted to Date objects.
|
||||
|
||||
myData = JSON.parse(text, function (key, value) {
|
||||
var a;
|
||||
if (typeof value === 'string') {
|
||||
a =
|
||||
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
if (a) {
|
||||
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
||||
+a[5], +a[6]));
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
|
||||
var d;
|
||||
if (typeof value === 'string' &&
|
||||
value.slice(0, 5) === 'Date(' &&
|
||||
value.slice(-1) === ')') {
|
||||
d = new Date(value.slice(5, -1));
|
||||
if (d) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
|
||||
This is a reference implementation. You are free to copy, modify, or
|
||||
redistribute.
|
||||
*/
|
||||
|
||||
/*jslint evil: true, regexp: true */
|
||||
|
||||
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
|
||||
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
|
||||
lastIndex, length, parse, prototype, push, replace, slice, stringify,
|
||||
test, toJSON, toString, valueOf
|
||||
*/
|
||||
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// methods in a closure to avoid creating global variables.
|
||||
|
||||
if (typeof JSON !== 'object') {
|
||||
JSON = {};
|
||||
}
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return n < 10 ? '0' + n : n;
|
||||
}
|
||||
|
||||
if (typeof Date.prototype.toJSON !== 'function') {
|
||||
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
return isFinite(this.valueOf())
|
||||
? this.getUTCFullYear() + '-' +
|
||||
f(this.getUTCMonth() + 1) + '-' +
|
||||
f(this.getUTCDate()) + 'T' +
|
||||
f(this.getUTCHours()) + ':' +
|
||||
f(this.getUTCMinutes()) + ':' +
|
||||
f(this.getUTCSeconds()) + 'Z'
|
||||
: null;
|
||||
};
|
||||
|
||||
String.prototype.toJSON =
|
||||
Number.prototype.toJSON =
|
||||
Boolean.prototype.toJSON = function () {
|
||||
return this.valueOf();
|
||||
};
|
||||
}
|
||||
|
||||
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
||||
gap,
|
||||
indent,
|
||||
meta = { // table of character substitutions
|
||||
'\b': '\\b',
|
||||
'\t': '\\t',
|
||||
'\n': '\\n',
|
||||
'\f': '\\f',
|
||||
'\r': '\\r',
|
||||
'"' : '\\"',
|
||||
'\\': '\\\\'
|
||||
},
|
||||
rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
escapable.lastIndex = 0;
|
||||
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === 'string'
|
||||
? c
|
||||
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + '"' : '"' + string + '"';
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i, // The loop counter.
|
||||
k, // The member key.
|
||||
v, // The member value.
|
||||
length,
|
||||
mind = gap,
|
||||
partial,
|
||||
value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (value && typeof value === 'object' &&
|
||||
typeof value.toJSON === 'function') {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === 'function') {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return quote(value);
|
||||
|
||||
case 'number':
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return isFinite(value) ? String(value) : 'null';
|
||||
|
||||
case 'boolean':
|
||||
case 'null':
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce 'null'. The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is 'object', we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case 'object':
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return 'null';
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// Is the value an array?
|
||||
|
||||
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
||||
|
||||
// The value is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || 'null';
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0
|
||||
? '[]'
|
||||
: gap
|
||||
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
|
||||
: '[' + partial.join(',') + ']';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (rep && typeof rep === 'object') {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
if (typeof rep[i] === 'string') {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0
|
||||
? '{}'
|
||||
: gap
|
||||
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
|
||||
: '{' + partial.join(',') + '}';
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
// If the JSON object does not yet have a stringify method, give it one.
|
||||
|
||||
if (typeof JSON.stringify !== 'function') {
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = '';
|
||||
indent = '';
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === 'number') {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += ' ';
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === 'string') {
|
||||
indent = space;
|
||||
}
|
||||
|
||||
// If there is a replacer, it must be a function or an array.
|
||||
// Otherwise, throw an error.
|
||||
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== 'function' &&
|
||||
(typeof replacer !== 'object' ||
|
||||
typeof replacer.length !== 'number')) {
|
||||
throw new Error('JSON.stringify');
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of ''.
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str('', {'': value});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// If the JSON object does not yet have a parse method, give it one.
|
||||
|
||||
if (typeof JSON.parse !== 'function') {
|
||||
JSON.parse = function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k, v, value = holder[key];
|
||||
if (value && typeof value === 'object') {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in four stages. In the first stage, we replace certain
|
||||
// Unicode characters with escape sequences. JavaScript handles many characters
|
||||
// incorrectly, either silently deleting them, or treating them as line endings.
|
||||
|
||||
text = String(text);
|
||||
cx.lastIndex = 0;
|
||||
if (cx.test(text)) {
|
||||
text = text.replace(cx, function (a) {
|
||||
return '\\u' +
|
||||
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
});
|
||||
}
|
||||
|
||||
// In the second stage, we run the text against regular expressions that look
|
||||
// for non-JSON patterns. We are especially concerned with '()' and 'new'
|
||||
// because they can cause invocation, and '=' because it can cause mutation.
|
||||
// But just to be safe, we want to reject all unexpected forms.
|
||||
|
||||
// We split the second stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with ']' characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or ']' or
|
||||
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
||||
|
||||
if (/^[\],:{}\s]*$/
|
||||
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
|
||||
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
||||
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
||||
|
||||
// In the third stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval('(' + text + ')');
|
||||
|
||||
// In the optional fourth stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return typeof reviver === 'function'
|
||||
? walk({'': j}, '')
|
||||
: j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError('JSON.parse');
|
||||
};
|
||||
}
|
||||
}());
|
||||
6
templates/backOffice/default/assets/js/libs/jquery.js
vendored
Normal file
6
templates/backOffice/default/assets/js/libs/jquery.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
templates/backOffice/default/assets/js/libs/respond.min.js
vendored
Executable file
6
templates/backOffice/default/assets/js/libs/respond.min.js
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document);
|
||||
|
||||
/*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this);
|
||||
153
templates/backOffice/default/assets/js/main.js
Normal file
153
templates/backOffice/default/assets/js/main.js
Normal file
@@ -0,0 +1,153 @@
|
||||
(function($, window, document){
|
||||
|
||||
$(function(){
|
||||
|
||||
// -- Init datepicker --
|
||||
if($('.date').length){
|
||||
//$('.date').datepicker();
|
||||
}
|
||||
|
||||
// -- Init tablesorter --
|
||||
/*if($('.tablesorter').length){
|
||||
$('.tablesorter').tablesorter({
|
||||
widgets: ["filter", "stickyHeaders"],
|
||||
widthFixed : false,
|
||||
widgetOptions : {
|
||||
filter_cssFilter : 'input-medium form-control',
|
||||
filter_formatter : {
|
||||
|
||||
2 : function($cell, indx){
|
||||
return $.tablesorter.filterFormatter.uiDateCompare( $cell, indx, {
|
||||
dateFormat: "dd/mm/yy",
|
||||
changeMonth : true,
|
||||
changeYear : true,
|
||||
compare : '='
|
||||
});
|
||||
},
|
||||
|
||||
3 : function($cell, indx){
|
||||
return $.tablesorter.filterFormatter.uiRange( $cell, indx, {
|
||||
value: 1,
|
||||
min: 1,
|
||||
max: 50,
|
||||
delayed: true,
|
||||
valueToHeader: false,
|
||||
exactMatch: false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
// -- Bootstrap tooltip --
|
||||
if($('[rel="tooltip"]').length){
|
||||
$('[rel="tooltip"]').tooltip();
|
||||
}
|
||||
|
||||
// -- Bootstrap select --
|
||||
if($('[data-toggle="selectpicker"]').length){
|
||||
$('[data-toggle="selectpicker"]').selectpicker();
|
||||
}
|
||||
|
||||
// -- Confirm Box --
|
||||
if($('[data-toggle="confirm"]').length){
|
||||
$('[data-toggle="confirm"]').click(function(e){
|
||||
|
||||
var $this = $(this);
|
||||
var $modal = $($this.data('target'));
|
||||
|
||||
$modal.modal('show');
|
||||
|
||||
$modal.on('shown', function () {
|
||||
if($this.data('script')){
|
||||
|
||||
$('[data-confirm]').click(function(){
|
||||
|
||||
eval($this.data('script'));
|
||||
|
||||
$modal.modal('hide');
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
$('[data-confirm]').attr('href', $this.attr('href'));
|
||||
}
|
||||
});
|
||||
|
||||
if($modal.is(':hidden')){
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// -- Mini browser --
|
||||
miniBrowser = function (root, url){
|
||||
|
||||
$.getJSON(url, {
|
||||
root: root
|
||||
})
|
||||
.done(function(data) {
|
||||
var resultat = data;
|
||||
|
||||
var breadcrumb = $('<div />');
|
||||
$(resultat.breadcrumb).each(function(k, v){
|
||||
breadcrumb.append(
|
||||
$('<span />').html(' > '),
|
||||
$('<a />').attr('href', '#').html(v.display).click(function(e){
|
||||
e.preventDefault();
|
||||
miniBrowser(v.url);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
var categories = $('<div />');
|
||||
$(resultat.categories).each(function(k, v){
|
||||
categories.append(
|
||||
$('<p />').append(
|
||||
$('<a />').attr('href', '#').html(v.titre).click(function(e){
|
||||
e.preventDefault();
|
||||
miniBrowser(v.id);
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
var products = $('<div />');
|
||||
$(resultat.products).each(function(k, v){
|
||||
products.append(
|
||||
$('<p />').append(
|
||||
$('<a />').attr('href', '#').html(v.titre).click(function(e){
|
||||
e.preventDefault();
|
||||
|
||||
$('#productToAdd_ref').val(v.ref);
|
||||
$('#productToAdd_titre').val(v.titre);
|
||||
$('#productToAdd_quantite').val(1);
|
||||
|
||||
manageStock(v.variants, v.promo?v.prix2:v.prix);
|
||||
|
||||
$('#productToAdd_tva').val(v.tva);
|
||||
|
||||
$('.productToAddInformation').show();
|
||||
$('#btn_ajout_produit').show();
|
||||
})
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
$('#minibrowser-breadcrumb').unbind().empty().append(breadcrumb);
|
||||
$('#minibrowser-categories').unbind().empty().append(categories);
|
||||
})
|
||||
.fail(function() {
|
||||
console.log('An error occurred while reading from JSON file');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}(window.jQuery, window, document));
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Metadata - jQuery plugin for parsing metadata from elements
|
||||
*
|
||||
* Copyright (c) 2006 John Resig, Yehuda Katz, Jörn Zaefferer, Paul McLanahan
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
|
||||
* in the JSON will become a property of the element itself.
|
||||
*
|
||||
* There are three supported types of metadata storage:
|
||||
*
|
||||
* attr: Inside an attribute. The name parameter indicates *which* attribute.
|
||||
*
|
||||
* class: Inside the class attribute, wrapped in curly braces: { }
|
||||
*
|
||||
* elem: Inside a child element (e.g. a script tag). The
|
||||
* name parameter indicates *which* element.
|
||||
*
|
||||
* The metadata for an element is loaded the first time the element is accessed via jQuery.
|
||||
*
|
||||
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
|
||||
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
|
||||
*
|
||||
* @name $.metadata.setType
|
||||
*
|
||||
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("class")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from the class attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("attr", "data")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a "data" attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
|
||||
* @before $.metadata.setType("elem", "script")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a nested script element
|
||||
*
|
||||
* @param String type The encoding type
|
||||
* @param String name The name of the attribute to be used to get metadata (optional)
|
||||
* @cat Plugins/Metadata
|
||||
* @descr Sets the type of encoding to be used when loading metadata for the first time
|
||||
* @type undefined
|
||||
* @see metadata()
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.extend({
|
||||
metadata : {
|
||||
defaults : {
|
||||
type: 'class',
|
||||
name: 'metadata',
|
||||
cre: /(\{.*\})/,
|
||||
single: 'metadata'
|
||||
},
|
||||
setType: function( type, name ){
|
||||
this.defaults.type = type;
|
||||
this.defaults.name = name;
|
||||
},
|
||||
get: function( elem, opts ){
|
||||
var data, m, e, attr,
|
||||
settings = $.extend({},this.defaults,opts);
|
||||
// check for empty string in single property
|
||||
if ( !settings.single.length ) { settings.single = 'metadata'; }
|
||||
|
||||
data = $.data(elem, settings.single);
|
||||
// returned cached data if it already exists
|
||||
if ( data ) { return data; }
|
||||
|
||||
data = "{}";
|
||||
|
||||
if ( settings.type === "class" ) {
|
||||
m = settings.cre.exec( elem.className );
|
||||
if ( m ) { data = m[1]; }
|
||||
} else if ( settings.type === "elem" ) {
|
||||
if( !elem.getElementsByTagName ) { return undefined; }
|
||||
e = elem.getElementsByTagName(settings.name);
|
||||
if ( e.length ) { data = $.trim(e[0].innerHTML); }
|
||||
} else if ( elem.getAttribute !== undefined ) {
|
||||
attr = elem.getAttribute( settings.name );
|
||||
if ( attr ) { data = attr; }
|
||||
}
|
||||
|
||||
if ( data.indexOf( '{' ) <0 ) { data = "{" + data + "}"; }
|
||||
|
||||
data = eval("(" + data + ")");
|
||||
|
||||
$.data( elem, settings.single, data );
|
||||
return data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the metadata object for the first member of the jQuery object.
|
||||
*
|
||||
* @name metadata
|
||||
* @descr Returns element's metadata object
|
||||
* @param Object opts An object contianing settings to override the defaults
|
||||
* @type jQuery
|
||||
* @cat Plugins/Metadata
|
||||
*/
|
||||
$.fn.metadata = function( opts ){
|
||||
return $.metadata.get( this[0], opts );
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
1477
templates/backOffice/default/assets/js/tablesorter/jquery.tablesorter.min.js
vendored
Normal file
1477
templates/backOffice/default/assets/js/tablesorter/jquery.tablesorter.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,826 @@
|
||||
/*! Filter widget formatter functions - updated 6/4/2013
|
||||
* requires: tableSorter 2.7.7+ and jQuery 1.4.3+
|
||||
*
|
||||
* uiSpinner (jQuery UI spinner)
|
||||
* uiSlider (jQuery UI slider)
|
||||
* uiRange (jQuery UI range slider)
|
||||
* uiDateCompare (jQuery UI datepicker; 1 input)
|
||||
* uiDatepicker (jQuery UI datepicker; 2 inputs, filter range)
|
||||
* html5Number (spinner)
|
||||
* html5Range (slider)
|
||||
* html5Color (color)
|
||||
*/
|
||||
/*jshint browser:true, jquery:true, unused:false */
|
||||
/*global jQuery: false */
|
||||
;(function($){
|
||||
"use strict";
|
||||
$.tablesorter = $.tablesorter || {};
|
||||
|
||||
$.tablesorter.filterFormatter = {
|
||||
|
||||
/**********************\
|
||||
jQuery UI Spinner
|
||||
\**********************/
|
||||
uiSpinner: function($cell, indx, spinnerDef) {
|
||||
var o = $.extend({
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
value : 1,
|
||||
delayed : true,
|
||||
addToggle : true,
|
||||
disabled : false,
|
||||
exactMatch : true,
|
||||
compare : ''
|
||||
}, spinnerDef ),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="filter" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
updateSpinner({ value: this.value, delayed: false });
|
||||
}),
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
// this function updates the hidden input and adds the current values to the header cell text
|
||||
updateSpinner = function(ui) {
|
||||
var chkd = true, state,
|
||||
// ui is not undefined on create
|
||||
v = ui && ui.value && $.tablesorter.formatFloat((ui.value + '').replace(/[><=]/g,'')) || $cell.find('.spinner').val() || o.value;
|
||||
if (o.addToggle) {
|
||||
chkd = $cell.find('.toggle').is(':checked');
|
||||
}
|
||||
state = o.disabled || !chkd ? 'disable' : 'enable';
|
||||
$cell.find('.filter')
|
||||
// add equal to the beginning, so we filter exact numbers
|
||||
.val( chkd ? (o.compare ? o.compare : o.exactMatch ? '=' : '') + v : '' )
|
||||
.trigger('search', ui && typeof ui.delayed === 'boolean' ? ui.delayed : o.delayed).end()
|
||||
.find('.spinner').spinner(state).val(v);
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.spinner').spinner(state).val(v);
|
||||
if (o.addToggle) {
|
||||
$shcell.find('.toggle')[0].checked = chkd;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldcreate = o.create;
|
||||
o.oldspin = o.spin;
|
||||
o.create = function(event, ui) {
|
||||
updateSpinner(); // ui is an empty object on create
|
||||
if (typeof o.oldcreate === 'function') { o.oldcreate(event, ui); }
|
||||
};
|
||||
o.spin = function(event, ui) {
|
||||
updateSpinner(ui);
|
||||
if (typeof o.oldspin === 'function') { o.oldspin(event, ui); }
|
||||
};
|
||||
if (o.addToggle) {
|
||||
$('<div class="button"><input id="uispinnerbutton' + indx + '" type="checkbox" class="toggle" /><label for="uispinnerbutton' + indx + '"></label></div>')
|
||||
.appendTo($cell)
|
||||
.find('.toggle')
|
||||
.bind('change', function(){
|
||||
updateSpinner();
|
||||
});
|
||||
}
|
||||
// make sure we use parsed data
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
// add a jQuery UI spinner!
|
||||
$('<input class="spinner spinner' + indx + '" />')
|
||||
.val(o.value)
|
||||
.appendTo($cell)
|
||||
.spinner(o)
|
||||
.bind('change keyup', function(e){
|
||||
updateSpinner();
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
if (o.addToggle) {
|
||||
$('<div class="button"><input id="stickyuispinnerbutton' + indx + '" type="checkbox" class="toggle" /><label for="stickyuispinnerbutton' + indx + '"></label></div>')
|
||||
.appendTo($shcell)
|
||||
.find('.toggle')
|
||||
.bind('change', function(){
|
||||
$cell.find('.toggle')[0].checked = this.checked;
|
||||
updateSpinner();
|
||||
});
|
||||
}
|
||||
// add a jQuery UI spinner!
|
||||
$('<input class="spinner spinner' + indx + '" />')
|
||||
.val(o.value)
|
||||
.appendTo($shcell)
|
||||
.spinner(o)
|
||||
.bind('change keyup', function(e){
|
||||
$cell.find('.spinner').val( this.value );
|
||||
updateSpinner();
|
||||
});
|
||||
});
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
// turn off the toggle checkbox
|
||||
if (o.addToggle) {
|
||||
$cell.find('.toggle')[0].checked = false;
|
||||
}
|
||||
updateSpinner();
|
||||
});
|
||||
|
||||
updateSpinner();
|
||||
return $input;
|
||||
},
|
||||
|
||||
/**********************\
|
||||
jQuery UI Slider
|
||||
\**********************/
|
||||
uiSlider: function($cell, indx, sliderDef) {
|
||||
var o = $.extend({
|
||||
value : 0,
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
range : "min",
|
||||
delayed : true,
|
||||
valueToHeader : false,
|
||||
exactMatch : true,
|
||||
compare : '',
|
||||
allText : 'all'
|
||||
}, sliderDef ),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="filter" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
updateSlider({ value: this.value });
|
||||
}),
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
// this function updates the hidden input and adds the current values to the header cell text
|
||||
updateSlider = function(ui) {
|
||||
// ui is not undefined on create
|
||||
var v = typeof ui !== "undefined" ? $.tablesorter.formatFloat((ui.value + '').replace(/[><=]/g,'')) || o.min : o.value,
|
||||
val = o.compare ? v : v === o.min ? o.allText : v,
|
||||
result = o.compare + val;
|
||||
if (o.valueToHeader) {
|
||||
// add range indication to the header cell above!
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(' (' + result + ')');
|
||||
} else {
|
||||
// add values to the handle data-value attribute so the css tooltip will work properly
|
||||
$cell.find('.ui-slider-handle').addClass('value-popup').attr('data-value', result);
|
||||
}
|
||||
// update the hidden input;
|
||||
// ****** ADD AN EQUAL SIGN TO THE BEGINNING! <- this makes the slide exactly match the number ******
|
||||
// when the value is at the minimum, clear the hidden input so all rows will be seen
|
||||
$cell.find('.filter')
|
||||
.val( ( o.compare ? o.compare + v : v === o.min ? '' : (o.exactMatch ? '=' : '') + v ) )
|
||||
.trigger('search', ui && typeof ui.delayed === 'boolean' ? ui.delayed : o.delayed).end()
|
||||
.find('.slider').slider('value', v);
|
||||
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.slider').slider('value', v);
|
||||
if (o.valueToHeader) {
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(' (' + result + ')');
|
||||
} else {
|
||||
$shcell.find('.ui-slider-handle').addClass('value-popup').attr('data-value', result);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
|
||||
// add span to header for value - only works if the line in the updateSlider() function is also un-commented out
|
||||
if (o.valueToHeader) {
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.tablesorter-header-inner').append('<span class="curvalue" />');
|
||||
}
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldcreate = o.create;
|
||||
o.oldslide = o.slide;
|
||||
o.create = function(event, ui) {
|
||||
updateSlider(); // ui is an empty object on create
|
||||
if (typeof o.oldcreate === 'function') { o.oldcreate(event, ui); }
|
||||
};
|
||||
o.slide = function(event, ui) {
|
||||
updateSlider(ui);
|
||||
if (typeof o.oldslide === 'function') { o.oldslide(event, ui); }
|
||||
};
|
||||
// add a jQuery UI slider!
|
||||
$('<div class="slider slider' + indx + '"/>')
|
||||
.appendTo($cell)
|
||||
.slider(o);
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
$cell.find('.slider').slider('value', o.value);
|
||||
updateSlider();
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
|
||||
// add a jQuery UI slider!
|
||||
$('<div class="slider slider' + indx + '"/>')
|
||||
.val(o.value)
|
||||
.appendTo($shcell)
|
||||
.slider(o)
|
||||
.bind('change keyup', function(e){
|
||||
$cell.find('.slider').val( this.value );
|
||||
updateSlider();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return $input;
|
||||
},
|
||||
|
||||
/*************************\
|
||||
jQuery UI Range Slider (2 handles)
|
||||
\*************************/
|
||||
uiRange: function($cell, indx, rangeDef) {
|
||||
var o = $.extend({
|
||||
values : [0, 100],
|
||||
min : 0,
|
||||
max : 100,
|
||||
range : true,
|
||||
delayed : true,
|
||||
valueToHeader : false
|
||||
}, rangeDef ),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="filter" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
var v = this.value.split(' - ');
|
||||
if (this.value === '') { v = [ o.min, o.max ]; }
|
||||
if (v && v[1]) {
|
||||
updateUiRange({ values: v, delay: false });
|
||||
}
|
||||
}),
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
// this function updates the hidden input and adds the current values to the header cell text
|
||||
updateUiRange = function(ui) {
|
||||
// ui.values are undefined for some reason on create
|
||||
var val = ui && ui.values || o.values,
|
||||
result = val[0] + ' - ' + val[1],
|
||||
// make range an empty string if entire range is covered so the filter row will hide (if set)
|
||||
range = val[0] === o.min && val[1] === o.max ? '' : result;
|
||||
if (o.valueToHeader) {
|
||||
// add range indication to the header cell above (if not using the css method)!
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.currange').html(' (' + result + ')');
|
||||
} else {
|
||||
// add values to the handle data-value attribute so the css tooltip will work properly
|
||||
$cell.find('.ui-slider-handle')
|
||||
.addClass('value-popup')
|
||||
.eq(0).attr('data-value', val[0]).end() // adding value to data attribute
|
||||
.eq(1).attr('data-value', val[1]); // value popup shown via css
|
||||
}
|
||||
// update the hidden input
|
||||
$cell.find('.filter').val(range)
|
||||
.trigger('search', ui && typeof ui.delayed === 'boolean' ? ui.delayed : o.delayed).end()
|
||||
.find('.range').slider('values', val);
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.range').slider('values', val);
|
||||
if (o.valueToHeader) {
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.currange').html(' (' + result + ')');
|
||||
} else {
|
||||
$shcell.find('.ui-slider-handle')
|
||||
.addClass('value-popup')
|
||||
.eq(0).attr('data-value', val[0]).end() // adding value to data attribute
|
||||
.eq(1).attr('data-value', val[1]); // value popup shown via css
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
|
||||
// add span to header for value - only works if the line in the updateUiRange() function is also un-commented out
|
||||
if (o.valueToHeader) {
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.tablesorter-header-inner').append('<span class="currange"/>');
|
||||
}
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldcreate = o.create;
|
||||
o.oldslide = o.slide;
|
||||
// add a jQuery UI range slider!
|
||||
o.create = function(event, ui) {
|
||||
updateUiRange(); // ui is an empty object on create
|
||||
if (typeof o.oldcreate === 'function') { o.oldcreate(event, ui); }
|
||||
};
|
||||
o.slide = function(event, ui) {
|
||||
updateUiRange(ui);
|
||||
if (typeof o.oldslide === 'function') { o.oldslide(event, ui); }
|
||||
};
|
||||
$('<div class="range range' + indx +'"/>')
|
||||
.appendTo($cell)
|
||||
.slider(o);
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
$cell.find('.range').slider('values', o.values);
|
||||
updateUiRange();
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
|
||||
// add a jQuery UI slider!
|
||||
$('<div class="range range' + indx + '"/>')
|
||||
.val(o.value)
|
||||
.appendTo($shcell)
|
||||
.slider(o)
|
||||
.bind('change keyup', function(e){
|
||||
$cell.find('.range').val( this.value );
|
||||
updateUiRange();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// return the hidden input so the filter widget has a reference to it
|
||||
return $input;
|
||||
},
|
||||
|
||||
/*************************\
|
||||
jQuery UI Datepicker compare (1 input)
|
||||
\*************************/
|
||||
uiDateCompare: function($cell, indx, defDate) {
|
||||
var o = $.extend({
|
||||
defaultDate : '',
|
||||
cellText : '',
|
||||
changeMonth : true,
|
||||
changeYear : true,
|
||||
numberOfMonths : 1,
|
||||
compare : ''
|
||||
}, defDate),
|
||||
$hdr = $cell.closest('thead').find('th[data-column=' + indx + ']'),
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="dateCompare" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
var v = this.value;
|
||||
if (v) {
|
||||
o.onClose(v);
|
||||
}
|
||||
}),
|
||||
t, $shcell = [],
|
||||
c = $cell.closest('table')[0].config;
|
||||
|
||||
// make sure we're using parsed dates in the search
|
||||
$hdr.addClass('filter-parsed');
|
||||
// Add date range picker
|
||||
t = '<label>' + o.cellText + '</label><input type="text" class="date date' + indx +
|
||||
'" placeholder="' + ($hdr.data('placeholder') || $hdr.attr('data-placeholder') || '') + '" />';
|
||||
$(t).appendTo($cell);
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldonClose = o.onClose;
|
||||
|
||||
o.onClose = function( selectedDate, ui ) {
|
||||
var date = new Date(selectedDate + ( o.compare.match('<') ? ' 23:59:59' : '' )).getTime() || '';
|
||||
$cell
|
||||
// update hidden input
|
||||
.find('.dateCompare').val( o.compare + date )
|
||||
.trigger('search').end()
|
||||
.find('.date')
|
||||
.datepicker('setDate', selectedDate);
|
||||
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.date').datepicker('setDate', selectedDate);
|
||||
}
|
||||
|
||||
if (typeof o.oldonClose === 'function') { o.oldonClose(selectedDate, ui); }
|
||||
};
|
||||
$cell.find('.date').datepicker(o);
|
||||
|
||||
if (o.filterDate) {
|
||||
$cell.find('.date').datepicker('setDate', o.filterDate);
|
||||
}
|
||||
|
||||
// on reset
|
||||
c.$table.bind('filterReset', function(){
|
||||
$cell.find('.date').val('').datepicker('option', 'currentText', '' );
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.date').val('').datepicker('option', 'currentText', '' );
|
||||
}
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
// add a jQuery datepicker!
|
||||
$shcell
|
||||
.append(t)
|
||||
.find('.date')
|
||||
.datepicker(o);
|
||||
});
|
||||
|
||||
// return the hidden input so the filter widget has a reference to it
|
||||
return $input.val( o.defaultDate ? o.defaultDate : '' );
|
||||
},
|
||||
|
||||
/*************************\
|
||||
jQuery UI Datepicker (2 inputs)
|
||||
\*************************/
|
||||
uiDatepicker: function($cell, indx, defDate) {
|
||||
var o = $.extend({
|
||||
from : '',
|
||||
to : '',
|
||||
textFrom : 'from',
|
||||
textTo : 'to',
|
||||
changeMonth : true,
|
||||
changeYear : true,
|
||||
numberOfMonths : 1
|
||||
}, defDate),
|
||||
t, closeFrom, $shcell = [],
|
||||
// Add a hidden input to hold the range values
|
||||
$input = $('<input class="dateRange" type="hidden">')
|
||||
.appendTo($cell)
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
.bind('change.tsfilter', function(){
|
||||
var v = this.value;
|
||||
if (v.match(' - ')) {
|
||||
v = v.split(' - ');
|
||||
$cell.find('.dateTo').val(v[1]);
|
||||
closeFrom(v[0]);
|
||||
} else if (v.match('>=')) {
|
||||
closeFrom( v.replace('>=', '') );
|
||||
} else if (v.match('<=')) {
|
||||
o.onClose( v.replace('<=', '') );
|
||||
}
|
||||
}),
|
||||
c = $cell.closest('table')[0].config;
|
||||
|
||||
// make sure we're using parsed dates in the search
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
||||
// Add date range picker
|
||||
t = '<label>' + o.textFrom + '</label><input type="text" class="dateFrom" /><label>' + o.textTo + '</label><input type="text" class="dateTo" />';
|
||||
$(t).appendTo($cell);
|
||||
|
||||
// add callbacks; preserve added callbacks
|
||||
o.oldonClose = o.onClose;
|
||||
|
||||
o.defaultDate = o.from || o.defaultDate;
|
||||
|
||||
closeFrom = o.onClose = function( selectedDate, ui ) {
|
||||
var from = ( (new Date(selectedDate)).getTime() || ''),
|
||||
to = (new Date($cell.find('.dateTo').val() + ' 23:59:59').getTime() || ''),
|
||||
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
|
||||
$cell
|
||||
.find('.dateTo').datepicker('option', 'minDate', selectedDate ).end()
|
||||
.find('.dateFrom').val(selectedDate).end()
|
||||
// update hidden input
|
||||
.find('.dateRange').val(range)
|
||||
.trigger('search');
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell
|
||||
.find('.dateTo').datepicker('option', 'minDate', selectedDate ).end()
|
||||
.find('.dateFrom').val(selectedDate);
|
||||
}
|
||||
if (typeof o.oldonClose === 'function') { o.oldonClose(selectedDate, ui); }
|
||||
};
|
||||
|
||||
$cell.find('.dateFrom').datepicker(o);
|
||||
o.defaultDate = o.to || '+7d'; // set to date +7 days from today (if not defined)
|
||||
o.onClose = function( selectedDate, ui ) {
|
||||
var from = new Date( $cell.find('.dateFrom').val() ).getTime() || '',
|
||||
to = new Date( selectedDate + ' 23:59:59' ).getTime() || '',
|
||||
range = from ? ( to ? from + ' - ' + to : '>=' + from ) : (to ? '<=' + to : '');
|
||||
$cell
|
||||
.find('.dateFrom').datepicker('option', 'maxDate', selectedDate ).end()
|
||||
.find('.dateTo').val(selectedDate).end()
|
||||
.find('.dateRange').val(range)
|
||||
.trigger('search');
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell
|
||||
.find('.dateFrom').datepicker('option', 'maxDate', selectedDate ).end()
|
||||
.find('.dateTo').val(selectedDate);
|
||||
}
|
||||
if (typeof o.oldonClose === 'function') { o.oldonClose(selectedDate, ui); }
|
||||
};
|
||||
$cell.find('.dateTo').datepicker(o);
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
// add a jQuery datepicker!
|
||||
$shcell.append(t).find('.dateTo').datepicker(o);
|
||||
o.defaultDate = o.from || o.defaultDate || new Date();
|
||||
o.onClose = closeFrom;
|
||||
$shcell.find('.dateFrom').datepicker(o);
|
||||
});
|
||||
|
||||
// on reset
|
||||
$cell.closest('table').bind('filterReset', function(){
|
||||
$cell.find('.dateFrom, .dateTo').val('');
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.dateFrom, .dateTo').val('');
|
||||
}
|
||||
});
|
||||
|
||||
// return the hidden input so the filter widget has a reference to it
|
||||
t = o.from ? ( o.to ? o.from + ' - ' + o.to : '>=' + o.from ) : (o.to ? '<=' + o.to : '');
|
||||
return $input.val( t );
|
||||
},
|
||||
|
||||
/**********************\
|
||||
HTML5 Number (spinner)
|
||||
\**********************/
|
||||
html5Number : function($cell, indx, def5Num) {
|
||||
var t, o = $.extend({
|
||||
value : 0,
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
delayed : true,
|
||||
disabled : false,
|
||||
addToggle : true,
|
||||
exactMatch : true,
|
||||
compare : '',
|
||||
skipTest: false
|
||||
}, def5Num),
|
||||
|
||||
// test browser for HTML5 range support
|
||||
$number = $('<input type="number" style="visibility:hidden;" value="test">').appendTo($cell),
|
||||
// test if HTML5 number is supported - from Modernizr
|
||||
numberSupported = o.skipTest || $number.attr('type') === 'number' && $number.val() !== 'test',
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
updateNumber = function(v, delayed){
|
||||
var chkd = o.addToggle ? $cell.find('.toggle').is(':checked') : true;
|
||||
$cell.find('input[type=hidden]')
|
||||
// add equal to the beginning, so we filter exact numbers
|
||||
.val( !o.addToggle || chkd ? (o.compare ? o.compare : o.exactMatch ? '=' : '') + v : '' )
|
||||
.trigger('search', delayed ? delayed : o.delayed).end()
|
||||
.find('.number').val(v);
|
||||
if ($cell.find('.number').length) {
|
||||
$cell.find('.number')[0].disabled = (o.disabled || !chkd);
|
||||
}
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.number').val(v)[0].disabled = (o.disabled || !chkd);
|
||||
if (o.addToggle) {
|
||||
$shcell.find('.toggle')[0].checked = chkd;
|
||||
}
|
||||
}
|
||||
};
|
||||
$number.remove();
|
||||
|
||||
if (numberSupported) {
|
||||
t = o.addToggle ? '<div class="button"><input id="html5button' + indx + '" type="checkbox" class="toggle" /><label for="html5button' + indx + '"></label></div>' : '';
|
||||
t += '<input class="number" type="number" min="' + o.min + '" max="' + o.max + '" value="' +
|
||||
o.value + '" step="' + o.step + '" />';
|
||||
// add HTML5 number (spinner)
|
||||
$cell
|
||||
.html(t + '<input type="hidden" />')
|
||||
.find('.toggle, .number').bind('change', function(){
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
})
|
||||
.closest('thead').find('th[data-column=' + indx + ']')
|
||||
.addClass('filter-parsed') // get exact numbers from column
|
||||
// on reset
|
||||
.closest('table').bind('filterReset', function(){
|
||||
// turn off the toggle checkbox
|
||||
if (o.addToggle) {
|
||||
$cell.find('.toggle')[0].checked = false;
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.toggle')[0].checked = false;
|
||||
}
|
||||
}
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
});
|
||||
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
$cell.find('input[type=hidden]').bind('change.tsfilter', function(){
|
||||
updateNumber( this.value );
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
$shcell
|
||||
.html(t)
|
||||
.find('.toggle, .number').bind('change', function(){
|
||||
updateNumber( $shcell.find('.number').val() );
|
||||
});
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
});
|
||||
|
||||
updateNumber( $cell.find('.number').val() );
|
||||
|
||||
}
|
||||
|
||||
return numberSupported ? $cell.find('input[type="hidden"]') : $('<input type="search">');
|
||||
},
|
||||
|
||||
/**********************\
|
||||
HTML5 range slider
|
||||
\**********************/
|
||||
html5Range : function($cell, indx, def5Range) {
|
||||
var t, o = $.extend({
|
||||
value : 0,
|
||||
min : 0,
|
||||
max : 100,
|
||||
step : 1,
|
||||
delayed : true,
|
||||
valueToHeader : true,
|
||||
exactMatch : true,
|
||||
compare : '',
|
||||
allText : 'all',
|
||||
skipTest : false
|
||||
}, def5Range),
|
||||
|
||||
// test browser for HTML5 range support
|
||||
$range = $('<input type="range" style="visibility:hidden;" value="test">').appendTo($cell),
|
||||
// test if HTML5 range is supported - from Modernizr (but I left out the method to detect in Safari 2-4)
|
||||
// see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/inputtypes.js
|
||||
rangeSupported = o.skipTest || $range.attr('type') === 'range' && $range.val() !== 'test',
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
updateRange = function(v, delayed){
|
||||
/*jshint eqeqeq:false */
|
||||
v = (v + '').replace(/[<>=]/g,'') || o.min; // hidden input changes may include compare symbols
|
||||
var t = ' (' + (o.compare ? o.compare + v : v == o.min ? o.allText : v) + ')';
|
||||
$cell.find('input[type=hidden]')
|
||||
// add equal to the beginning, so we filter exact numbers
|
||||
.val( ( o.compare ? o.compare + v : ( v == o.min ? '' : ( o.exactMatch ? '=' : '' ) + v ) ) )
|
||||
//( val == o.min ? '' : val + (o.exactMatch ? '=' : ''))
|
||||
.trigger('search', delayed ? delayed : o.delayed).end()
|
||||
.find('.range').val(v);
|
||||
// or add current value to the header cell, if desired
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(t);
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.range').val(v);
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.curvalue').html(t);
|
||||
}
|
||||
};
|
||||
$range.remove();
|
||||
|
||||
if (rangeSupported) {
|
||||
// add HTML5 range
|
||||
$cell
|
||||
.html('<input type="hidden"><input class="range" type="range" min="' + o.min + '" max="' + o.max + '" value="' + o.value + '" />')
|
||||
.closest('thead').find('th[data-column=' + indx + ']')
|
||||
.addClass('filter-parsed') // get exact numbers from column
|
||||
// add span to header for the current slider value
|
||||
.find('.tablesorter-header-inner').append('<span class="curvalue" />');
|
||||
|
||||
$cell.find('.range').bind('change', function(){
|
||||
updateRange( this.value );
|
||||
});
|
||||
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
$cell.find('input[type=hidden]').bind('change.tsfilter', function(){
|
||||
/*jshint eqeqeq:false */
|
||||
var v = this.value;
|
||||
if (v !== this.lastValue) {
|
||||
this.lastValue = ( o.compare ? o.compare + v : ( v == o.min ? '' : ( o.exactMatch ? '=' : '' ) + v ) );
|
||||
this.value = this.lastValue;
|
||||
updateRange( v );
|
||||
}
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
|
||||
$shcell
|
||||
.html('<input class="range" type="range" min="' + o.min + '" max="' + o.max + '" value="' + o.value + '" />')
|
||||
.find('.range').bind('change', function(){
|
||||
updateRange( $shcell.find('.range').val() );
|
||||
});
|
||||
updateRange( $cell.find('.range').val() );
|
||||
});
|
||||
|
||||
// on reset
|
||||
$cell.closest('table').bind('filterReset', function(){
|
||||
// just turn off the colorpicker
|
||||
updateRange(o.value);
|
||||
});
|
||||
|
||||
updateRange( $cell.find('.range').val() );
|
||||
|
||||
}
|
||||
|
||||
return rangeSupported ? $cell.find('input[type="hidden"]') : $('<input type="search">');
|
||||
},
|
||||
|
||||
/**********************\
|
||||
HTML5 Color picker
|
||||
\**********************/
|
||||
html5Color: function($cell, indx, defColor) {
|
||||
var t, o = $.extend({
|
||||
value : '#000000',
|
||||
disabled : false,
|
||||
addToggle : true,
|
||||
exactMatch : true,
|
||||
valueToHeader : false,
|
||||
skipTest : false
|
||||
}, defColor),
|
||||
// Add a hidden input to hold the range values
|
||||
$color = $('<input type="color" style="visibility:hidden;" value="test">').appendTo($cell),
|
||||
// test if HTML5 color is supported - from Modernizr
|
||||
colorSupported = o.skipTest || $color.attr('type') === 'color' && $color.val() !== 'test',
|
||||
$shcell = [],
|
||||
c = $cell.closest('table')[0].config,
|
||||
|
||||
updateColor = function(v){
|
||||
v = v || o.value;
|
||||
var chkd = true,
|
||||
t = ' (' + v + ')';
|
||||
if (o.addToggle) {
|
||||
chkd = $cell.find('.toggle').is(':checked');
|
||||
}
|
||||
if ($cell.find('.colorpicker').length) {
|
||||
$cell.find('.colorpicker').val(v)[0].disabled = (o.disabled || !chkd);
|
||||
}
|
||||
|
||||
$cell.find('input[type=hidden]')
|
||||
.val( chkd ? v + (o.exactMatch ? '=' : '') : '' )
|
||||
.trigger('search');
|
||||
if (o.valueToHeader) {
|
||||
// add current color to the header cell
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.curcolor').html(t);
|
||||
} else {
|
||||
// current color to span in cell
|
||||
$cell.find('.currentColor').html(t);
|
||||
}
|
||||
|
||||
// update sticky header cell
|
||||
if ($shcell.length) {
|
||||
$shcell.find('.colorpicker').val(v)[0].disabled = (o.disabled || !chkd);
|
||||
if (o.addToggle) {
|
||||
$shcell.find('.toggle')[0].checked = chkd;
|
||||
}
|
||||
if (o.valueToHeader) {
|
||||
// add current color to the header cell
|
||||
$shcell.closest('thead').find('th[data-column=' + indx + ']').find('.curcolor').html(t);
|
||||
} else {
|
||||
// current color to span in cell
|
||||
$shcell.find('.currentColor').html(t);
|
||||
}
|
||||
}
|
||||
};
|
||||
$color.remove();
|
||||
|
||||
if (colorSupported) {
|
||||
// add HTML5 color picker
|
||||
t = '<div class="color-controls-wrapper">';
|
||||
t += o.addToggle ? '<div class="button"><input id="colorbutton' + indx + '" type="checkbox" class="toggle" /><label for="colorbutton' + indx + '"></label></div>' : '';
|
||||
t += '<input type="hidden"><input class="colorpicker" type="color" />';
|
||||
t += (o.valueToHeader ? '' : '<span class="currentColor">(#000000)</span>') + '</div>';
|
||||
$cell.html(t);
|
||||
|
||||
// add span to header for the current color value - only works if the line in the updateColor() function is also un-commented out
|
||||
if (o.valueToHeader) {
|
||||
$cell.closest('thead').find('th[data-column=' + indx + ']').find('.tablesorter-header-inner').append('<span class="curcolor" />');
|
||||
}
|
||||
|
||||
$cell.find('.toggle, .colorpicker').bind('change', function(){
|
||||
updateColor( $cell.find('.colorpicker').val() );
|
||||
});
|
||||
|
||||
// hidden filter update (.tsfilter) namespace trigger by filter widget
|
||||
$cell.find('input[type=hidden]').bind('change.tsfilter', function(){
|
||||
updateColor( this.value );
|
||||
});
|
||||
|
||||
// on reset
|
||||
$cell.closest('table').bind('filterReset', function(){
|
||||
// just turn off the colorpicker
|
||||
$cell.find('.toggle')[0].checked = false;
|
||||
updateColor( $cell.find('.colorpicker').val() );
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx);
|
||||
$shcell
|
||||
.html(t)
|
||||
.find('.toggle, .colorpicker').bind('change', function(){
|
||||
updateColor( $shcell.find('.colorpicker').val() );
|
||||
});
|
||||
updateColor( $shcell.find('.colorpicker').val() );
|
||||
});
|
||||
|
||||
updateColor( o.value );
|
||||
}
|
||||
return colorSupported ? $cell.find('input[type="hidden"]') : $('<input type="search">');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user