first commit

This commit is contained in:
Kevin Adametz 2021-01-08 17:48:20 +01:00
commit 0baac018a2
1011 changed files with 145854 additions and 0 deletions

25
public/js/German.json Normal file
View file

@ -0,0 +1,25 @@
{
"sEmptyTable": "Keine Daten in der Tabelle vorhanden",
"sInfo": "_START_ bis _END_ von _TOTAL_ Einträgen",
"sInfoEmpty": "0 bis 0 von 0 Einträgen",
"sInfoFiltered": "(gefiltert von _MAX_ Einträgen)",
"sInfoPostFix": "",
"sInfoThousands": ".",
"sLengthMenu": "_MENU_ Einträge anzeigen",
"sLoadingRecords": "Wird geladen...",
"sProcessing": "Bitte warten...",
"sSearch": "Suchen",
"sZeroRecords": "Keine Einträge vorhanden.",
"oPaginate": {
"sFirst": "Erste",
"sPrevious": "Zurück",
"sNext": "Nächste",
"sLast": "Letzte"
},
"oAria": {
"sSortAscending": ": aktivieren, um Spalte aufsteigend zu sortieren",
"sSortDescending": ": aktivieren, um Spalte absteigend zu sortieren"
}
}

179
public/js/application.js Normal file
View file

@ -0,0 +1,179 @@
(function(e, a) { for(var i in a) e[i] = a[i]; }(window, /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 119);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./resources/assets/js/application.js":
/*!********************************************!*\
!*** ./resources/assets/js/application.js ***!
\********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! ./bootstrap */ "./resources/assets/js/bootstrap.js");
/***/ }),
/***/ "./resources/assets/js/bootstrap.js":
/*!******************************************!*\
!*** ./resources/assets/js/bootstrap.js ***!
\******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// Auto update layout
if (window.layoutHelpers) {
window.layoutHelpers.setAutoUpdate(true);
}
$(function () {
// Initialize sidenav
$('#layout-sidenav').each(function () {
new SideNav(this, {
orientation: $(this).hasClass('sidenav-horizontal') ? 'horizontal' : 'vertical'
});
}); // Initialize sidenav togglers
$('body').on('click', '.layout-sidenav-toggle', function (e) {
e.preventDefault();
window.layoutHelpers.toggleCollapsed();
}); // Swap dropdown menus in RTL mode
if ($('html').attr('dir') === 'rtl') {
$('#layout-navbar .dropdown-menu').toggleClass('dropdown-menu-right');
}
});
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
// window.axios = require('axios');
//
// window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/**
* Next we will register the CSRF Token as a common header with Axios so that
* all outgoing HTTP requests automatically have it attached. This is just
* a simple convenience so we don't have to attach every token manually.
*/
// let token = document.head.querySelector('meta[name="csrf-token"]');
//
// if (token) {
// window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
// } else {
// console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
// }
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
// import Echo from 'laravel-echo'
// window.Pusher = require('pusher-js');
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// encrypted: true
// });
/***/ }),
/***/ 119:
/*!**************************************************!*\
!*** multi ./resources/assets/js/application.js ***!
\**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(/*! /Volumes/Websites/partner.gruene-seele.bio/resources/assets/js/application.js */"./resources/assets/js/application.js");
/***/ })
/******/ })));

1
public/js/bootstrap-datepicker.de.min.js vendored Executable file
View file

@ -0,0 +1 @@
!function(a){a.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fre","Sam"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",clear:"Löschen",weekStart:1,format:"dd.mm.yyyy"}}(jQuery);

1
public/js/cookieconsent.min.js vendored Executable file

File diff suppressed because one or more lines are too long

198
public/js/custom.js Normal file
View file

@ -0,0 +1,198 @@
$(function () {
// $('.selectpicker').selectpicker();
$('[data-toggle="tooltip"]').tooltip();
});
function update_modal_data_load(e, $ele) {
var ele = $ele,
url = ele.data('url'),
data = {data:ele.data('data'), target:ele.data('target')} ,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
console.log(data);
console.log(url);
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
// do what ever you want here. add content to <div> if it was not 1 .
$(data.target).find('.modal-content').html(data.response);
// $('.selectpicker').selectpicker(["refresh"]);
// $('.input-daterange').datepicker({toggleActive: true,format: 'dd.mm.yyyy'});
$(data.target).modal('show');
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(status);
console.log("Sorry, there was a problem!");
}
});
return false;
}
jQuery(document).ready(function() {
$(".update_modal_data_load").on('click', function (e) {
e.preventDefault();
update_modal_data_load(e, $(this));
});
if($('.datepicker-base').length > 0) {
$('.datepicker-base').datepicker({
orientation: 'auto right',
calendarWeeks: true,
todayBtn: 'linked',
//daysOfWeekDisabled: '1',
todayHighlight: true,
multidate: false,
daysOfWeekHighlighted: '0,6',
autoclose: true,
format: 'dd.mm.yyyy',
language: 'de',
clearBtn: true,
});
}
if($('.datepicker-birthday').length > 0) {
$('.datepicker-birthday').datepicker({
todayBtn: 'linked',
// daysOfWeekDisabled: '1',
multidate: false,
daysOfWeekHighlighted: '0,6',
autoclose: true,
format: 'dd.mm.yyyy',
language: 'de',
clearBtn: true,
startView: 2,
});
}
if($('.b-material-datetime-picker').length > 0) {
$('.b-material-datetime-picker').bootstrapMaterialDatePicker({
weekStart: 1,
format: 'DD.MM.YYYY HH:mm',
shortTime: false,
nowButton: true,
clearButton: true,
lang: 'de',
//currentDate: ''
});
}
});
function _scrollTo(to, offset) {
$('html,body').animate({scrollTop: $(to).offset().top - offset}, 800);
}
$(function () {
$('#modals-load-content').on('show.bs.modal', function (event) {
var button = $(event.relatedTarget);
if (!button.data('id')) {
return;
}
var data = {};
$.each(button.data(), function(index, value){
if(index !== 'bs.tooltip'){
data[index] = value;
}
});
console.log(data);
loadModalInner(this, data);
});
function initModalInner() {
$('[data-toggle="reloadModal"]').off().on('click', function(event) {
event.preventDefault();
button = $(this);
var data = {};
$.each(button.data(), function(index, value){
if(index !== 'bs.tooltip'){
data[index] = value;
}
});
//console.log(data);
loadModalInner(this, data);
});
}
function loadModalInner(self, data){
var url = data.route,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
console.log(data);
if(data.response.modal){
$(data.response.target).find('.modal-dialog').addClass(data.response.modal);
}
$(data.response.target).find('.modal-dialog').html(data.html);
$(data.response.target).find('.selectpicker').selectpicker('refresh');
initModalInner();
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
}
});
return false;
}
function ajax_object_action(event, object, callback) {
event.preventDefault();
var data = {};
$.each(object.data(), function(index, value){
if(typeof value !== 'object'){
data[index] = value;
}
});
var url = data['url'];
console.log(data);
console.log(url);
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
//data will send data to callback function
callback(data);
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(status);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
}
});
return false;
}
});

71
public/js/forms_file-upload.js Executable file
View file

@ -0,0 +1,71 @@
// Dropzone
$(function() {
Dropzone.autoDiscover = false;
$('#dropzone-before').dropzone({
parallelUploads: 1,
maxFilesize: 50000,
filesizeBase: 1000,
addRemoveLinks: true,
});
$('#dropzone-after').dropzone({
parallelUploads: 1,
maxFilesize: 50000,
filesizeBase: 1000,
addRemoveLinks: true,
});
// Mock the file upload progress (only for the demo)
//
/* Dropzone.prototype.uploadFiles = function(files) {
var minSteps = 6;
var maxSteps = 60;
var timeBetweenSteps = 100;
var bytesPerStep = 100000;
var isUploadSuccess = Math.round(Math.random());
var self = this;
for (var i = 0; i < files.length; i++) {
var file = files[i];
var totalSteps = Math.round(Math.min(maxSteps, Math.max(minSteps, file.size / bytesPerStep)));
for (var step = 0; step < totalSteps; step++) {
var duration = timeBetweenSteps * (step + 1);
setTimeout(function(file, totalSteps, step) {
return function() {
file.upload = {
progress: 100 * (step + 1) / totalSteps,
total: file.size,
bytesSent: (step + 1) * file.size / totalSteps
};
self.emit('uploadprogress', file, file.upload.progress, file.upload.bytesSent);
if (file.upload.progress == 100) {
if (isUploadSuccess) {
file.status = Dropzone.SUCCESS;
self.emit('success', file, 'success', null);
} else {
file.status = Dropzone.ERROR;
self.emit('error', file, 'Some upload error', null);
}
self.emit('complete', file);
self.processQueue();
}
};
}(file, totalSteps, step), duration);
}
}
};*/
});

201
public/js/iq-homeparty-cart.js Executable file
View file

@ -0,0 +1,201 @@
var IqHomepartyCart = {
form: "#homeparty-order-form",
btn_modal_add: '.add-product-basket',
btn_add: '.add-from-basket',
btn_remove: '.remove-from-basket',
table_input: '.table-input-event-onchange',
oTable: null,
cart_holder: '#insert_show_products_order_',
cart_holders: '.insert_show_products_order',
modal: '#modals-load-content',
remove_item_cart: '.remove_item_form_cart',
insert_show_total_order: '#insert_show_total_order',
insert_show_bonus: '#insert_show_bonus',
insert_show_bonus_host: '#insert_show_bonus_host',
select_delivery_option: '.select_delivery_option',
/*
comp_holder: '#holder_html_view_comp_product',
is_for: null,
url: null,
btn_clear: '#clear-products-basket',
cart_input: '.cart-input-event-onchange',
remove_item: '.remove_item_form_cart',
shipping_state: '#change_shipping_state',
comp_products: 'switchers-comp-product',
count_comp_products: 'count_comp_products',
shipping_is_for: 'shipping_is_for',*/
_log: function ($msg){
console.log($msg);
},
init: function () {
var _self = this;
_self.url = $(_self.form).attr('action');
$(_self.cart_holders).each(function (key, obj){
_self.reInit($(obj));
});
//_self.showInit();
/*$(_self.shipping_state).on('change', function(){
_self.update_shipping_state($(this));
});*/
return _self;
},
setDatabase: function (oTable){
var _self = this;
_self.oTable = oTable;
},
reInitModal: function (){
var _self = this;
$(_self.oTable).find(_self.btn_modal_add).on('click', function(){
_self.add_product_modal($(this))
});
},
add_product_modal: function (_obj){
var _self = this;
_self.performRequest({
product_id: _obj.data('product-id'),
homeparty_id: $(_self.oTable).data('homeparty-id'),
homeparty_user_id: $(_self.oTable).data('homeparty-user-id'),
qty: 1,
action: 'addProduct'
}).done(_self.refreshView);
},
reInit: function (obj){
var _self = this;
var _obj = obj;
obj.find(_self.btn_add).off('click').on('click', function(){
_self.add_product($(this), _obj)
});
obj.find(_self.btn_remove).off('click').on('click', function(){
_self.remove_product($(this), _obj)
});
obj.find(_self.table_input).off('change').on('change', function(){
_self.update_input_table($(this), _obj);
});
obj.find(_self.remove_item_cart).off('click').on('click', function(){
_self.remove_from_cart($(this), _obj);
});
obj.find(_self.select_delivery_option).off('change').on('change', function(){
_self.update_delivery_option($(this), _obj);
});
},
add_product: function (_obj, _holder){
var _self = this;
var input = _holder.find('input[name="product_qty_'+_obj.data('order-item-id')+'"]');
var qty = parseInt(input.val()) + 1;
qty = _self.checkNumber(qty);
input.val(qty);
_self.update_cart(_holder, _obj, qty);
},
remove_product: function (_obj, _holder){
var _self = this;
var input = _holder.find('input[name="product_qty_'+_obj.data('order-item-id')+'"]');
var qty = parseInt(input.val()) - 1;
qty = _self.checkNumber(qty);
input.val(qty);
_self.update_cart(_holder, _obj, qty);
},
update_input_table: function (_obj, _holder){
var _self = this;
var qty = parseInt(_obj.val());
qty = _self.checkNumber(qty);
_obj.val(qty);
_self.update_cart(_holder, _obj, qty);
},
update_cart: function (_holder, _obj, qty){
var _self = this;
_self.performRequest({
product_id: _obj.data('product-id'),
order_item_id: _obj.data('order-item-id'),
homeparty_id: _holder.data('homeparty-id'),
homeparty_user_id: _holder.data('homeparty-user-id'),
qty: qty,
action: 'updateCart'
}).done(_self.refreshView);
},
remove_from_cart: function (_obj, _holder){
var _self = this;
_self.performRequest({
product_id: _obj.data('product-id'),
order_item_id: _obj.data('order-item-id'),
homeparty_id: _holder.data('homeparty-id'),
homeparty_user_id: _holder.data('homeparty-user-id'),
action: 'removeFromCart'
}).done(_self.refreshView);
},
update_delivery_option: function (_obj, _holder){
var _self = this;
_self.performRequest({
delivery: _obj.val(),
homeparty_id: _holder.data('homeparty-id'),
homeparty_user_id: _holder.data('homeparty-user-id'),
action: 'updateDeliveryOption'
}).done(_self.refreshView);
},
refreshView: function (data) {
var _self = IqHomepartyCart;
var obj = $(_self.cart_holder+data.data.homeparty_user_id)
obj.html(data.html_user_cart);
$(_self.insert_show_total_order).html(data.html_total);
$(_self.insert_show_bonus).html(data.html_bonus);
$(_self.insert_show_bonus_host).html(data.html_host_bonus);
$(_self.modal).modal('hide');
_self.reInit(obj);
//$(_self.comp_holder).html(data.html_comp);
// var input = $(_self.table).find('input[name="product_qty_'+data.data.product_id+'"]');
// input.val(data.data.qty);
// _self.showInit();
},
performRequest : function(data) {
var _self = this;
var url = _self.url,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
console.log(data);
console.log(url);
return $.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
})
.done(function (data) {
console.log('performRequest');
console.log(data);
}).fail(function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(jqXHR.responseText);
console.log(textStatus);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
});
},
checkNumber : function(number){
if(number < 1 || isNaN(number)){
return 1;
}
if(number >= 100){
return 100;
}
return number;
}
};

190
public/js/iq-shopping-cart.js Executable file
View file

@ -0,0 +1,190 @@
var IqShoppingCart = {
table: "#datatables-order-list",
btn_add: '.add-product-basket',
btn_remove: '.remove-product-basket',
card_holder: '#holder_html_view_card',
comp_holder: '#holder_html_view_comp_product',
is_for: null,
url: null,
btn_clear: '#clear-products-basket',
modal: null,
oTable: null,
table_input: '.table-input-event-onchange',
cart_input: '.cart-input-event-onchange',
remove_item: '.remove_item_form_cart',
shipping_state: '#change_shipping_state',
comp_products: 'switchers-comp-product',
count_comp_products: 'count_comp_products',
shipping_is_for: 'shipping_is_for',
init: function () {
var _self = this;
_self.url = $(_self.table).data('url');
_self.is_for = $('input[name="'+_self.shipping_is_for+'"]').val();
_self.showInit();
$(_self.shipping_state).on('change', function(){
_self.update_shipping_state($(this));
});
return _self;
},
setDatabase: function (oTable){
var _self = this;
_self.oTable = oTable;
},
reInit: function (){
var _self = this;
$(_self.table).find(_self.btn_add).on('click', function(){
_self.add_product($(this))
});
$(_self.table).find(_self.btn_remove).on('click', function(){
_self.remove_product($(this))
});
$(_self.table).find(_self.table_input).off('change').on('change', function(){
_self.update_input_table($(this));
});
},
showInit: function (){
var _self = this;
$(_self.btn_clear).on('click', function (){
_self.performRequest({action: 'clearCart'})
.done(_self.refreshDatabaseRefreshAndView)
});
$(_self.cart_input).on('change', function(){
_self.update_input_cart($(this));
});
$(_self.remove_item).on('click', function(event){
event.preventDefault();
_self.update_cart_database($(this).data('product-id'), 0);
});
if(_self.is_for === 'me'){
$('input[name^="'+_self.comp_products+'"]').on('change', function(){
_self.update_comp_product($(this));
});
}
},
update_shipping_state : function (_obj){
var _self = this;
var id = parseInt(_obj.val());
var is_for = _obj.data('is-for');
_self.performRequest({shipping_country_id: id, shipping_is_for: is_for, action: 'updateShippingCountry'})
.done(_self.refreshItemsAndView);
},
update_input_table: function (_obj){
var _self = this;
var qty = parseInt(_obj.val());
qty = _self.checkNumber(qty);
_obj.val(qty);
_self.update_cart(_obj.data('product-id'), qty);
},
update_input_cart: function (_obj){
var _self = this;
var qty = parseInt(_obj.val());
qty = _self.checkNumber(qty);
_obj.val(qty);
_self.update_cart_database(_obj.data('product-id'), qty);
},
update_comp_product: function (_obj){
var _self = this;
_self.performRequest({comp_product_id: _obj.val(), comp_num: _obj.data('comp_num'), count_comp_products: $('input[name="'+_self.count_comp_products+'"]').val(), action: 'updateCompProduct'})
.done(_self.refreshItemsAndView);
},
add_product: function (_obj){
var _self = this;
var input = $(_self.table).find('input[name="product_qty_'+_obj.data('product-id')+'"]');
var qty = parseInt(input.val()) + 1;
qty = _self.checkNumber(qty);
input.val(qty);
_self.update_cart(_obj.data('product-id'), qty);
},
remove_product: function (_obj){
var _self = this;
var input = $(_self.table).find('input[name="product_qty_'+_obj.data('product-id')+'"]');
var qty = parseInt(input.val()) - 1;
if(qty < 0){
qty = 0;
}
input.val(qty);
_self.update_cart(_obj.data('product-id'), qty);
},
update_cart_database: function (product_id, qty){
var _self = this;
_self.performRequest({product_id: product_id, qty: qty, action: 'updateCart'})
.done(_self.refreshDatabaseAndView);
},
update_cart: function (product_id, qty){
var _self = this;
_self.performRequest({product_id: product_id, qty: qty, action: 'updateCart'})
.done(_self.refreshItemsAndView);
},
refreshItemsAndView: function (data){
var _self = IqShoppingCart;
$(_self.card_holder).html(data.html_card);
$(_self.comp_holder).html(data.html_comp);
_self.showInit();
},
refreshDatabaseAndView: function (data) {
var _self = IqShoppingCart;
$(_self.card_holder).html(data.html_card);
$(_self.comp_holder).html(data.html_comp);
var input = $(_self.table).find('input[name="product_qty_'+data.data.product_id+'"]');
input.val(data.data.qty);
_self.showInit();
},
refreshDatabaseRefreshAndView : function (data){
var _self = IqShoppingCart;
$(_self.card_holder).html(data.html_card);
$(_self.comp_holder).html(data.html_comp);
_self.showInit();
_self.oTable.draw();
},
checkNumber : function(number){
if(number < 0 || isNaN(number)){
return 0;
}
if(number >= 100){
return 100;
}
return number;
},
performRequest : function(data) {
var _self = this;
var url = _self.url,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
data.shipping_is_for = _self.is_for;
console.log(data);
console.log(url);
return $.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
})
.done(function (data) {
console.log('performRequest');
console.log(data);
}).fail(function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(jqXHR.responseText);
console.log(textStatus);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
});
}
};

4
public/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

106
public/js/shopping_card.js Normal file
View file

@ -0,0 +1,106 @@
var ShoppingCard = {
image_dialog_images_url: "/iq/content/assets/modal",
image_dialog_title: 'Medien',
image_dialog_close_btn_text: 'schließen',
image_dialog_ok_btn_text: 'Einfügen',
data_id: null,
data_obj: null,
data_set: null,
data_img: null,
data_content: null,
modal: null,
init: function () {
var _self = this;
var $modal = _self.modal = $('#modal_iq_assets').hide();
$modal.find("button#modal_iq_save").click(function(event)
{
var items = LFileManager.getSelectedItems();
$modal.modal('hide');
if(items[0]){
var item = items[0];
if(_self.data_img){
var img = $(_self.data_id).find(_self.data_img);
if(item['thumb_url'] && img){
img.attr('src', item['thumb_url']);
}
}
//console.log(_self.data_content);
//console.log(item['content']);
if(_self.data_content){
var input = $(_self.data_id).find('input[name="'+_self.data_obj+'['+_self.data_content+']"]');
var val = item['content'][_self.data_content];
//console.log(input);
//console.log(val);
if(input){
input.val(val).change();
}
}
_self.data_set.forEach(function (setter, index) {
var input = $(_self.data_id).find('input[name="'+_self.data_obj+'['+setter+']"]');
var val = item[setter]
if(input && val){
input.val(val).change();
}
});
}
/*items.forEach(function (item, index) {
});*/
});
$('.btn-lfm-open-modal').on('click', function () {
_self.data_id = $(this).data('id');
_self.data_obj = $(this).data('obj');
_self.data_set = $(this).data('set');
_self.data_img = $(this).data('img');
_self.data_content = $(this).data('content');
_self.fillModal();
_self.modal.modal();
});
},
fillModal: function () {
var _self = this;
var next = _self.setEvents;
_self.getImagesFromUrl(next);
},
setEvents: function()
{
// images click event to select image
/*self.$modal.find('img').click(function(event)
{
// $(this).toggleClass(self.select_class);
});*/
},
getImagesFromUrl: function(callback)
{
var _self = this;
// get images html from url
$.get(_self.image_dialog_images_url, function(html)
{
_self.setModalHtml(html);
callback();
}).fail(function()
{
console.error("error loading from "+_self.image_dialog_images_url);
})
},
setModalHtml: function(html)
{ // set variabl parts to modal html
var _self = this;
_self.modal.find('.modal-title').html(_self.image_dialog_title);
_self.modal.find('#modal_iq_close').html(_self.image_dialog_close_btn_text);
_self.modal.find('#modal_iq_save').html(_self.image_dialog_ok_btn_tex);
_self.modal.find('.modal-body').html(html);
LFileManager.initFileManager(true);
},
};

178
public/js/summernote-cleaner.js Executable file
View file

@ -0,0 +1,178 @@
/* https://github.com/DiemenDesign/summernote-cleaner */
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory(require('jquery'));
} else {
factory(window.jQuery);
}
}
(function ($) {
$.extend(true, $.summernote.lang, {
'en-US': {
cleaner: {
tooltip: 'Cleaner',
not: 'Text has been Cleaned!!!',
limitText: 'Text',
limitHTML: 'HTML'
}
}
});
$.extend($.summernote.options, {
cleaner: {
action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.
newline: '<br>', // Summernote's default is to use '<p><br></p>'
notStyle: 'position:absolute;top:0;left:0;right:0',
icon: '<i class="note-icon"><svg xmlns="http://www.w3.org/2000/svg" id="libre-paintbrush" viewBox="0 0 14 14" width="14" height="14"><path d="m 11.821425,1 q 0.46875,0 0.82031,0.311384 0.35157,0.311384 0.35157,0.780134 0,0.421875 -0.30134,1.01116 -2.22322,4.212054 -3.11384,5.035715 -0.64956,0.609375 -1.45982,0.609375 -0.84375,0 -1.44978,-0.61942 -0.60603,-0.61942 -0.60603,-1.469866 0,-0.857143 0.61608,-1.419643 l 4.27232,-3.877232 Q 11.345985,1 11.821425,1 z m -6.08705,6.924107 q 0.26116,0.508928 0.71317,0.870536 0.45201,0.361607 1.00781,0.508928 l 0.007,0.475447 q 0.0268,1.426339 -0.86719,2.32366 Q 5.700895,13 4.261155,13 q -0.82366,0 -1.45982,-0.311384 -0.63616,-0.311384 -1.0212,-0.853795 -0.38505,-0.54241 -0.57924,-1.225446 -0.1942,-0.683036 -0.1942,-1.473214 0.0469,0.03348 0.27455,0.200893 0.22768,0.16741 0.41518,0.29799 0.1875,0.130581 0.39509,0.24442 0.20759,0.113839 0.30804,0.113839 0.27455,0 0.3683,-0.247767 0.16741,-0.441965 0.38505,-0.753349 0.21763,-0.311383 0.4654,-0.508928 0.24776,-0.197545 0.58928,-0.31808 0.34152,-0.120536 0.68974,-0.170759 0.34821,-0.05022 0.83705,-0.07031 z"/></svg></i>',
keepHtml: true, //Remove all Html formats
keepOnlyTags: [], // If keepHtml is true, remove all tags except these
keepClasses: false, //Remove Classes
badTags: ['style', 'script', 'applet', 'embed', 'noframes', 'noscript', 'html'], //Remove full tags with contents
badAttributes: ['style', 'start'], //Remove attributes from remaining tags
limitChars: 0, // 0|# 0 disables option
limitDisplay: 'both', // none|text|html|both
limitStop: false // true/false
}
});
$.extend($.summernote.plugins, {
'cleaner': function (context) {
var self = this,
ui = $.summernote.ui,
$note = context.layoutInfo.note,
$editor = context.layoutInfo.editor,
options = context.options,
lang = options.langInfo;
var cleanText = function (txt, nlO) {
var out = txt;
if (!options.cleaner.keepClasses) {
var sS = /(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g;
out = txt.replace(sS, ' ');
}
var nL = /(\n)+/g;
out = out.replace(nL, nlO);
if (options.cleaner.keepHtml) {
var cS = new RegExp('<!--(.*?)-->', 'gi');
out = out.replace(cS, '');
var tS = new RegExp('<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>', 'gi');
out = out.replace(tS, '');
var bT = options.cleaner.badTags;
for (var i = 0; i < bT.length; i++) {
tS = new RegExp('<' + bT[i] + '\\b.*>.*</' + bT[i] + '>', 'gi');
out = out.replace(tS, '');
}
var allowedTags = options.cleaner.keepOnlyTags;
if (typeof(allowedTags) == "undefined") allowedTags = [];
if (allowedTags.length > 0) {
allowedTags = (((allowedTags||'') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;
out = out.replace(tags, function($0, $1) {
return allowedTags.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''
});
}
var bA = options.cleaner.badAttributes;
for (var ii = 0; ii < bA.length; ii++ ) {
//var aS=new RegExp(' ('+bA[ii]+'="(.*?)")|('+bA[ii]+'=\'(.*?)\')', 'gi');
var aS = new RegExp(' ' + bA[ii] + '=[\'|"](.*?)[\'|"]', 'gi');
out = out.replace(aS, '');
aS = new RegExp(' ' + bA[ii] + '[=0-9a-z]', 'gi');
out = out.replace(aS, '');
}
}
return out;
};
if (options.cleaner.action == 'both' || options.cleaner.action == 'button') {
context.memo('button.cleaner', function () {
var button = ui.button({
contents: options.cleaner.icon,
tooltip: lang.cleaner.tooltip,
container: 'body',
click: function () {
if ($note.summernote('createRange').toString())
$note.summernote('pasteHTML', $note.summernote('createRange').toString());
else
$note.summernote('code', cleanText($note.summernote('code')));
if ($editor.find('.note-status-output').length > 0)
$editor.find('.note-status-output').html('<div class="alert alert-success">' + lang.cleaner.not + '</div>');
}
});
return button.render();
});
}
this.events = {
'summernote.init': function () {
if ($.summernote.interface === 'lite') {
$("head").append('<style>.note-statusbar .pull-right{float:right!important}.note-status-output .text-muted{color:#777}.note-status-output .text-primary{color:#286090}.note-status-output .text-success{color:#3c763d}.note-status-output .text-info{color:#31708f}.note-status-output .text-warning{color:#8a6d3b}.note-status-output .text-danger{color:#a94442}.alert{margin:-7px 0 0 0;padding:7px 10px;border:1px solid transparent;border-radius:0}.alert .note-icon{margin-right:5px}.alert-success{color:#3c763d!important;background-color: #dff0d8 !important;border-color:#d6e9c6}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}</style>');
}
if (options.cleaner.limitChars != 0 || options.cleaner.limitDisplay != 'none') {
var textLength = $editor.find(".note-editable").text().replace(/(<([^>]+)>)/ig, "").replace(/( )/, " ");
var codeLength = $editor.find('.note-editable').html();
var lengthStatus = '';
if (textLength.length > options.cleaner.limitChars && options.cleaner.limitChars > 0)
lengthStatus += 'text-danger">';
else
lengthStatus += '">';
if (options.cleaner.limitDisplay == 'text' || options.cleaner.limitDisplay == 'both') lengthStatus += lang.cleaner.limitText + ': ' + textLength.length;
if (options.cleaner.limitDisplay == 'both') lengthStatus += ' / ';
if (options.cleaner.limitDisplay == 'html' || options.cleaner.limitDisplay == 'both') lengthStatus += lang.cleaner.limitHTML + ': ' + codeLength.length;
$editor.find('.note-status-output').html('<small class="pull-right ' + lengthStatus + '&nbsp;</small>');
}
},
'summernote.keydown': function (we, e) {
if (options.cleaner.limitChars != 0 || options.cleaner.limitDisplay != 'none') {
var textLength = $editor.find(".note-editable").text().replace(/(<([^>]+)>)/ig, "").replace(/( )/, " ");
var codeLength = $editor.find('.note-editable').html();
var lengthStatus = '';
if (options.cleaner.limitStop == true && textLength.length >= options.cleaner.limitChars) {
var key = e.keyCode;
allowed_keys = [8, 37, 38, 39, 40, 46]
if ($.inArray(key, allowed_keys) != -1) {
$editor.find('.cleanerLimit').removeClass('text-danger');
return true;
} else {
$editor.find('.cleanerLimit').addClass('text-danger');
e.preventDefault();
e.stopPropagation();
}
} else {
if (textLength.length > options.cleaner.limitChars && options.cleaner.limitChars > 0)
lengthStatus += 'text-danger">';
else
lengthStatus += '">';
if (options.cleaner.limitDisplay == 'text' || options.cleaner.limitDisplay == 'both')
lengthStatus += lang.cleaner.limitText + ': ' + textLength.length;
if (options.cleaner.limitDisplay == 'both')
lengthStatus += ' / ';
if (options.cleaner.limitDisplay == 'html' || options.cleaner.limitDisplay == 'both')
lengthStatus += lang.cleaner.limitHTML + ': ' + codeLength.length;
$editor.find('.note-status-output').html('<small class="cleanerLimit pull-right ' + lengthStatus + '&nbsp;</small>');
}
}
},
'summernote.paste': function (we, e) {
if (options.cleaner.action == 'both' || options.cleaner.action == 'paste') {
e.preventDefault();
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
msie = msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./);
var ffox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
if (msie)
var text = window.clipboardData.getData("Text");
else
var text = e.originalEvent.clipboardData.getData(options.cleaner.keepHtml ? 'text/html' : 'text/plain');
if (text) {
if (msie || ffox)
setTimeout(function () {
$note.summernote('pasteHTML', cleanText(text, options.cleaner.newline));
}, 1);
else
$note.summernote('pasteHTML', cleanText(text, options.cleaner.newline));
if ($editor.find('.note-status-output').length > 0)
$editor.find('.note-status-output').html('<div class="summernote-cleanerAlert alert alert-success">' + lang.cleaner.not + '</div>');
}
}
}
}
}
});
}));