js/plugins/linkButton.js

function addHttps(url){
    if (!/^(f|ht)tps?:\/\//i.test(url)) {
        url = "https://" + url;
    }
    return url;
}
registerPlugin("drawAccount",function(data){
    var account = data["account"];
    if (("url" in account["other"]) && (account["other"]["url"] != "")) {
        var row = data["row"];
        row.find(".namecell .cellOptionButton:last").before($('<a>')
            .attr('title',"Open")
            .attr('target',"_blank") 增加此行在新窗口打开链接
            .attr('class','cellOptionButton')
            .attr('href',addHttps(account["other"]["url"])) 
            .append($('<span></span>')
                .attr('class','glyphicon glyphicon-globe')));
    }
});

随机一言(显示内容与本文关)
Last modification:May 24th, 2018 at 09:11 pm
If you think my article is useful to you, please feel free to appreciate