Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
Ken2812221(留言墙 | 貢獻) 小无编辑摘要 标签:sourceedit |
||
第60行: | 第60行: | ||
e.preventDefault(); |
e.preventDefault(); |
||
var all = $('#new_team_table input'); |
var all = $('#new_team_table input'); |
||
− | var text=' |
+ | var text=decodeURI('%7B%7BRanks|size=700|title=' + $('#stage_name').val() + |
'|id1=' + all.eq( 0).val() + '|lv1=' + all.eq( 1).val() + '|cd1=' + all.eq( 2).val() + '|ref1=' + all.eq( 3).val() + |
'|id1=' + all.eq( 0).val() + '|lv1=' + all.eq( 1).val() + '|cd1=' + all.eq( 2).val() + '|ref1=' + all.eq( 3).val() + |
||
'|id2=' + all.eq( 4).val() + '|lv2=' + all.eq( 5).val() + '|cd2=' + all.eq( 6).val() + '|ref2=' + all.eq( 7).val() + |
'|id2=' + all.eq( 4).val() + '|lv2=' + all.eq( 5).val() + '|cd2=' + all.eq( 6).val() + '|ref2=' + all.eq( 7).val() + |
||
第67行: | 第67行: | ||
'|id5=' + all.eq(16).val() + '|lv5=' + all.eq(17).val() + '|cd5=' + all.eq(18).val() + '|ref5=' + all.eq(19).val() + |
'|id5=' + all.eq(16).val() + '|lv5=' + all.eq(17).val() + '|cd5=' + all.eq(18).val() + '|ref5=' + all.eq(19).val() + |
||
'|id6=' + all.eq(20).val() + '|lv6=' + all.eq(21).val() + '|cd6=' + all.eq(22).val() + '|ref6=' + all.eq(23).val() + |
'|id6=' + all.eq(20).val() + '|lv6=' + all.eq(21).val() + '|cd6=' + all.eq(22).val() + '|ref6=' + all.eq(23).val() + |
||
− | '|explain=' + $('#attack_method').val() + ' |
+ | '|explain=' + $('#attack_method').val() + '%7D%7D'); |
alert(text); |
alert(text); |
||
}); |
}); |
2015年7月11日 (六) 06:34的版本
<form id="new_team">
隊伍名:<input type="text" id="team_name" /> 關卡名:<input type="text" id="stage_name" disabled="disabled" />
編號 | 等級 | 技能回合數 | 昇華等級 | |
---|---|---|---|---|
隊長 | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> |
隊員1 | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> |
隊員2 | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> |
隊員3 | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> |
隊員4 | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> |
隊友 | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> | <input type="number" min="1" max="9999" /> |
完整通關攻略 <textarea id="attack_method" style="resize:none;width:300px;height:200px;"></textarea> <input type="submit" /> </form> <script> (function NewTeam(){ if(typeof jQuery == "undefined") { setTimeout(NewTeam, 100); return; }
if(typeof mw == "undefined") { setTimeout(NewTeam, 100); return; }
function submit() { var token = mw.user.tokens.get('editToken'); $.post( "http://zh.tos.wikia.com/api.php", { action: 'edit', appendtext: text, title: title + '/通關技巧及參考隊伍', token: token, format: json }, function() {}, 'json' ); } $('#stage_name').val((wgTitle.split('/'))[0]);
$('#new_team').on('submit', function(e){ e.preventDefault(); var all = $('#new_team_table input'); var text=decodeURI('%7B%7BRanks|size=700|title=' + $('#stage_name').val() + '|id1=' + all.eq( 0).val() + '|lv1=' + all.eq( 1).val() + '|cd1=' + all.eq( 2).val() + '|ref1=' + all.eq( 3).val() + '|id2=' + all.eq( 4).val() + '|lv2=' + all.eq( 5).val() + '|cd2=' + all.eq( 6).val() + '|ref2=' + all.eq( 7).val() + '|id3=' + all.eq( 8).val() + '|lv3=' + all.eq( 9).val() + '|cd3=' + all.eq(10).val() + '|ref3=' + all.eq(11).val() + '|id4=' + all.eq(12).val() + '|lv4=' + all.eq(13).val() + '|cd4=' + all.eq(14).val() + '|ref4=' + all.eq(15).val() + '|id5=' + all.eq(16).val() + '|lv5=' + all.eq(17).val() + '|cd5=' + all.eq(18).val() + '|ref5=' + all.eq(19).val() + '|id6=' + all.eq(20).val() + '|lv6=' + all.eq(21).val() + '|cd6=' + all.eq(22).val() + '|ref6=' + all.eq(23).val() + '|explain=' + $('#attack_method').val() + '%7D%7D'); alert(text); });
})(); </script>