first commit
This commit is contained in:
9
modules/squaremeter/views/js/format.min.js
vendored
Normal file
9
modules/squaremeter/views/js/format.min.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
IntegraXor Web SCADA - JavaScript Number Formatter
|
||||
http://www.integraxor.com/
|
||||
author: KPL, KHL
|
||||
(c)2011 ecava
|
||||
*/
|
||||
window.format=function(b,a){if(!b||isNaN(+a))return a;var a=b.charAt(0)=="-"?-a:+a,j=a<0?a=-a:0,e=b.match(/[^\d\-\+#]/g),h=e&&e[e.length-1]||".",e=e&&e[1]&&e[0]||",",b=b.split(h),a=a.toFixed(b[1]&&b[1].length),a=+a+"",d=b[1]&&b[1].lastIndexOf("0"),c=a.split(".");if(!c[1]||c[1]&&c[1].length<=d)a=(+a).toFixed(d+1);d=b[0].split(e);b[0]=d.join("");var f=b[0]&&b[0].indexOf("0");if(f>-1)for(;c[0].length<b[0].length-f;)c[0]="0"+c[0];else+c[0]==0&&(c[0]="");a=a.split(".");a[0]=c[0];if(c=d[1]&&d[d.length-
|
||||
1].length){for(var d=a[0],f="",k=d.length%c,g=0,i=d.length;g<i;g++)f+=d.charAt(g),!((g-k+1)%c)&&g<i-c&&(f+=e);a[0]=f}a[1]=b[1]&&a[1]?h+a[1]:"";return(j?"-":"")+a[0]+a[1]};
|
||||
29
modules/squaremeter/views/js/index.php
Normal file
29
modules/squaremeter/views/js/index.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2021 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This module is not a free module and all rights are reserved. It is prohibited to sell or redistribute this module for any purpose. Each license can be used only in one website. For multishop environment, a new license is required for each e-shop managed.
|
||||
*
|
||||
* 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 MEG Venture <info@megventure.com>
|
||||
* @copyright 2007-2021 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;
|
||||
11008
modules/squaremeter/views/js/jquery-1.12.4.js
vendored
Normal file
11008
modules/squaremeter/views/js/jquery-1.12.4.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
18706
modules/squaremeter/views/js/jquery-ui.js
vendored
Normal file
18706
modules/squaremeter/views/js/jquery-ui.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
42
modules/squaremeter/views/js/jquery-ui.min.js
vendored
Normal file
42
modules/squaremeter/views/js/jquery-ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
15
modules/squaremeter/views/js/popup.js
Normal file
15
modules/squaremeter/views/js/popup.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @license Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
|
||||
// show_popup : show the popup
|
||||
function show_popup(id) {
|
||||
// show the popup
|
||||
$('#' + id).show();
|
||||
}
|
||||
|
||||
// close_popup : close the popup
|
||||
function close_popup(id) {
|
||||
// hide the popup
|
||||
$('#' + id).hide();
|
||||
}
|
||||
1140
modules/squaremeter/views/js/product_admin.js
Normal file
1140
modules/squaremeter/views/js/product_admin.js
Normal file
File diff suppressed because it is too large
Load Diff
1140
modules/squaremeter/views/js/product_admin_e.js
Normal file
1140
modules/squaremeter/views/js/product_admin_e.js
Normal file
File diff suppressed because it is too large
Load Diff
225
modules/squaremeter/views/js/product_front.js
Normal file
225
modules/squaremeter/views/js/product_front.js
Normal file
@@ -0,0 +1,225 @@
|
||||
/**
|
||||
* @license Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
calc_pos();
|
||||
$('.button-minus, .button-plus').hide();
|
||||
var price = $('.current-price');
|
||||
var pricecurrencyval = $('meta[property="product:price:currency"]').attr('content');
|
||||
if (null == currencySign)
|
||||
var currencySign = pricecurrencyval;
|
||||
if (null == currencyRate)
|
||||
var currencyRate = 1;
|
||||
if (null == currencyFormat)
|
||||
var currencyFormat = 2;
|
||||
if (null == currencyBlank)
|
||||
var currencyBlank = 1;
|
||||
|
||||
function number_format (number, decimals, decPoint, thousandsSep) { // eslint-disable-line camelcase
|
||||
// discuss at: http://locutus.io/php/number_format/
|
||||
// example 1: number_format(1234.56)
|
||||
// returns 1: '1,235'
|
||||
// example 2: number_format(1234.56, 2, ',', ' ')
|
||||
// returns 2: '1 234,56'
|
||||
// example 3: number_format(1234.5678, 2, '.', '')
|
||||
// returns 3: '1234.57'
|
||||
// example 4: number_format(67, 2, ',', '.')
|
||||
// returns 4: '67,00'
|
||||
// example 5: number_format(1000)
|
||||
// returns 5: '1,000'
|
||||
// example 6: number_format(67.311, 2)
|
||||
// returns 6: '67.31'
|
||||
// example 7: number_format(1000.55, 1)
|
||||
// returns 7: '1,000.6'
|
||||
// example 8: number_format(67000, 5, ',', '.')
|
||||
// returns 8: '67.000,00000'
|
||||
// example 9: number_format(0.9, 0)
|
||||
// returns 9: '1'
|
||||
// example 10: number_format('1.20', 2)
|
||||
// returns 10: '1.20'
|
||||
// example 11: number_format('1.20', 4)
|
||||
// returns 11: '1.2000'
|
||||
// example 12: number_format('1.2000', 3)
|
||||
// returns 12: '1.200'
|
||||
// example 13: number_format('1 000,50', 2, '.', ' ')
|
||||
// returns 13: '100 050.00'
|
||||
// example 14: number_format(1e-8, 8, '.', '')
|
||||
// returns 14: '0.00000001'
|
||||
number = (number + '').replace(/[^0-9+\-Ee.]/g, '')
|
||||
var n = !isFinite(+number) ? 0 : +number
|
||||
var prec = !isFinite(+decimals) ? 0 : Math.abs(decimals)
|
||||
var sep = (typeof thousandsSep === 'undefined') ? ',' : thousandsSep
|
||||
var dec = (typeof decPoint === 'undefined') ? '.' : decPoint
|
||||
var s = ''
|
||||
var toFixedFix = function (n, prec) {
|
||||
var k = Math.pow(10, prec)
|
||||
return '' + (Math.round(n * k) / k)
|
||||
.toFixed(prec)
|
||||
}
|
||||
// @todo: for IE parseFloat(0.55).toFixed(0) = 0;
|
||||
s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.')
|
||||
if (s[0].length > 3) {
|
||||
s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep)
|
||||
}
|
||||
if ((s[1] || '').length < prec) {
|
||||
s[1] = s[1] || ''
|
||||
s[1] += new Array(prec - s[1].length + 1).join('0')
|
||||
}
|
||||
return s.join(dec)
|
||||
}
|
||||
|
||||
function ps_round_half_up(value, precision)
|
||||
{
|
||||
var mul = Math.pow(10, precision);
|
||||
var val = value * mul;
|
||||
|
||||
var next_digit = Math.floor(val * 10) - 10 * Math.floor(val);
|
||||
if (next_digit >= 5)
|
||||
val = Math.ceil(val);
|
||||
else
|
||||
val = Math.floor(val);
|
||||
|
||||
return val / mul;
|
||||
}
|
||||
|
||||
function ps_round(value, places)
|
||||
{
|
||||
if (typeof(roundMode) === 'undefined')
|
||||
roundMode = 2;
|
||||
if (typeof(places) === 'undefined')
|
||||
places = 2;
|
||||
|
||||
var method = roundMode;
|
||||
|
||||
if (method === 0)
|
||||
return ceilf(value, places);
|
||||
else if (method === 1)
|
||||
return floorf(value, places);
|
||||
else if (method === 2)
|
||||
return ps_round_half_up(value, places);
|
||||
else if (method == 3 || method == 4 || method == 5)
|
||||
{
|
||||
// From PHP Math.c
|
||||
var precision_places = 14 - Math.floor(ps_log10(Math.abs(value)));
|
||||
var f1 = Math.pow(10, Math.abs(places));
|
||||
|
||||
if (precision_places > places && precision_places - places < 15)
|
||||
{
|
||||
var f2 = Math.pow(10, Math.abs(precision_places));
|
||||
if (precision_places >= 0)
|
||||
tmp_value = value * f2;
|
||||
else
|
||||
tmp_value = value / f2;
|
||||
|
||||
tmp_value = ps_round_helper(tmp_value, roundMode);
|
||||
|
||||
/* now correctly move the decimal point */
|
||||
f2 = Math.pow(10, Math.abs(places - precision_places));
|
||||
/* because places < precision_places */
|
||||
tmp_value /= f2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* adjust the value */
|
||||
if (places >= 0)
|
||||
tmp_value = value * f1;
|
||||
else
|
||||
tmp_value = value / f1;
|
||||
|
||||
if (Math.abs(tmp_value) >= 1e15)
|
||||
return value;
|
||||
}
|
||||
|
||||
tmp_value = ps_round_helper(tmp_value, roundMode);
|
||||
if (places > 0)
|
||||
tmp_value = tmp_value / f1;
|
||||
else
|
||||
tmp_value = tmp_value * f1;
|
||||
|
||||
return tmp_value;
|
||||
}
|
||||
}
|
||||
|
||||
function formatCurrency(price, currencyFormat, currencySign, currencyBlank) {
|
||||
var blank = '';
|
||||
price = parseFloat(parseFloat(price).toFixed(10));
|
||||
price = ps_round(price, 2);
|
||||
var priceDisplayPrecision = 2;
|
||||
if (currencyBlank > 0)
|
||||
blank = ' ';
|
||||
if (currencyFormat == 1)
|
||||
return (currencySign + blank + number_format(price, priceDisplayPrecision, ',', '.'));
|
||||
if (currencyFormat == 2)
|
||||
return (number_format(price, priceDisplayPrecision, ' ', ',') + blank + currencySign);
|
||||
if (currencyFormat == 3)
|
||||
return (currencySign + blank + number_format(price, priceDisplayPrecision, '.', ','));
|
||||
if (currencyFormat == 4)
|
||||
return (number_format(price, priceDisplayPrecision, ',', '.') + blank + currencySign);
|
||||
if (currencyFormat == 5)
|
||||
return (currencySign + blank + number_format(price, priceDisplayPrecision, '\'', '.'));
|
||||
return price;
|
||||
}
|
||||
|
||||
this.imagePreview = function(){
|
||||
/* CONFIG */
|
||||
|
||||
xOffset = 10;
|
||||
yOffset = 30;
|
||||
|
||||
// these 2 variable determine popup's distance from the cursor
|
||||
// you might want to adjust to get the right result
|
||||
|
||||
/* END CONFIG */
|
||||
$("a.preview").hover(function(e){
|
||||
this.t = this.title;
|
||||
this.title = "";
|
||||
var c = (this.t != "") ? "<br/>" + this.t : "";
|
||||
$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
|
||||
$("#preview")
|
||||
.css("top",(e.pageY - xOffset) + "px")
|
||||
.css("left",(e.pageX + yOffset) + "px")
|
||||
.css("z-index", "10000")
|
||||
.fadeIn("fast");
|
||||
},
|
||||
function(){
|
||||
this.title = this.t;
|
||||
$("#preview").remove();
|
||||
});
|
||||
$("a.preview").mousemove(function(e){
|
||||
$("#preview")
|
||||
.css("top",(e.pageY - xOffset) + "px")
|
||||
.css("left",(e.pageX + yOffset) + "px");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// starting the script on page load
|
||||
$(document).ready(function(){
|
||||
imagePreview();
|
||||
});
|
||||
|
||||
function increaseValue(id, stepType) {
|
||||
if (stepType)
|
||||
s = Number(stepType);
|
||||
else
|
||||
s = Number(step);
|
||||
var value = parseFloat(document.getElementById(id).value, 10);
|
||||
value = value + s;
|
||||
if((value % 1 < 1) && (value % 1 != 0))
|
||||
document.getElementById(id).value = parseFloat(value).toFixed(2);
|
||||
else
|
||||
document.getElementById(id).value = parseFloat(value);
|
||||
}
|
||||
|
||||
function decreaseValue(id, stepType) {
|
||||
if (stepType)
|
||||
s = Number(stepType);
|
||||
else
|
||||
s = Number(step);
|
||||
var value = parseFloat(document.getElementById(id).value, 10);
|
||||
value = isNaN(value) ? 0 : value;
|
||||
value = value - s;
|
||||
if((value % 1 < 1) && (value % 1 != 0))
|
||||
document.getElementById(id).value = parseFloat(value).toFixed(2);
|
||||
else
|
||||
document.getElementById(id).value = parseFloat(value);
|
||||
}
|
||||
51
modules/squaremeter/views/js/product_front_listing.js
Normal file
51
modules/squaremeter/views/js/product_front_listing.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @license Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
|
||||
function increaseValue(id, stepType) {
|
||||
if (stepType)
|
||||
s = Number(stepType);
|
||||
else
|
||||
s = Number(step);
|
||||
var value = parseFloat(document.getElementById(id).value, 10);
|
||||
value = value + s;
|
||||
if((value % 1 < 1) && (value % 1 != 0))
|
||||
document.getElementById(id).value = parseFloat(value).toFixed(2);
|
||||
else
|
||||
document.getElementById(id).value = parseFloat(value);
|
||||
}
|
||||
|
||||
function decreaseValue(id, stepType) {
|
||||
if (stepType)
|
||||
s = Number(stepType);
|
||||
else
|
||||
s = Number(step);
|
||||
var value = parseFloat(document.getElementById(id).value, 10);
|
||||
value = isNaN(value) ? 0 : value;
|
||||
value = value - s;
|
||||
if((value % 1 < 1) && (value % 1 != 0))
|
||||
document.getElementById(id).value = parseFloat(value).toFixed(2);
|
||||
else
|
||||
document.getElementById(id).value = parseFloat(value);
|
||||
}
|
||||
|
||||
function check_directinput(idProduct, min, max)
|
||||
{
|
||||
var qty_el_alt = document.getElementById('directinput_'+idProduct, min, max);
|
||||
|
||||
var qty_alt = Number(qty_el_alt.value);
|
||||
if (qty_alt<min)
|
||||
{
|
||||
qty_el_alt.value = Number(min);
|
||||
}
|
||||
else if (qty_alt>max)
|
||||
{
|
||||
qty_el_alt.value = Number(max);
|
||||
}
|
||||
else if (isNaN( qty_alt ))
|
||||
{
|
||||
qty_el_alt.value = Number(min);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user