Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,122 @@
/**
* Module generic file
*
* @category Administration
* @author bt-consulting <contact@bt-consulting.io>
* @copyright 2017 BT Consulting
* @version 1.0.0
* @license bt-consulting.io
* @since File available since Release 1.0
*/
$.extend(true, $.fn.dataTable.defaults, {
"sDom": "<'row-fluid'<'span2 pull-left'l><'span2 pull-right'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
}
});
$.extend($.fn.dataTableExt.oStdClasses, {
"sWrapper": "dataTables_wrapper form-inline"
});
$.fn.dataTableExt.oApi.fnPagingInfo = function (oSettings) {
return {
"iStart": oSettings._iDisplayStart,
"iEnd": oSettings.fnDisplayEnd(),
"iLength": oSettings._iDisplayLength,
"iTotal": oSettings.fnRecordsTotal(),
"iFilteredTotal": oSettings.fnRecordsDisplay(),
"iPage": Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
"iTotalPages": Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
};
};
$.extend($.fn.dataTableExt.oPagination, {
"bootstrap": {
"fnInit": function (oSettings, nPaging, fnDraw) {
var oLang = oSettings.oLanguage.oPaginate;
var fnClickHandler = function (e) {
e.preventDefault();
if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) {
fnDraw(oSettings);
}
};
$(nPaging).addClass('pagination').append('<ul>' + '<li class="prev disabled"><a href="#">&larr; ' + oLang.sPrevious + '</a></li>' + '<li class="next disabled"><a href="#">' + oLang.sNext + ' &rarr; </a></li>' + '</ul>');
var els = $('a', nPaging);
$(els[0]).bind('click.DT', {
action: "previous"
}, fnClickHandler);
$(els[1]).bind('click.DT', {
action: "next"
}, fnClickHandler);
},
"fnUpdate": function (oSettings, fnDraw) {
var iListLength = 5;
var oPaging = oSettings.oInstance.fnPagingInfo();
var an = oSettings.aanFeatures.p;
var i, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2);
if (oPaging.iTotalPages < iListLength) {
iStart = 1;
iEnd = oPaging.iTotalPages;
} else if (oPaging.iPage <= iHalf) {
iStart = 1;
iEnd = iListLength;
} else if (oPaging.iPage >= (oPaging.iTotalPages - iHalf)) {
iStart = oPaging.iTotalPages - iListLength + 1;
iEnd = oPaging.iTotalPages;
} else {
iStart = oPaging.iPage - iHalf + 1;
iEnd = iStart + iListLength - 1;
}
for (i = 0, iLen = an.length; i < iLen; i++) {
$('li:gt(0)', an[i]).filter(':not(:last)').remove();
for (j = iStart; j <= iEnd; j++) {
sClass = (j == oPaging.iPage + 1) ? 'class="active"' : '';
$('<li ' + sClass + '><a href="#">' + j + '</a></li>').insertBefore($('li:last', an[i])[0]).bind('click', function (e) {
e.preventDefault();
oSettings._iDisplayStart = (parseInt($('a', this).text(), 10) - 1) * oPaging.iLength;
fnDraw(oSettings);
});
}
if (oPaging.iPage === 0) {
$('li:first', an[i]).addClass('disabled');
} else {
$('li:first', an[i]).removeClass('disabled');
}
if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) {
$('li:last', an[i]).addClass('disabled');
} else {
$('li:last', an[i]).removeClass('disabled');
}
}
}
}
});
if ($.fn.DataTable.TableTools) {
$.extend(true, $.fn.DataTable.TableTools.classes, {
"container": "DTTT btn-group",
"buttons": {
"normal": "btn",
"disabled": "disabled"
},
"collection": {
"container": "DTTT_dropdown dropdown-menu",
"buttons": {
"normal": "",
"disabled": "disabled"
}
},
"print": {
"info": "DTTT_print_info modal"
},
"select": {
"row": "active"
}
});
$.extend(true, $.fn.DataTable.TableTools.DEFAULTS.oTags, {
"collection": {
"container": "ul",
"button": "li",
"liner": "a"
}
});
}

View File

@@ -0,0 +1,155 @@
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
$(document).ready(function(){
$('#saveImportMatchs').unbind('click').click(function(){
var newImportMatchs = $('#newImportMatchs').attr('value');
if (newImportMatchs == '')
jAlert(errorEmpty);
else
{
var matchFields = '';
$('.type_value').each( function () {
matchFields += '&'+$(this).attr('id')+'='+$(this).attr('value');
});
$.ajax({
type: 'POST',
url: 'index.php',
async: false,
cache: false,
dataType : "json",
data: 'ajax=1&action=saveImportMatchs&tab=AdminErpImport&token=' + token + '&skip=' + $('input[name=skip]').attr('value') + '&newImportMatchs=' + newImportMatchs + matchFields,
success: function(jsonData)
{
$('#valueImportMatchs').append('<option id="'+jsonData.id+'" value="'+matchFields+'" selected="selected">'+newImportMatchs+'</option>');
$('#selectDivImportMatchs').fadeIn('slow');
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
jAlert('TECHNICAL ERROR Details: ' + html_escape(XMLHttpRequest.responseText));
}
});
}
});
$('#loadImportMatchs').unbind('click').click(function(){
var idToLoad = $('select#valueImportMatchs option:selected').attr('id');
$.ajax({
type: 'POST',
url: 'index.php',
async: false,
cache: false,
dataType : "json",
data: 'ajax=1&action=loadImportMatchs&tab=AdminErpImport&token=' + token + '&idImportMatchs=' + idToLoad,
success: function(jsonData)
{
var matchs = jsonData.matchs.split('|')
$('input[name=skip]').val(jsonData.skip);
for (i=0;i<matchs.length;i++)
$('#type_value\\['+i+'\\]').val(matchs[i]).attr('selected',true);
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
jAlert('TECHNICAL ERROR Details: ' + html_escape(XMLHttpRequest.responseText));
}
});
});
$('#deleteImportMatchs').unbind('click').click(function(){
var idToDelete = $('select#valueImportMatchs option:selected').attr('id');
$.ajax({
type: 'POST',
url: 'index.php',
async: false,
cache: false,
dataType : "json",
data: 'ajax=1&action=deleteImportMatchs&tab=AdminErpImport&token=' + token + '&idImportMatchs=' + idToDelete ,
success: function(jsonData)
{
$('select#valueImportMatchs option[id=\''+idToDelete+'\']').remove();
if ($('select#valueImportMatchs option').length == 0)
$('#selectDivImportMatchs').fadeOut();
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
jAlert('TECHNICAL ERROR Details: ' + html_escape(XMLHttpRequest.responseText));
}
});
});
});
function validateImportation(mandatory)
{
var type_value = [];
var seted_value = [];
var elem;
var col = 'unknow';
toggle(getE('error_duplicate_type'), false);
toggle(getE('required_column'), false);
for (i = 0; elem = getE('type_value['+i+']'); i++)
{
if (seted_value[elem.options[elem.selectedIndex].value])
{
scroll(0,0);
toggle(getE('error_duplicate_type'), true);
return false;
}
else if (elem.options[elem.selectedIndex].value != 'no')
seted_value[elem.options[elem.selectedIndex].value] = true;
}
for (needed in mandatory)
if (!seted_value[mandatory[needed]])
{
scroll(0,0);
toggle(getE('required_column'), true);
getE('missing_column').innerHTML = mandatory[needed];
elem = getE('type_value[0]');
for (i = 0; i < elem.length; ++i)
{
if (elem.options[i].value == mandatory[needed])
{
getE('missing_column').innerHTML = elem.options[i].innerHTML;
break ;
}
}
return false
}
}
function html_escape(str) {
return String(str)
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,654 @@
/* ================================================
* Make use of Twitter Bootstrap's modal more monkey-friendly.
*
* For Bootstrap 3.
*
* javanoob@hotmail.com
*
* Licensed under The MIT License.
* ================================================ */
var BootstrapDialog = null;
!function($) {
"use strict";
BootstrapDialog = function(options) {
this.defaultOptions = {
id: BootstrapDialog.newGuid(),
type: BootstrapDialog.TYPE_PRIMARY,
size: BootstrapDialog.SIZE_NORMAL,
cssClass: '',
title: null,
message: null,
buttons: [],
closable: true,
spinicon: BootstrapDialog.ICON_SPINNER,
data: {},
onshow: null,
onhide: null,
autodestroy: true
};
this.indexedButtons = {};
this.realized = false;
this.opened = false;
this.initOptions(options);
this.holdThisInstance();
};
/**
* Some constants.
*/
BootstrapDialog.NAMESPACE = 'bootstrap-dialog';
BootstrapDialog.TYPE_DEFAULT = 'type-default';
BootstrapDialog.TYPE_INFO = 'type-info';
BootstrapDialog.TYPE_PRIMARY = 'type-primary';
BootstrapDialog.TYPE_SUCCESS = 'type-success';
BootstrapDialog.TYPE_WARNING = 'type-warning';
BootstrapDialog.TYPE_DANGER = 'type-danger';
BootstrapDialog.DEFAULT_TEXTS = {};
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DEFAULT] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_INFO] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_PRIMARY] = 'Information';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_SUCCESS] = 'Success';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_WARNING] = 'Warning';
BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DANGER] = 'Danger';
BootstrapDialog.SIZE_NORMAL = 'size-normal';
BootstrapDialog.SIZE_LARGE = 'size-large';
BootstrapDialog.BUTTON_SIZES = {};
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL] = '';
BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE] = 'btn-lg';
BootstrapDialog.ICON_SPINNER = 'icon-spinner icon-spin';
/**
* Open / Close all created dialogs all at once.
*/
BootstrapDialog.dialogs = {};
BootstrapDialog.openAll = function() {
$.each(BootstrapDialog.dialogs, function(id, dialogInstance) {
dialogInstance.open();
});
};
BootstrapDialog.closeAll = function() {
$.each(BootstrapDialog.dialogs, function(id, dialogInstance) {
dialogInstance.close();
});
};
BootstrapDialog.prototype = {
constructor: BootstrapDialog,
initOptions: function(options) {
this.options = $.extend(true, this.defaultOptions, options);
return this;
},
holdThisInstance: function() {
BootstrapDialog.dialogs[this.getId()] = this;
return this;
},
initModalStuff: function() {
this.setModal(this.createModal())
.setModalDialog(this.createModalDialog())
.setModalContent(this.createModalContent())
.setModalHeader(this.createModalHeader())
.setModalBody(this.createModalBody())
.setModalFooter(this.createModalFooter());
this.getModal().append(this.getModalDialog());
this.getModalDialog().append(this.getModalContent());
this.getModalContent()
.append(this.getModalHeader())
.append(this.getModalBody())
.append(this.getModalFooter());
return this;
},
createModal: function() {
return $('<div class="modal fade" tabindex="-1" id="' + this.getId() + '"></div>');
},
getModal: function() {
return this.$modal;
},
setModal: function($modal) {
this.$modal = $modal;
return this;
},
createModalDialog: function() {
return $('<div class="modal-dialog"></div>');
},
getModalDialog: function() {
return this.$modalDialog;
},
setModalDialog: function($modalDialog) {
this.$modalDialog = $modalDialog;
return this;
},
createModalContent: function() {
return $('<div class="modal-content"></div>');
},
getModalContent: function() {
return this.$modalContent;
},
setModalContent: function($modalContent) {
this.$modalContent = $modalContent;
return this;
},
createModalHeader: function() {
return $('<div class="modal-header"></div>');
},
getModalHeader: function() {
return this.$modalHeader;
},
setModalHeader: function($modalHeader) {
this.$modalHeader = $modalHeader;
return this;
},
createModalBody: function() {
return $('<div class="modal-body"></div>');
},
getModalBody: function() {
return this.$modalBody;
},
setModalBody: function($modalBody) {
this.$modalBody = $modalBody;
return this;
},
createModalFooter: function() {
return $('<div class="modal-footer"></div>');
},
getModalFooter: function() {
return this.$modaFooter;
},
setModalFooter: function($modaFooter) {
this.$modaFooter = $modaFooter;
return this;
},
createDynamicContent: function(rawContent) {
var content = null;
if (typeof rawContent === 'function') {
content = rawContent.call(rawContent, this);
} else {
content = rawContent;
}
if (typeof content === 'string') {
content = this.formatStringContent(content);
}
return content;
},
formatStringContent: function(content) {
return content.replace(/\r\n/g, '<br />').replace(/[\r\n]/g, '<br />');
},
setData: function(key, value) {
this.options.data[key] = value;
return this;
},
getData: function(key) {
return this.options.data[key];
},
setId: function(id) {
this.options.id = id;
return this;
},
getId: function() {
return this.options.id;
},
getType: function() {
return this.options.type;
},
setType: function(type) {
this.options.type = type;
return this;
},
getSize: function() {
return this.options.size;
},
setSize: function(size) {
this.options.size = size;
return this;
},
getCssClass: function() {
return this.options.cssClass;
},
setCssClass: function(cssClass){
this.options.cssClass = cssClass;
return this;
},
getTitle: function() {
return this.options.title;
},
setTitle: function(title) {
this.options.title = title;
return this;
},
getMessage: function() {
return this.options.message;
},
setMessage: function(message) {
this.options.message = message;
return this;
},
isClosable: function() {
return this.options.closable;
},
setClosable: function(closable) {
this.options.closable = closable;
this.updateClosable();
return this;
},
getSpinicon: function() {
return this.options.spinicon;
},
setSpinicon: function(spinicon) {
this.options.spinicon = spinicon;
return this;
},
addButton: function(button) {
this.options.buttons.push(button);
return this;
},
addButtons: function(buttons) {
var that = this;
$.each(buttons, function(index, button) {
that.addButton(button);
});
return this;
},
getButtons: function() {
return this.options.buttons;
},
setButtons: function(buttons) {
this.options.buttons = buttons;
return this;
},
/**
* If there is id provided for a button option, it will be in dialog.indexedButtons list.
*
* In that case you can use dialog.getButton(id) to find the button.
*
* @param {type} id
* @returns {undefined}
*/
getButton: function(id) {
if (typeof this.indexedButtons[id] !== 'undefined') {
return this.indexedButtons[id];
}
return null;
},
getButtonSize: function() {
if (typeof BootstrapDialog.BUTTON_SIZES[this.getSize()] !== 'undefined') {
return BootstrapDialog.BUTTON_SIZES[this.getSize()];
}
return '';
},
isAutodestroy: function() {
return this.options.autodestroy;
},
setAutodestroy: function(autodestroy) {
this.options.autodestroy = autodestroy;
},
getDefaultText: function() {
return BootstrapDialog.DEFAULT_TEXTS[this.getType()];
},
getNamespace: function(name) {
return BootstrapDialog.NAMESPACE + '-' + name;
},
createHeaderContent: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('header'));
// title
$container.append(this.createTitleContent());
// Close button
$container.append(this.createCloseButton());
return $container;
},
createTitleContent: function() {
var $title = $('<div></div>');
$title.addClass(this.getNamespace('title'));
$title.append(this.getTitle() !== null ? this.createDynamicContent(this.getTitle()) : this.getDefaultText());
return $title;
},
createCloseButton: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('close-button'));
var $icon = $('<button class="close">×</button>');
$container.append($icon);
$container.on('click', {dialog: this}, function(event) {
event.data.dialog.close();
});
return $container;
},
createBodyContent: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('body'));
// Message
$container.append(this.createMessageContent());
return $container;
},
createMessageContent: function() {
var $message = $('<div></div>');
$message.addClass(this.getNamespace('message'));
$message.append(this.createDynamicContent(this.getMessage()));
return $message;
},
createFooterContent: function() {
var $container = $('<div></div>');
$container.addClass(this.getNamespace('footer'));
// Buttons
$container.append(this.createFooterButtons());
return $container;
},
createFooterButtons: function() {
var that = this;
var $container = $('<div></div>');
$container.addClass(this.getNamespace('footer-buttons'));
this.indexedButtons = {};
$.each(this.options.buttons, function(index, button) {
var $button = that.createButton(button);
if (typeof button.id !== 'undefined') {
that.indexedButtons[button.id] = $button;
}
$container.append($button);
});
return $container;
},
createButton: function(button) {
var $button = $('<button class="btn"></button>');
$button.addClass(this.getButtonSize());
// Icon
if (typeof button.icon !== undefined && $.trim(button.icon) !== '') {
$button.append(this.createButtonIcon(button.icon));
}
// Label
if (typeof button.label !== undefined) {
$button.append(button.label);
}
// Css class
if (typeof button.cssClass !== undefined && $.trim(button.cssClass) !== '') {
$button.addClass(button.cssClass);
} else {
$button.addClass('btn-default');
}
// Button on click
$button.on('click', {dialog: this, button: button}, function(event) {
var dialog = event.data.dialog;
var button = event.data.button;
if (typeof button.action === 'function') {
button.action.call(this, dialog);
}
if (button.autospin) {
var $button = $(this);
$button.find('.' + dialog.getNamespace('button-icon')).remove();
$button.prepend(dialog.createButtonIcon(dialog.getSpinicon()).addClass('icon-spin'));
}
});
return $button;
},
createButtonIcon: function(icon) {
var $icon = $('<span></span>');
$icon.addClass(this.getNamespace('button-icon')).addClass(icon);
return $icon;
},
/**
* Invoke this only after the dialog is realized.
*
* @param {type} enable
* @returns {undefined}
*/
enableButtons: function(enable) {
var $buttons = this.getModalFooter().find('.btn');
$buttons.prop("disabled", !enable).toggleClass('disabled', !enable);
return this;
},
/**
* Invoke this only after the dialog is realized.
*
* @param {type} enable
* @returns {undefined}
*/
updateClosable: function() {
if (this.isRealized()) {
// Backdrop, I did't find a way to change bs3 backdrop option after the dialog is popped up, so here's a new wheel.
var $theBigMask = this.getModal();
$theBigMask.off('click').on('click', {dialog: this}, function(event) {
event.target === this && event.data.dialog.isClosable() && event.data.dialog.close();
});
// Close button
this.getModalHeader().find('.' + this.getNamespace('close-button')).toggle(this.isClosable());
// ESC key support
$theBigMask.off('keyup').on('keyup', {dialog: this}, function(event) {
event.which === 27 && event.data.dialog.isClosable() && event.data.dialog.close();
});
}
return this;
},
/**
* Set handler for modal event 'show'.
* This is a setter!
*
* @param {type} onopen
* @returns {_L9.BootstrapDialog.prototype}
*/
onShow: function(onshow) {
this.options.onshow = onshow;
return this;
},
/**
* Set handler for modal event 'hide'.
* This is a setter!
*
* @param {type} onclose
* @returns {_L9.BootstrapDialog.prototype}
*/
onHide: function(onhide) {
this.options.onhide = onhide;
return this;
},
isRealized: function() {
return this.realized;
},
setRealized: function(realized) {
this.realized = realized;
return this;
},
isOpened: function() {
return this.opened;
},
setOpened: function(opened) {
this.opened = opened;
return this;
},
handleModalEvents: function() {
this.getModal().on('show.bs.modal', {dialog: this}, function(event) {
var dialog = event.data.dialog;
typeof dialog.options.onshow === 'function' && dialog.options.onshow(dialog);
dialog.showPageScrollBar(true);
});
this.getModal().on('hide.bs.modal', {dialog: this}, function(event) {
var dialog = event.data.dialog;
typeof dialog.options.onhide === 'function' && dialog.options.onhide(dialog);
});
this.getModal().on('hidden.bs.modal', {dialog: this}, function(event) {
var dialog = event.data.dialog;
dialog.isAutodestroy() && $(this).remove();
dialog.showPageScrollBar(false);
});
return this;
},
showPageScrollBar: function(show) {
$(document.body).toggleClass('modal-open', show);
},
realize: function() {
this.initModalStuff();
this.getModal().addClass(BootstrapDialog.NAMESPACE)
.addClass(this.getType())
.addClass(this.getSize())
.addClass(this.getCssClass());
this.getModalHeader().append(this.createHeaderContent());
this.getModalBody().append(this.createBodyContent());
this.getModalFooter().append(this.createFooterContent());
this.getModal().modal({
backdrop: 'static',
keyboard: false,
show: false
});
this.handleModalEvents();
this.setRealized(true);
return this;
},
open: function() {
!this.isRealized() && this.realize();
this.updateClosable();
this.getModal().modal('show');
this.setOpened(true);
return this;
},
close: function() {
this.getModal().modal('hide');
if (this.isAutodestroy()) {
delete BootstrapDialog.dialogs[this.getId()];
}
this.setOpened(false);
return this;
}
};
/**
* RFC4122 version 4 compliant unique id creator.
*
* Added by https://github.com/tufanbarisyildirim/
*
* @returns {String}
*/
BootstrapDialog.newGuid = function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
};
/* ================================================
* For lazy people
* ================================================ */
/**
* Shortcut function: show
*
* @param {type} options
* @returns {undefined}
*/
BootstrapDialog.show = function(options) {
new BootstrapDialog(options).open();
};
/**
* Alert window
*
* @param {type} message
* @param {type} callback
* @returns {undefined}
*/
BootstrapDialog.alert = function(message, callback) {
new BootstrapDialog({
message: message,
data: {
'callback': callback
},
closable: false,
buttons: [{
label: 'OK',
action: function(dialog) {
typeof dialog.getData('callback') === 'function' && dialog.getData('callback')(true);
dialog.close();
}
}]
}).open();
};
/**
* Confirm window
*
* @param {type} message
* @param {type} callback
* @returns {undefined}
*/
BootstrapDialog.confirm = function(message, callback) {
new BootstrapDialog({
title: 'Confirmation',
message: message,
closable: false,
data: {
'callback': callback
},
buttons: [{
label: 'Cancel',
action: function(dialog) {
typeof dialog.getData('callback') === 'function' && dialog.getData('callback')(false);
dialog.close();
}
}, {
label: 'OK',
cssClass: 'btn-primary',
action: function(dialog) {
typeof dialog.getData('callback') === 'function' && dialog.getData('callback')(true);
dialog.close();
}
}]
}).open();
};
}(window.jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,90 @@
/**
* Module generic file
*
* @category Administration
* @author bt-consulting <contact@bt-consulting.io>
* @copyright 2017 BT Consulting
* @version 1.0.0
* @license bt-consulting.io
* @since File available since Release 1.0
*/
function fnFormatDetails(oTable, pTr) {
var aData = oTable.fnGetData(pTr);
var sOut = '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">';
sOut += '<tr><td>Rendering engine:</td><td>' + aData[1] + ' ' + aData[4] + '</td></tr>';
sOut += '<tr><td>Link to source:</td><td>Could provide a link here</td></tr>';
sOut += '<tr><td>Extra info:</td><td>And any further details here (images etc)</td></tr>';
sOut += '</table>';
return sOut;
}
$(document).ready(function () {
var nCloneTh = document.createElement('th');
$('.dataTableHidden thead tr').each(function () {
this.insertBefore(nCloneTh.cloneNode(true), this.childNodes[0]);
});
var nCloneTd = document.createElement('td');
nCloneTd.innerHTML = '<i class="icon-plus"></i>';
nCloneTd.className = "center hidden-table-info";
$('.dataTableHidden tbody tr').each(function () {
this.insertBefore(nCloneTd.cloneNode(true), this.childNodes[0]);
});
$('.dataTable').each(function () {
var $oTable = $(this).dataTable({
"aoColumnDefs": [{
"bSortable": false,
"aTargets": [0,1,2,3,4,5,6]
}],
"aaSorting": []
});
$(this).children().each(function () {
$(this).find('.sorting').append('<i class="icon-sort pull-right"></i>');
$(this).find('.sorting_asc').append('<i class="icon-sort-alpha-asc pull-right"></i>');
$(this).find('.sorting_desc').append('<i class="icon-sort-alpha-desc pull-right"></i>');
});
$(document).on('click', '.dataTableHidden tbody td', function () {
var $pTr = $(this).parents('tr')[0];
if ($oTable.fnIsOpen($pTr)) {
$oTable.fnClose($pTr);
} else {
$oTable.fnOpen($pTr, fnFormatDetails($oTable, $pTr), 'details');
}
});
});
$(document).on('click', '.dataTableHidden tbody td', function () {
$(this).children().toggleClass("icon-minus");
});
$(document).on('click', '.dataTable thead th', function () {
$(this).parents('thead').each(function () {
$(this).find('i').removeClass('icon-sort-alpha-asc icon-sort-amount-asc').addClass('icon-sort');
$(this).find('i').removeClass('icon-sort-alpha-desc icon-sort-amount-desc').addClass('icon-sort');
});
$(this).find('i').toggleClass(function() {
if ($( this ).parent().is(".number"))
{
asc_icon = 'icon-sort-amount-asc';
desc_icon = 'icon-sort-amount-desc';
} else {
asc_icon = 'icon-sort-alpha-asc';
desc_icon = 'icon-sort-alpha-desc';
}
if ($( this ).parent().is(".sorting_asc")) {
$(this).removeClass(desc_icon);
return asc_icon;
} else {
$(this).removeClass(asc_icon);
return desc_icon;
}
});
});
});

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2014 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,6 @@
/*!
* Autosize v1.18.1 (http://www.jacklmoore.com/autosize)
* (c) 2013 Jack Moore
* license: http://www.opensource.org/licenses/mit-license.php
*/
(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o;"getComputedStyle"in window?(t=window.getComputedStyle(u,null),o=u.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){o-=parseInt(t[i],10)}),s.style.width=o+"px"):s.style.width=Math.max(p.width(),0)+"px"}function a(){var a={};if(t=u,s.className=i.className,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?a():o(),s.value=u.value+i.append,s.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$);

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,997 @@
/**
* jscolor, JavaScript Color Picker
*
* @version 1.4.2
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
* @author Jan Odvarko, http://odvarko.cz
* @created 2008-06-15
* @updated 2013-11-25
* @link http://jscolor.com
*/
var jscolor = {
dir : '', // location of jscolor directory (leave empty to autodetect)
bindClass : 'color', // class name
binding : true, // automatic binding via <input class="...">
preloading : true, // use image preloading?
install : function() {
jscolor.addEvent(window, 'load', jscolor.init);
},
init : function() {
if(jscolor.binding) {
jscolor.bind();
}
if(jscolor.preloading) {
jscolor.preload();
}
},
getDir : function() {
if(!jscolor.dir) {
var detected = jscolor.detectDir();
jscolor.dir = detected!==false ? detected : 'jscolor/';
}
return jscolor.dir;
},
detectDir : function() {
var base = location.href;
var e = document.getElementsByTagName('base');
for(var i=0; i<e.length; i+=1) {
if(e[i].href) { base = e[i].href; }
}
var e = document.getElementsByTagName('script');
for(var i=0; i<e.length; i+=1) {
if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
var src = new jscolor.URI(e[i].src);
var srcAbs = src.toAbsolute(base);
srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
srcAbs.query = null;
srcAbs.fragment = null;
return srcAbs.toString();
}
}
return false;
},
bind : function() {
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
var e = document.getElementsByTagName('input');
for(var i=0; i<e.length; i+=1) {
var m;
if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
var prop = {};
if(m[3]) {
try {
prop = (new Function ('return (' + m[3] + ')'))();
} catch(eInvalidProp) {}
}
e[i].color = new jscolor.color(e[i], prop);
}
}
},
preload : function() {
for(var fn in jscolor.imgRequire) {
if(jscolor.imgRequire.hasOwnProperty(fn)) {
jscolor.loadImage(fn);
}
}
},
images : {
pad : [ 181, 101 ],
sld : [ 16, 101 ],
cross : [ 15, 15 ],
arrow : [ 7, 11 ]
},
imgRequire : {},
imgLoaded : {},
requireImage : function(filename) {
jscolor.imgRequire[filename] = true;
},
loadImage : function(filename) {
if(!jscolor.imgLoaded[filename]) {
jscolor.imgLoaded[filename] = new Image();
jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
}
},
fetchElement : function(mixed) {
return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
},
addEvent : function(el, evnt, func) {
if(el.addEventListener) {
el.addEventListener(evnt, func, false);
} else if(el.attachEvent) {
el.attachEvent('on'+evnt, func);
}
},
fireEvent : function(el, evnt) {
if(!el) {
return;
}
if(document.createEvent) {
var ev = document.createEvent('HTMLEvents');
ev.initEvent(evnt, true, true);
el.dispatchEvent(ev);
} else if(document.createEventObject) {
var ev = document.createEventObject();
el.fireEvent('on'+evnt, ev);
} else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
el['on'+evnt]();
}
},
getElementPos : function(e) {
var e1=e, e2=e;
var x=0, y=0;
if(e1.offsetParent) {
do {
x += e1.offsetLeft;
y += e1.offsetTop;
} while(e1 = e1.offsetParent);
}
while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
x -= e2.scrollLeft;
y -= e2.scrollTop;
}
return [x, y];
},
getElementSize : function(e) {
return [e.offsetWidth, e.offsetHeight];
},
getRelMousePos : function(e) {
var x = 0, y = 0;
if (!e) { e = window.event; }
if (typeof e.offsetX === 'number') {
x = e.offsetX;
y = e.offsetY;
} else if (typeof e.layerX === 'number') {
x = e.layerX;
y = e.layerY;
}
return { x: x, y: y };
},
getViewPos : function() {
if(typeof window.pageYOffset === 'number') {
return [window.pageXOffset, window.pageYOffset];
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
return [document.body.scrollLeft, document.body.scrollTop];
} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
} else {
return [0, 0];
}
},
getViewSize : function() {
if(typeof window.innerWidth === 'number') {
return [window.innerWidth, window.innerHeight];
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
return [document.body.clientWidth, document.body.clientHeight];
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
return [document.documentElement.clientWidth, document.documentElement.clientHeight];
} else {
return [0, 0];
}
},
URI : function(uri) { // See RFC3986
this.scheme = null;
this.authority = null;
this.path = '';
this.query = null;
this.fragment = null;
this.parse = function(uri) {
var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
this.scheme = m[3] ? m[2] : null;
this.authority = m[5] ? m[6] : null;
this.path = m[7];
this.query = m[9] ? m[10] : null;
this.fragment = m[12] ? m[13] : null;
return this;
};
this.toString = function() {
var result = '';
if(this.scheme !== null) { result = result + this.scheme + ':'; }
if(this.authority !== null) { result = result + '//' + this.authority; }
if(this.path !== null) { result = result + this.path; }
if(this.query !== null) { result = result + '?' + this.query; }
if(this.fragment !== null) { result = result + '#' + this.fragment; }
return result;
};
this.toAbsolute = function(base) {
var base = new jscolor.URI(base);
var r = this;
var t = new jscolor.URI;
if(base.scheme === null) { return false; }
if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
r.scheme = null;
}
if(r.scheme !== null) {
t.scheme = r.scheme;
t.authority = r.authority;
t.path = removeDotSegments(r.path);
t.query = r.query;
} else {
if(r.authority !== null) {
t.authority = r.authority;
t.path = removeDotSegments(r.path);
t.query = r.query;
} else {
if(r.path === '') {
t.path = base.path;
if(r.query !== null) {
t.query = r.query;
} else {
t.query = base.query;
}
} else {
if(r.path.substr(0,1) === '/') {
t.path = removeDotSegments(r.path);
} else {
if(base.authority !== null && base.path === '') {
t.path = '/'+r.path;
} else {
t.path = base.path.replace(/[^\/]+$/,'')+r.path;
}
t.path = removeDotSegments(t.path);
}
t.query = r.query;
}
t.authority = base.authority;
}
t.scheme = base.scheme;
}
t.fragment = r.fragment;
return t;
};
function removeDotSegments(path) {
var out = '';
while(path) {
if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
path = path.replace(/^\.+/,'').substr(1);
} else if(path.substr(0,3)==='/./' || path==='/.') {
path = '/'+path.substr(3);
} else if(path.substr(0,4)==='/../' || path==='/..') {
path = '/'+path.substr(4);
out = out.replace(/\/?[^\/]*$/, '');
} else if(path==='.' || path==='..') {
path = '';
} else {
var rm = path.match(/^\/?[^\/]*/)[0];
path = path.substr(rm.length);
out = out + rm;
}
}
return out;
}
if(uri) {
this.parse(uri);
}
},
//
// Usage example:
// var myColor = new jscolor.color(myInputElement)
//
color : function(target, prop) {
this.required = true; // refuse empty values?
this.adjust = true; // adjust value to uniform notation?
this.hash = false; // prefix color with # symbol?
this.caps = true; // uppercase?
this.slider = true; // show the value/saturation slider?
this.valueElement = target; // value holder
this.styleElement = target; // where to reflect current color
this.onImmediateChange = null; // onchange callback (can be either string or function)
this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
this.minH = 0; // read-only 0-6
this.maxH = 6; // read-only 0-6
this.minS = 0; // read-only 0-1
this.maxS = 1; // read-only 0-1
this.minV = 0; // read-only 0-1
this.maxV = 1; // read-only 0-1
this.pickerOnfocus = true; // display picker on focus?
this.pickerMode = 'HSV'; // HSV | HVS
this.pickerPosition = 'bottom'; // left | right | top | bottom
this.pickerSmartPosition = true; // automatically adjust picker position when necessary
this.pickerButtonHeight = 20; // px
this.pickerClosable = false;
this.pickerCloseText = 'Close';
this.pickerButtonColor = 'ButtonText'; // px
this.pickerFace = 10; // px
this.pickerFaceColor = 'ThreeDFace'; // CSS color
this.pickerBorder = 1; // px
this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
this.pickerInset = 1; // px
this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
this.pickerZIndex = 10000;
for(var p in prop) {
if(prop.hasOwnProperty(p)) {
this[p] = prop[p];
}
}
this.hidePicker = function() {
if(isPickerOwner()) {
removePicker();
}
};
this.showPicker = function() {
if(!isPickerOwner()) {
var tp = jscolor.getElementPos(target); // target pos
var ts = jscolor.getElementSize(target); // target size
var vp = jscolor.getViewPos(); // view pos
var vs = jscolor.getViewSize(); // view size
var ps = getPickerDims(this); // picker size
var a, b, c;
switch(this.pickerPosition.toLowerCase()) {
case 'left': a=1; b=0; c=-1; break;
case 'right':a=1; b=0; c=1; break;
case 'top': a=0; b=1; c=-1; break;
default: a=0; b=1; c=1; break;
}
var l = (ts[b]+ps[b])/2;
// picker pos
if (!this.pickerSmartPosition) {
var pp = [
tp[a],
tp[b]+ts[b]-l+l*c
];
} else {
var pp = [
-vp[a]+tp[a]+ps[a] > vs[a] ?
(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
tp[a],
-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
(tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
];
}
drawPicker(pp[a], pp[b]);
}
};
this.importColor = function() {
if(!valueElement) {
this.exportColor();
} else {
if(!this.adjust) {
if(!this.fromString(valueElement.value, leaveValue)) {
styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
styleElement.style.color = styleElement.jscStyle.color;
this.exportColor(leaveValue | leaveStyle);
}
} else if(!this.required && /^\s*$/.test(valueElement.value)) {
valueElement.value = '';
styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
styleElement.style.color = styleElement.jscStyle.color;
this.exportColor(leaveValue | leaveStyle);
} else if(this.fromString(valueElement.value)) {
// OK
} else {
this.exportColor();
}
}
};
this.exportColor = function(flags) {
if(!(flags & leaveValue) && valueElement) {
var value = this.toString();
if(this.caps) { value = value.toUpperCase(); }
if(this.hash) { value = '#'+value; }
valueElement.value = value;
}
if(!(flags & leaveStyle) && styleElement) {
styleElement.style.backgroundImage = "none";
styleElement.style.backgroundColor =
'#'+this.toString();
styleElement.style.color =
0.213 * this.rgb[0] +
0.715 * this.rgb[1] +
0.072 * this.rgb[2]
< 0.5 ? '#FFF' : '#000';
}
if(!(flags & leavePad) && isPickerOwner()) {
redrawPad();
}
if(!(flags & leaveSld) && isPickerOwner()) {
redrawSld();
}
};
this.fromHSV = function(h, s, v, flags) { // null = don't change
if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); }
if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
this.rgb = HSV_RGB(
h===null ? this.hsv[0] : (this.hsv[0]=h),
s===null ? this.hsv[1] : (this.hsv[1]=s),
v===null ? this.hsv[2] : (this.hsv[2]=v)
);
this.exportColor(flags);
};
this.fromRGB = function(r, g, b, flags) { // null = don't change
if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); }
if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); }
if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); }
var hsv = RGB_HSV(
r===null ? this.rgb[0] : r,
g===null ? this.rgb[1] : g,
b===null ? this.rgb[2] : b
);
if(hsv[0] !== null) {
this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0]));
}
if(hsv[2] !== 0) {
this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
}
this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
// update RGB according to final HSV, as some values might be trimmed
var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
this.rgb[0] = rgb[0];
this.rgb[1] = rgb[1];
this.rgb[2] = rgb[2];
this.exportColor(flags);
};
this.fromString = function(hex, flags) {
var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
if(!m) {
return false;
} else {
if(m[1].length === 6) { // 6-char notation
this.fromRGB(
parseInt(m[1].substr(0,2),16) / 255,
parseInt(m[1].substr(2,2),16) / 255,
parseInt(m[1].substr(4,2),16) / 255,
flags
);
} else { // 3-char notation
this.fromRGB(
parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
flags
);
}
return true;
}
};
this.toString = function() {
return (
(0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
(0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
(0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
);
};
function RGB_HSV(r, g, b) {
var n = Math.min(Math.min(r,g),b);
var v = Math.max(Math.max(r,g),b);
var m = v - n;
if(m === 0) { return [ null, 0, v ]; }
var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
return [ h===6?0:h, m/v, v ];
}
function HSV_RGB(h, s, v) {
if(h === null) { return [ v, v, v ]; }
var i = Math.floor(h);
var f = i%2 ? h-i : 1-(h-i);
var m = v * (1 - s);
var n = v * (1 - s*f);
switch(i) {
case 6:
case 0: return [v,n,m];
case 1: return [n,v,m];
case 2: return [m,v,n];
case 3: return [m,n,v];
case 4: return [n,m,v];
case 5: return [v,m,n];
}
}
function removePicker() {
delete jscolor.picker.owner;
document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
}
function drawPicker(x, y) {
if(!jscolor.picker) {
jscolor.picker = {
box : document.createElement('div'),
boxB : document.createElement('div'),
pad : document.createElement('div'),
padB : document.createElement('div'),
padM : document.createElement('div'),
sld : document.createElement('div'),
sldB : document.createElement('div'),
sldM : document.createElement('div'),
btn : document.createElement('div'),
btnS : document.createElement('span'),
btnT : document.createTextNode(THIS.pickerCloseText)
};
for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
var seg = document.createElement('div');
seg.style.height = segSize+'px';
seg.style.fontSize = '1px';
seg.style.lineHeight = '0';
jscolor.picker.sld.appendChild(seg);
}
jscolor.picker.sldB.appendChild(jscolor.picker.sld);
jscolor.picker.box.appendChild(jscolor.picker.sldB);
jscolor.picker.box.appendChild(jscolor.picker.sldM);
jscolor.picker.padB.appendChild(jscolor.picker.pad);
jscolor.picker.box.appendChild(jscolor.picker.padB);
jscolor.picker.box.appendChild(jscolor.picker.padM);
jscolor.picker.btnS.appendChild(jscolor.picker.btnT);
jscolor.picker.btn.appendChild(jscolor.picker.btnS);
jscolor.picker.box.appendChild(jscolor.picker.btn);
jscolor.picker.boxB.appendChild(jscolor.picker.box);
}
var p = jscolor.picker;
// controls interaction
p.box.onmouseup =
p.box.onmouseout = function() { target.focus(); };
p.box.onmousedown = function() { abortBlur=true; };
p.box.onmousemove = function(e) {
if (holdPad || holdSld) {
holdPad && setPad(e);
holdSld && setSld(e);
if (document.selection) {
document.selection.empty();
} else if (window.getSelection) {
window.getSelection().removeAllRanges();
}
dispatchImmediateChange();
}
};
if('ontouchstart' in window) { // if touch device
var handle_touchmove = function(e) {
var event={
'offsetX': e.touches[0].pageX-touchOffset.X,
'offsetY': e.touches[0].pageY-touchOffset.Y
};
if (holdPad || holdSld) {
holdPad && setPad(event);
holdSld && setSld(event);
dispatchImmediateChange();
}
e.stopPropagation(); // prevent move "view" on broswer
e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
};
p.box.removeEventListener('touchmove', handle_touchmove, false)
p.box.addEventListener('touchmove', handle_touchmove, false)
}
p.padM.onmouseup =
p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
p.padM.onmousedown = function(e) {
// if the slider is at the bottom, move it up
switch(modeID) {
case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
}
holdSld=false;
holdPad=true;
setPad(e);
dispatchImmediateChange();
};
if('ontouchstart' in window) {
p.padM.addEventListener('touchstart', function(e) {
touchOffset={
'X': e.target.offsetParent.offsetLeft,
'Y': e.target.offsetParent.offsetTop
};
this.onmousedown({
'offsetX':e.touches[0].pageX-touchOffset.X,
'offsetY':e.touches[0].pageY-touchOffset.Y
});
});
}
p.sldM.onmouseup =
p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
p.sldM.onmousedown = function(e) {
holdPad=false;
holdSld=true;
setSld(e);
dispatchImmediateChange();
};
if('ontouchstart' in window) {
p.sldM.addEventListener('touchstart', function(e) {
touchOffset={
'X': e.target.offsetParent.offsetLeft,
'Y': e.target.offsetParent.offsetTop
};
this.onmousedown({
'offsetX':e.touches[0].pageX-touchOffset.X,
'offsetY':e.touches[0].pageY-touchOffset.Y
});
});
}
// picker
var dims = getPickerDims(THIS);
p.box.style.width = dims[0] + 'px';
p.box.style.height = dims[1] + 'px';
// picker border
p.boxB.style.position = 'absolute';
p.boxB.style.clear = 'both';
p.boxB.style.left = x+'px';
p.boxB.style.top = y+'px';
p.boxB.style.zIndex = THIS.pickerZIndex;
p.boxB.style.border = THIS.pickerBorder+'px solid';
p.boxB.style.borderColor = THIS.pickerBorderColor;
p.boxB.style.background = THIS.pickerFaceColor;
// pad image
p.pad.style.width = jscolor.images.pad[0]+'px';
p.pad.style.height = jscolor.images.pad[1]+'px';
// pad border
p.padB.style.position = 'absolute';
p.padB.style.left = THIS.pickerFace+'px';
p.padB.style.top = THIS.pickerFace+'px';
p.padB.style.border = THIS.pickerInset+'px solid';
p.padB.style.borderColor = THIS.pickerInsetColor;
// pad mouse area
p.padM.style.position = 'absolute';
p.padM.style.left = '0';
p.padM.style.top = '0';
p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
p.padM.style.height = p.box.style.height;
p.padM.style.cursor = 'crosshair';
// slider image
p.sld.style.overflow = 'hidden';
p.sld.style.width = jscolor.images.sld[0]+'px';
p.sld.style.height = jscolor.images.sld[1]+'px';
// slider border
p.sldB.style.display = THIS.slider ? 'block' : 'none';
p.sldB.style.position = 'absolute';
p.sldB.style.right = THIS.pickerFace+'px';
p.sldB.style.top = THIS.pickerFace+'px';
p.sldB.style.border = THIS.pickerInset+'px solid';
p.sldB.style.borderColor = THIS.pickerInsetColor;
// slider mouse area
p.sldM.style.display = THIS.slider ? 'block' : 'none';
p.sldM.style.position = 'absolute';
p.sldM.style.right = '0';
p.sldM.style.top = '0';
p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
p.sldM.style.height = p.box.style.height;
try {
p.sldM.style.cursor = 'pointer';
} catch(eOldIE) {
p.sldM.style.cursor = 'hand';
}
// "close" button
function setBtnBorder() {
var insetColors = THIS.pickerInsetColor.split(/\s+/);
var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
p.btn.style.borderColor = pickerOutsetColor;
}
p.btn.style.display = THIS.pickerClosable ? 'block' : 'none';
p.btn.style.position = 'absolute';
p.btn.style.left = THIS.pickerFace + 'px';
p.btn.style.bottom = THIS.pickerFace + 'px';
p.btn.style.padding = '0 15px';
p.btn.style.height = '18px';
p.btn.style.border = THIS.pickerInset + 'px solid';
setBtnBorder();
p.btn.style.color = THIS.pickerButtonColor;
p.btn.style.font = '12px sans-serif';
p.btn.style.textAlign = 'center';
try {
p.btn.style.cursor = 'pointer';
} catch(eOldIE) {
p.btn.style.cursor = 'hand';
}
p.btn.onmousedown = function () {
THIS.hidePicker();
};
p.btnS.style.lineHeight = p.btn.style.height;
// load images in optimal order
switch(modeID) {
case 0: var padImg = 'hs.png'; break;
case 1: var padImg = 'hv.png'; break;
}
p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
p.padM.style.backgroundRepeat = "no-repeat";
p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
p.sldM.style.backgroundRepeat = "no-repeat";
p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
p.pad.style.backgroundRepeat = "no-repeat";
p.pad.style.backgroundPosition = "0 0";
// place pointers
redrawPad();
redrawSld();
jscolor.picker.owner = THIS;
document.getElementsByTagName('body')[0].appendChild(p.boxB);
}
function getPickerDims(o) {
var dims = [
2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] +
(o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0),
o.pickerClosable ?
4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight :
2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1]
];
return dims;
}
function redrawPad() {
// redraw the pad pointer
switch(modeID) {
case 0: var yComponent = 1; break;
case 1: var yComponent = 2; break;
}
var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
jscolor.picker.padM.style.backgroundPosition =
(THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
(THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
// redraw the slider image
var seg = jscolor.picker.sld.childNodes;
switch(modeID) {
case 0:
var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
for(var i=0; i<seg.length; i+=1) {
seg[i].style.backgroundColor = 'rgb('+
(rgb[0]*(1-i/seg.length)*100)+'%,'+
(rgb[1]*(1-i/seg.length)*100)+'%,'+
(rgb[2]*(1-i/seg.length)*100)+'%)';
}
break;
case 1:
var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
var i = Math.floor(THIS.hsv[0]);
var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
switch(i) {
case 6:
case 0: rgb=[0,1,2]; break;
case 1: rgb=[1,0,2]; break;
case 2: rgb=[2,0,1]; break;
case 3: rgb=[2,1,0]; break;
case 4: rgb=[1,2,0]; break;
case 5: rgb=[0,2,1]; break;
}
for(var i=0; i<seg.length; i+=1) {
s = 1 - 1/(seg.length-1)*i;
c[1] = c[0] * (1 - s*f);
c[2] = c[0] * (1 - s);
seg[i].style.backgroundColor = 'rgb('+
(c[rgb[0]]*100)+'%,'+
(c[rgb[1]]*100)+'%,'+
(c[rgb[2]]*100)+'%)';
}
break;
}
}
function redrawSld() {
// redraw the slider pointer
switch(modeID) {
case 0: var yComponent = 2; break;
case 1: var yComponent = 1; break;
}
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
jscolor.picker.sldM.style.backgroundPosition =
'0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
}
function isPickerOwner() {
return jscolor.picker && jscolor.picker.owner === THIS;
}
function blurTarget() {
if(valueElement === target) {
THIS.importColor();
}
if(THIS.pickerOnfocus) {
THIS.hidePicker();
}
}
function blurValue() {
if(valueElement !== target) {
THIS.importColor();
}
}
function setPad(e) {
var mpos = jscolor.getRelMousePos(e);
var x = mpos.x - THIS.pickerFace - THIS.pickerInset;
var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
switch(modeID) {
case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
}
}
function setSld(e) {
var mpos = jscolor.getRelMousePos(e);
var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
switch(modeID) {
case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
}
}
function dispatchImmediateChange() {
if (THIS.onImmediateChange) {
var callback;
if (typeof THIS.onImmediateChange === 'string') {
callback = new Function (THIS.onImmediateChange);
} else {
callback = THIS.onImmediateChange;
}
callback.call(THIS);
}
}
var THIS = this;
var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
var abortBlur = false;
var
valueElement = jscolor.fetchElement(this.valueElement),
styleElement = jscolor.fetchElement(this.styleElement);
var
holdPad = false,
holdSld = false,
touchOffset = {};
var
leaveValue = 1<<0,
leaveStyle = 1<<1,
leavePad = 1<<2,
leaveSld = 1<<3;
// target
jscolor.addEvent(target, 'focus', function() {
if(THIS.pickerOnfocus) { THIS.showPicker(); }
});
jscolor.addEvent(target, 'blur', function() {
if(!abortBlur) {
window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
} else {
abortBlur = false;
}
});
// valueElement
if(valueElement) {
var updateField = function() {
THIS.fromString(valueElement.value, leaveValue);
dispatchImmediateChange();
};
jscolor.addEvent(valueElement, 'keyup', updateField);
jscolor.addEvent(valueElement, 'input', updateField);
jscolor.addEvent(valueElement, 'blur', blurValue);
valueElement.setAttribute('autocomplete', 'off');
}
// styleElement
if(styleElement) {
styleElement.jscStyle = {
backgroundImage : styleElement.style.backgroundImage,
backgroundColor : styleElement.style.backgroundColor,
color : styleElement.style.color
};
}
// require images
switch(modeID) {
case 0: jscolor.requireImage('hs.png'); break;
case 1: jscolor.requireImage('hv.png'); break;
}
jscolor.requireImage('cross.gif');
jscolor.requireImage('arrow.gif');
this.importColor();
}
};
jscolor.install();

View File

@@ -0,0 +1,64 @@
/*
* Public JS
*
* @author Thomas BERLOT - <contact@bt-consulting.io>
* @copyright 2017 BT Consulting
* @license http://www.apache.org/licenses/ Apache License
* International Registered Trademark & Property of BT Consulting
*/
// Main Function
var Main = function () {
// function to custom select
var runCustomElement = function () {
// check submit
var is_submit = $("#modulecontent").attr('role');
if (is_submit == 1) {
$(".list-group-item").each(function() {
if ($(this).hasClass('active')) {
$(this).removeClass("active");
}
else if ($(this).attr('href') == "#config") {
$(this).addClass("active");
}
});
$('#config').addClass("active");
$('#informations').removeClass("active");
}
if (is_submit == 2) {
$(".list-group-item").each(function() {
if ($(this).hasClass('active')) {
$(this).removeClass("active");
}
else if ($(this).attr('href') == "#options") {
$(this).addClass("active");
}
});
$('#support').addClass("active");
$('#informations').removeClass("active");
}
$('.module_confirmation').delay(10000).hide(100); // Hides 'Configuration Updated' alert after 10 seconds
// toggle panel
$(".list-group-item").on('click', function() {
var $el = $(this).parent().closest(".list-group").children(".active");
if ($el.hasClass("active")) {
$el.removeClass("active");
$(this).addClass("active");
}
});
};
return {
//main function to initiate template pages
init: function () {
runCustomElement();
}
};
}();
$(function() {
// Load functions
Main.init();
});

View File

@@ -0,0 +1,15 @@
/*
* Public JS
*
* @author Thomas BERLOT - <contact@bt-consulting.io>
* @copyright 2017 BT Consulting
* @license http://www.apache.org/licenses/ Apache License
* International Registered Trademark & Property of BT Consulting
*/
(function($,window,document,undefined){var pluginName="tabulous",defaults={effect:"scale"};function Plugin(element,options){this.element=element;this.$elem=$(this.element);this.options=$.extend({},defaults,options);this._defaults=defaults;this._name=pluginName;this.init()}Plugin.prototype={init:function(){var links=this.$elem.find("a");var firstchild=this.$elem.find("li:first-child").find("a");var lastchild=this.$elem.find("li:last-child").after('<span class="tabulousclear"></span>');if(this.options.effect==
"scale")tab_content=this.$elem.find("div").not(":first").not(":nth-child(1)").addClass("hidescale");else if(this.options.effect=="slideLeft")tab_content=this.$elem.find("div").not(":first").not(":nth-child(1)").addClass("hideleft");else if(this.options.effect=="scaleUp")tab_content=this.$elem.find("div").not(":first").not(":nth-child(1)").addClass("hidescaleup");else if(this.options.effect=="flip")tab_content=this.$elem.find("div").not(":first").not(":nth-child(1)").addClass("hideflip");var firstdiv=
this.$elem.find("#tabs_container");var firstdivheight=firstdiv.find("div:first").height();var alldivs=this.$elem.find("div:first").find("div");alldivs.css({"position":"absolute","top":"40px"});firstdiv.css("height","auto");firstchild.addClass("tabulous_active");links.bind("click",{myOptions:this.options},function(e){e.preventDefault();var $options=e.data.myOptions;var effect=$options.effect;var mythis=$(this);var thisform=mythis.parent().parent().parent();var thislink=mythis.attr("href");
firstdiv.addClass("transition");links.removeClass("tabulous_active");mythis.addClass("tabulous_active");thisdivwidth=thisform.find("div"+thislink).height();if(effect=="scale"){alldivs.removeClass("showscale").addClass("make_transist").addClass("hidescale");thisform.find("div"+thislink).addClass("make_transist").addClass("showscale")}else if(effect=="slideLeft"){alldivs.removeClass("showleft").addClass("make_transist").addClass("hideleft");thisform.find("div"+thislink).addClass("make_transist").addClass("showleft")}else if(effect==
"scaleUp"){alldivs.removeClass("showscaleup").addClass("make_transist").addClass("hidescaleup");thisform.find("div"+thislink).addClass("make_transist").addClass("showscaleup")}else if(effect=="flip"){alldivs.removeClass("showflip").addClass("make_transist").addClass("hideflip");thisform.find("div"+thislink).addClass("make_transist").addClass("showflip")}firstdiv.css("height","auto")})},yourOtherFunction:function(el,options){}};$.fn[pluginName]=function(options){return this.each(function(){new Plugin(this,
options)})}})(jQuery,window,document);

View File

@@ -0,0 +1,79 @@
/*
* Public JS
*
* @author Thomas BERLOT - <contact@bt-consulting.io>
* @copyright 2017 BT Consulting
* @license http://www.apache.org/licenses/ Apache License
* International Registered Trademark & Property of BT Consulting
*/
$(document).ready(function(){
var message = $('.toolbarHead');
var view = $(window);
// bind only if message exists. placeholder will be its parent
view.bind("scroll resize", function(e)
{
message.each(function(el){
if (message.length)
{
placeholder = $(this).parent();
if(e.type == 'resize')
$(this).css('width', $(this).parent().width());
placeholderTop = placeholder.offset().top;
var viewTop = view.scrollTop() + 15;
// here we force the toolbar to be "not fixed" when
// the height of the window is really small (toolbar hiding the page is not cool)
window_is_more_than_twice_the_toolbar = view.height() > message.parent().height() * 2;
if (!$(this).hasClass("fix-toolbar") && (window_is_more_than_twice_the_toolbar && (viewTop > placeholderTop)))
{
$(this).css('width', $(this).width());
// fixing parent height will prevent that annoying "pagequake" thing
// the order is important : this has to be set before adding class fix-toolbar
$(this).parent().css('height', $(this).parent().height());
$(this).addClass("fix-toolbar");
}
else if ($(this).hasClass("fix-toolbar") && (!window_is_more_than_twice_the_toolbar || (viewTop <= placeholderTop)) )
{
$(this).removeClass("fix-toolbar");
$(this).removeAttr('style');
$(this).parent().removeAttr('style');
}
}
});
}); // end bind
// if count errors
$('#hideError').live('click', function(e)
{
e.preventDefault();
$('.error').hide('slow', function (){
$('.error').remove();
});
return false;
});
// if count warnings
$('#linkSeeMore').live('click', function(e){
e.preventDefault();
$('.warn #seeMore').show();
$(this).hide();
$('.warn #linkHide').show();
return false;
});
$('#linkHide').live('click', function(e){
e.preventDefault();
$('.warn #seeMore').hide();
$(this).hide();
$('.warn #linkSeeMore').show();
return false;
});
$('#hideWarn').live('click', function(e){
e.preventDefault();
$('.warn').hide('slow', function (){
$('.warn').remove();
});
return false;
});
});