ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<div class="fotorama-item" data-gallery-role="gallery">
<div data-gallery-role="fotorama__focusable-start" tabindex="-1"></div>
<div class="fotorama__wrap fotorama__wrap--css3 fotorama__wrap--slide fotorama__wrap--toggle-arrows">
<div class="fotorama__stage" data-fotorama-stage="fotorama__stage">
<div class="fotorama__arr fotorama__arr--prev" tabindex="0" role="button" aria-label="Previous" data-gallery-role="arrow">
<div class="fotorama__arr__arr"></div>
</div>
<div class="fotorama__stage__shaft" tabindex="0" data-gallery-role="stage-shaft">
</div>
<div class="fotorama__arr fotorama__arr--next fotorama__arr--disabled" tabindex="-1" role="button"
aria-label="Next" data-gallery-role="arrow">
<div class="fotorama__arr__arr"></div>
</div>
<div class="fotorama__video-close"></div>
<div class="fotorama__zoom-in" data-gallery-role="fotorama__zoom-in" aria-label="Zoom in" role="button" tabindex="0"></div>
<div class="fotorama__zoom-out" data-gallery-role="fotorama__zoom-out" aria-label="Zoom out" role="button" tabindex="0"></div>
<div class="fotorama__spinner"></div>
</div>
<div class="fotorama__nav-wrap" data-gallery-role="nav-wrap">
<div class="fotorama__nav fotorama__nav--thumbs">
<div class="fotorama__fullscreen-icon" data-gallery-role="fotorama__fullscreen-icon" tabindex="0" aria-label="Exit fullscreen" role="button"></div>
<div class="fotorama__thumb__arr fotorama__thumb__arr--left" role="button" aria-label="Previous" data-gallery-role="arrow" tabindex = "-1">
<div class="fotorama__thumb--icon"></div>
</div>
<div class="fotorama__nav__shaft">
<div class="fotorama__thumb-border"></div>
</div>
<div class="fotorama__thumb__arr fotorama__thumb__arr--right" role="button" aria-label="Next" data-gallery-role="arrow" tabindex = "-1">
<div class="fotorama__thumb--icon"></div>
</div>
</div>
</div>
</div>
<div data-gallery-role="fotorama__focusable-end" tabindex="-1"></div>
</div>
<div class="magnifier-preview" data-gallery-role="magnifier" id="preview"></div>
+563
View File
@@ -0,0 +1,563 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
define([
'jquery',
'fotorama/fotorama',
'underscore',
'matchMedia',
'mage/template',
'text!mage/gallery/gallery.html',
'uiClass',
'mage/translate'
], function ($, fotorama, _, mediaCheck, template, galleryTpl, Class, $t) {
'use strict';
/**
* Retrieves index if the main item.
* @param {Array.<Object>} data - Set of gallery items.
*/
var getMainImageIndex = function (data) {
var mainIndex;
if (_.every(data, function (item) {
return _.isObject(item);
})
) {
mainIndex = _.findIndex(data, function (item) {
return item.isMain;
});
}
return mainIndex > 0 ? mainIndex : 0;
},
/**
* Helper for parse translate property
*
* @param {Element} el - el that to parse
* @returns {Array} - array of properties.
*/
getTranslate = function (el) {
var slideTransform = $(el).attr('style').split(';');
slideTransform = $.map(slideTransform, function (style) {
style = style.trim();
if (style.startsWith('transform: translate3d')) {
return style.match(/transform: translate3d\((.+)px,(.+)px,(.+)px\)/);
}
return false;
});
return slideTransform.filter(Boolean);
},
/**
* @param {*} str
* @return {*}
* @private
*/
_toNumber = function (str) {
var type = typeof str;
if (type === 'string') {
return parseInt(str); //eslint-disable-line radix
}
return str;
};
return Class.extend({
defaults: {
settings: {},
config: {},
startConfig: {}
},
/**
* Checks if device has touch interface.
* @return {Boolean} The result of searching touch events on device.
*/
isTouchEnabled: (function () {
return 'ontouchstart' in document.documentElement;
})(),
/**
* Initializes gallery.
* @param {Object} config - Gallery configuration.
* @param {String} element - String selector of gallery DOM element.
*/
initialize: function (config, element) {
var self = this;
this._super();
_.bindAll(this,
'_focusSwitcher'
);
/*turn off arrows for touch devices*/
if (this.isTouchEnabled) {
config.options.arrows = false;
if (config.fullscreen) {
config.fullscreen.arrows = false;
}
}
config.options.width = _toNumber(config.options.width);
config.options.height = _toNumber(config.options.height);
config.options.thumbwidth = _toNumber(config.options.thumbwidth);
config.options.thumbheight = _toNumber(config.options.thumbheight);
config.options.swipe = true;
this.config = config;
this.settings = {
$element: $(element),
$pageWrapper: $('body>.page-wrapper'),
currentConfig: config,
defaultConfig: _.clone(config),
fullscreenConfig: _.clone(config.fullscreen),
breakpoints: config.breakpoints,
activeBreakpoint: {},
fotoramaApi: null,
isFullscreen: false,
api: null,
data: _.clone(config.data)
};
config.options.ratio = config.options.width / config.options.height;
config.options.height = null;
$.extend(true, this.startConfig, config);
this.initGallery();
this.initApi();
this.setupBreakpoints();
this.initFullscreenSettings();
this.settings.$element.on('click', '.fotorama__stage__frame', function () {
if (
!$(this).parents('.fotorama__shadows--left, .fotorama__shadows--right').length &&
!$(this).hasClass('fotorama-video-container')
) {
self.openFullScreen();
}
});
if (this.isTouchEnabled && this.settings.isFullscreen) {
this.settings.$element.on('tap', '.fotorama__stage__frame', function () {
var translate = getTranslate($(this).parents('.fotorama__stage__shaft'));
if (translate[1] === '0' && !$(this).hasClass('fotorama-video-container')) {
self.openFullScreen();
self.settings.$pageWrapper.hide();
}
});
}
},
/**
* Open gallery fullscreen
*/
openFullScreen: function () {
this.settings.api.fotorama.requestFullScreen();
this.settings.$fullscreenIcon.css({
opacity: 1,
visibility: 'visible',
display: 'block'
});
},
/**
* Gallery fullscreen settings.
*/
initFullscreenSettings: function () {
var settings = this.settings,
self = this;
settings.$gallery = this.settings.$element.find('[data-gallery-role="gallery"]');
settings.$fullscreenIcon = this.settings.$element.find('[data-gallery-role="fotorama__fullscreen-icon"]');
settings.focusableStart = this.settings.$element.find('[data-gallery-role="fotorama__focusable-start"]');
settings.focusableEnd = this.settings.$element.find('[data-gallery-role="fotorama__focusable-end"]');
settings.closeIcon = this.settings.$element.find('[data-gallery-role="fotorama__fullscreen-icon"]');
settings.fullscreenConfig.swipe = true;
settings.$gallery.on('fotorama:fullscreenenter', function () {
settings.closeIcon.show();
settings.focusableStart.attr('tabindex', '0');
settings.focusableEnd.attr('tabindex', '0');
settings.focusableStart.on('focusin', self._focusSwitcher);
settings.focusableEnd.on('focusin', self._focusSwitcher);
settings.api.updateOptions(settings.defaultConfig.options, true);
settings.api.updateOptions(settings.fullscreenConfig, true);
if (!_.isEqual(settings.activeBreakpoint, {}) && settings.breakpoints) {
settings.api.updateOptions(settings.activeBreakpoint.options, true);
}
settings.isFullscreen = true;
});
settings.$gallery.on('fotorama:fullscreenexit', function () {
settings.closeIcon.hide();
settings.focusableStart.attr('tabindex', '-1');
settings.focusableEnd.attr('tabindex', '-1');
settings.api.updateOptions(settings.defaultConfig.options, true);
settings.focusableStart.off('focusin', this._focusSwitcher);
settings.focusableEnd.off('focusin', this._focusSwitcher);
settings.closeIcon.hide();
if (!_.isEqual(settings.activeBreakpoint, {}) && settings.breakpoints) {
settings.api.updateOptions(settings.activeBreakpoint.options, true);
}
settings.isFullscreen = false;
settings.$element.data('gallery').updateOptions({
swipe: true
});
});
},
/**
* Switcher focus.
*/
_focusSwitcher: function (e) {
var target = $(e.target),
settings = this.settings;
if (target.is(settings.focusableStart)) {
this._setFocus('start');
} else if (target.is(settings.focusableEnd)) {
this._setFocus('end');
}
},
/**
* Set focus to element.
* @param {String} position - can be "start" and "end"
* positions.
* If position is "end" - sets focus to first
* focusable element in modal window scope.
* If position is "start" - sets focus to last
* focusable element in modal window scope
*/
_setFocus: function (position) {
var settings = this.settings,
focusableElements,
infelicity;
if (position === 'end') {
settings.$gallery.find(settings.closeIcon).trigger('focus');
} else if (position === 'start') {
infelicity = 3; //Constant for find last focusable element
focusableElements = settings.$gallery.find(':focusable');
focusableElements.eq(focusableElements.length - infelicity).trigger('focus');
}
},
/**
* Initializes gallery with configuration options.
*/
initGallery: function () {
var breakpoints = {},
settings = this.settings,
config = this.config,
tpl = template(galleryTpl, {
next: $t('Next'),
previous: $t('Previous')
}),
mainImageIndex,
$element = settings.$element,
$fotoramaElement,
$fotoramaStage;
if (settings.breakpoints) {
_.each(_.values(settings.breakpoints), function (breakpoint) {
var conditions;
_.each(_.pairs(breakpoint.conditions), function (pair) {
conditions = conditions ? conditions + ' and (' + pair[0] + ': ' + pair[1] + ')' :
'(' + pair[0] + ': ' + pair[1] + ')';
});
breakpoints[conditions] = breakpoint.options;
});
settings.breakpoints = breakpoints;
}
_.extend(config, config.options,
{
options: undefined,
click: false,
breakpoints: null
}
);
settings.currentConfig = config;
$element
.css('min-height', settings.$element.height())
.append(tpl);
$fotoramaElement = $element.find('[data-gallery-role="gallery"]');
$fotoramaStage = $fotoramaElement.find('.fotorama__stage');
$fotoramaStage.css('position', 'absolute');
$fotoramaElement.fotorama(config);
$fotoramaElement.find('.fotorama__stage__frame.fotorama__active')
.one('f:load', function () {
// Remove placeholder when main gallery image loads.
$element.find('.gallery-placeholder__image').remove();
$element
.removeClass('_block-content-loading')
.css('min-height', '');
$fotoramaStage.css('position', '');
});
settings.$elementF = $fotoramaElement;
settings.fotoramaApi = $fotoramaElement.data('fotorama');
$.extend(true, config, this.startConfig);
mainImageIndex = getMainImageIndex(config.data);
if (mainImageIndex) {
this.settings.fotoramaApi.show({
index: mainImageIndex,
time: 0
});
}
},
/**
* Creates breakpoints for gallery.
*/
setupBreakpoints: function () {
var pairs,
settings = this.settings,
config = this.config,
startConfig = this.startConfig,
isInitialized = {},
isTouchEnabled = this.isTouchEnabled;
if (_.isObject(settings.breakpoints)) {
pairs = _.pairs(settings.breakpoints);
_.each(pairs, function (pair) {
var mediaQuery = pair[0];
isInitialized[mediaQuery] = false;
mediaCheck({
media: mediaQuery,
/**
* Is triggered when breakpoint enties.
*/
entry: function () {
$.extend(true, config, _.clone(startConfig));
settings.api.updateOptions(settings.defaultConfig.options, true);
if (settings.isFullscreen) {
settings.api.updateOptions(settings.fullscreenConfig, true);
}
if (isTouchEnabled) {
settings.breakpoints[mediaQuery].options.arrows = false;
if (settings.breakpoints[mediaQuery].options.fullscreen) {
settings.breakpoints[mediaQuery].options.fullscreen.arrows = false;
}
}
settings.api.updateOptions(settings.breakpoints[mediaQuery].options, true);
$.extend(true, config, settings.breakpoints[mediaQuery]);
settings.activeBreakpoint = settings.breakpoints[mediaQuery];
isInitialized[mediaQuery] = true;
},
/**
* Is triggered when breakpoint exits.
*/
exit: function () {
if (isInitialized[mediaQuery]) {
$.extend(true, config, _.clone(startConfig));
settings.api.updateOptions(settings.defaultConfig.options, true);
if (settings.isFullscreen) {
settings.api.updateOptions(settings.fullscreenConfig, true);
}
settings.activeBreakpoint = {};
} else {
isInitialized[mediaQuery] = true;
}
}
});
});
}
},
/**
* Creates gallery's API.
*/
initApi: function () {
var settings = this.settings,
config = this.config,
api = {
/**
* Contains fotorama's API methods.
*/
fotorama: settings.fotoramaApi,
/**
* Displays the last image on preview.
*/
last: function () {
settings.fotoramaApi.show('>>');
},
/**
* Displays the first image on preview.
*/
first: function () {
settings.fotoramaApi.show('<<');
},
/**
* Displays previous element on preview.
*/
prev: function () {
settings.fotoramaApi.show('<');
},
/**
* Displays next element on preview.
*/
next: function () {
settings.fotoramaApi.show('>');
},
/**
* Displays image with appropriate count number on preview.
* @param {Number} index - Number of image that should be displayed.
*/
seek: function (index) {
if (_.isNumber(index) && index !== 0) {
if (index > 0) {
index -= 1;
}
settings.fotoramaApi.show(index);
}
},
/**
* Updates gallery with new set of options.
* @param {Object} configuration - Standart gallery configuration object.
* @param {Boolean} isInternal - Is this function called via breakpoints.
*/
updateOptions: function (configuration, isInternal) {
var $selectable = $('a[href], area[href], input, select, ' +
'textarea, button, iframe, object, embed, *[tabindex], *[contenteditable]')
.not('[tabindex=-1], [disabled], :hidden'),
$focus = $(':focus'),
index;
if (_.isObject(configuration)) {
//Saves index of focus
$selectable.each(function (number) {
if ($(this).is($focus)) {
index = number;
}
});
if (this.isTouchEnabled) {
configuration.arrows = false;
}
configuration.click = false;
configuration.breakpoints = null;
if (!isInternal) {
!_.isEqual(settings.activeBreakpoint, {} && settings.breakpoints) ?
$.extend(true, settings.activeBreakpoint.options, configuration) :
settings.isFullscreen ?
$.extend(true, settings.fullscreenConfig, configuration) :
$.extend(true, settings.defaultConfig.options, configuration);
}
$.extend(true, settings.currentConfig.options, configuration);
settings.fotoramaApi.setOptions(settings.currentConfig.options);
if (_.isNumber(index)) {
$selectable.eq(index).trigger('focus');
}
}
},
/**
* Updates gallery with specific set of items.
* @param {Array.<Object>} data - Set of gallery items to update.
*/
updateData: function (data) {
var mainImageIndex;
if (_.isArray(data)) {
settings.fotoramaApi.load(data);
mainImageIndex = getMainImageIndex(data);
if (settings.fotoramaApi.activeIndex !== mainImageIndex) {
settings.fotoramaApi.show({
index: mainImageIndex,
time: 0
});
}
$.extend(false, settings, {
data: data,
defaultConfig: data
});
$.extend(false, config, {
data: data
});
}
},
/**
* Returns current images list
*
* @returns {Array}
*/
returnCurrentImages: function () {
var images = [];
_.each(this.fotorama.data, function (item) {
images.push(_.omit(item, '$navThumbFrame', '$navDotFrame', '$stageFrame', 'labelledby'));
});
return images;
},
/**
* Updates gallery data partially by index
* @param {Number} index - Index of image in data array to be updated.
* @param {Object} item - Standart gallery image object.
*
*/
updateDataByIndex: function (index, item) {
settings.fotoramaApi.spliceByIndex(index, item);
}
};
settings.$element.data('gallery', api);
settings.api = settings.$element.data('gallery');
settings.$element.trigger('gallery:loaded');
}
});
});
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+127
View File
@@ -0,0 +1,127 @@
// /**
// * Copyright © Magento, Inc. All rights reserved.
// * See COPYING.txt for license details.
// */
.fotorama-stretch {
bottom: 0;
height: 100%;
left: 0;
position: absolute;
right: 0;
top: 0;
width: 100%;
}
.fotorama-grab-cursor {
cursor: move;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: -o-grab;
cursor: -ms-grab;
cursor: grab;
}
.fotorama-grabbing-cursor {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: -o-grabbing;
cursor: -ms-grabbing;
cursor: grabbing;
}
.fotorama-gpu {
transform: translateZ(0);
}
.fotorama-focus {
outline: 0;
}
.fotorama-focus-overlay {
&:after {
&:extend(.fotorama-stretch);
background-color: @theme__color__primary-alt;
border-radius: inherit;
content: '';
}
}
.fotorama-transform-disabled {
transform: none !important;
}
.fotorama-transition-for-slide {
transition-duration: 0ms;
transition-property: transform, width;
transition-timing-function: cubic-bezier(0.1, 0, 0.25, 1);
}
.fotorama-no-select {
user-select: none;
}
.fotorama-select {
user-select: text;
}
.fotorama-empty-bg {
background: url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);
}
.fotorama-auto-margin {
margin: auto;
padding: 0;
}
.fotorama-inline-block {
.fotorama-inline-block();
}
.fotorama-content-box {
box-sizing: content-box;
}
.fotorama-border-box {
box-sizing: border-box;
}
.fotorama-hidden {
left: -99999px;
position: absolute;
top: -99999px;
z-index: -@z-index-10;
}
.fotorama-visible {
left: auto;
opacity: 1;
position: relative;
top: auto;
z-index: auto;
}
.fotorama-no-tap {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.transitionDuration {
transition-duration: 333ms;
}
.transitionDurationZero {
transition-duration: 0ms;
}
.fotorama-sprite {
&:extend(.fotorama-print-background);
background-image: url('gallery.png');
background-repeat: no-repeat;
}
.fotorama-print-background {
@media print {
background: none !important;
}
}
+66
View File
@@ -0,0 +1,66 @@
// /**
// * Copyright © Magento, Inc. All rights reserved.
// * See COPYING.txt for license details.
// */
.fotorama__fullscreen-icon:focus,
.fotorama__zoom-out:focus,
.fotorama__zoom-in:focus,
.fotorama__arr:focus,
.fotorama__stage__shaft:focus,
.fotorama__nav__frame--thumb:focus .fotorama__thumb,
.fotorama__nav__frame--dot:focus .fotorama__dot {
box-shadow: none;
&:after {
border-radius: inherit;
bottom: @fotorama-inner-box-shadow;
box-shadow: @focus__box-shadow;
content: '';
left: @fotorama-inner-box-shadow;
position: absolute;
right: @fotorama-inner-box-shadow;
top: @fotorama-inner-box-shadow;
z-index: @z-index-10;
}
}
.fotorama__nav__frame--thumb:focus,
.fotorama__nav__frame--dot:focus {
.fotorama__thumb:after,
.fotorama__dot:after{
bottom: 0;
left: 0;
right: 0;
top: 0;
}
.fotorama__thumb.fotorama_vertical_ratio:after {
left: 2px;
right: 2px;
}
.fotorama__thumb {
overflow: inherit;
}
}
.fotorama__nav__frame:nth-child(2):focus {
.fotorama__thumb:after{
left: 1px;
}
.fotorama__thumb.fotorama_vertical_ratio:after{
top: 1px;
}
}
.fotorama__nav__frame:last-child:focus {
.fotorama__thumb:after{
right: 1px;
}
.fotorama__thumb.fotorama_vertical_ratio:after{
bottom: 1px;
}
}
.fotorama__thumb__arr {
box-shadow: none;
}
@@ -0,0 +1,64 @@
// /**
// * Copyright © Magento, Inc. All rights reserved.
// * See COPYING.txt for license details.
// */
.fotorama--fullscreen {
background: @color-white;
bottom: 0 !important;
float: none !important;
left: 0 !important;
margin: 0 !important;
position: fixed !important;
right: 0 !important;
top: 0 !important;
width: 100% !important;
z-index: @z-index-10 !important;
&:extend(.fotorama-gpu);
.fotorama__wrap {
max-width: 100% !important;
}
}
.fotorama__fullscreen {
overflow: hidden;
position: relative;
.fotorama__zoom-in,
.fotorama__zoom-out {
cursor: pointer;
display: block;
height: @size-fotorama-block;
overflow: hidden;
position: absolute;
width: @size-fotorama-block;
}
.fotorama__zoom-out {
&:extend(.fotorama-sprite);
background-position: 0 (-@size-fotorama-block) !important;
top: 80px;
&.fotorama__zoom-out--disabled {
display: none;
}
}
.fotorama__zoom-in {
&:extend(.fotorama-sprite);
background-position: 0 0 !important;
top: 0;
&.fotorama__zoom-in--disabled {
display: none;
}
}
.fotorama__video-close {
display: none;
}
}
.fotorama--fullscreen .fotorama__loaded--full {
.fotorama__img {
display: none;
}
.fotorama__img--full {
display: block;
}
}
+62
View File
@@ -0,0 +1,62 @@
// /**
// * Copyright © Magento, Inc. All rights reserved.
// * See COPYING.txt for license details.
// */
.fotorama-translate3d(@x; @y; @z) {
-webkit-transform: translate3d(@x, @y, @z);
-ms-transform: translate3d(@x, @y, @z);
-o-transform: translate3d(@x, @y, @z);
transform: translate3d(@x, @y, @z);
}
.fotorama-rotate (@deg) {
-webkit-transform: rotate(@deg);
-ms-transform: rotate(@deg);
transform: rotate(@deg);
}
.translateX(@value) {
-webkit-transform: translateX(@value);
-ms-transform: translateX(@value);
-o-transform: translateX(@value);
transform: translateX(@value);
}
.translateY(@value) {
-webkit-transform: translateY(@value);
-ms-transform: translateY(@value);
-o-transform: translateY(@value);
transform: translateY(@value);
}
.translate(@x, @y) {
-webkit-transform: translate(@x, @y);
-ms-transform: translateY(@x, @y);
-o-transform: translateY(@x, @y);
transform: translateY(@x, @y);
}
.fotorama-shadow-gradient(@x, @y) {
background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.2) 25%, rgba(0, 0, 0, 0.3) 75%, transparent), radial-gradient(farthest-side at @x @y, rgba(0, 0, 0, 0.4), transparent);
}
.fotorama-inline-block(@va: middle) {
*display: inline;
*zoom: 1;
-moz-box-orient: vertical;
display: -moz-inline-box;
display: inline-block;
vertical-align: @va;
}
.fotorama-button-background() {
background-color: rgba(255, 255, 255, 0.3);
transition: background-color @fotorama-duration-time ease-in-out;
&:hover {
background-color: rgba(255, 255, 255, 0.5);
}
&:active {
background-color: rgba(213, 213, 213, 0.5);
}
}
@@ -0,0 +1,12 @@
// * Copyright © Magento, Inc. All rights reserved.
// * See COPYING.txt for license details.
// */
// /**
@fotorama-arw-size: 80px;
@fotorama-duration-time: 0.3s;
@fotorama-fullscreen-zoom-time: 0.3s;
@fotorama-inner-box-shadow: 3px;
@fotorama-spinner-size: 64px;
@fotorama-thumb-arrow: 30px;
@fotorama_close_button: 80px;
@size-fotorama-block: 80px;