「MediaWiki:Common.js」の版間の差分
ナビゲーションに移動
検索に移動
10行目: | 10行目: | ||
href_tw_url + '">' + href_tw_url + '</a></blockquote>'; | href_tw_url + '">' + href_tw_url + '</a></blockquote>'; | ||
$(element).parent().append(html_tw_data); | $(element).parent().append(html_tw_data); | ||
− | |||
$(element).closest('p').css('margin-right', '20px'); | $(element).closest('p').css('margin-right', '20px'); | ||
$(element).closest('p').addClass('twitter_box'); | $(element).closest('p').addClass('twitter_box'); |
2021年3月1日 (月) 21:43時点における版
/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */ $("a[target='_blank'][href^='https://twitter.com/'][href*='status']").each(function(index, element) { console.log(index + ':' + $(element).text()); if ($(element).parent('blockquote.twitter-tweet').length == 0) { var href_tw_url = $(element).attr('href'); var html_tw_data = '<blockquote class="twitter-tweet" data-width="240" data-height="360"><a target="_blank" rel="nofollow noreferrer noopener" class="external free" href="' + href_tw_url + '">' + href_tw_url + '</a></blockquote>'; $(element).parent().append(html_tw_data); $(element).closest('p').css('margin-right', '20px'); $(element).closest('p').addClass('twitter_box'); $(element).remove(); } }); if ($('body.page-ペルソナ5sコラボ表情集!').length > 0) { $('p.twitter_box').first().before('<div id="halidom_wiki_tw_p_list" style="display: flex; flex-wrap: wrap;"></div>'); $('p.twitter_box').each(function(index, element) { $(element).appendTo('#halidom_wiki_tw_p_list'); }); } $.getScript("//platform.twitter.com/widgets.js"); $.getScript("//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"); $('body').prepend( '<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">' ); function halidom_wiki2_newpage_dialog() { $( '<div >新しく作るページの名前<input type="text" id="halidom_wiki2_newpage_input"></div>' ).dialog({ modal: true, buttons: { "移動": function() { window.location.href = "/index.php?veaction=edit&title=" + $( "#halidom_wiki2_newpage_input").val(); } } }); } $('#n-randompage').after( '<li></li><li id="newpage_link_button_added"><a href="#" title="新しいページを作ります" onclick="halidom_wiki2_newpage_dialog()">ページを追加</a></li>' ); function createPracticePage() { open("/index.php?veaction=edit&preload=Preload:ユニット&title=練習用ページ_" + new Date().getTime() .toString(16) + Math.floor(1000 * Math.random()).toString(16), "_blank"); } function my_collapse_function() { var col_click_btn = this; var col_start = $(col_click_btn).parents().nextAll('div.collapse_start'); if (col_start.length > 0 && col_start.first().nextAll('div.collapse_end').length > 0) { if ($.trim(col_start.first().prev().text()) == '') { col_start.first().prev().remove(); } col_start.nextAll().each(function(index,element){ if (!$(this).hasClass('collapse_end')) { $(this).addClass('mycollapse_temp'); } else { return false; // break } }); $('.mycollapse_temp').wrapAll('<div class="collapse_field">'); $('.mycollapse_temp').parent('div.collapse_field').hide(); $('.mycollapse_temp').removeClass('mycollapse_temp'); } } $('.collapse_title').click(function(){ $(this).parents().nextAll('div.collapse_field').first().toggle(); }); $(document).ready(function(){ $('.collapse_title').each(my_collapse_function); }); $(document).ready(function(){ $('table.mw-collapsible').wrap('<div class="scrollbox">'); }); setInterval(function(){ if ( $('#ooui-22').val() == 'Image' ) { var __timestamp = (new Date()).getTime(); $('#ooui-22').val('image' + __timestamp); } });