Skip to content

Commit eb09d38

Browse files
authored
Merge pull request #122 from ImageMarkup/add-gtm-to-gallery
2 parents 19919a6 + 87cff89 commit eb09d38

11 files changed

Lines changed: 57 additions & 44 deletions

File tree

error.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
<head>
4+
<!-- Google Tag Manager -->
5+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
6+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
7+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
8+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
9+
})(window,document,'script','dataLayer','GTM-W2JQSNLL');</script>
10+
<!-- End Google Tag Manager -->
11+
</head>
312
<body>
13+
<!-- Google Tag Manager (noscript) -->
14+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W2JQSNLL"
15+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
16+
<!-- End Google Tag Manager (noscript) -->
17+
418
<div class="error-page">
519
<img src='sources/images/inner-pages/error-page.png'>
620
<div class="not-found-404">404</div>
721
<div class="page-not-found">Page not found</div>
822
<div class="page-does-not-exist">Oops! The page you are looking for does not exist.</div>
923
</div>
1024

11-
<!-- Google tag (gtag.js) -->
12-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-541WGVR6R5"></script>
13-
<script>
14-
window.dataLayer = window.dataLayer || [];
15-
function gtag(){dataLayer.push(arguments);}
16-
gtag('js', new Date());
17-
18-
gtag('config', 'G-541WGVR6R5');
19-
</script>
20-
2125
</body>
2226
</html>

index.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5+
6+
<!-- Google Tag Manager -->
7+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
8+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
9+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
10+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
11+
})(window,document,'script','dataLayer','GTM-W2JQSNLL');</script>
12+
<!-- End Google Tag Manager -->
13+
514
<meta name="viewport" content="width=device-width">
615
<title>ISIC Archive</title>
716
<link rel="shortcut icon" href="sources/images/favicon.ico" type="image/x-icon" />
@@ -15,6 +24,11 @@
1524

1625
</head>
1726
<body>
27+
<!-- Google Tag Manager (noscript) -->
28+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W2JQSNLL"
29+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
30+
<!-- End Google Tag Manager (noscript) -->
31+
1832
<svg class="svg" xmlns="http://www.w3.org/2000/svg">
1933
<!-- icons -->
2034
<symbol viewBox="0 0 26 26" id="close-icon">
@@ -103,15 +117,5 @@
103117
</symbol>
104118
</svg>
105119

106-
<!-- Google tag (gtag.js) -->
107-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-541WGVR6R5"></script>
108-
<script>
109-
window.dataLayer = window.dataLayer || [];
110-
function gtag(){dataLayer.push(arguments);}
111-
gtag('js', new Date());
112-
113-
gtag('config', 'G-541WGVR6R5');
114-
</script>
115-
116120
</body>
117121
</html>

sources/views/subviews/gallery/gallery.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default class GalleryView extends JetView {
4444
const clonePagerForNameFilter = {
4545
view: "pager",
4646
name: NAME_CLONED_PAGER_FOR_NAME_SEARCH,
47+
css: "gtm-paginator",
4748
size: 80,
4849
hidden: true,
4950
height: 36,

sources/views/subviews/gallery/galleryMobile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,15 @@ export default class GalleryMobileView extends JetView {
264264
<div class="thumbnails-name" style="font-size: 20px">${obj.isic_id}</div>
265265
<div class="mobile-gallery-images-buttons" style="bottom: ${imageIconDimensions[2]}px;">
266266
<div class="gallery-images-button-elem tooltip-container tooltip-gallery-images" style="width: ${imageIconDimensions[0].width}px; height: ${imageIconDimensions[0].height}px;">
267-
<span class="gallery-images-button resize-icon tooltip-title">
267+
<span class="gtm-image-enlargement gallery-images-button resize-icon tooltip-title">
268268
<svg viewBox="0 0 26 26" class="gallery-icon-svg" style="width: ${imageIconDimensions[1].width}px; height: ${imageIconDimensions[1].height}px;">
269269
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#resize-icon" class="gallery-icon-use"></use>
270270
</svg>
271271
</span>
272272
<span class="tooltip-block tooltip-block-top" style="display: block">Enlarge</span>
273273
</div>
274274
<div class="gallery-images-button-elem tooltip-container tooltip-gallery-images" style="width: ${imageIconDimensions[0].width}px; height: ${imageIconDimensions[0].height}px;">
275-
<span class="gallery-images-button info-icon tooltip-title">
275+
<span class="gtm-image-metadata gallery-images-button info-icon tooltip-title">
276276
<svg viewBox="0 0 26 26" class="gallery-icon-svg" style="width: ${imageIconDimensions[1].width}px; height: ${imageIconDimensions[1].height}px;">
277277
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#info-icon" class="gallery-icon-use"></use>
278278
</svg>
@@ -505,7 +505,7 @@ export default class GalleryMobileView extends JetView {
505505
this.removeParam.bind(this)
506506
));
507507
this.metadataWindow = this.getMetadataLayout();
508-
const contextMenuConfig = contextMenu.getConfig(ID_MOBILE_GALLERY_CONTEXT_MENU);
508+
const contextMenuConfig = contextMenu.getConfig(ID_MOBILE_GALLERY_CONTEXT_MENU, "gtm-single-download");
509509
this.contextMenu = this.ui(contextMenuConfig);
510510
const enlargeContextMenuConfig = contextMenu.getConfig(ID_ENLARGE_CONTEXT_MENU);
511511
this.enlargeContextMenu = this.ui(enlargeContextMenuConfig);

sources/views/subviews/gallery/parts/cartList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ function getConfig(config) {
4242
const downloadZipButton = {
4343
view: "button",
4444
value: "Download ZIP",
45+
css: "gtm-multi-download",
4546
id: ID_DOWNLOAD_SELECTED_IMAGES_BUTTON,
4647
name: NAME_DOWNLOAD_SELECTED_IMAGES_BUTTON
4748
};

sources/views/subviews/gallery/parts/contextMenu.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ const contextMenu = {
55
data: [constants.ID_GALLERY_CONTEXT_MENU_SAVE_IMAGE]
66
};
77

8-
function getConfig(id) {
9-
contextMenu.id = id || `contextmenu-${webix.uid()}`;
10-
return contextMenu;
11-
}
12-
13-
function getIdFromConfig() {
14-
return contextMenu;
8+
function getConfig(id = `contextmenu-${webix.uid()}`, css) {
9+
return {
10+
...contextMenu,
11+
id,
12+
...(css && { css })
13+
};
1514
}
1615

1716
export default {
1817
getConfig,
19-
getIdFromConfig
2018
};

sources/views/subviews/gallery/parts/filterPanel.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function getConfig(config) {
2020
const switchButton = {
2121
view: "switch",
2222
name: NAME_SWITCH_BUTTON,
23-
css: "switch-search-gallery-button",
23+
css: "gtm-selector switch-search-gallery-button",
2424
label: "Search by filters",
2525
labelRight: "Search by name",
2626
width: 285,
@@ -31,6 +31,7 @@ function getConfig(config) {
3131
const downloadFilteredImagesButton = {
3232
view: "button",
3333
value: "Download ZIP",
34+
css: "gtm-filtered-download",
3435
id: ID_DOWNLOAD_FILTERED_IMAGES_BUTTON,
3536
name: NAME_DOWNLOAD_FILTERED_IMAGES_BUTTON,
3637
hidden: true
@@ -39,7 +40,7 @@ function getConfig(config) {
3940
const searchSuggestConfig = {
4041
id: ID_SEARCH_SUGGESTION,
4142
fitMaster: false,
42-
css: "filters-suggest",
43+
css: "gtm-search filters-suggest",
4344
};
4445
const searchSuggestView = searchSuggest.getConfig(searchSuggestConfig);
4546
searchSuggestView.body.template = obj => (obj.name
@@ -99,6 +100,7 @@ function getConfig(config) {
99100
const filtersForm = {
100101
id: ID_FILTERS_FORM,
101102
name: NAME_FILTERS_FORM,
103+
css: "gtm-filter",
102104
view: "form",
103105
paddingX: 7,
104106
margin: 0,

sources/views/subviews/gallery/parts/galleryDataview.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const dataview = {
129129
? ""
130130
: " disabled-badge";
131131
const lesionIcon = `<div class="${lesionIconElementClass} tooltip-container tooltip-gallery-images" style="height:${imageIconDimensions[0].height}px;width:${imageIconDimensions[0].width}px;">
132-
<span class="gallery-images-button layer-group tooltip-title">
132+
<span class="gtm-lesion-viewer gallery-images-button layer-group tooltip-title">
133133
<svg viewBox="0 0 26 26" class="gallery-icon-svg" style="width: ${imageIconDimensions[1].width}px; height: ${imageIconDimensions[1].height}px">
134134
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#layer-group" class="gallery-icon-use"></use>
135135
</svg>
@@ -151,28 +151,28 @@ const dataview = {
151151
<div class="check-layout ${checkedClass}" style="height: ${util.getImageHeight()}px; width: 100%; position: absolute; right:0px; top:${Math.floor((util.getDataviewItemHeight() - util.getImageHeight()) / 2)}px">
152152
<div class='gallery-images-info' style="height: ${util.getImageHeight()}px; position: absolute; right:0px;">
153153
<div class="gallery-images-header">
154-
<div class="gallery-images-checkbox"> ${common.markCheckbox(obj, common)}</div>
155-
<div class="thumbnails-name" style="font-size: ${util.getNewThumnailsNameFontSize()}px">${obj.isic_id}</div>
154+
<div class="gtm-image-selection gallery-images-checkbox"> ${common.markCheckbox(obj, common)}</div>
155+
<div class="thumbnails-name" style="font-size: ${util.getNewThumnailsNameFontSize()}px">${obj.isic_id}</div>
156156
</div>
157157
<div class="gallery-images-buttons" style="bottom: ${imageIconDimensions[2]}px;">
158158
<div class="gallery-images-button-elem tooltip-container tooltip-gallery-images" style="width: ${imageIconDimensions[0].width}px; height: ${imageIconDimensions[0].height}px;">
159-
<span class="gallery-images-button resize-icon tooltip-title">
159+
<span class="gtm-image-enlargement gallery-images-button resize-icon tooltip-title">
160160
<svg viewBox="0 0 26 26" class="gallery-icon-svg" style="width: ${imageIconDimensions[1].width}px; height: ${imageIconDimensions[1].height}px;">
161161
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#resize-icon" class="gallery-icon-use"></use>
162162
</svg>
163163
</span>
164164
<span class="tooltip-block tooltip-block-top" style="display: block">Enlarge</span>
165165
</div>
166166
<div class="gallery-images-button-elem tooltip-container tooltip-gallery-images" style="width: ${imageIconDimensions[0].width}px; height: ${imageIconDimensions[0].height}px;">
167-
<span class="gallery-images-button info-icon tooltip-title">
167+
<span class="gtm-image-metadata gallery-images-button info-icon tooltip-title">
168168
<svg viewBox="0 0 26 26" class="gallery-icon-svg" style="width: ${imageIconDimensions[1].width}px; height: ${imageIconDimensions[1].height}px;">
169169
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#info-icon" class="gallery-icon-use"></use>
170170
</svg>
171171
</span>
172172
<span class="tooltip-block tooltip-block-top">Metadata</span>
173173
</div>
174174
<div class="gallery-images-button-elem tooltip-container tooltip-gallery-images" style="width: ${imageIconDimensions[0].width}px; height: ${imageIconDimensions[0].height}px;">
175-
<span class="gallery-images-button batch-icon tooltip-title">
175+
<span class="gtm-single-download gallery-images-button batch-icon tooltip-title">
176176
<svg viewBox="0 0 26 26" class="gallery-icon-svg" style="width: ${imageIconDimensions[1].width}px; height: ${imageIconDimensions[1].height}px;">
177177
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#batch-icon" class="gallery-icon-use"></use>
178178
</svg>

sources/views/subviews/gallery/parts/galleryPager.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import util from "../../../../utils/util";
55
let dataviewId;
66

77
function createPager({height, width, css, template}) {
8+
const combinedCss = `gtm-paginator${css ? ` ${css}` : ""}`;
89
return {
910
view: "pager",
1011
height,
1112
width,
1213
master: false,
13-
css,
14+
css: combinedCss,
1415
template,
1516
on: {
1617
onItemClick(id) {

sources/views/subviews/gallery/parts/mobileFilterPanel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ function getConfig(config) {
121121
const filtersForm = {
122122
id: ID_FILTERS_FORM,
123123
name: NAME_FILTERS_FORM,
124+
css: "gtm-filter",
124125
view: "form",
125126
paddingX: 7,
126127
margin: 0,
@@ -198,6 +199,7 @@ function getConfig(config) {
198199
const landscapeFiltersForm = {
199200
id: ID_LANDSCAPE_FILTERS_FORM,
200201
name: NAME_LANDSCAPE_FILTERS_FORM,
202+
css: "gtm-filter",
201203
view: "form",
202204
paddingX: 7,
203205
margin: 0,

0 commit comments

Comments
 (0)