59 lines
1.4 KiB
JavaScript
59 lines
1.4 KiB
JavaScript
window.kon = window.kon || {}
|
|
|
|
kon.description = (function () {
|
|
var variable;
|
|
|
|
function setVariable(vars) { kon.description.variable = vars; }
|
|
|
|
function DM1() {
|
|
var nextFunc = function() {
|
|
return true;
|
|
};
|
|
return nextFunc
|
|
}
|
|
|
|
function DM2(option) {
|
|
var time = ""
|
|
|
|
if(option.time) {
|
|
time = option.time
|
|
} else {
|
|
time = 3
|
|
}
|
|
$(".question-button-box button").css("display","none")
|
|
|
|
var count = createnode("div",time,{"id":"count","style":"font-weight:bold"});
|
|
$(".question-button-box").append(count)
|
|
var timer = setInterval(function() {
|
|
time--;
|
|
$("#count").remove();
|
|
var count = createnode("div",time,{"id":"count","style":"font-weight:bold"});
|
|
$(".question-button-box").append(count)
|
|
if(time === 0) {
|
|
$("#count").remove();
|
|
$(".question-button-box button").fadeIn()
|
|
clearInterval(timer);
|
|
}
|
|
|
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
var nextFunc = function() {
|
|
return true;
|
|
};
|
|
return nextFunc
|
|
}
|
|
|
|
var module = {
|
|
/* variable */
|
|
variable:variable,
|
|
/* function */
|
|
setVariable:setVariable,
|
|
DM1:DM1,
|
|
DM2:DM2
|
|
}
|
|
|
|
return module;
|
|
})(); |