User:PetraMagna/story.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
PetraMagna (talk | contribs) add options js |
PetraMagna (talk | contribs) remove redundancy |
||
Line 1: | Line 1: | ||
(function() { |
|||
// wait for jQuery to become available |
|||
function defer(method) { |
|||
if (window.jQuery) { |
|||
method(); |
|||
} else { |
|||
setTimeout(function() { defer(method) }, 50); |
|||
} |
|||
} |
|||
// specifies what to do after the user clicks on a sensei reply option |
|||
function story_option_click(group_num, option_num) { |
function story_option_click(group_num, option_num) { |
||
const container = $("#story-sensei-option-group-" + group_num); |
const container = $("#story-sensei-option-group-" + group_num); |
||
Line 56: | Line 48: | ||
} |
} |
||
⚫ | |||
// specifies what to do after the user clicks on a sensei reply option |
|||
})(); |
|||
function bgm_stop_click() { |
|||
$('.story-bgm-container button.vjs-playing').each(function(num, pause_button) { |
|||
pause_button.click(); |
|||
}); |
|||
} |
|||
function bgm_init() { |
|||
$(".story-bgm-stop-button").each(function(i, stop_button) { |
|||
stop_button.onclick = bgm_stop_click; |
|||
}); |
|||
} |
|||
function bgm_main() { |
|||
$(document).ready(function() { |
|||
bgm_init(); |
|||
⚫ | |||
}); |
|||
} |
|||
defer(bgm_main); |
|||
}; |
|||
story_js(); |