//------------------------------------- globals
const snGroup = "tarot";
const snClient = "osho.co.kr";
const zCards = 60;
//------------------------------------- globals
//------------------------------------- globals
//------------------------------------- globals
//--- swappable to local file BEGIN
//------------------------------------- globals
//------------------------------------- globals
//------------------------------------- globals
const html_ways_g = [
'\
\n\
\n\
\n\
카드 1
\n\
\n\
\n\
',
'\
\n\
\n\
\n\
카드 1
\n\
\n\
\n\
\n\
카드 2
\n\
\n\
\n\
\n\
\n\
카드 3
\n\
\n\
\n\
\n\
카드 4
\n\
\n\
\n\
',
'\
\n\
\n\
\n\
카드 1
\n\
\n\
\n\
\n\
카드 2
\n\
\n\
\
\n\
\
\n\
\n\
카드 3
\n\
\n\
\n\
\n\
카드 4
\n\
\n\
\n\
',
'\
\n\
\n\
\n\
카드 1
\n\
\n\
\n\
\n\
카드 2
\n\
\n\
\
\n\
\n\
카드 3
\n\
\
\n\
',
];
//------------------------------------- globals
//------------------------------------- globals
//------------------------------------- globals
//--- swappable to local file END
//------------------------------------- globals
//------------------------------------- globals
//------------------------------------- globals
const html_show_card_inner_div = '\
\n\
\n\
\n\
\n\
\n\
\n\
\n\
\
';
var way_idx_g = 0;
var cards_of_way_g = [1, 4, 4, 3, ];
var chosen_nums_g = [0];
var description_shown_g = true;
var description_num_g = 0;
//------------------------------------- globals
function get_tarot_text(idx) {
var sText = "";
if (snClient != "osho.co.kr") {
sText = sText + "\n\n" + "
" + get_card_info(idx) + "
";
}
sText = sText + "\n\n" + get_tarot_text_1(idx);
// sText = sText + "\\n\\\n\n" + get_tarot_text_2(idx);
return sText;
}
function show_description(oImg, id, img_idx) {
const num = chosen_nums_g[img_idx];
const sNum = pad_zero_num(num, 2);
const sTitle = get_tarot_title(num);
// --------------------------------
$("#box_container").hide();
// --------------------------------
jQuery( html_show_card_inner_div, {}).insertAfter('#box_container');
// --------------------------------
let oImgNew = $('img#tcb_i');
oImgNew.click(function(event){ on_hide_description(event); });
oImgNew.attr("src", get_sf_card(num));
$("#tcb_p").html(sTitle);
// --------------------------------
const sText = get_tarot_text(num);
$("#tc_description").html(sText);
description_shown_g = true;
description_num_g = num;
return img_idx;
}
function on_hide_description(event) {
if (way_idx_g == 0) {
$('#box_container').css('margin-top', '3em');
$("#tc_description").html(OneCard_description);
} else {
$("#tc_description").html(FourCard_description);
}
// $("#tc_description").html("");
// description_shown_g = false;
description_num_g = 0;
$("#box_container_show").remove();
$("#box_container").show();
}
function do_reset() {
if (description_shown_g) {
$("#box_container_show").remove();
$("#box_container").show();
}
// description_shown_g = false;
description_num_g = 0;
$("#box_container").html("");
$("#tc_description").html("");
$("#sOut").html = "";
}
function set_way(way_idx) {
do_reset();
way_idx_g = way_idx;
// chosen_nums_g = new Array(cards_of_way_g[way_idx]).fill(0); // 0 : not yet chosen.
chosen_nums_g = new Array(cards_of_way_g[way_idx]); // 0 : not yet chosen.
for(let i=0; i
" + get_card_info(idx) + "";
sText = sText + "\n\n" + get_tarot_text_1(idx);
return sText;
}
function show_description_by_num(num) {
const sNum = pad_zero_num(num, 2);
const sTitle = get_tarot_title(num);
// --------------------------------
$("#box_container").hide();
// --------------------------------
jQuery( html_show_card_inner_div, {}).insertAfter('#box_container');
// --------------------------------
let oImgNew = $('img#tcb_i');
oImgNew.click(function(event){ window.location.replace( caller_g ); });
oImgNew.attr("src", get_sf_card(num));
$("#tcb_p").html(sTitle);
// --------------------------------
const sText = get_tarot_text_by_num(num);
$('#tc_description').css("margin-top", '7pt');
$("#tc_description").html(sText);
// description_shown_g = true;
// description_num_g = num;
}
function init() {
do_reset();
}
$( window ).load(function() {
var rq = getRequests();
caller_g = rq["caller"];
var num = rq["num"];
if (typeof num != "undefined") {
show_description_by_num(num);
return;
}
var mode = rq["mode"]; if (typeof mode == "undefined") mode = default_mode;
set_way(mode);
});