Fixed WK link url generation for radicals.
This commit is contained in:
parent
d0dfdee06c
commit
bcc9fd08c7
@ -29,6 +29,7 @@ refreshQuestion = () ->
|
||||
$("#question-image").show()
|
||||
else
|
||||
$("#question-area").text(selection['question']);
|
||||
document.getElementById('view-on-wk').href ="https://www.wanikani.com/radicals/" + selection['answer']
|
||||
else
|
||||
if(selection['item_type'] == 'kanji')
|
||||
document.body.style.backgroundColor = "deeppink";
|
||||
@ -41,8 +42,7 @@ refreshQuestion = () ->
|
||||
else
|
||||
$("#kana").attr("placeholder", "かな")
|
||||
wanakana.bind(input_element);
|
||||
urlForType = if selection['item_type'] == 'radical' then 'radicals' else selection['item_type']
|
||||
document.getElementById('view-on-wk').href ="https://www.wanikani.com/" + urlForType + "/" + selection['question']
|
||||
document.getElementById('view-on-wk').href ="https://www.wanikani.com/" + selection['item_type'] + "/" + selection['question']
|
||||
|
||||
updateQuizItemStats = () ->
|
||||
$('#radical-num').text(sessionStorage.getItem('radical_count'));
|
||||
|
@ -9,7 +9,7 @@
|
||||
selection = null;
|
||||
|
||||
refreshQuestion = function() {
|
||||
var input_element, items, urlForType;
|
||||
var input_element, items;
|
||||
if (sessionStorage.getItem('user_items')) {
|
||||
items = JSON.parse(sessionStorage.getItem('user_items'));
|
||||
if (linearMode) {
|
||||
@ -39,6 +39,7 @@
|
||||
} else {
|
||||
$("#question-area").text(selection['question']);
|
||||
}
|
||||
return document.getElementById('view-on-wk').href = "https://www.wanikani.com/radicals/" + selection['answer'];
|
||||
} else {
|
||||
if (selection['item_type'] === 'kanji') {
|
||||
document.body.style.backgroundColor = "deeppink";
|
||||
@ -53,9 +54,8 @@
|
||||
$("#kana").attr("placeholder", "かな");
|
||||
wanakana.bind(input_element);
|
||||
}
|
||||
return document.getElementById('view-on-wk').href = "https://www.wanikani.com/" + selection['item_type'] + "/" + selection['question'];
|
||||
}
|
||||
urlForType = selection['item_type'] === 'radical' ? 'radicals' : selection['item_type'];
|
||||
return document.getElementById('view-on-wk').href = "https://www.wanikani.com/" + urlForType + "/" + selection['question'];
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user