تفاوت میان نسخه‌های «مدیاویکی:Gadget-CommonsSSL.js»

از مشروطه
پرش به ناوبری پرش به جستجو
(صفحه‌ای جدید حاوی 'function CommonsSSL() { if (!/^https?:\/\/secure\.wikimedia\.org/.test(window.location.href)) { $('a').each(function () { ...' ایجاد کرد)
 
 
خط ۱: خط ۱:
function CommonsSSL() {
+
$(function () {
 
     if (!/^https?:\/\/secure\.wikimedia\.org/.test(window.location.href)) {
 
     if (!/^https?:\/\/secure\.wikimedia\.org/.test(window.location.href)) {
 
         $('a').each(function () {
 
         $('a').each(function () {
             if (/^http:\/\/commons.wikimedia.org.*/.test(this.href)) this.href = this.href.replace(/http:\/\/commons.wikimedia.org/, "https://secure.wikimedia.org/wikipedia/commons").replace(/commons\/?$/, "commons/wiki").replace(/\/%D9%BE%D8%B1%D9%88%D9%86%D8%AF%D9%87/, "/File");
+
             if (/^http:\/\/commons.wikimedia.org.*/.test(this.href)) this.href = this.href.replace(/http:\/\/commons.wikimedia.org/, "https://commons.wikimedia.org").replace(/commons\/?$/, "commons/wiki").replace(/\/%D9%BE%D8%B1%D9%88%D9%86%D8%AF%D9%87/, "/File");
 
         });
 
         });
 
     }
 
     }
}
+
});
addOnloadHook(CommonsSSL);
 

نسخهٔ کنونی تا ‏۱ ژوئیهٔ ۲۰۱۴، ساعت ۰۶:۴۰

$(function () {
    if (!/^https?:\/\/secure\.wikimedia\.org/.test(window.location.href)) {
        $('a').each(function () {
            if (/^http:\/\/commons.wikimedia.org.*/.test(this.href)) this.href = this.href.replace(/http:\/\/commons.wikimedia.org/, "https://commons.wikimedia.org").replace(/commons\/?$/, "commons/wiki").replace(/\/%D9%BE%D8%B1%D9%88%D9%86%D8%AF%D9%87/, "/File");
        });
    }
});