Glorious Wiki readers. We are adding the Midnight Magic video and livestream to the wiki. We appreciate your patience as we process the new and updated information!

“MediaWiki:Common.js”的版本间差异

来自Ashes of Creation Wiki
跳到导航 跳到搜索
Lex讨论 | 贡献
第1行: 第1行:
 
$(function () {
 
$(function () {
     $('.gallery video:not([controls])').click(function (e) {
+
     $('.gallery video:not([controls]):not(.mediatest)').click(function (e) {
 
         var url = $(e.target).find('a').text();
 
         var url = $(e.target).find('a').text();
 
         window.location.href = url;
 
         window.location.href = url;
 +
    });
 +
    $('.gallery video:not([controls]).mediatest').click(function (e) {
 +
e.preventDefault();
 +
e.stopPropagation();
 +
var html = $(e.target).parent().html();
 +
console.log(html);
 +
$("#content").append(
 +
$("<dialog>", { id: "ll-modal", html }).append(
 +
$("<div>", { class: "ll-close", html: "⊗" }).click(function (e) {
 +
$("#ll-modal")[0].close();
 +
                                $("#ll-modal").remove();
 +
})
 +
)
 +
);
 +
$("#ll-modal")[0].showModal();
 
     });
 
     });
 
     $('.gallery.hoverhighlight a:has(img[link])').removeClass('image').off('click').click(function (e) {
 
     $('.gallery.hoverhighlight a:has(img[link])').removeClass('image').off('click').click(function (e) {

2024年4月22日 (一) 22:20的版本

$(function () {
    $('.gallery video:not([controls]):not(.mediatest)').click(function (e) {
        var url = $(e.target).find('a').text();
        window.location.href = url;
    });
    $('.gallery video:not([controls]).mediatest').click(function (e) {
	e.preventDefault();
	e.stopPropagation();
	var html = $(e.target).parent().html();
	console.log(html);
	$("#content").append(
		$("<dialog>", { id: "ll-modal", html }).append(
			$("<div>", { class: "ll-close", html: "⊗" }).click(function (e) {
				$("#ll-modal")[0].close();
                                $("#ll-modal").remove();
			})
		)
	);
	$("#ll-modal")[0].showModal();
    });
    $('.gallery.hoverhighlight a:has(img[link])').removeClass('image').off('click').click(function (e) {
        e.preventDefault();
        e.stopPropagation();
        return false;
    });
    $('.gallery.hoverhighlight a').off('click').click(function (e) {
        e.preventDefault();
        e.stopPropagation();
        var url = decodeURI($(e.target).parents('a').first().attr('href'));
        if(!url) return false;
        var matches = url.match(/"(.*?)"/);
        if(matches)
           window.location.href = matches[1];
        return false;
    });
});