MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / createGalleryChart

Function createGalleryChart

examples/js/wechat.js:3–31  ·  view source on GitHub ↗
(example)

Source from the content-addressed store, hash-verified

1/* Copyright© 2000 - 2026 SuperMap Software Co.Ltd. All rights reserved.*/
2
3function createGalleryChart(example) {
4 var target = 'editor-wechat.html',
5 defaultThumb = '../img/thumb.png',
6 title = utils.getLocalPairs(example, 'name'),
7 href = example.fileName ? example.fileName : '',
8 thumbnail = example.thumbnail ? thumbLocation + '/img/' + example.thumbnail : '',
9 version = example.version;
10 href = href.replace(/editor/, 'editor-wechat');
11 var chartDiv = $("<div class='col-xlg-2 col-lg-3 col-md-4 col-sm-6 col-xs-6'></div>");
12 var chart = $("<div class='chart'></div>");
13 var link = $("<a class='chart-link' href='" + target + '#' + href + "'></a>");
14 var chartTitle = $("<h5 class='chart-title'>" + title + '</h5>');
15 var newTip = $(
16 '<svg xmlns="http://www.w3.org/2000/svg" class="new-example" style="width:8px !important;height:8px;right: 1px;top: 1px;position: absolute;"><circle cx="4" cy="4" r="4" fill="#e14d57"></circle></svg>'
17 );
18 var thumb = $(
19 "<img class='chart-thumb' src='" + defaultThumb + "' data-original='" + thumbnail + "' style='display: inline'>"
20 );
21
22 chartTitle.appendTo(link);
23 if (window.version === version) {
24 newTip.appendTo(link);
25 }
26 thumb.appendTo(link);
27 link.appendTo(chart);
28 chart.appendTo(chartDiv);
29
30 return chartDiv;
31}

Callers

nothing calls this directly

Calls 2

appendToMethod · 0.80
$Function · 0.50

Tested by

no test coverage detected