Initial commit
This commit is contained in:
9
lib/assets/javascripts/builder/components/loading/loading.tpl
Executable file
9
lib/assets/javascripts/builder/components/loading/loading.tpl
Executable file
@@ -0,0 +1,9 @@
|
||||
<div class="IntermediateInfo">
|
||||
<div class="CDB-LoaderIcon CDB-LoaderIcon--big is-dark js-loader">
|
||||
<svg class="CDB-LoaderIcon-spinner" viewbox="0 0 50 50">
|
||||
<circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"/>
|
||||
</svg>
|
||||
</div>
|
||||
<h4 class="CDB-Text CDB-Size-large u-mainTextColor u-secondaryTextColor u-bSpace--m u-tSpace-xl"><%- title %></h4>
|
||||
<div class="CDB-Text CDB-Size-medium u-altTextColor"><%= descHTML %></div>
|
||||
</div>
|
||||
6
lib/assets/javascripts/builder/components/loading/quote.tpl
Executable file
6
lib/assets/javascripts/builder/components/loading/quote.tpl
Executable file
@@ -0,0 +1,6 @@
|
||||
<p class="CDB-Text CDB-Size-medium u-altTextColor">
|
||||
"<%= quote %>"
|
||||
</p>
|
||||
<% if (author) { %>
|
||||
<p class="CDB-Text CDB-Size-medium u-altTextColor u-tSpace"><i>– <%- author %></i></p>
|
||||
<% } %>
|
||||
23
lib/assets/javascripts/builder/components/loading/random-quote.js
Executable file
23
lib/assets/javascripts/builder/components/loading/random-quote.js
Executable file
@@ -0,0 +1,23 @@
|
||||
var template = require('./quote.tpl');
|
||||
|
||||
var QUOTES = [
|
||||
{ quote: '地理学家永远不会迷路,他们只是做意外的野外工作.', author: '' },
|
||||
{ quote: '地理只是物理学放慢了脚步,里面夹着几棵树.', author: '' },
|
||||
{ quote: '并非所有流浪者都迷路了.', author: '' },
|
||||
{ quote: '制图艺术达到了如此完美的境界,以致单个省份的地图占据了整个城市的整个区域.', author: '' },
|
||||
{ quote: '无论走到哪里,都有地理大数据.', author: null },
|
||||
{ quote: "没有地理,无处可去!", author: '' },
|
||||
{ quote: '一切都发生在某个地方.', author: '' },
|
||||
{ quote: '地图线条和颜色代表着梦想的实现.', author: '' },
|
||||
{ quote: '一切都与其他事物相关,<br />但近处的事物比远处的事物更相关.', author: "" },
|
||||
{ quote: '地图的优点在于,它们显示了可以在有限空间内完成的工作,并预见了其中可能发生的一切.', author: '' }
|
||||
];
|
||||
|
||||
/**
|
||||
* Random quote
|
||||
*/
|
||||
module.exports = function () {
|
||||
var idx = Math.round(Math.random() * (QUOTES.length - 1));
|
||||
|
||||
return template(QUOTES[idx]);
|
||||
};
|
||||
17
lib/assets/javascripts/builder/components/loading/render-loading.js
Executable file
17
lib/assets/javascripts/builder/components/loading/render-loading.js
Executable file
@@ -0,0 +1,17 @@
|
||||
var cdb = require('internal-carto.js');
|
||||
var template = require('./loading.tpl');
|
||||
var randomQuote = require('./random-quote');
|
||||
|
||||
/**
|
||||
* @param {Object} opts
|
||||
* @param {String=} opts.title
|
||||
* @param {String=} opts.desc
|
||||
*/
|
||||
module.exports = function (opts) {
|
||||
var customDesc = opts.desc && cdb.core.sanitize(opts.desc);
|
||||
|
||||
return template({
|
||||
title: opts.title || '',
|
||||
descHTML: customDesc || randomQuote()
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user